[Bug c++/94034] [10 Regression] Broken diagnostic: 'result_decl' not supported by dump_expr
ppalka at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Apr 8 16:34:48 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94034
--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Here is a rejects-valid testcase caused by the same underlying issue:
$ cat testcase.C
struct A { A *p = this; int n; };
constexpr A
foo()
{
return {};
}
constexpr A
bar()
{
A a = foo();
a.p->n = 5;
return a;
}
static_assert(bar().n == 5);
$ g++ -std=c++2a testcase.C
testcase.C:17:23: error: non-constant condition for static assertion
17 | static_assert(bar().n == 5);
| ~~~~~~~~^~~~
testcase.C:17:19: in ‘constexpr’ expansion of ‘bar()’
testcase.C:17:23: error: modification of ‘‘result_decl’ not supported by
dump_expr<expression error>’ is not a constant expression
More information about the Gcc-bugs
mailing list