[clang] [Clang] Add -Wtrivial-auto-var-init warning for unreachable variables (PR #178318)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 10 12:50:34 PST 2026


efriedma-quic wrote:

I think we want to follow the new gcc behavior for both C and C++.  It's more intuitive to just say that scalars are initialized, whatever jumps exist.

(I don't think the gcc developers intentionally introduced divergence between C and C++ here; it just requires a separate patch for C because they don't have a unified C/C++ frontend.)

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


More information about the cfe-commits mailing list