summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/misplaced-2.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/test/Modules/misplaced-2.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/test/Modules/misplaced-2.cpp')
-rw-r--r--clang/test/Modules/misplaced-2.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Modules/misplaced-2.cpp b/clang/test/Modules/misplaced-2.cpp
new file mode 100644
index 00000000000..da460993868
--- /dev/null
+++ b/clang/test/Modules/misplaced-2.cpp
@@ -0,0 +1,6 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -verify
+
+void func1() { // expected-note{{function 'func1' begins here}}
+#include "dummy.h" // expected-error{{import of module 'dummy' appears within function 'func1'}}
+}
OpenPOWER on IntegriCloud