================
@@ -3140,15 +3140,17 @@ static void checkNewAttributesAfterDef(Sema &S, Decl
*New, const Decl *Old) {
--E;
continue;
}
- } else if (isa<SelectAnyAttr>(NewAttribute) &&
- cast<VarDecl>(New)->isInline() &&
- !cast<VarDecl>(New)->isInlineSpecified()) {
+ } else if (isa<SelectAnyAttr>(NewAttribute)) {
// Don't warn about applying selectany to implicitly inline variables.
// Older compilers and language modes would require the use of selectany
// to make such variables inline, and it would have no effect if we
// honored it.
- ++I;
- continue;
+ if (auto *VD = dyn_cast<VarDecl>(New)) {
+ if (VD->isInline() && !VD->isInlineSpecified()) {
+ ++I;
+ continue;
+ }
+ }
----------------
a-tarasyuk wrote:
@AaronBallman I've updated formatting for both cases.
https://github.com/llvm/llvm-project/pull/189641
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits