diff options
Diffstat (limited to 'clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp')
| -rw-r--r-- | clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp | 35 |
1 files changed, 15 insertions, 20 deletions
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 033ae349a02e..70a96bed0586 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 @@ -43,11 +43,10 @@ namespace std_example { requires sizeof(a) == 4; // OK requires a == 0; // expected-error{{substitution into constraint expression resulted in a non-constant expression}} // expected-note@-1{{while checking the satisfaction of nested requirement requested here}} - // expected-note@-2{{in instantiation of requirement here}} - // expected-note@-3{{while checking the satisfaction of nested requirement requested here}} - // expected-note@-6{{while substituting template arguments into constraint expression here}} - // expected-note@-5{{function parameter 'a' with unknown value cannot be used in a constant expression}} - // expected-note@-8{{declared here}} + // expected-note@-2{{while checking the satisfaction of nested requirement requested here}} + // expected-note@-5{{while substituting template arguments into constraint expression here}} + // expected-note@-4{{function parameter 'a' with unknown value cannot be used in a constant expression}} + // expected-note@-7{{declared here}} }; static_assert(C2<int>); // expected-error{{static assertion failed}} // expected-note@-1{{while checking the satisfaction of concept 'C2<int>' requested here}} @@ -84,31 +83,26 @@ static_assert(Pipes<S>); static_assert(Pipes<double>); static_assert(Amps1<S>); -static_assert(!Amps1<double>); +static_assert(Amps1<double>); static_assert(Amps2<S>); -static_assert(!Amps2<double>); +static_assert(Amps2<double>); template<class T> -void foo1() requires requires (T x) { // #foo1 +void foo1() requires requires (T x) { requires - True<decltype(x.value)> // #foo1Value + True<decltype(x.value)> && True<T>; } {} template<class T> void fooPipes() requires Pipes<T> {} -template<class T> void fooAmps1() requires Amps1<T> {} // #fooAmps1 +template<class T> void fooAmps1() requires Amps1<T> {} void foo() { foo1<S>(); - foo1<int>(); // expected-error {{no matching function for call to 'foo1'}} - // expected-note@#foo1Value {{because 'True<decltype(x.value)> && True<T>' would be invalid: member reference base type 'int' is not a structure or union}} - // expected-note@#foo1 {{candidate template ignored: constraints not satisfied [with T = int]}} + foo1<int>(); fooPipes<S>(); fooPipes<int>(); fooAmps1<S>(); - fooAmps1<int>(); // expected-error {{no matching function for call to 'fooAmps1'}} - // expected-note@#fooAmps1 {{candidate template ignored: constraints not satisfied [with T = int]}} - // expected-note@#fooAmps1 {{because 'int' does not satisfy 'Amps1'}} - // expected-note@#Amps1 {{because 'True<decltype(x.value)> && True<T> && !False<T>' would be invalid: member reference base type 'int' is not a structure or union}} + fooAmps1<int>(); } template<class T> @@ -158,15 +152,16 @@ void func() { // expected-note@#bar {{while substituting template arguments into constraint expression here}} // expected-note@#bar {{while checking the satisfaction of nested requirement requested here}} // expected-note@#bar {{candidate template ignored: constraints not satisfied [with T = False]}} - // expected-note@#bar {{because 'X<SubstitutionFailureNestedRequires::ErrorExpressions_NotSF::False>::value' evaluated to false}} + // expected-note@#bar {{because 'X<False>::value' evaluated to false}} bar<int>(); + // expected-error@-1 {{no matching function for call to 'bar'}} \ // expected-note@-1 {{while checking constraint satisfaction for template 'bar<int>' required here}} \ - // expected-note@-1 {{while substituting deduced template arguments into function template 'bar' [with T = int]}} + // expected-note@-1 {{while substituting deduced template arguments into function template 'bar' [with T = int]}} \ // expected-note@#bar {{in instantiation of static data member}} - // expected-note@#bar {{in instantiation of requirement here}} // expected-note@#bar {{while checking the satisfaction of nested requirement requested here}} // expected-note@#bar {{while substituting template arguments into constraint expression here}} + // expected-note@#bar {{candidate template ignored}} // expected-error@#X_Value {{type 'int' cannot be used prior to '::' because it has no members}} } } |
