annotate clang/test/SemaTemplate/instantiation-depth.cpp @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1f2b6ac9f198
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-depth=5 -ftemplate-backtrace-limit=4 %s
150
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
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
19 // RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-depth=5 -ftemplate-backtrace-limit=4 -std=c++11 -DNOEXCEPT %s
150
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