mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 06:10:12 +00:00
Fix crash in constraining partial specialization on nested template.
Fixes: https://github.com/llvm/llvm-project/issues/53354 Differential Revision: https://reviews.llvm.org/D136259
This commit is contained in:
parent
ca0a0bf963
commit
4c87e12484
@ -5803,8 +5803,8 @@ struct MarkUsedTemplateParameterVisitor :
|
||||
}
|
||||
|
||||
bool TraverseTemplateName(TemplateName Template) {
|
||||
if (auto *TTP =
|
||||
dyn_cast<TemplateTemplateParmDecl>(Template.getAsTemplateDecl()))
|
||||
if (auto *TTP = llvm::dyn_cast_or_null<TemplateTemplateParmDecl>(
|
||||
Template.getAsTemplateDecl()))
|
||||
if (TTP->getDepth() == Depth)
|
||||
Used[TTP->getIndex()] = true;
|
||||
RecursiveASTVisitor<MarkUsedTemplateParameterVisitor>::
|
||||
|
20
clang/test/SemaTemplate/concepts-GH53354.cpp
Normal file
20
clang/test/SemaTemplate/concepts-GH53354.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
// RUN: %clang_cc1 -std=c++20 -verify %s
|
||||
// expected-no-diagnostics
|
||||
|
||||
template <template <class> class>
|
||||
struct S
|
||||
{};
|
||||
|
||||
template <class T>
|
||||
concept C1 = requires
|
||||
{
|
||||
typename S<T::template value_types>;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
requires C1<T>
|
||||
struct A {};
|
||||
|
||||
template <class T>
|
||||
requires C1<T> && true
|
||||
struct A<T> {};
|
Loading…
Reference in New Issue
Block a user