aboutsummaryrefslogtreecommitdiff
path: root/test/Misc/diag-template-diffing.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2013-02-27 01:41:53 +0000
committerRichard Trieu <rtrieu@google.com>2013-02-27 01:41:53 +0000
commitda8910519b8dc79826781e74aaafddbd5c4ba19c (patch)
tree8df9ca0a7fbad8c9a6e73f816d14fe5346b4e502 /test/Misc/diag-template-diffing.cpp
parentb3a49f567a918406020cc2bb5a4cdba4e976d09c (diff)
Update template diffing to handle template arguments that are declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176153 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Misc/diag-template-diffing.cpp')
-rw-r--r--test/Misc/diag-template-diffing.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/Misc/diag-template-diffing.cpp b/test/Misc/diag-template-diffing.cpp
index c6fc32d1b3..6be705511d 100644
--- a/test/Misc/diag-template-diffing.cpp
+++ b/test/Misc/diag-template-diffing.cpp
@@ -869,6 +869,40 @@ namespace rdar12931988 {
}
}
+namespace ValueDecl {
+ int int1, int2, default_int;
+ template <const int& T = default_int>
+ struct S {};
+
+ typedef S<int1> T1;
+ typedef S<int2> T2;
+ typedef S<> TD;
+
+ void test() {
+ T1 t1;
+ T2 t2;
+ TD td;
+
+ t1 = t2;
+ // CHECK-ELIDE-NOTREE: no viable overloaded '='
+ // CHECK-ELIDE-NOTREE: no known conversion from 'S<int2>' to 'S<int1>'
+
+ t2 = t1;
+ // CHECK-ELIDE-NOTREE: no viable overloaded '='
+ // CHECK-ELIDE-NOTREE: no known conversion from 'S<int1>' to 'S<int2>'
+
+ td = t1;
+ // TODO: Find out why (default) isn't printed on second template.
+ // CHECK-ELIDE-NOTREE: no viable overloaded '='
+ // CHECK-ELIDE-NOTREE: no known conversion from 'S<int1>' to 'S<default_int>'
+
+ t2 = td;
+ // CHECK-ELIDE-NOTREE: no viable overloaded '='
+ // CHECK-ELIDE-NOTREE: no known conversion from 'S<(default) default_int>' to 'S<int2>'
+
+ }
+}
+
// CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-ELIDE-TREE: {{[0-9]*}} errors generated.