summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc/diag-template-diffing.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-10-08 16:58:52 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-10-08 16:58:52 +0000
commit3b05e20031bcd9fbdc4f65ef1ada3e887f9daeaf (patch)
tree836211894d6d830d2de875527e50f5d5d5800f4a /clang/test/Misc/diag-template-diffing.cpp
parent22d6ac7e9a8180157044a33732c23125aa99fcb5 (diff)
downloadbcm5719-llvm-3b05e20031bcd9fbdc4f65ef1ada3e887f9daeaf.tar.gz
bcm5719-llvm-3b05e20031bcd9fbdc4f65ef1ada3e887f9daeaf.zip
Fix an edge case in the template differ with default arguments.
In the test case one type is coming from a typedef with no default arg, the other has the default arg. Taking the default arg from the typedef crashes, so always use the real template paramter declaration. PR17510. llvm-svn: 192202
Diffstat (limited to 'clang/test/Misc/diag-template-diffing.cpp')
-rw-r--r--clang/test/Misc/diag-template-diffing.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/clang/test/Misc/diag-template-diffing.cpp b/clang/test/Misc/diag-template-diffing.cpp
index 722ce98ecff..46807070c7c 100644
--- a/clang/test/Misc/diag-template-diffing.cpp
+++ b/clang/test/Misc/diag-template-diffing.cpp
@@ -1051,8 +1051,24 @@ namespace DependentInt {
}
}
+namespace PR17510 {
+class Atom;
+
+template <typename T> class allocator;
+template <typename T, typename A> class vector;
+
+typedef vector<const Atom *, allocator<const Atom *> > AtomVector;
+
+template <typename T, typename A = allocator<const Atom *> > class vector {};
+
+void foo() {
+ vector<Atom *> v;
+ AtomVector v2(v);
+ // CHECK-ELIDE-NOTREE: no known conversion from 'vector<class PR17510::Atom *, [...]>' to 'const vector<const class PR17510::Atom *, [...]>'
+}
+}
+
// CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-ELIDE-TREE: {{[0-9]*}} errors generated.
// CHECK-NOELIDE-TREE: {{[0-9]*}} errors generated.
-
OpenPOWER on IntegriCloud