summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiation-depth.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-20 07:18:24 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-20 07:18:24 +0000
commitffed1cb339106c7bc04337aec61bf5da9ecfc742 (patch)
treed3bfaf12596740eace062bbbcf7a7e0fe20b1ae3 /clang/test/SemaTemplate/instantiation-depth.cpp
parent5debc3316841966d66bda90106560ffc09d2757c (diff)
downloadbcm5719-llvm-ffed1cb339106c7bc04337aec61bf5da9ecfc742.tar.gz
bcm5719-llvm-ffed1cb339106c7bc04337aec61bf5da9ecfc742.zip
Introduce a limit on the depth of the template instantiation backtrace
we will print with each error that occurs during template instantiation. When the backtrace is longer than that, we will print N/2 of the innermost backtrace entries and N/2 of the outermost backtrace entries, then skip the middle entries with a note such as: note: suppressed 2 template instantiation contexts; use -ftemplate-backtrace-limit=N to change the number of template instantiation entries shown This should eliminate some excessively long backtraces that aren't providing any value. llvm-svn: 101882
Diffstat (limited to 'clang/test/SemaTemplate/instantiation-depth.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiation-depth.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/test/SemaTemplate/instantiation-depth.cpp b/clang/test/SemaTemplate/instantiation-depth.cpp
index f48ede9c44c..20a5c2431b6 100644
--- a/clang/test/SemaTemplate/instantiation-depth.cpp
+++ b/clang/test/SemaTemplate/instantiation-depth.cpp
@@ -1,8 +1,10 @@
-// RUN: %clang_cc1 -fsyntax-only -ftemplate-depth 5 -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-depth 5 -ftemplate-backtrace-limit 4 %s
-template<typename T> struct X : X<T*> { }; // expected-error{{recursive template instantiation exceeded maximum depth of 5}} \
-// expected-note{{use -ftemplate-depth-N to increase recursive template instantiation depth}} \
-// expected-note 5 {{instantiation of template class}}
+template<typename T> struct X : X<T*> { }; \
+// expected-error{{recursive template instantiation exceeded maximum depth of 5}} \
+// expected-note 3 {{instantiation of template class}} \
+// expected-note {{suppressed 2 template instantiation contexts}} \
+// expected-note {{use -ftemplate-depth-N to increase recursive template instantiation depth}}
void test() {
(void)sizeof(X<int>); // expected-note {{instantiation of template class}}
OpenPOWER on IntegriCloud