[cfe-commits] r54775 - /cfe/trunk/lib/Sema/SemaExpr.cpp
Chris Lattner
sabre at nondot.org
Wed Aug 13 21:33:25 PDT 2008
Author: lattner
Date: Wed Aug 13 23:33:24 2008
New Revision: 54775
URL: http://llvm.org/viewvc/llvm-project?rev=54775&view=rev
Log:
Make diagnostics relating to the callee hilight just the callee
and put the caret on the ()'s. e.g. produces:
t.c:13:9: error: called object is not a function or function pointer
((B)a)();
~~~~~~^
instead of:
t.c:13:3: error: called object is not a function or function pointer
((B)a)();
^~~~~~~~
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=54775&r1=54774&r2=54775&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Aug 13 23:33:24 2008
@@ -951,12 +951,12 @@
// type pointer to function".
const PointerType *PT = Fn->getType()->getAsPointerType();
if (PT == 0)
- return Diag(Fn->getLocStart(), diag::err_typecheck_call_not_function,
- SourceRange(Fn->getLocStart(), RParenLoc));
+ return Diag(LParenLoc, diag::err_typecheck_call_not_function,
+ Fn->getSourceRange());
const FunctionType *FuncT = PT->getPointeeType()->getAsFunctionType();
if (FuncT == 0)
- return Diag(Fn->getLocStart(), diag::err_typecheck_call_not_function,
- SourceRange(Fn->getLocStart(), RParenLoc));
+ return Diag(LParenLoc, diag::err_typecheck_call_not_function,
+ Fn->getSourceRange());
// We know the result type of the call, set it.
TheCall->setType(FuncT->getResultType());
More information about the cfe-commits
mailing list