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

Manuel Klimek via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 6 03:37:08 PDT 2016


klimek added a reviewer: rsmith.

================
Comment at: lib/Sema/SemaType.cpp:1339
@@ +1338,3 @@
+        auto R = DS.getSourceRange();
+        if (R.getEnd().isInvalid())
+          R.setEnd(R.getBegin());
----------------
erikjv wrote:
> klimek wrote:
> > Do you know in which cases we get source ranges that are half valid?
> In Parser::ParseTypeofSpecifier the 'cast range' for a typeof(...) is parsed, but is found to be invalid. Then it explicitly sets the DeclSpec's end location to an invalid location.
Ok, in this case, we'll need Richard to verify whether he intended half-valid source locations something that users need to deal with.


http://reviews.llvm.org/D21075





More information about the cfe-commits mailing list