Stop accepting 'bool' in a concept declaration as an extension.
authorErich Keane <erich.keane@intel.com>
Mon, 28 Nov 2022 18:21:38 +0000 (10:21 -0800)
committerErich Keane <erich.keane@intel.com>
Mon, 28 Nov 2022 18:22:54 +0000 (10:22 -0800)
We no longer support the concepts-ts flag for this release, so stop
supporting this concepts-ts compat extension as well.

clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/lib/Parse/ParseTemplate.cpp
clang/test/Parser/cxx2a-concept-declaration.cpp

index e9280ca..ab7334e 100644 (file)
@@ -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
 -------------------------------------------------
index ffbc859..79035b4 100644 (file)
@@ -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<DiagGroup<"concepts-ts-compat">>;
+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">;
 }
index 03f5d0b..a93edfa 100644 (file)
@@ -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();
index 25c4412..0a7af84 100644 (file)
@@ -50,7 +50,7 @@ template <bool word> concept C6 = integral_constant<bool, wor>::value;
 // expected-note@-2{{'word' declared here}}
 
 template<typename T> 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}}