...
Code Block | ||||
---|---|---|---|---|
| ||||
class S { int v; public: S() : v(12) {} // Not a non-trivial constructor void f(); }; void f() { // ... goto bad_idea; // ... S s; // Control passes over the declaration, so initialization does not take place. bad_idea: s.f(); } |
...
Code Block | ||||
---|---|---|---|---|
| ||||
class S { int v; public: S() : v(12) {} // Not a non-trivial constructor void f(); }; void f() { S s; // ... goto bad_idea; // ... bad_idea: s.f(); } |
...