This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/82218] New: [C++1x] constexpr on static member function causes segfault
- From: "emil.fresk at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 15 Sep 2017 06:19:49 +0000
- Subject: [Bug c++/82218] New: [C++1x] constexpr on static member function causes segfault
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82218
Bug ID: 82218
Summary: [C++1x] constexpr on static member function causes
segfault
Product: gcc
Version: 6.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: emil.fresk at gmail dot com
Target Milestone: ---
The constexpr on line 55 in Compiler Explorer https://godbolt.org/g/sJA8nK
causes the segfault.
By removing this, it compiles fine.
The error is tested in 6.3.0 and 6.3.1, where it exists.
Found on arm-none-eabi-gcc 6.3.1 on Ubuntu 16.04, reproduced on the normal GCC
6.3.x.
Not triggered any more in GCC 7.1 and 7.2.
Full error message:
<source>: In instantiation of 'static constexpr R delegate<R(Params
...)>::invoke_function(void*, Params ...) [with R (* Fptr)(Params ...) =
delegate<R(Params ...)>::error_function<void, {}>; R = void; Params = {}]':
103 : <source>:103:12: required from 'static constexpr auto delegate<R(Params
...)>::from() [with R (* Fptr)(Params ...) = delegate<R(Params
...)>::error_function<void, {}>; R = void; Params = {}]'
72 : <source>:72:35: required from 'delegate<R(Params ...)>::delegate() [with
R = void; Params = {}]'
134 : <source>:134:24: required from here
43 : <source>:43:23: in constexpr expansion of 'delegate<R(Params
...)>::error_function<void, {}>()'
42 : <source>:42:22: internal compiler error: Segmentation fault
constexpr static R invoke_function(void*, Params... params) noexcept(
^~~~~~~~~~~~~~~
mmap: Cannot allocate memory
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Compiler exited with result code 1