[clang] [Clang] Initialize bypassed variables w/ trivial-auto-var-init (PR #181937)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Fri May 22 14:10:49 PDT 2026


efriedma-quic wrote:

Sorry, I haven't touched this part of the C standard in a while... I should have spotted that.

Whether the compiler's initialization counts as initialization isn't really important; "the value becomes indeterminate each time the declaration is reached" covers us.

But say you make the test slightly more complicated:

```
int f() {
  int b = 0;
BEGIN:;
goto CONT;
  int *p;
CONT:
  if (b)
    *p = 10;
  p = &b;
  if (!b) {
    b = 1;
    goto BEGIN;
  }
  return b;
}
```

In this form, the declaration is never reached, so the whole sentence is irrelevant.

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


More information about the cfe-commits mailing list