[clang] [Clang] Make '-Wglobal-constructors` work on the GNU attributes (PR #129917)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 6 09:51:21 PST 2025


================
@@ -2138,6 +2138,8 @@ static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
   if (AL.getNumArgs() &&
       !S.checkUInt32Argument(AL, AL.getArgAsExpr(0), priority))
     return;
+  S.Diag(D->getLocation(), diag::warn_global_constructor)
----------------
erichkeane wrote:

Ah!  I missed that about the constructor attribute.  Thanks!  Makes sense to me.

https://github.com/llvm/llvm-project/pull/129917


More information about the cfe-commits mailing list