| // RUN: %clang_cc1 -std=c++2a -verify %s |
| // RUN: %clang_cc1 -std=c++2a -verify %s -fno-concept-satisfaction-caching -DNO_CACHE |
| // expected-no-diagnostics |
| concept C = (f(T()), true); |
| constexpr bool foo() { return false; } |
| constexpr bool foo() requires (f(T()), true) { return true; } |
| static_assert(foo<a::A>()); |
| // This makes calls to f ambiguous, but the second check will still succeed |
| // because the constraint satisfaction results are cached. |
| constexpr void f(A a, int = 2) {} |
| static_assert(!foo<a::A>()); |
| static_assert(foo<a::A>()); |