ptr-declarator ( parameter-declaration-clause ) noexcept-specifier attribute-specifier-seq
struct S {
S(); // declares the constructor
};
S::S() { } // defines the constructor
— end example
struct C;
void no_opt(C*);
struct C {
int c;
C() : c(0) { no_opt(this); }
};
const C cobj;
void no_opt(C* cptr) {
int i = cobj.c * 100; // value of cobj.c is unspecified
cptr->c = 1;
cout << cobj.c * 100 // value of cobj.c is unspecified
<< '\n';
}
extern struct D d;
struct D {
D(int a) : a(a), b(d.a) {}
int a, b;
};
D d = D(1); // value of d.b is unspecified
— end example