// RUN: %clang_cc1 -std=c++20 -verify %s // RUN: %clang_cc1 -std=c++20 -verify %s -DDEPENDENT_OR #ifdef DEPENDENT_OR // This causes the || below to be a CXXOperatorCallExpr not a BinaryOperator. struct A {}; bool operator||(A, A); #endif namespace PR45589 { template struct X { static constexpr bool value = T::value; }; // expected-error {{cannot be used prior to '::'}} struct False { static constexpr bool value = false; }; struct True { static constexpr bool value = true; }; template concept C = true; template constexpr int test = 0; template requires C constexpr int test = 1; template requires (B && C) || (X::value && C) constexpr int test = 2; // expected-error {{non-constant expression}} expected-note {{subexpression}} expected-note {{instantiation of}} expected-note {{while substituting}} static_assert(test == 2); static_assert(test == 2); static_assert(test == 2); // satisfaction of second term of || not considered static_assert(test == 1); static_assert(test == 2); // constraints are partially ordered // FIXME: These diagnostics are excessive. static_assert(test == 1); // expected-note 2{{while}} expected-note 2{{during}} }