diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-08-11 02:04:19 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-08-11 02:04:19 +0000 |
| commit | 08877541108cfbd62f8a40748116dbfaecf1f6ca (patch) | |
| tree | 8198ff12d8c00cb0f19b60e9efa88aeb25ffeccc /clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp | |
| parent | 8d7bdf6dffb56c31bb671be4476c9fb057eaf26d (diff) | |
| download | bcm5719-llvm-08877541108cfbd62f8a40748116dbfaecf1f6ca.tar.gz bcm5719-llvm-08877541108cfbd62f8a40748116dbfaecf1f6ca.zip | |
PR33489: A function-style cast to a deduced class template specialization type is type-dependent if it can't be resolved due to a type-dependent argument.
llvm-svn: 310691
Diffstat (limited to 'clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp')
| -rw-r--r-- | clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp b/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp index 668c2428025..9232a8b6eba 100644 --- a/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp +++ b/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp @@ -286,6 +286,29 @@ namespace tuple_tests { } } +namespace dependent { + template<typename T> struct X { + X(T); + }; + template<typename T> int Var(T t) { + X x(t); + return X(x) + 1; // expected-error {{invalid operands}} + } + template<typename T> int Cast(T t) { + return X(X(t)) + 1; // expected-error {{invalid operands}} + } + template<typename T> int New(T t) { + return X(new X(t)) + 1; // expected-error {{invalid operands}} + }; + template int Var(float); // expected-note {{instantiation of}} + template int Cast(float); // expected-note {{instantiation of}} + template int New(float); // expected-note {{instantiation of}} + template<typename T> int operator+(X<T>, int); + template int Var(int); + template int Cast(int); + template int New(int); +} + #else // expected-no-diagnostics |

