[PATCH] D20428: Tracking exception specification source locations
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Thu May 26 17:43:44 PDT 2016
rsmith added a comment.
Seems reasonable to me.
================
Comment at: lib/Parse/ParseDeclCXX.cpp:3403-3427
@@ -3402,5 +3402,6 @@
// recovery, but emit a diagnostic and don't store the results.
- SourceRange NoexceptRange;
+ SourceRange NoexceptRange(Tok.getLocation(),
+ Tok.getEndLoc().getLocWithOffset(-1));
ExceptionSpecificationType NoexceptType = EST_None;
SourceLocation KeywordLoc = ConsumeToken();
@@ -3423,6 +3424,5 @@
} else {
// There is no argument.
NoexceptType = EST_BasicNoexcept;
- NoexceptRange = SourceRange(KeywordLoc, KeywordLoc);
}
----------------
This change seems strange:
1) We should be using normal token-based ranges here; the `getEndLoc().getLocWithOffset(-1)` doesn't make sense.
2) This specifies a range for the error case, where we produce an exception specification of `EST_None`. We should not have a `NoexceptRange` if we're recovering as if there were no `noexcept`.
Can you revert the changes to this file?
http://reviews.llvm.org/D20428
More information about the cfe-commits
mailing list