diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-05-21 06:58:08 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-05-21 06:58:08 +0000 |
commit | d5f23b0b7528b5c3caed1ba14f897cc4aaa9e3c3 (patch) | |
tree | 133ab22e59f61162b7f8e8e794dd6458769e8e1a /test/Misc/diag-template-diffing.cpp | |
parent | 624e91b063cecc3671eeb40e4b0fa08d71b59284 (diff) |
Notes
Diffstat (limited to 'test/Misc/diag-template-diffing.cpp')
-rw-r--r-- | test/Misc/diag-template-diffing.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Misc/diag-template-diffing.cpp b/test/Misc/diag-template-diffing.cpp index bdd6d62fdda2..0f2edfb63546 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. |