Skip to content

Commit e30002e

Browse files
committed
Address PR comments.
1 parent da0d2e6 commit e30002e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,15 +2194,15 @@ static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
21942194
return;
21952195
S.Diag(D->getLocation(), diag::warn_global_constructor)
21962196
<< D->getSourceRange();
2197-
D->addAttr(::new (S.Context) ConstructorAttr(S.Context, AL, E.get()));
2197+
D->addAttr(ConstructorAttr::Create(S.Context, E.get(), AL));
21982198
}
21992199

22002200
static void handleDestructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
22012201
ExprResult E = sharedGetConstructorDestructorAttrExpr(S, AL);
22022202
if (E.isInvalid())
22032203
return;
22042204
S.Diag(D->getLocation(), diag::warn_global_destructor) << D->getSourceRange();
2205-
D->addAttr(::new (S.Context) DestructorAttr(S.Context, AL, E.get()));
2205+
D->addAttr(DestructorAttr::Create(S.Context, E.get(), AL));
22062206
}
22072207

22082208
template <typename AttrTy>

clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static void sharedInstantiateConstructorDestructorAttr(
257257
}
258258
}
259259
}
260-
New->addAttr(new (C) Attr(C, *A, tempInstPriority));
260+
New->addAttr(Attr::Create(C, tempInstPriority, *A));
261261
}
262262

263263
static Expr *instantiateDependentFunctionAttrCondition(

0 commit comments

Comments
 (0)