rsmith added a comment.

It seems to me that the bug is that we're producing an invalid source location, 
not how we handle that downstream. Typo correction should be able to preserve 
the source location of whatever expression it was correcting.


================
Comment at: lib/Sema/SemaExpr.cpp:14047-14048
@@ -14046,1 +14046,4 @@
 
+  if (Loc.isInvalid())
+    return true;
+
----------------
General rule: for a function that returns `true` to say "an error occurred", it 
is not acceptable to return `true` without either (a) producing an error or (b) 
observing some state that proves someone else emitted an error (such as a decl 
that has been set as invalid).


http://reviews.llvm.org/D17762



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to