https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88820
Bug ID: 88820
Summary: ICE in in C++2a mode for code which is able to be
compiled in C++17 mode
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: hanicka at hanicka dot net
Target Milestone: ---
Created attachment 45420
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45420&action=edit
one file with all includes included
Hi, I found ICE in GCC9-HEAD with CTRE library (I'm author) when I compiled it
with C++2a mode. Same code with C++17 mode is compiled correctly, I wasn't able
to minimize code which reproduce the error.
But I was able to find responsible part of the library and reimplement it
differently (problematic part is enabled with
-DCTRE_ENABLE_TRAMPOLINING_ON_GCC9)
I think that problem is related to class-nontype-template-arguments change in
C++2a, check line 314.
I'm using GCC9 current head (January 13th 2019).
https://gcc.godbolt.org/z/_G0854
(GCC8.2 is compiling correctly the same code.)
g++-HEAD test-me.cpp -std=c++17 -DCTRE_ENABLE_TRAMPOLINING_ON_GCC9 -g0
=> correct
g++-HEAD test-me.cpp -std=c++2a -DCTRE_ENABLE_TRAMPOLINING_ON_GCC9 -g0
=> fail
<source>: In substitution of 'template<class Grammar, basic_fixed_string input,
class ActionSelector, bool IgnoreUnknownActions> template<class Subject> static
constexpr auto ctll::parser<Grammar, input, ActionSelector,
IgnoreUnknownActions>::trampoline_decide(Subject) [with Subject = <missing>;
Grammar = ctll::empty_subject; basic_fixed_string input = <missing>;
ActionSelector = <missing>; bool IgnoreUnknownActions = <missing>]':
<source>:464:74: required from here
<source>:458:68: internal compiler error: tree check: expected tree that
contains 'decl minimal' structure, have 'error_mark' in decl_anon_ns_mem_p, at
cp/tree.c:3478
458 | template <typename Subject = empty_subject> static constexpr auto
trampoline_decide(Subject subject = {}) noexcept {
|
^~~~~~~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
test.me.cpp is attached