Issue 142842
Summary [clang] segfault infinite recursion template template parameter default argument
Labels bug, clang:frontend, crash-on-invalid
Assignees
Reporter mizvekov
    Example: https://godbolt.org/z/5eKPfxK85
```C++
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
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to