aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/type-formatting.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-02-17 06:52:25 +0000
committerDouglas Gregor <dgregor@apple.com>2011-02-17 06:52:25 +0000
commitc6daf0b29d6c48a99cb1ad707973a7e6dfcafd58 (patch)
tree857832d4d4283bd0e16d721bd6ef119f15179a1a /test/SemaCXX/type-formatting.cpp
parent6810630bb00ba2944cbeb54834f38f69dbddfd7f (diff)
When printing a qualified type, look through a substituted template
parameter type to see what's behind it, so that we don't end up printing silly things like "float const *" when "const float *" would make more sense. Also, replace the pile of "isa" tests with a simple switch enumerating all of the cases, making a few more obvious cases use prefix qualifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125729 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/type-formatting.cpp')
-rw-r--r--test/SemaCXX/type-formatting.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaCXX/type-formatting.cpp b/test/SemaCXX/type-formatting.cpp
new file mode 100644
index 0000000000..3fe9278c40
--- /dev/null
+++ b/test/SemaCXX/type-formatting.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+struct X0 { };
+struct X1 { };
+
+template<typename T>
+void f0() {
+ const T *t = (const X0*)0; // expected-error{{cannot initialize a variable of type 'const X1 *' with an rvalue of type 'const X0 *'}}
+}
+template void f0<X1>(); // expected-note{{instantiation of}}