@@ -2498,40 +2498,13 @@ void Parser::ParseCXX2CTriviallyRelocatableSpecifier(SourceLocation &TRS) {
24982498
24992499 Diag (Tok.getLocation (), getLangOpts ().CPlusPlus26
25002500 ? diag::warn_relocatable_keyword
2501- : diag::ext_relocatable_keyword)
2502- << /* relocatable*/ 0 ;
2501+ : diag::ext_relocatable_keyword);
25032502
25042503 TRS = ConsumeToken ();
25052504}
25062505
2507- bool Parser::isCXX2CReplaceableKeyword (Token Tok) const {
2508- if (!getLangOpts ().CPlusPlus || Tok.isNot (tok::identifier))
2509- return false ;
2510- if (!Ident_replaceable_if_eligible)
2511- Ident_replaceable_if_eligible =
2512- &PP.getIdentifierTable ().get (" replaceable_if_eligible" );
2513- IdentifierInfo *II = Tok.getIdentifierInfo ();
2514- return II == Ident_replaceable_if_eligible;
2515- }
2516-
2517- bool Parser::isCXX2CReplaceableKeyword () const {
2518- return isCXX2CReplaceableKeyword (Tok);
2519- }
2520-
2521- void Parser::ParseCXX2CReplaceableSpecifier (SourceLocation &MRS) {
2522- assert (isCXX2CReplaceableKeyword () &&
2523- " expected a replaceable_if_eligible specifier" );
2524-
2525- Diag (Tok.getLocation (), getLangOpts ().CPlusPlus26
2526- ? diag::warn_relocatable_keyword
2527- : diag::ext_relocatable_keyword)
2528- << /* replaceable*/ 1 ;
2529-
2530- MRS = ConsumeToken ();
2531- }
2532-
25332506bool Parser::isClassCompatibleKeyword (Token Tok) const {
2534- if (isCXX2CTriviallyRelocatableKeyword (Tok) || isCXX2CReplaceableKeyword (Tok) )
2507+ if (isCXX2CTriviallyRelocatableKeyword (Tok))
25352508 return true ;
25362509 VirtSpecifiers::Specifier Specifier = isCXX11VirtSpecifier (Tok);
25372510 return Specifier == VirtSpecifiers::VS_Final ||
@@ -3587,7 +3560,6 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
35873560 bool IsFinalSpelledSealed = false ;
35883561 bool IsAbstract = false ;
35893562 SourceLocation TriviallyRelocatable;
3590- SourceLocation Replaceable;
35913563
35923564 // Parse the optional 'final' keyword.
35933565 if (getLangOpts ().CPlusPlus && Tok.is (tok::identifier)) {
@@ -3599,23 +3571,12 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
35993571 auto Skipped = Tok;
36003572 ConsumeToken ();
36013573 Diag (Skipped, diag::err_duplicate_class_relocation_specifier)
3602- << /* trivial_relocatable */ 0 << TriviallyRelocatable;
3574+ << TriviallyRelocatable;
36033575 } else {
36043576 ParseCXX2CTriviallyRelocatableSpecifier (TriviallyRelocatable);
36053577 }
36063578 continue ;
36073579 }
3608- if (isCXX2CReplaceableKeyword (Tok)) {
3609- if (Replaceable.isValid ()) {
3610- auto Skipped = Tok;
3611- ConsumeToken ();
3612- Diag (Skipped, diag::err_duplicate_class_relocation_specifier)
3613- << /* replaceable*/ 1 << Replaceable;
3614- } else {
3615- ParseCXX2CReplaceableSpecifier (Replaceable);
3616- }
3617- continue ;
3618- }
36193580 break ;
36203581 }
36213582 if (isCXX11FinalKeyword ()) {
@@ -3654,7 +3615,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
36543615 Diag (FinalLoc, diag::ext_warn_gnu_final);
36553616 }
36563617 assert ((FinalLoc.isValid () || AbstractLoc.isValid () ||
3657- TriviallyRelocatable.isValid () || Replaceable. isValid () ) &&
3618+ TriviallyRelocatable.isValid ()) &&
36583619 " not a class definition" );
36593620
36603621 // Parse any C++11 attributes after 'final' keyword.
@@ -3729,7 +3690,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
37293690 if (TagDecl)
37303691 Actions.ActOnStartCXXMemberDeclarations (
37313692 getCurScope (), TagDecl, FinalLoc, IsFinalSpelledSealed, IsAbstract,
3732- TriviallyRelocatable, Replaceable, T.getOpenLocation ());
3693+ TriviallyRelocatable, T.getOpenLocation ());
37333694
37343695 // C++ 11p3: Members of a class defined with the keyword class are private
37353696 // by default. Members of a class defined with the keywords struct or union
0 commit comments