[Bug c++/85363] Throwing exception from member constructor (brace initializer vs initializer list)
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Apr 12 10:42:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85363
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-04-12
Ever confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Please provide *complete* testcases, not ones missing headers.
Confirmed with this:
int init (int f) {
throw f;
}
struct X {
X (int f) : n {init (f)} {}
int n;
};
struct P {
X x {20};
};
int main ()
{
try {
P p {};
}
catch (int n) {
return 0;
}
return 1;
}
It only fails in C++11 mode, not C++14 or later.
More information about the Gcc-bugs
mailing list