29 lines · cpp
1// RUN: %clang_cc1 -std=c++2a -verify %s2// expected-no-diagnostics3 4template<typename T>5concept C = (f(T()), true);6 7template<typename T>8constexpr bool foo() { return false; }9 10template<typename T>11 requires (f(T()), true)12constexpr bool foo() requires (f(T()), true) { return true; }13 14namespace a {15 struct A {};16 constexpr void f(A a) {}17}18 19static_assert(C<a::A>);20static_assert(foo<a::A>());21 22namespace a {23 // This makes calls to f ambiguous, but the second check will still succeed24 // because the constraint satisfaction results are cached.25 constexpr void f(A a, int = 2) {}26}27static_assert(C<a::A>);28static_assert(foo<a::A>());29