mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-03 21:56:05 +00:00

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
20 lines
358 B
C++
20 lines
358 B
C++
// RUN: rm -rf %t
|
|
// RUN: %clang -fmodules-cache-path=%t -fmodules -x objective-c -I %S/Inputs -emit-ast -o %t.ast %s
|
|
// RUN: %clang_cc1 -ast-print -x ast - < %t.ast | FileCheck %s
|
|
|
|
@import import_decl;
|
|
// CHECK: struct T
|
|
|
|
int main() {
|
|
return 0;
|
|
}
|
|
|
|
// <rdar://problem/15084587>
|
|
@interface A
|
|
-method;
|
|
@end
|
|
|
|
void testImport(A *import) {
|
|
[import method];
|
|
}
|