summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/static-cast.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-11-08 03:40:48 +0000
committerDouglas Gregor <dgregor@apple.com>2010-11-08 03:40:48 +0000
commite81f58e1801176942d2d47b1b7027c4dfb7d9d1b (patch)
treebe6b8cd51cd38166f5f36c0c08ef97fcb21c9a50 /clang/test/SemaCXX/static-cast.cpp
parent21184644afefd30f76098b2b48abe6d6ae0fc115 (diff)
downloadbcm5719-llvm-e81f58e1801176942d2d47b1b7027c4dfb7d9d1b.tar.gz
bcm5719-llvm-e81f58e1801176942d2d47b1b7027c4dfb7d9d1b.zip
Properly diagnose invalid casts to function references. Patch by
Faisal Vali, tweaked by me. Fixes PR8230. llvm-svn: 118400
Diffstat (limited to 'clang/test/SemaCXX/static-cast.cpp')
-rw-r--r--clang/test/SemaCXX/static-cast.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/static-cast.cpp b/clang/test/SemaCXX/static-cast.cpp
index c8639a95440..46c6eee2c4e 100644
--- a/clang/test/SemaCXX/static-cast.cpp
+++ b/clang/test/SemaCXX/static-cast.cpp
@@ -184,7 +184,7 @@ void PR5897() { (void)static_cast<const int(*)[1]>((const void*)0); }
namespace PR6072 {
struct A { };
- struct B : A { void f(int); void f(); };
+ struct B : A { void f(int); void f(); }; // expected-note 2{{candidate function}}
struct C : B { };
struct D { };
@@ -192,6 +192,6 @@ namespace PR6072 {
(void)static_cast<void (A::*)()>(&B::f);
(void)static_cast<void (B::*)()>(&B::f);
(void)static_cast<void (C::*)()>(&B::f);
- (void)static_cast<void (D::*)()>(&B::f); // expected-error{{static_cast from '<overloaded function type>' to 'void (PR6072::D::*)()' is not allowed}}
+ (void)static_cast<void (D::*)()>(&B::f); // expected-error{{address of overloaded function 'f' cannot be static_cast to type 'void (PR6072::D::*)()'}}
}
}
OpenPOWER on IntegriCloud