Public bug reported:

// bug.cpp
// g++ -std=c++14 bug.cpp -DCAUSE_GCC_INTERNAL_COMPILER_ERROR
inline constexpr bool bug() noexcept {
#ifdef CAUSE_GCC_INTERNAL_COMPILER_ERROR
  auto tmp = __FUNCTION__; // same for __PRETTY_FUNCTION__
#else
  auto tmp = "bug";
#endif
  return true;
}
static_assert(bug(), "g++ 5.3.1 bug");
int main(int, const char *[]) { return 0; }

$ g++ -std=c++14 bug.cpp

$ g++ -std=c++14 bug.cpp -DCAUSE_GCC_INTERNAL_COMPILER_ERROR
bug.cpp:11:18:   in constexpr expansion of ‘bug()’
bug.cpp:11:38: internal compiler error: Segmentation fault
 static_assert(bug(), "g++ 5.3.1 bug");
                                      ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.

$ 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_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04 LTS"

** Affects: gcc-5 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1593608

Title:
  __FUNCTION__ causes g++ internal compiler error in constexpr functions

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1593608/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to