diff options
Diffstat (limited to 'clang/test/SemaTemplate')
-rw-r--r-- | clang/test/SemaTemplate/concepts.cpp | 8 | ||||
-rw-r--r-- | clang/test/SemaTemplate/deduction-guide.cpp | 16 |
2 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/concepts.cpp b/clang/test/SemaTemplate/concepts.cpp index 62a4f95..663bc98 100644 --- a/clang/test/SemaTemplate/concepts.cpp +++ b/clang/test/SemaTemplate/concepts.cpp @@ -1250,3 +1250,11 @@ static_assert(!D<Priv>::has, "Private should be invisible."); static_assert(!D<Prot>::has, "Protected should be invisible."); } + + +namespace GH149986 { +template <typename T> concept PerfectSquare = [](){} // expected-note 2{{here}} +([](auto) { return true; }) < PerfectSquare <class T>; +// expected-error@-1 {{declaration of 'T' shadows template parameter}} \ +// expected-error@-1 {{a concept definition cannot refer to itself}} +} diff --git a/clang/test/SemaTemplate/deduction-guide.cpp b/clang/test/SemaTemplate/deduction-guide.cpp index 0953f647..f6bc6ee 100644 --- a/clang/test/SemaTemplate/deduction-guide.cpp +++ b/clang/test/SemaTemplate/deduction-guide.cpp @@ -966,3 +966,19 @@ Expand<Type, Invocable<>> _{}; // CHECK-NEXT: | `-ParmVarDecl {{.+}} 'T...' pack } + +namespace GH134613 { +template <typename R> struct Foo { + using value_type = R; + + Foo() = default; + Foo(Foo<Foo<R>> &&rhs) {} +}; + +void main() { + auto r1 = Foo(Foo<Foo<int>>{}); + + static_assert(__is_same(decltype(r1)::value_type, int)); +} + +} |