summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Misc')
-rw-r--r--clang/test/Misc/diag-template-diffing-color.cpp14
-rw-r--r--clang/test/Misc/diag-template-diffing-cxx98.cpp18
-rw-r--r--clang/test/Misc/diag-template-diffing.cpp2
3 files changed, 32 insertions, 2 deletions
diff --git a/clang/test/Misc/diag-template-diffing-color.cpp b/clang/test/Misc/diag-template-diffing-color.cpp
index 2c228414b3e..c771857f390 100644
--- a/clang/test/Misc/diag-template-diffing-color.cpp
+++ b/clang/test/Misc/diag-template-diffing-color.cpp
@@ -70,3 +70,17 @@ void test19() {
// TREE: vector<
// TREE: [const != const [[CYAN]]volatile[[RESET]]] vector<
// TREE: [...]>>
+
+namespace default_args {
+ template <int x, int y = 1+1, int z = 2>
+ class A {};
+
+ void foo(A<0> &M) {
+ // CHECK: no viable conversion from 'A<[...], (default) [[CYAN]]1 + 1[[RESET]][[BOLD]] aka [[CYAN]]2[[RESET]][[BOLD]], (default) [[CYAN]]2[[RESET]][[BOLD]]>' to 'A<[...], [[CYAN]]0[[RESET]][[BOLD]], [[CYAN]]0[[RESET]][[BOLD]]>'
+ A<0, 0, 0> N = M;
+
+ // CHECK: no viable conversion from 'A<[2 * ...], (default) [[CYAN]]2[[RESET]][[BOLD]]>' to 'A<[2 * ...], [[CYAN]]0[[RESET]][[BOLD]]>'
+ A<0, 2, 0> N2 = M;
+ }
+
+}
diff --git a/clang/test/Misc/diag-template-diffing-cxx98.cpp b/clang/test/Misc/diag-template-diffing-cxx98.cpp
index f374fbc4179..9d0439c2828 100644
--- a/clang/test/Misc/diag-template-diffing-cxx98.cpp
+++ b/clang/test/Misc/diag-template-diffing-cxx98.cpp
@@ -11,7 +11,23 @@ namespace PR15513 {
class A {};
void foo(A<0> &M) {
- // CHECK: no viable conversion from 'A<[...], (default) x + 1>' to 'A<[...], 0>'
+ // CHECK: no viable conversion from 'A<[...], (default) x + 1 aka 1>' to 'A<[...], 0>'
A<0, 0> N = M;
+ // CHECK: no viable conversion from 'A<0, [...]>' to 'A<1, [...]>'
+ A<1, 1> O = M;
}
}
+
+namespace default_args {
+ template <int x, int y = 1+1, int z = 2>
+ class A {};
+
+ void foo(A<0> &M) {
+ // CHECK: no viable conversion from 'A<[...], (default) 1 + 1 aka 2, (default) 2>' to 'A<[...], 0, 0>'
+ A<0, 0, 0> N = M;
+
+ // CHECK: no viable conversion from 'A<[2 * ...], (default) 2>' to 'A<[2 * ...], 0>'
+ A<0, 2, 0> N2 = M;
+ }
+
+}
diff --git a/clang/test/Misc/diag-template-diffing.cpp b/clang/test/Misc/diag-template-diffing.cpp
index 6be705511db..ac15dfe29cf 100644
--- a/clang/test/Misc/diag-template-diffing.cpp
+++ b/clang/test/Misc/diag-template-diffing.cpp
@@ -797,7 +797,7 @@ namespace PR14342 {
X<int, (signed char)-1> x = X<long, -1>();
X<int, 3UL> y = X<int, 2>();
// CHECK-ELIDE-NOTREE: error: no viable conversion from 'X<long, [...]>' to 'X<int, [...]>'
- // CHECK-ELIDE-NOTREE: error: no viable conversion from 'X<[...], 2>' to 'X<[...], 3UL>'
+ // CHECK-ELIDE-NOTREE: error: no viable conversion from 'X<[...], 2>' to 'X<[...], 3>'
}
namespace PR14489 {
OpenPOWER on IntegriCloud