================
@@ -7146,15 +7148,17 @@ static void checkAliasAttr(Sema &S, NamedDecl &ND) {
}
static void checkSelectAnyAttr(Sema &S, NamedDecl &ND) {
- // 'selectany' only applies to externally visible variable declarations.
- // It does not apply to functions.
- if (SelectAnyAttr *Attr = ND.getAttr<SelectAnyAttr>()) {
- if (isa<FunctionDecl>(ND) || !ND.isExternallyVisible()) {
- S.Diag(Attr->getLocation(),
- diag::err_attribute_selectany_non_extern_data);
- ND.dropAttr<SelectAnyAttr>();
- }
+ SelectAnyAttr *Attr = ND.getAttr<SelectAnyAttr>();
+ if (!Attr)
----------------
a-tarasyuk wrote:
@erichkeane, I think isExternallyVisible should already cover `selectany` cases
- unless we need to be more precise here?
https://github.com/llvm/llvm-project/pull/189641
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits