[PATCH] D136355: [clang][Sema] Fix caret position to be on the non null parameter

Arthur Grillo Queiroz Cabral via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 20 07:12:44 PDT 2022


Grillo created this revision.
Grillo added a reviewer: aaron.ballman.
Herald added a project: All.
Grillo requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

When checking for non null arguments the wrong SourceLocation was given,
this fix to pass the proper argument's location.

Reported in PR58273.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136355

Files:
  clang/lib/Sema/SemaChecking.cpp


Index: clang/lib/Sema/SemaChecking.cpp
===================================================================
--- clang/lib/Sema/SemaChecking.cpp
+++ clang/lib/Sema/SemaChecking.cpp
@@ -5638,7 +5638,7 @@
   for (unsigned ArgIndex = 0, ArgIndexEnd = NonNullArgs.size();
        ArgIndex != ArgIndexEnd; ++ArgIndex) {
     if (NonNullArgs[ArgIndex])
-      CheckNonNullArgument(S, Args[ArgIndex], CallSiteLoc);
+      CheckNonNullArgument(S, Args[ArgIndex], Args[ArgIndex]->getExprLoc());
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136355.469219.patch
Type: text/x-patch
Size: 494 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221020/36ecc7cb/attachment-0001.bin>


More information about the cfe-commits mailing list