@@ -1934,12 +1934,12 @@ Parser::DeclGroupPtrTy Parser::ParseSimpleDeclaration(
19341934 bool RequireSemi, ForRangeInit *FRI, SourceLocation *DeclSpecStart) {
19351935 // Need to retain these for diagnostics before we add them to the DeclSepc.
19361936 ParsedAttributesView OriginalDeclSpecAttrs;
1937- OriginalDeclSpecAttrs.addAll (DeclSpecAttrs.begin (), DeclSpecAttrs.end ());
1937+ OriginalDeclSpecAttrs.prepend (DeclSpecAttrs.begin (), DeclSpecAttrs.end ());
19381938 OriginalDeclSpecAttrs.Range = DeclSpecAttrs.Range ;
19391939
19401940 // Parse the common declaration-specifiers piece.
19411941 ParsingDeclSpec DS (*this );
1942- DS.takeAttributesFrom (DeclSpecAttrs);
1942+ DS.takeAttributesAppendingingFrom (DeclSpecAttrs);
19431943
19441944 ParsedTemplateInfo TemplateInfo;
19451945 DeclSpecContext DSContext = getDeclSpecContextFromDeclaratorContext (Context);
@@ -2135,7 +2135,7 @@ Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS,
21352135 // list. This ensures that we will not attempt to interpret them as statement
21362136 // attributes higher up the callchain.
21372137 ParsedAttributes LocalAttrs (AttrFactory);
2138- LocalAttrs.takeAllFrom (Attrs);
2138+ LocalAttrs.takeAllPrependingFrom (Attrs);
21392139 ParsingDeclarator D (*this , DS, LocalAttrs, Context);
21402140 if (TemplateInfo.TemplateParams )
21412141 D.setTemplateParameterLists (*TemplateInfo.TemplateParams );
@@ -3462,7 +3462,7 @@ void Parser::ParseDeclarationSpecifiers(
34623462 PA.setInvalid ();
34633463 }
34643464
3465- DS.takeAttributesFrom (attrs);
3465+ DS.takeAttributesAppendingingFrom (attrs);
34663466 }
34673467
34683468 // If this is not a declaration specifier token, we're done reading decl
@@ -3689,7 +3689,7 @@ void Parser::ParseDeclarationSpecifiers(
36893689 if (ParseImplicitInt (DS, &SS, TemplateInfo, AS, DSContext, Attrs)) {
36903690 if (!Attrs.empty ()) {
36913691 AttrsLastTime = true ;
3692- attrs.takeAllFrom (Attrs);
3692+ attrs.takeAllAppendingFrom (Attrs);
36933693 }
36943694 continue ;
36953695 }
@@ -3854,7 +3854,7 @@ void Parser::ParseDeclarationSpecifiers(
38543854 if (ParseImplicitInt (DS, nullptr , TemplateInfo, AS, DSContext, Attrs)) {
38553855 if (!Attrs.empty ()) {
38563856 AttrsLastTime = true ;
3857- attrs.takeAllFrom (Attrs);
3857+ attrs.takeAllAppendingFrom (Attrs);
38583858 }
38593859 continue ;
38603860 }
@@ -4463,7 +4463,7 @@ void Parser::ParseDeclarationSpecifiers(
44634463 // take them over and handle them here.
44644464 if (!Attributes.empty ()) {
44654465 AttrsLastTime = true ;
4466- attrs.takeAllFrom (Attributes);
4466+ attrs.takeAllAppendingFrom (Attributes);
44674467 }
44684468 continue ;
44694469 }
@@ -4830,7 +4830,7 @@ void Parser::ParseLexedCAttribute(LateParsedAttribute &LA, bool EnterScope,
48304830 ConsumeAnyToken ();
48314831
48324832 if (OutAttrs) {
4833- OutAttrs->takeAllFrom (Attrs);
4833+ OutAttrs->takeAllAppendingFrom (Attrs);
48344834 }
48354835}
48364836
@@ -6122,7 +6122,7 @@ void Parser::ParseTypeQualifierListOpt(
61226122 isAllowedCXX11AttributeSpecifier ()) {
61236123 ParsedAttributes Attrs (AttrFactory);
61246124 ParseCXX11Attributes (Attrs);
6125- DS.takeAttributesFrom (Attrs);
6125+ DS.takeAttributesAppendingingFrom (Attrs);
61266126 }
61276127
61286128 SourceLocation EndLoc;
@@ -7483,7 +7483,7 @@ void Parser::ParseParameterDeclarationClause(
74837483 // Take them so that we only apply the attributes to the first parameter.
74847484 // We have already started parsing the decl-specifier sequence, so don't
74857485 // parse any parameter-declaration pieces that precede it.
7486- ArgDeclSpecAttrs.takeAllFrom (FirstArgAttrs);
7486+ ArgDeclSpecAttrs.takeAllPrependingFrom (FirstArgAttrs);
74877487 } else {
74887488 // Parse any C++11 attributes.
74897489 MaybeParseCXX11Attributes (ArgDeclAttrs);
@@ -7505,7 +7505,7 @@ void Parser::ParseParameterDeclarationClause(
75057505 DeclSpecContext::DSC_normal,
75067506 /* LateAttrs=*/ nullptr , AllowImplicitTypename);
75077507
7508- DS.takeAttributesFrom (ArgDeclSpecAttrs);
7508+ DS.takeAttributesAppendingingFrom (ArgDeclSpecAttrs);
75097509
75107510 // Parse the declarator. This is "PrototypeContext" or
75117511 // "LambdaExprParameterContext", because we must accept either
0 commit comments