================ @@ -2152,29 +2152,44 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } +static std::optional<Expr *> sharedGetConstructorDestructorAttrExpr(Sema &S, const ParsedAttr &AL) { + Expr *E = nullptr; + if (AL.getNumArgs() == 1) { + E = AL.getArgAsExpr(0); + if (E->isValueDependent()) { ---------------- Sirraide wrote:
Since you’re only checking `isValueDependent()` here, can you add a test to see what happens if an expression is only type-dependent, e.g. ```c++ template <typename T> [[gnu::constructor(static_cast<T>(42))]] void foo() {} template void foo<int>(); ``` https://github.com/llvm/llvm-project/pull/151400 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits