@@ -2168,12 +2168,12 @@ static ExprResult sharedGetConstructorDestructorAttrExpr(Sema &S,
21682168 if (!E->isTypeDependent () && !E->getType ()->isIntegerType ()) {
21692169 S.Diag (AL.getLoc (), diag::err_attribute_argument_type)
21702170 << AL << AANT_ArgumentIntegerConstant << E->getSourceRange ();
2171- return ExprResult ( /* Invalid= */ true );
2171+ return ExprError ( );
21722172 }
21732173 } else {
21742174 uint32_t priority;
21752175 if (!S.checkUInt32Argument (AL, AL.getArgAsExpr (0 ), priority)) {
2176- return ExprResult ( /* Invalid= */ true );
2176+ return ExprError ( );
21772177 }
21782178 return ConstantExpr::Create (S.Context , E,
21792179 APValue (llvm::APSInt::getUnsigned (priority)));
@@ -2188,7 +2188,7 @@ static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
21882188 return ;
21892189 }
21902190 ExprResult E = sharedGetConstructorDestructorAttrExpr (S, AL);
2191- if (!E. isUsable ())
2191+ if (E. isInvalid ())
21922192 return ;
21932193 S.Diag (D->getLocation (), diag::warn_global_constructor)
21942194 << D->getSourceRange ();
@@ -2197,7 +2197,7 @@ static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
21972197
21982198static void handleDestructorAttr (Sema &S, Decl *D, const ParsedAttr &AL) {
21992199 ExprResult E = sharedGetConstructorDestructorAttrExpr (S, AL);
2200- if (!E. isUsable ())
2200+ if (E. isInvalid ())
22012201 return ;
22022202 S.Diag (D->getLocation (), diag::warn_global_destructor) << D->getSourceRange ();
22032203 D->addAttr (::new (S.Context ) DestructorAttr (S.Context , AL, E.get ()));
0 commit comments