summaryrefslogtreecommitdiffstats
path: root/test/Misc/diag-template-diffing.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-05-21 06:58:08 +0000
committerdim <dim@FreeBSD.org>2015-05-21 06:58:08 +0000
commit38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (patch)
tree133ab22e59f61162b7f8e8e794dd6458769e8e1a /test/Misc/diag-template-diffing.cpp
parentc1ee82b9c3720cafd4ddba67d76e76d4edd03163 (diff)
downloadFreeBSD-src-38d6f2e7f2ce51a5b3836d26596c6c34a3288752.zip
FreeBSD-src-38d6f2e7f2ce51a5b3836d26596c6c34a3288752.tar.gz
Vendor import of clang RELEASE_361/final tag r237755 (effectively, 3.6.1 release):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_361/final@237755
Diffstat (limited to 'test/Misc/diag-template-diffing.cpp')
-rw-r--r--test/Misc/diag-template-diffing.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Misc/diag-template-diffing.cpp b/test/Misc/diag-template-diffing.cpp
index bdd6d62..0f2edfb 100644
--- a/test/Misc/diag-template-diffing.cpp
+++ b/test/Misc/diag-template-diffing.cpp
@@ -1247,6 +1247,33 @@ template <class T> using A7 = A<(T::num)>;
// CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A<(T::num), (default) 0>' vs 'A<T::num, 1>')
}
+namespace TemplateArgumentImplicitConversion {
+template <int X> struct condition {};
+
+struct is_const {
+ constexpr operator int() const { return 10; }
+};
+
+using T = condition<(is_const())>;
+void foo(const T &t) {
+ T &t2 = t;
+}
+// CHECK-ELIDE-NOTREE: binding of reference to type 'condition<[...]>' to a value of type 'const condition<[...]>' drops qualifiers
+}
+
+namespace BoolArgumentBitExtended {
+template <bool B> struct BoolT {};
+
+template <typename T> void foo(T) {}
+
+void test() {
+ BoolT<false> X;
+ 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: {{[0-9]*}} errors generated.
// CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-ELIDE-TREE: {{[0-9]*}} errors generated.
OpenPOWER on IntegriCloud