[clang] [Clang] disallow selectany on non-global-variable declarations (PR #189641)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed May 6 05:33:05 PDT 2026


================
@@ -4500,6 +4500,8 @@ def DLLImportStaticLocal : InheritableAttr, TargetSpecificAttr<TargetHasDLLImpor
 
 def SelectAny : InheritableAttr {
   let Spellings = [Declspec<"selectany">, GCC<"selectany">];
+  let Subjects = SubjectList<[NonParmVar, Function], ErrorDiag,
+                             "variable declarations with external linkage">;
----------------
AaronBallman wrote:

Why is `Function` in the list of subjects?

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


More information about the cfe-commits mailing list