diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-11-08 03:40:48 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-11-08 03:40:48 +0000 |
commit | e81f58e1801176942d2d47b1b7027c4dfb7d9d1b (patch) | |
tree | be6b8cd51cd38166f5f36c0c08ef97fcb21c9a50 /clang/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp | |
parent | 21184644afefd30f76098b2b48abe6d6ae0fc115 (diff) | |
download | bcm5719-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/CXX/expr/expr.unary/expr.unary.op/p4.cpp')
-rw-r--r-- | clang/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp b/clang/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp index 170c734fd30..06cc6107402 100644 --- a/clang/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp +++ b/clang/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp @@ -7,8 +7,7 @@ namespace test0 { template<typename T> void g(T); void test() { - // FIXME: this diagnostic is terrible - foo(&g<int>); // expected-error {{cannot initialize a parameter of type 'void (test0::A::*)(int)' with an rvalue of type '<overloaded function type>'}} + foo(&g<int>); // expected-error {{can't form member pointer of type 'void (test0::A::*)(int)' without '&' and class name}} } }; } @@ -39,7 +38,6 @@ namespace test2 { }; void A::test() { - // FIXME: This diagnostic is terrible. - int (A::*ptr)(int) = &(A::foo); // expected-error {{cannot initialize a variable of type 'int (test2::A::*)(int)' with an rvalue of type '<overloaded function type>'}} + int (A::*ptr)(int) = &(A::foo); // expected-error {{can't form member pointer of type 'int (test2::A::*)(int)' without '&' and class name}} } } |