https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93115

--- Comment #8 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
Slightly better example without warnings (used `__builtin_trap();` to work
around use of uninitialized value):

```c++
struct a {
  char ac1;
  char ac2;
  int d() { return av() + ac1 + ac2; }
  virtual void f() {}
  virtual int av() { __builtin_trap(); }

  a(){}
};

struct g : a {
  virtual void f2();

  g():a(){}
};

#ifdef LIB_FILE
void g::f2() {}
#endif
#ifdef MAIN_FILE
static g b;
static char bb;
char cc() { return bb; }

void h() {
  if (cc()) {
    b.d();
    return;
  }
}
int main() {}
#endif
```

Reply via email to