summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-10 18:33:27 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-10 18:33:27 +0000
commit65b2c4c3817beb0f0e456fafb921c5156d80dd00 (patch)
treeac4f1c53bd0b77c5480cdd059b341c64d9c8300b /clang/test
parent805dd4cac78bbadc1d916a6b2fbdf5cbb106be91 (diff)
downloadbcm5719-llvm-65b2c4c3817beb0f0e456fafb921c5156d80dd00.tar.gz
bcm5719-llvm-65b2c4c3817beb0f0e456fafb921c5156d80dd00.zip
Add pretty-printing for class template specializations, e.g.,
'struct A<double, int>' In the "template instantiation depth exceeded" message, print "-ftemplate-depth-N" rather than "-ftemplate-depth=N". An unnamed tag type that is declared with a typedef, e.g., typedef struct { int x, y; } Point; can be used as a template argument. Allow this, and check that we get sensible pretty-printing for such things. llvm-svn: 66560
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaTemplate/class-template-id-2.cpp2
-rw-r--r--clang/test/SemaTemplate/class-template-spec.cpp2
-rw-r--r--clang/test/SemaTemplate/instantiation-backtrace.cpp11
-rw-r--r--clang/test/SemaTemplate/instantiation-depth.cpp2
4 files changed, 12 insertions, 5 deletions
diff --git a/clang/test/SemaTemplate/class-template-id-2.cpp b/clang/test/SemaTemplate/class-template-id-2.cpp
index 3014208b6ea..5499c50a949 100644
--- a/clang/test/SemaTemplate/class-template-id-2.cpp
+++ b/clang/test/SemaTemplate/class-template-id-2.cpp
@@ -4,7 +4,7 @@ namespace N {
template<> class A<int> { };
- template<> class A<float>; // expected-note{{forward declaration of 'class A'}}
+ template<> class A<float>; // expected-note{{forward declaration of 'class A<float>'}}
class B : public A<int> { };
}
diff --git a/clang/test/SemaTemplate/class-template-spec.cpp b/clang/test/SemaTemplate/class-template-spec.cpp
index 023ba381ec4..90ab39f32e9 100644
--- a/clang/test/SemaTemplate/class-template-spec.cpp
+++ b/clang/test/SemaTemplate/class-template-spec.cpp
@@ -19,7 +19,7 @@ int test_incomplete_specs(A<double, double> *a1,
A<double> *a2)
{
(void)a1->x; // expected-error{{incomplete definition of type 'A<double, double>'}}
- (void)a2->x; // expected-error{{implicit instantiation of undefined template 'struct A'}}
+ (void)a2->x; // expected-error{{implicit instantiation of undefined template 'struct A<double, int>'}}
}
typedef float FLOAT;
diff --git a/clang/test/SemaTemplate/instantiation-backtrace.cpp b/clang/test/SemaTemplate/instantiation-backtrace.cpp
index 4c8ea13a8d7..f8aabff0973 100644
--- a/clang/test/SemaTemplate/instantiation-backtrace.cpp
+++ b/clang/test/SemaTemplate/instantiation-backtrace.cpp
@@ -1,7 +1,8 @@
// RUN: clang -fsyntax-only -verify %s
-template<typename T> struct A; // expected-note{{template is declared here}}
+template<typename T> struct A; // expected-note 2{{template is declared here}}
-template<typename T> struct B : A<T*> { }; // expected-error{{implicit instantiation of undefined template}}
+template<typename T> struct B : A<T*> { }; // expected-error{{implicit instantiation of undefined template}} \
+// expected-error{{implicit instantiation of undefined template 'struct A<X *>'}}
template<typename T> struct C : B<T> { } ; // expected-note{{instantiation of template class}}
@@ -14,3 +15,9 @@ template<typename T> struct F : E<T(T)> { }; // expected-note{{instantiation of
void f() {
(void)sizeof(F<int>); // expected-note{{instantiation of template class}}
}
+
+typedef struct { } X;
+
+void g() {
+ (void)sizeof(B<X>); // expected-note{{in instantiation of template class 'struct B<X>' requested here}}
+}
diff --git a/clang/test/SemaTemplate/instantiation-depth.cpp b/clang/test/SemaTemplate/instantiation-depth.cpp
index 25c40fce4d1..06317d88d48 100644
--- a/clang/test/SemaTemplate/instantiation-depth.cpp
+++ b/clang/test/SemaTemplate/instantiation-depth.cpp
@@ -1,7 +1,7 @@
// RUN: clang -fsyntax-only -ftemplate-depth=5 -verify %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{{use -ftemplate-depth-N to increase recursive template instantiation depth}} \
// expected-note 5 {{instantiation of template class}}
void test() {
OpenPOWER on IntegriCloud