From: Erich Keane Date: Mon, 28 Nov 2022 18:21:38 +0000 (-0800) Subject: Stop accepting 'bool' in a concept declaration as an extension. X-Git-Tag: upstream/17.0.6~26138 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9061928ebbb1a9d002583ede2700429100305d6a;p=platform%2Fupstream%2Fllvm.git Stop accepting 'bool' in a concept declaration as an extension. We no longer support the concepts-ts flag for this release, so stop supporting this concepts-ts compat extension as well. --- diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index e9280ca..ab7334e 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -401,6 +401,8 @@ Improvements to Clang's diagnostics PCH or modules. When Clang hits this limit, it now produces notes mentioning which header and source files are consuming large amounts of this space. ``#pragma clang __debug sloc_usage`` can also be used to request this report. +- Clang no longer permits the keyword 'bool' in a concept declaration as a + concepts-ts compatibility extension. Non-comprehensive list of changes in this release ------------------------------------------------- diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td index ffbc859..79035b4 100644 --- a/clang/include/clang/Basic/DiagnosticParseKinds.td +++ b/clang/include/clang/Basic/DiagnosticParseKinds.td @@ -1633,9 +1633,8 @@ def warn_deprecated_for_co_await : Warning< let CategoryName = "Concepts Issue" in { def err_concept_definition_not_identifier : Error< "name defined in concept definition must be an identifier">; -def ext_concept_legacy_bool_keyword : ExtWarn< - "ISO C++20 does not permit the 'bool' keyword after 'concept'">, - InGroup>; +def err_concept_legacy_bool_keyword : Error< + "ISO C++ does not permit the 'bool' keyword after 'concept'">; def err_placeholder_expected_auto_or_decltype_auto : Error< "expected 'auto' or 'decltype(auto)' after concept name">; } diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp index 03f5d0b..a93edfa 100644 --- a/clang/lib/Parse/ParseTemplate.cpp +++ b/clang/lib/Parse/ParseTemplate.cpp @@ -392,7 +392,7 @@ Parser::ParseConceptDefinition(const ParsedTemplateInfo &TemplateInfo, SourceLocation BoolKWLoc; if (TryConsumeToken(tok::kw_bool, BoolKWLoc)) - Diag(Tok.getLocation(), diag::ext_concept_legacy_bool_keyword) << + Diag(Tok.getLocation(), diag::err_concept_legacy_bool_keyword) << FixItHint::CreateRemoval(SourceLocation(BoolKWLoc)); DiagnoseAndSkipCXX11Attributes(); diff --git a/clang/test/Parser/cxx2a-concept-declaration.cpp b/clang/test/Parser/cxx2a-concept-declaration.cpp index 25c4412..0a7af84 100644 --- a/clang/test/Parser/cxx2a-concept-declaration.cpp +++ b/clang/test/Parser/cxx2a-concept-declaration.cpp @@ -50,7 +50,7 @@ template concept C6 = integral_constant::value; // expected-note@-2{{'word' declared here}} template concept bool C7 = true; -// expected-warning@-1{{ISO C++20 does not permit the 'bool' keyword after 'concept'}} +// expected-error@-1{{ISO C++ does not permit the 'bool' keyword after 'concept'}} template<> concept C8 = false; // expected-error@-1{{concept template parameter list must have at least one parameter; explicit specialization of concepts is not allowed}}