Revert rC330794 and some dependent tiny bug fixes
See Richard's humbling feedback here:
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226482.html
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226486.html
Wish I'd had the patience to solicit the feedback prior to committing :)
Sorry for the noise guys.
Thank you Richard for being the steward that clang deserves!
llvm-svn: 330888
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 9b0828a..3d3abe3 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -1739,8 +1739,7 @@
ParsingDeclSpec DS(*this);
DeclSpecContext DSContext = getDeclSpecContextFromDeclaratorContext(Context);
- ParseDeclarationSpecifiersOrConceptDefinition(DS, ParsedTemplateInfo(),
- AS_none, DSContext);
+ ParseDeclarationSpecifiers(DS, ParsedTemplateInfo(), AS_none, DSContext);
// If we had a free-standing type definition with a missing semicolon, we
// may get this far before the problem becomes obvious.
@@ -2387,8 +2386,7 @@
/// specifier-qualifier-list is a subset of declaration-specifiers. Just
/// parse declaration-specifiers and complain about extra stuff.
/// TODO: diagnose attribute-specifiers and alignment-specifiers.
- ParseDeclarationSpecifiersOrConceptDefinition(DS, ParsedTemplateInfo(), AS,
- DSC);
+ ParseDeclarationSpecifiers(DS, ParsedTemplateInfo(), AS, DSC);
// Validate declspec for type-name.
unsigned Specs = DS.getParsedSpecifiers();
@@ -2873,12 +2871,11 @@
// and call ParsedFreeStandingDeclSpec as appropriate.
DS.ClearTypeSpecType();
ParsedTemplateInfo NotATemplate;
- ParseDeclarationSpecifiersOrConceptDefinition(DS, NotATemplate, AS, DSContext,
- LateAttrs);
+ ParseDeclarationSpecifiers(DS, NotATemplate, AS, DSContext, LateAttrs);
return false;
}
-/// ParseDeclarationSpecifiersOrConceptDefinition
+/// ParseDeclarationSpecifiers
/// declaration-specifiers: [C99 6.7]
/// storage-class-specifier declaration-specifiers[opt]
/// type-specifier declaration-specifiers[opt]
@@ -2905,8 +2902,7 @@
/// [OpenCL] '__kernel'
/// 'friend': [C++ dcl.friend]
/// 'constexpr': [C++0x dcl.constexpr]
-/// [C++2a] 'concept'
-void Parser::ParseDeclarationSpecifiersOrConceptDefinition(DeclSpec &DS,
+void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
const ParsedTemplateInfo &TemplateInfo,
AccessSpecifier AS,
DeclSpecContext DSContext,
@@ -3684,11 +3680,7 @@
ConsumeToken();
ParseEnumSpecifier(Loc, DS, TemplateInfo, AS, DSContext);
continue;
-
- case tok::kw_concept:
- ConsumeToken();
- ParseConceptDefinition(Loc, DS, TemplateInfo, AS, DSContext);
- continue;
+
// cv-qualifier:
case tok::kw_const:
isInvalid = DS.SetTypeQual(DeclSpec::TQ_const, Loc, PrevSpec, DiagID,
@@ -6374,7 +6366,7 @@
// too much hassle.
DS.takeAttributesFrom(FirstArgAttrs);
- ParseDeclarationSpecifiersOrConceptDefinition(DS);
+ ParseDeclarationSpecifiers(DS);
// Parse the declarator. This is "PrototypeContext" or