// RUN: %clang_cc1 -std=c++2c -verify %s namespace Errors { template auto> struct S1; template auto> struct S2; template concept> struct S3; template concept> struct S4; int a; template concept C = true; // expected-note 2{{template argument refers to a concept 'C', here}} template auto Var = 0; // expected-note 2{{template argument refers to a variable template 'Var', here}} S1<1> t1; // expected-error {{template argument for template template parameter must be a variable template}} S1 t2; // expected-error {{template argument for template template parameter must be a variable template}} S1 t3; // expected-error {{template argument for template template parameter must be a variable template}} S1 t4; // expected-error {{template argument does not refer to a variable template, or template template parameter}} S2<1> t5; // expected-error {{template argument for template template parameter must be a variable template}} S2 t6; // expected-error {{template argument for template template parameter must be a variable template}} S2 t7; // expected-error {{template argument for template template parameter must be a variable template}} S2 t8; // expected-error {{template argument does not refer to a variable template, or template template parameter}} S3<1> t9; // expected-error {{template argument for template template parameter must be a concept}} S3 t10; // expected-error {{template argument for template template parameter must be a concept}} S3 t11; // expected-error {{template argument for template template parameter must be a concept}} S3 t12; // expected-error {{template argument does not refer to a concept, or template template parameter}} S4<1> t13; // expected-error {{template argument for template template parameter must be a concept}} S4 t14; // expected-error {{template argument for template template parameter must be a concept}} S4 t15; // expected-error {{template argument for template template parameter must be a concept}} S4 t16; // expected-error {{template argument does not refer to a concept, or template template parameter}} } template auto V> // expected-note {{previous template template parameter is here}} \ // expected-error{{template argument for non-type template parameter must be an expression}} struct S1 { static_assert(V == 42); static_assert(V == 84); static_assert(V == 0); }; template auto V> // expected-error {{template argument for template type parameter must be a type}} \ // expected-note {{previous template template parameter is here}} struct S2 { static_assert(V<0> == 1); static_assert(V<1> == 0); }; template concept C > // expected-error {{template argument for non-type template parameter must be an expression}} \ // expected-note {{previous template template parameter is here}} struct S3 { static_assert(C); }; template concept C> // expected-error {{template argument for template type parameter must be a type}} \ // expected-note {{previous template template parameter is here}} struct S4 { static_assert(C<0>); }; template // expected-note {{template parameter is declared here}} concept C = true; template // expected-note {{template parameter is declared here}} concept CI = true; template // expected-note {{template parameter is declared here}} constexpr auto Var = 42; template constexpr auto Var = 84; template <> constexpr auto Var = 0; template // expected-note {{template parameter is declared here}} constexpr auto Var2 = 0; template requires (N%2 == 0) constexpr auto Var2 = 1; void test () { S1 sE; // expected-note {{template template argument has different template parameters than its corresponding template template parameter}} S2 sE; // expected-note {{template template argument has different template parameters than its corresponding template template parameter}} S1 s1; S2 s2; S3 s3; S4 sE; // expected-note {{template template argument has different template parameters than its corresponding template template parameter}} S4 s4; S3 sE; // expected-note {{template template argument has different template parameters than its corresponding template template parameter}} } namespace template_type_constraints { template concept Unary = true; template concept BinaryDefaulted = true; template concept UnaryFalse = false; // expected-note 3{{because 'false' evaluated to false}} template concept BinaryDefaultedFalse = false; template