Fix a minor edge case in C89 mode related to the definition of a
"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
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 045fa18..c4360a9 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -4095,7 +4095,7 @@
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();