summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiation-backtrace.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-10 18:52:44 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-10 18:52:44 +0000
commit27b152fa7443f4e24630b997c07def6b0c23925a (patch)
tree478ae818f13c3655240bf0805502c5ee12840331 /test/SemaTemplate/instantiation-backtrace.cpp
parent98137534e612c274ba270af99d73429043957e53 (diff)
downloadclang-27b152fa7443f4e24630b997c07def6b0c23925a.tar.gz
If we run into multiple errors within the same template instantiation,
only print the template instantiation backtrace for the first error. Also, if a base class has failed to type-check during instantiation, just drop that base class and continue on to check other base classes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66563 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiation-backtrace.cpp')
-rw-r--r--test/SemaTemplate/instantiation-backtrace.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/SemaTemplate/instantiation-backtrace.cpp b/test/SemaTemplate/instantiation-backtrace.cpp
index f8aabff097..10c2de0381 100644
--- a/test/SemaTemplate/instantiation-backtrace.cpp
+++ b/test/SemaTemplate/instantiation-backtrace.cpp
@@ -1,5 +1,5 @@
// RUN: clang -fsyntax-only -verify %s
-template<typename T> struct A; // expected-note 2{{template is declared here}}
+template<typename T> struct A; // expected-note 4{{template is declared here}}
template<typename T> struct B : A<T*> { }; // expected-error{{implicit instantiation of undefined template}} \
// expected-error{{implicit instantiation of undefined template 'struct A<X *>'}}
@@ -21,3 +21,12 @@ typedef struct { } X;
void g() {
(void)sizeof(B<X>); // expected-note{{in instantiation of template class 'struct B<X>' requested here}}
}
+
+template<typename T>
+struct G : A<T>, // expected-error{{implicit instantiation of undefined template 'struct A<int>'}}
+ A<T*> // expected-error{{implicit instantiation of undefined template 'struct A<int *>'}}
+ { };
+
+void h() {
+ (void)sizeof(G<int>); // expected-note{{in instantiation of template class 'struct G<int>' requested here}}
+}