// RUN: %clang_cc1 -verify -std=c++1y %s namespace PR17846 { template constexpr T pi = T(3.14); template constexpr T tau = 2 * pi; constexpr double tau_double = tau; static_assert(tau_double == 6.28, ""); } namespace PR17848 { template constexpr T var = 12345; template constexpr T f() { return var; } constexpr int k = f(); static_assert(k == 12345, ""); } namespace NonDependent { template constexpr T a = 0; template constexpr T b = a; static_assert(b == 0, ""); } namespace InstantiationDependent { int f(int); void f(char); template constexpr int a = 1; template constexpr T b = a; // expected-error {{invalid application of 'sizeof' to an incomplete type 'void'}} static_assert(b == 1, ""); static_assert(b == 1, ""); // expected-note {{in instantiation of}} expected-error {{not an integral constant}} template void f() { static_assert(a == 0, ""); // expected-error {{static_assert failed}} } } namespace PR24483 { template struct A; template A models; template<> struct B models<>; // expected-error {{incomplete type 'struct B'}} expected-note {{forward declaration}} } namespace InvalidInsertPos { template T v; template decltype(v) v; template<> int v; int k = v; }