diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2013-06-20 01:35:13 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2013-06-20 01:35:13 +0000 |
commit | 61a511ff5bb89a5219733c26301c12695da2d975 (patch) | |
tree | 78f6a95e930577c9cd296f286f1c17bf14e383d5 /clang/test/SemaCXX/cast-conversion.cpp | |
parent | 8e5e97690dee0323d76f90e11f364742c58e7be5 (diff) | |
download | bcm5719-llvm-61a511ff5bb89a5219733c26301c12695da2d975.tar.gz bcm5719-llvm-61a511ff5bb89a5219733c26301c12695da2d975.zip |
Add a few more tests for casts.
llvm-svn: 184392
Diffstat (limited to 'clang/test/SemaCXX/cast-conversion.cpp')
-rw-r--r-- | clang/test/SemaCXX/cast-conversion.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cast-conversion.cpp b/clang/test/SemaCXX/cast-conversion.cpp index 270f96831bd..76b09997ef1 100644 --- a/clang/test/SemaCXX/cast-conversion.cpp +++ b/clang/test/SemaCXX/cast-conversion.cpp @@ -65,3 +65,11 @@ void *intToPointer4() { void *intToPointer5(long l) { return (void*)l; } + +struct AmbiguousCast { + operator int(); // expected-note {{candidate function}} + operator unsigned int(); // expected-note {{candidate function}} +}; +long long AmbiguousCastFunc(AmbiguousCast& a) { + return static_cast<long long>(a); // expected-error {{ambiguous conversion for static_cast from 'AmbiguousCast' to 'long long'}} +} |