https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117044

            Bug ID: 117044
           Summary: Recursive template instantiation crashes gcc trunk:
                    Segmentation fault signal terminated program cc1plus
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

The following illformed code crashes current gcc trunk. This code was generated
by a fuzzer.

Compiler Explorer: https://godbolt.org/z/5v85M1Ea9

Code:

template<typename T, int N> T v;
template<int N> decltype(v<int, N-1>) v<int, N>;
int k = v<int, 1>;

Compilation result:

g++: internal compiler error: Segmentation fault signal terminated program
cc1plus
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 4

Reply via email to