diff options
Diffstat (limited to 'clang/test/SemaTemplate')
| -rw-r--r-- | clang/test/SemaTemplate/temp_arg_nontype_cxx11.cpp | 9 | ||||
| -rw-r--r-- | clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/clang/test/SemaTemplate/temp_arg_nontype_cxx11.cpp b/clang/test/SemaTemplate/temp_arg_nontype_cxx11.cpp index aa4cc8c094e..17e5253bfee 100644 --- a/clang/test/SemaTemplate/temp_arg_nontype_cxx11.cpp +++ b/clang/test/SemaTemplate/temp_arg_nontype_cxx11.cpp @@ -27,3 +27,12 @@ namespace CanonicalNullptr { namespace Auto { template<auto> struct A { }; // expected-error {{until C++1z}} } + +namespace check_conversion_early { + struct X {}; + template<int> struct A {}; + template<X &x> struct A<x> {}; // expected-error {{not implicitly convertible}} + + struct Y { constexpr operator int() const { return 0; } }; + template<Y &y> struct A<y> {}; // expected-error {{depends on a template parameter of the partial specialization}} +} diff --git a/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp b/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp index abfb0f2836e..97ecbdb3f90 100644 --- a/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp +++ b/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp @@ -137,7 +137,7 @@ namespace DeduceDifferentType { struct Z { constexpr operator Y&() { return y; } } z; constexpr Y::operator Z&() { return z; } template<Y &> struct D {}; - template<Z &z> int d(D<z>); // expected-note {{does not have the same type}} + template<Z &z> int d(D<z>); // expected-note {{couldn't infer template argument 'z'}} int d_imp = d(D<y>()); // expected-error {{no matching function}} int d_exp = d<y>(D<y>()); } |

