[Bug c++/94205] [8/9/10 Regression] ICE in cxx_eval_constant_expression with 'this'-capturing lambda inside an NSDMI since r8-1251
jason at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Mar 31 22:01:12 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94205
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
C++14 version that goes back to the introduction of C++14 constexpr in GCC 5:
struct S
{
struct A
{
S *p;
constexpr A(S* p): p(p) {}
constexpr operator int() { p->a = 5; return 6; }
};
int a = A(this);
};
constexpr S s = {};
#define SA(X) static_assert((X),#X)
SA(s.a == 6);
More information about the Gcc-bugs
mailing list