"function designator".
(This causes a minor glitch in the
diagnostics for C++ member pointers, but we weren't printing the
right diagnostic there anyway.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70307
91177308-0d34-0410-b5e6-
96231b3b80d8
if (lval != Expr::LV_Valid) { // C99 6.5.3.2p1
// The operand must be either an l-value or a function designator
- if (!dcl || !isa<FunctionDecl>(dcl)) {
+ if (!op->getType()->isFunctionType()) {
// FIXME: emit more specific diag...
Diag(OpLoc, diag::err_typecheck_invalid_lvalue_addrof)
<< op->getSourceRange();
int b = 1[test13a().X]; /* expected-warning {{ISO C90 does not allow subscripting non-lvalue array}} */
}
+/* Make sure we allow *test14 as a "function designator" */
+int test14() { return (&*test14)(); }
void (HasMembers::*pmf)() = &HasMembers::f;
void (*pnf)() = &Fake::f;
- &hm.f; // expected-error {{address expression must be an lvalue or a function designator}}
+ &hm.f; // FIXME: needs diagnostic expected-warning{{result unused}}
void (HasMembers::*pmgv)() = &HasMembers::g;
void (HasMembers::*pmgi)(int) = &HasMembers::g;