[clang] [Clang] Consider reachability for file-scope warnings on initializers (PR #163885)
Justin Stitt via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 17 11:12:28 PDT 2025
================
@@ -57,10 +61,14 @@ class AnalysisBasedWarnings {
enum VisitFlag { NotVisited = 0, Visited = 1, Pending = 2 };
llvm::DenseMap<const FunctionDecl*, VisitFlag> VisitedFD;
+ llvm::MapVector<VarDecl *, SmallVector<PossiblyUnreachableDiag, 4>>
+ VarDeclPossiblyUnreachableDiags;
Policy PolicyOverrides;
void clearOverrides();
+ void FlushDiagnostics(SmallVector<clang::sema::PossiblyUnreachableDiag, 4>);
----------------
JustinStitt wrote:
I decided to just remove this method as there is a `flushDiagnostics` already. That one, however, takes a function scope argument so I just open-coded this function inline. Its a simple loop anyways.
https://github.com/llvm/llvm-project/pull/163885
More information about the cfe-commits
mailing list