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
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits