The program as follows is ill-formed: ``` constexpr bool g() { int * p = nullptr; { int c = 0; p = &c; } return *p == 0; //indirection via dangling pointer }; int main() { static_assert( g() ); } ``` but GCC erroneously accepts it, demo: https://gcc.godbolt.org/z/8xE7csGKo The compiler must fail the program, see stackoverflow explanation: https://stackoverflow.com/a/69446660/7325599
Dup of bug 70331. *** This bug has been marked as a duplicate of bug 70331 ***