[PATCH] D68913: Adds fixit hints to the Wrange-loop-analysis

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 13 13:03:46 PDT 2019


aaron.ballman added inline comments.


================
Comment at: clang/lib/Sema/SemaStmt.cpp:2759
         SemaRef.Context.getLValueReferenceType(E->getType().withConst());
-    SemaRef.Diag(VD->getBeginLoc(), diag::note_use_type_or_non_reference)
-        << NonReferenceType << NewReferenceType << VD->getSourceRange();
+    SemaRef.Diag(VD->getTypeSpecEndLoc(), diag::note_use_type_or_non_reference)
+        << NonReferenceType << NewReferenceType << VD->getSourceRange()
----------------
I don't think the diagnostic should point to the end of the type specification rather than the beginning. That puts the caret in a rather strange location for the diagnostic.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68913/new/

https://reviews.llvm.org/D68913





More information about the cfe-commits mailing list