// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++1z -triple=x86_64-linux-gnu template struct S1 { static constexpr const bool value = false; }; template inline constexpr bool global_inline_var = S1::value; template struct S2 { template static inline constexpr bool var = global_inline_var; }; template inline constexpr bool constexpr_return_false() { return false; } template void foo() { static_assert(S1::value); // expected-error@-1{{static_assert failed due to requirement 'S1::value'}} } template void foo(); // expected-note@-1{{in instantiation of function template specialization 'foo' requested here}} template void foo2() { static_assert(global_inline_var); // expected-error@-1{{static_assert failed due to requirement 'global_inline_var'}} } template void foo2(); // expected-note@-1{{in instantiation of function template specialization 'foo2' requested here}} template void foo3() { static_assert(T::template var); // expected-error@-1{{static_assert failed due to requirement 'S2::var'}} } template void foo3, int, float>(); // expected-note@-1{{in instantiation of function template specialization 'foo3, int, float>' requested here}} template void foo4() { static_assert(S1::value, ""); // expected-error@-1{{static_assert failed due to requirement 'S1::value'}} }; template void foo4(); // expected-note@-1{{in instantiation of function template specialization 'foo4' requested here}} template void foo5() { static_assert(!!(global_inline_var)); // expected-error@-1{{static_assert failed due to requirement '!!(global_inline_var)'}} } template void foo5(); // expected-note@-1{{in instantiation of function template specialization 'foo5' requested here}} struct ExampleTypes { explicit ExampleTypes(int); using T = int; using U = float; }; template struct X { int i = 0; int j = 0; constexpr operator bool() const { return false; } }; template void foo6() { static_assert(X()); // expected-error@-1{{static_assert failed due to requirement 'X()'}} static_assert(X{}); // expected-error@-1{{static_assert failed due to requirement 'X{}'}} static_assert(X{1, 2}); // expected-error@-1{{static_assert failed due to requirement 'X{1, 2}'}} static_assert(X({1, 2})); // expected-error@-1{{static_assert failed due to requirement 'X({1, 2})'}} static_assert(typename T::T{0}); // expected-error@-1{{static_assert failed due to requirement 'int{0}'}} static_assert(typename T::T(0)); // expected-error@-1{{static_assert failed due to requirement 'int(0)'}} static_assert(sizeof(X) == 0); // expected-error@-1{{static_assert failed due to requirement 'sizeof(X) == 0'}} static_assert((const X *)nullptr); // expected-error@-1{{static_assert failed due to requirement '(const X *)nullptr'}} static_assert(static_cast *>(nullptr)); // expected-error@-1{{static_assert failed due to requirement 'static_cast *>(nullptr)'}} static_assert((const X[]){} == nullptr); // expected-error@-1{{static_assert failed due to requirement '(X const[0]){} == nullptr'}} static_assert(sizeof(X().X::~X())>) == 0); // expected-error@-1{{static_assert failed due to requirement 'sizeof(X) == 0'}} static_assert(constexpr_return_false()); // expected-error@-1{{static_assert failed due to requirement 'constexpr_return_false()'}} } template void foo6(); // expected-note@-1{{in instantiation of function template specialization 'foo6' requested here}}