summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2015-09-19 05:32:57 +0000
committerSerge Pavlov <sepavloff@gmail.com>2015-09-19 05:32:57 +0000
commitc4e04a29640335082eec854bbfdcf3d3a1f897c3 (patch)
treeb969eed8446a32911bea64ca2705fe4dbc01f7b6 /clang/lib/Parse/ParseDecl.cpp
parent0510cd5161bf66747bccf09dbbe6728029efa83c (diff)
downloadbcm5719-llvm-c4e04a29640335082eec854bbfdcf3d3a1f897c3.tar.gz
bcm5719-llvm-c4e04a29640335082eec854bbfdcf3d3a1f897c3.zip
[Modules] More descriptive diagnostics for misplaced import directive
If an import directive was put into wrong context, the error message was obscure, complaining on misbalanced braces. To get more descriptive messages, annotation tokens related to modules are processed where they must not be seen. Differential Revision: http://reviews.llvm.org/D11844 llvm-svn: 248085
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 80d25426f66..f5983c0295e 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -3589,7 +3589,8 @@ void Parser::ParseStructUnionBody(SourceLocation RecordLoc,
SmallVector<Decl *, 32> FieldDecls;
// While we still have something to read, read the declarations in the struct.
- while (Tok.isNot(tok::r_brace) && !isEofOrEom()) {
+ while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof) &&
+ !tryParseMisplacedModuleImport()) {
// Each iteration of this loop reads one struct-declaration.
// Check for extraneous top-level semicolon.
OpenPOWER on IntegriCloud