Index: lib/Sema/SemaDecl.cpp =================================================================== --- lib/Sema/SemaDecl.cpp +++ lib/Sema/SemaDecl.cpp @@ -5119,6 +5119,9 @@ if (D.getDeclSpec().isConstexprSpecified()) Diag(D.getDeclSpec().getConstexprSpecLoc(), diag::err_invalid_constexpr) << 1; + if (D.getDeclSpec().isConceptSpecified()) + Diag(D.getDeclSpec().getConceptSpecLoc(), + diag::err_concept_wrong_decl_kind); if (D.getName().Kind != UnqualifiedId::IK_Identifier) { Diag(D.getName().StartLocation, diag::err_typedef_not_identifier) @@ -10277,6 +10280,8 @@ if (DS.isConstexprSpecified()) Diag(DS.getConstexprSpecLoc(), diag::err_invalid_constexpr) << 0; + if (DS.isConceptSpecified()) + Diag(DS.getConceptSpecLoc(), diag::err_concept_wrong_decl_kind); DiagnoseFunctionSpecifiers(DS); Index: test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p1.cpp =================================================================== --- test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p1.cpp +++ test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p1.cpp @@ -37,5 +37,7 @@ template concept class TCC1 {}; // expected-error {{'concept' can only appear on the definition of a function template or variable template}} template concept struct TCS1 {}; // expected-error {{'concept' can only appear on the definition of a function template or variable template}} template concept union TCU1 {}; // expected-error {{'concept' can only appear on the definition of a function template or variable template}} +typedef concept int CI; // expected-error {{'concept' can only appear on the definition of a function template or variable template}} +void fpc(concept int i) {} // expected-error {{'concept' can only appear on the definition of a function template or variable template}} concept bool; // expected-error {{'concept' can only appear on the definition of a function template or variable template}}