summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/import-decl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-11-07 22:55:02 +0000
committerDouglas Gregor <dgregor@apple.com>2013-11-07 22:55:02 +0000
commit594b8c934f79de7c2085a6ca7fb519648a7ff684 (patch)
treefc076913310c4493f343f3825e14b24206cee7ff /clang/test/Modules/import-decl.cpp
parent4b60a1594d2c6b1d18b0839614cd414306ca0176 (diff)
downloadbcm5719-llvm-594b8c934f79de7c2085a6ca7fb519648a7ff684.tar.gz
bcm5719-llvm-594b8c934f79de7c2085a6ca7fb519648a7ff684.zip
Modules: Teach the preprocessor to recognize 'import' only after an '@'.
The preprocessor currently recognizes module declarations to load a module based on seeing the 'import' keyword followed by an identifier. This sequence is fairly unlikely in C (one would need a type named 'import'), but is more common in Objective-C (where a variable named 'import' can cause problems). Since import declarations currently require a leading '@', recognize that in the preprocessor as well. Fixes <rdar://problem/15084587>. llvm-svn: 194225
Diffstat (limited to 'clang/test/Modules/import-decl.cpp')
-rw-r--r--clang/test/Modules/import-decl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Modules/import-decl.cpp b/clang/test/Modules/import-decl.cpp
index 900e090c0c5..56428b3eba6 100644
--- a/clang/test/Modules/import-decl.cpp
+++ b/clang/test/Modules/import-decl.cpp
@@ -8,3 +8,12 @@
int main() {
return 0;
}
+
+// <rdar://problem/15084587>
+@interface A
+-method;
+@end
+
+void testImport(A *import) {
+ [import method];
+}
OpenPOWER on IntegriCloud