]> granicus.if.org Git - clang/commit
[Modules] More descriptive diagnostics for misplaced import directive
authorSerge Pavlov <sepavloff@gmail.com>
Sat, 19 Sep 2015 05:32:57 +0000 (05:32 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Sat, 19 Sep 2015 05:32:57 +0000 (05:32 +0000)
commit5bd7ce1215838ea98fcf8d5209266ea146f3c555
treefcc06ac82e7a26931fa55b59ba3d3efc0c1d8404
parent5c9ee3a97f80600e7d85b26abc88b85febe1f7eb
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248085 91177308-0d34-0410-b5e6-96231b3b80d8
20 files changed:
include/clang/Basic/DiagnosticParseKinds.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Parse/Parser.h
include/clang/Sema/Sema.h
lib/Parse/ParseDecl.cpp
lib/Parse/ParseDeclCXX.cpp
lib/Parse/ParseStmt.cpp
lib/Parse/Parser.cpp
lib/Sema/SemaDecl.cpp
test/Modules/Inputs/misplaced/misplaced-a.h [new file with mode: 0644]
test/Modules/Inputs/misplaced/misplaced-b.h [new file with mode: 0644]
test/Modules/Inputs/misplaced/misplaced.modulemap [new file with mode: 0644]
test/Modules/auto-module-import.m
test/Modules/extern_c.cpp
test/Modules/malformed.cpp
test/Modules/misplaced-1.cpp [new file with mode: 0644]
test/Modules/misplaced-2.cpp [new file with mode: 0644]
test/Modules/misplaced-3.cpp [new file with mode: 0644]
test/Modules/misplaced-4.cpp [new file with mode: 0644]
test/Modules/misplaced-5.c [new file with mode: 0644]