diff options
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 1bbc8943372..727915c5a6c 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -2449,8 +2449,11 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, DeclSpecContext DSContext, LateParsedAttrList *LateAttrs) { if (DS.getSourceRange().isInvalid()) { + // Start the range at the current token but make the end of the range + // invalid. This will make the entire range invalid unless we successfully + // consume a token. DS.SetRangeStart(Tok.getLocation()); - DS.SetRangeEnd(Tok.getLocation()); + DS.SetRangeEnd(SourceLocation()); } bool EnteringContext = (DSContext == DSC_class || DSContext == DSC_top_level); |