annotate clang/test/SemaTemplate/instantiation-depth.cpp @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children 1f2b6ac9f198
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-depth 5 -ftemplate-backtrace-limit 4 %s
anatofuz
parents:
diff changeset
2 // RUN: %clang -fsyntax-only -Xclang -verify -ftemplate-depth-5 -ftemplate-backtrace-limit=4 %s
anatofuz
parents:
diff changeset
3 // RUN: %clang -fsyntax-only -Xclang -verify -ftemplate-depth=5 -ftemplate-backtrace-limit=4 %s
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 #ifndef NOEXCEPT
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 template<typename T> struct X : X<T*> { }; \
anatofuz
parents:
diff changeset
8 // expected-error{{recursive template instantiation exceeded maximum depth of 5}} \
anatofuz
parents:
diff changeset
9 // expected-note 3 {{instantiation of template class}} \
anatofuz
parents:
diff changeset
10 // expected-note {{skipping 2 contexts in backtrace}} \
anatofuz
parents:
diff changeset
11 // expected-note {{use -ftemplate-depth=N to increase recursive template instantiation depth}}
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 void test() {
anatofuz
parents:
diff changeset
14 (void)sizeof(X<int>); // expected-note {{instantiation of template class}}
anatofuz
parents:
diff changeset
15 }
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 #else
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 // RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-depth 5 -ftemplate-backtrace-limit 4 -std=c++11 -DNOEXCEPT %s
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 template<typename T> struct S {
anatofuz
parents:
diff changeset
22 S() noexcept(noexcept(S<S>())); \
anatofuz
parents:
diff changeset
23 // expected-error{{recursive template instantiation exceeded maximum depth of 5}} \
anatofuz
parents:
diff changeset
24 // expected-note 3 {{in instantiation of exception spec}} \
anatofuz
parents:
diff changeset
25 // expected-note {{skipping 2 contexts in backtrace}} \
anatofuz
parents:
diff changeset
26 // expected-note {{use -ftemplate-depth=N to increase recursive template instantiation depth}}
anatofuz
parents:
diff changeset
27 };
anatofuz
parents:
diff changeset
28 S<void> t; // expected-note {{in instantiation of exception spec}}
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 #endif