aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-04-28 17:59:09 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-04-28 17:59:09 +0000
commit9895d88c34cb2eab65c622cddeaf721108d1af38 (patch)
tree03259f550a58622f5a4be328aef0fe61a216bcfa /lib
parent8a31774e1e18ff08a5ce0486bdf1c7a51be7a1e8 (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaExpr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 045fa180e6..c4360a94a7 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -4095,7 +4095,7 @@ QualType Sema::CheckAddressOfOperand(Expr *op, SourceLocation OpLoc) {
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();