]> granicus.if.org Git - clang/commitdiff
Make diagnostics relating to the callee hilight just the callee
authorChris Lattner <sabre@nondot.org>
Thu, 14 Aug 2008 04:33:24 +0000 (04:33 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 14 Aug 2008 04:33:24 +0000 (04:33 +0000)
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)();
  ^~~~~~~~

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54775 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index b3e748097e015987f731cd38d1ac888a636ac855..2e99b3dfe81299f1a8a9e405860f5eec7094f9e0 100644 (file)
@@ -951,12 +951,12 @@ ActOnCallExpr(ExprTy *fn, SourceLocation LParenLoc,
   // 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());