Skip to content

[clang] crash infinite recursion template template parameter default argument #142842

Open
@mizvekov

Description

@mizvekov

Example: https://godbolt.org/z/5eKPfxK85

template<class T, template<class> class TT>     struct A;
template<class T, template<class> class TT = A> struct A {};
A<int> a;

This exhausts the stack before we hit the instantiation depth implementation limit:

<source>:2:46: warning: stack nearly exhausted; compilation time may suffer, and crashes due to stack overflow are likely [-Wstack-exhausted]
    2 | template<class T, template<class> class TT = A> struct A {};
      |                                              ^
Program terminated with signal: SIGSEGV
Compiler returned: 139

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions