[Bug c++/85944] Address of member variable of temporary not considered constexpr at global scope
david at doublewise dot net
gcc-bugzilla@gcc.gnu.org
Mon May 28 17:20:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85944
--- Comment #2 from David Stone <david at doublewise dot net> ---
I have simplified the bug. It does not require a member variable to trigger the
bug, just taking the address of a a temporary bound to a reference function
parameter at global scope:
constexpr bool f(int const & x) {
return &x;
}
constexpr auto x = f(0);
Note that this code does not trigger the bug:
int const & x = 0;
constexpr bool b = &x;
More information about the Gcc-bugs
mailing list