summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc/diag-template-diffing.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2016-01-15 02:55:17 +0000
committerRichard Trieu <rtrieu@google.com>2016-01-15 02:55:17 +0000
commitd5c7378b9eafcb3c54aee0a02cbe7c1cc09db4f1 (patch)
tree38794b3a0b4d54a058d68aaa3b709c9cab980c2f /clang/test/Misc/diag-template-diffing.cpp
parentd2f24b62b56a1d50cb00314085d94b3ad3cfde4b (diff)
downloadbcm5719-llvm-d5c7378b9eafcb3c54aee0a02cbe7c1cc09db4f1.tar.gz
bcm5719-llvm-d5c7378b9eafcb3c54aee0a02cbe7c1cc09db4f1.zip
Save the integer type for integral template arguments.
Save the integer type when diffing integers in template type diffing. When integers are different sizes, print out the type along with the integer value. Also with the type information, print true and false instead of 1 and 0 for boolean values. llvm-svn: 257861
Diffstat (limited to 'clang/test/Misc/diag-template-diffing.cpp')
-rw-r--r--clang/test/Misc/diag-template-diffing.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/test/Misc/diag-template-diffing.cpp b/clang/test/Misc/diag-template-diffing.cpp
index f106c7d03da..424ac51c9a1 100644
--- a/clang/test/Misc/diag-template-diffing.cpp
+++ b/clang/test/Misc/diag-template-diffing.cpp
@@ -1271,9 +1271,23 @@ void test() {
foo<BoolT<true>>(X);
}
// CHECK-ELIDE-NOTREE: no matching function for call to 'foo'
-// CHECK-ELIDE-NOTREE: candidate function [with T = BoolArgumentBitExtended::BoolT<true>] not viable: no known conversion from 'BoolT<0>' to 'BoolT<1>' for 1st argument
+// CHECK-ELIDE-NOTREE: candidate function [with T = BoolArgumentBitExtended::BoolT<true>] not viable: no known conversion from 'BoolT<false>' to 'BoolT<true>' for 1st argument
}
+namespace DifferentIntegralTypes {
+template<typename T, T n>
+class A{};
+void foo() {
+ A<int, 1> a1 = A<long long, 1>();
+ A<unsigned int, 1> a2 = A<int, 5>();
+ A<bool, true> a3 = A<signed char, true>();
+}
+// CHECK-ELIDE-NOTREE: error: no viable conversion from 'A<long long, (long long) 1>' to 'A<int, (int) 1>'
+// CHECK-ELIDE-NOTREE: error: no viable conversion from 'A<int, (int) 5>' to 'A<unsigned int, (unsigned int) 1>'
+// CHECK-ELIDE-NOTREE: error: no viable conversion from 'A<signed char, (signed char) 1>' to 'A<bool, (bool) true>'
+}
+
+
// CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-ELIDE-TREE: {{[0-9]*}} errors generated.
OpenPOWER on IntegriCloud