aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/expr/expr.unary/expr.unary.op
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
commit8e960435696b4ccf6a8ad0ed0530e3280b77af8b (patch)
treef2af3c028275c68c0431fea64ca8eb1f75430e59 /test/CXX/expr/expr.unary/expr.unary.op
parentfd4524b4452d5dcda9c7cb9b1b665fd0f4b6267e (diff)
Properly diagnose invalid casts to function references. Patch by
Faisal Vali, tweaked by me. Fixes PR8230. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/expr/expr.unary/expr.unary.op')
-rw-r--r--test/CXX/expr/expr.unary/expr.unary.op/p4.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp b/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp
index 170c734fd3..06cc610740 100644
--- a/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp
+++ b/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}}
}
}