__FUNCTION__ causes g++ internal compiler error in constexpr functions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-5 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
// bug.cpp
// g++ -std=c++14 bug.cpp -DCAUSE_
inline constexpr bool bug() noexcept {
#ifdef CAUSE_GCC_
auto tmp = __FUNCTION__; // same for __PRETTY_FUNCTION__
#else
auto tmp = "bug";
#endif
return true;
}
static_
int main(int, const char *[]) { return 0; }
$ g++ -std=c++14 bug.cpp
$ g++ -std=c++14 bug.cpp -DCAUSE_
bug.cpp:11:18: in constexpr expansion of ‘bug()’
bug.cpp:11:38: internal compiler error: Segmentation fault
static_
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:/
$ gcc --version
gcc (Ubuntu 5.3.1-14ubuntu2.1) 5.3.1 20160413
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_
DISTRIB_
DISTRIB_
Changed in gcc-5 (Ubuntu): | |
status: | In Progress → Fix Released |
fixed in yakkety and in ppa:ubuntu- toolchain- r/ppa (which is supposed to go to xenial-updates)