From 3b05e20031bcd9fbdc4f65ef1ada3e887f9daeaf Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Tue, 8 Oct 2013 16:58:52 +0000 Subject: 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 --- clang/test/Misc/diag-template-diffing.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'clang/test/Misc/diag-template-diffing.cpp') 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 class allocator; +template class vector; + +typedef vector > AtomVector; + +template > class vector {}; + +void foo() { + vector v; + AtomVector v2(v); + // CHECK-ELIDE-NOTREE: no known conversion from 'vector' to 'const vector' +} +} + // 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. - -- cgit v1.2.3