Index: lib/Frontend/FrontendActions.cpp =================================================================== --- lib/Frontend/FrontendActions.cpp +++ lib/Frontend/FrontendActions.cpp @@ -416,6 +416,10 @@ return "DefiningSynthesizedFunction"; case CodeSynthesisContext::Memoization: return "Memoization"; + case CodeSynthesisContext::ConstraintsCheck: + return "ConstraintsCheck"; + case CodeSynthesisContext::ConstraintSubstitution: + return "ConstraintSubstitution"; } return ""; } Index: test/Parser/cxx2a-concept-declaration.cpp =================================================================== --- test/Parser/cxx2a-concept-declaration.cpp +++ test/Parser/cxx2a-concept-declaration.cpp @@ -27,12 +27,12 @@ concept C2 = true; // expected-error {{extraneous template parameter list in concept definition}} template concept C3 = true; // expected-note {{previous}} expected-note {{previous}} -int C4; // expected-error {{redefinition}} -struct C4 {}; // expected-error {{redefinition}} +int C3; // expected-error {{redefinition}} +struct C3 {}; // expected-error {{redefinition}} -struct C5 {}; // expected-note{{previous definition is here}} -template concept C5 = true; -// expected-error@-1{{redefinition of 'C5' as different kind of symbol}} +struct C4 {}; // expected-note{{previous definition is here}} +template concept C4 = true; +// expected-error@-1{{redefinition of 'C4' as different kind of symbol}} // TODO: Add test to prevent explicit specialization, partial specialization // and explicit instantiation of concepts. @@ -41,55 +41,55 @@ struct integral_constant { static constexpr T value = v; }; namespace N { - template concept C6 = true; + template concept C5 = true; } -using N::C6; +using N::C5; -template concept C7 = integral_constant::value; +template concept C6 = integral_constant::value; // expected-error@-1{{use of undeclared identifier 'wor'; did you mean 'word'?}} // expected-note@-2{{'word' declared here}} -template concept bool C8 = true; +template concept bool C7 = true; // expected-error@-1{{'bool' keyword after 'concept' is no longer valid in C++2a; remove it}} -template<> concept C9 = false; +template<> concept C8 = false; // expected-error@-1{{concept template parameter list must have at least one parameter; explicit specialization of concepts is not allowed, did you attempt this?}} -template<> concept C8 = false; +template<> concept C7 = false; // expected-error@-1{{name defined in concept definition must be an identifier}} -template concept N::C12 = false; +template concept N::C9 = false; // expected-error@-1{{unexpected namespace scope before concept name; concepts must be defined inside their namespace, if any}} class A { }; // expected-note@-1{{'A' declared here}} -template concept A::C13 = false; +template concept A::C10 = false; // expected-error@-1{{expected namespace name}} template concept operator int = false; // expected-error@-1{{name defined in concept definition must be an identifier}} -template concept C14 = 2; // expected-error {{atomic constraint must be of type 'bool' (found 'int')}} -template concept C15 = 2 && x; // expected-error {{atomic constraint must be of type 'bool' (found 'int')}} -template concept C16 = x || 2 || x; // expected-error {{atomic constraint must be of type 'bool' (found 'int')}} -template concept C17 = 8ull && x || x; // expected-error {{atomic constraint must be of type 'bool' (found 'unsigned long long')}} -template concept C18 = sizeof(T); // expected-error {{atomic constraint must be of type 'bool' (found 'unsigned long')}} -template concept C19 = T{}; -static_assert(!C19); -template concept C20 = (bool&&)true; -static_assert(C20); -template concept C21 = (const bool&)true; -static_assert(C21); -template concept C22 = (const bool)true; -static_assert(C22); -template concept C23 = integral_constant::value && true; -static_assert(C23); -static_assert(!C23); -template concept C24 = integral_constant::value; -static_assert(C24); -static_assert(!C24); - -template concept C25 = integral_constant::value; +template concept C11 = 2; // expected-error {{atomic constraint must be of type 'bool' (found 'int')}} +template concept C12 = 2 && x; // expected-error {{atomic constraint must be of type 'bool' (found 'int')}} +template concept C13 = x || 2 || x; // expected-error {{atomic constraint must be of type 'bool' (found 'int')}} +template concept C14 = 8ull && x || x; // expected-error {{atomic constraint must be of type 'bool' (found 'unsigned long long')}} +template concept C15 = sizeof(T); // expected-error {{atomic constraint must be of type 'bool' (found 'unsigned long')}} +template concept C16 = T{}; +static_assert(!C16); +template concept C17 = (bool&&)true; +static_assert(C17); +template concept C18 = (const bool&)true; +static_assert(C18); +template concept C19 = (const bool)true; +static_assert(C19); +template concept C20 = integral_constant::value && true; +static_assert(C20); +static_assert(!C20); +template concept C21 = integral_constant::value; +static_assert(C21); +static_assert(!C21); + +template concept C22 = integral_constant::value; // expected-error@-1{{use of undeclared identifier 'wor'; did you mean 'word'?}} // expected-note@-2{{'word' declared here}}