================
@@ -8120,8 +8125,15 @@ NamedDecl *Sema::ActOnVariableDeclarator(
!NewVD->getType().isConstQualified()) {
FunctionDecl *CurFD = getCurFunctionDecl();
if (CurFD && isFunctionDefinitionDiscarded(*this, CurFD)) {
- Diag(D.getDeclSpec().getStorageClassSpecLoc(),
- diag::warn_static_local_in_extern_inline);
+ unsigned DiagID;
+ if (getLangOpts().C2y)
+ DiagID = diag::warn_c2y_compat_static_local_in_extern_inline;
+ else if (getSourceManager().isInMainFile(D.getBeginLoc()))
+ DiagID = diag::ext_static_local_in_extern_inline_quiet;
----------------
AaronBallman wrote:
I don't think we need this diagnostic in this case; I think that's specific to
the case where we were calling a function, not using a variable.
https://github.com/llvm/llvm-project/pull/167086
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits