fhahn added a comment.
================ Comment at: clang/lib/Sema/SemaType.cpp:7661 - Expr *SizeExpr; - // Special case where the argument is a template id. - if (Attr.isArgIdent(0)) { - CXXScopeSpec SS; - SourceLocation TemplateKWLoc; - UnqualifiedId Id; - Id.setIdentifier(Attr.getArgAsIdent(0)->Ident, Attr.getLoc()); - - ExprResult Size = S.ActOnIdExpression(S.getCurScope(), SS, TemplateKWLoc, - Id, /*HasTrailingLParen=*/false, - /*IsAddressOfOperand=*/false); - - if (Size.isInvalid()) - return; - SizeExpr = Size.get(); - } else { - SizeExpr = Attr.getArgAsExpr(0); - } + assert(Attr.isArgExpr(0) && "Argument to should be an expression"); + Expr *SizeExpr = Attr.getArgAsExpr(0); ---------------- erichkeane wrote: > I think the asserts aren't necessary, isArgExpr does a ArgsUnion::get<Expr*>, > which already asserts. Good point, I removed the assertions. It's even more compact now :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94092/new/ https://reviews.llvm.org/D94092 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits