llvm-project/clang/test/SemaTemplate/instantiation-depth-exception-spec.cpp
Nikita Popov 07f3388fff Revert "[clang] Implement instantiation context note for checking template parameters (#126088)"
This reverts commit a24523ac8dc07f3478311a5969184b922b520395.

This is causing significant compile-time regressions for C++ code, see:
https://github.com/llvm/llvm-project/pull/126088#issuecomment-2704874202
2025-03-10 10:32:08 +01:00

15 lines
570 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -ftemplate-depth=16 -fcxx-exceptions -fexceptions %s
template<int N> struct X {
static int go(int a) noexcept(noexcept(X<N+1>::go(a))); // \
// expected-error {{recursive template instantiation exceeded maximum depth of 16}} \
// expected-note 9{{in instantiation of exception specification}} \
// expected-note {{skipping 7 context}} \
// expected-note {{use -ftemplate-depth}}
};
void f() {
int k = X<0>::go(0); // \
// expected-note {{in instantiation of exception specification for 'go' requested here}}
}