[PATCH] D21075: Correct invalid end location in diagnostics for some identifiers.

Erik Verbruggen via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 26 13:05:14 PDT 2016


erikjv added inline comments.


================
Comment at: lib/Sema/SemaExpr.cpp:2061-2062
+  auto Builder = Diag(R.getNameLoc(), diagnostic) << Name;
+  if (Name.isIdentifier())
+    Builder << SourceRange(R.getNameLoc());
   return true;
----------------
rsmith wrote:
> I'm indifferent on this change: I don't see much point in adding a single-token range when we already point the caret at that token, but I don't see any harm either.
It's mostly about how much is "underlined". If there is only a caret, that quite often translates into a single character being pointed out, instead of an identifier (i.e. the first character). Hene the extension of the range.


https://reviews.llvm.org/D21075





More information about the cfe-commits mailing list