aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-06-20 07:52:11 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-06-20 07:52:11 +0000
commitae0bafa229d076a0fb90b5aeccea7e3039c58751 (patch)
tree6d329e2afe0efa314e0feb5dfef54f65334311ae /lib/Sema/SemaExpr.cpp
parentc04985647bbd54d53b1f1219287eddce8ff530b5 (diff)
Fix a problem with the diagnostics of invalid arithmetic with function
pointers I found while working on the NULL arithmetic warning. We here always assuming the LHS was the pointer, instead of using the selected pointer expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133428 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 5d62910068..a00877622d 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -7218,13 +7218,13 @@ QualType Sema::CheckAdditionOperands( // C99 6.5.6
} else if (PointeeTy->isFunctionType()) {
if (getLangOptions().CPlusPlus) {
Diag(Loc, diag::err_typecheck_pointer_arith_function_type)
- << lex.get()->getType() << lex.get()->getSourceRange();
+ << PExp->getType() << PExp->getSourceRange();
return QualType();
}
// GNU extension: arithmetic on pointer to function
Diag(Loc, diag::ext_gnu_ptr_func_arith)
- << lex.get()->getType() << lex.get()->getSourceRange();
+ << PExp->getType() << PExp->getSourceRange();
} else {
// Check if we require a complete type.
if (((PExp->getType()->isPointerType() &&