[clang] 3b186db - [clang][C++20] Add test for crash in NestedRequirement.

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 21 21:52:55 PST 2022


Author: Utkarsh Saxena
Date: 2022-12-22T06:52:44+01:00
New Revision: 3b186db5a97c8392bdbb0446e84353497870551e

URL: https://github.com/llvm/llvm-project/commit/3b186db5a97c8392bdbb0446e84353497870551e
DIFF: https://github.com/llvm/llvm-project/commit/3b186db5a97c8392bdbb0446e84353497870551e.diff

LOG: [clang][C++20] Add test for crash in NestedRequirement.

Added: 
    

Modified: 
    clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp
index c494117056105..3abff0bb32e1c 100644
--- a/clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp
+++ b/clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp
@@ -163,3 +163,20 @@ void func() {
 }
 }
 }
+
+namespace no_crash_D138914 {
+// https://reviews.llvm.org/D138914
+template <class a, a> struct b;
+template <bool c> using d = b<bool, c>;
+template <class a, class e> using f = d<__is_same(a, e)>;
+template <class a, class e>
+concept g = f<a, e>::h;
+template <class a, class e>
+concept i = g<e, a>;
+template <typename> class j { // expected-note {{candidate template ignored}}
+  template <typename k>
+  requires requires { requires i<j, k>; }
+  j(); // expected-note {{candidate template ignored}}
+};
+template <> j(); // expected-error {{deduction guide declaration without trailing return type}} // expected-error {{no function template}}
+}


        


More information about the cfe-commits mailing list