@@ -3355,12 +3355,12 @@ void Sema::mergeDeclAttributes(NamedDecl *New, Decl *Old,
33553355 if (!foundAny) New->dropAttrs();
33563356}
33573357
3358- void Sema::CheckAttributesOnDeducedType(Expr *E, Decl *D) {
3358+ void Sema::CheckAttributesOnDeducedType(Decl *D) {
33593359 if (!D->hasAttrs())
33603360 return;
33613361
33623362 for (const Attr *A : D->getAttrs()) {
3363- checkAttrIsTypeDependent(E, D, A);
3363+ checkAttrIsTypeDependent(D, A);
33643364 }
33653365}
33663366
@@ -13818,7 +13818,7 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) {
1381813818 return;
1381913819 }
1382013820
13821- this->CheckAttributesOnDeducedType(Init, RealDecl);
13821+ this->CheckAttributesOnDeducedType(RealDecl);
1382213822
1382313823 // dllimport cannot be used on variable definitions.
1382413824 if (VDecl->hasAttr<DLLImportAttr>() && !VDecl->isStaticDataMember()) {
@@ -14311,6 +14311,8 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl) {
1431114311 DeduceVariableDeclarationType(Var, false, nullptr))
1431214312 return;
1431314313
14314+ this->CheckAttributesOnDeducedType(RealDecl);
14315+
1431414316 // C++11 [class.static.data]p3: A static data member can be declared with
1431514317 // the constexpr specifier; if so, its declaration shall specify
1431614318 // a brace-or-equal-initializer.
@@ -14610,7 +14612,6 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl) {
1461014612 Var->setInit(RecoveryExpr.get());
1461114613 }
1461214614
14613- this->CheckAttributesOnDeducedType(Init.get(), RealDecl);
1461414615 CheckCompleteVariableDeclaration(Var);
1461514616 }
1461614617}
0 commit comments