Clang Project

clang_source_code/test/SemaTemplate/instantiation-depth-exception-spec.cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -ftemplate-depth 16 -fcxx-exceptions -fexceptions %s
2
3template<int N> struct X {
4  static int go(int a) noexcept(noexcept(X<N+1>::go(a))); // \
5// expected-error {{recursive template instantiation exceeded maximum depth of 16}} \
6// expected-note 9{{in instantiation of exception specification}} \
7// expected-note {{skipping 7 context}} \
8// expected-note {{use -ftemplate-depth}}
9};
10
11void f() {
12  int k = X<0>::go(0); // \
13  // expected-note {{in instantiation of exception specification for 'go' requested here}}
14}
15