]> granicus.if.org Git - clang/commit
Modules: Teach the preprocessor to recognize 'import' only after an '@'.
authorDouglas Gregor <dgregor@apple.com>
Thu, 7 Nov 2013 22:55:02 +0000 (22:55 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 7 Nov 2013 22:55:02 +0000 (22:55 +0000)
commita5ba7b405dff48a5a0a63fff32c99eedb044842b
tree08a2df4571a1eb85943e49c4c9fe2159b6d1df85
parent1ce550906a9163fdf4d174a2f4ed594aa18d75ac
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>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194225 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Lex/Preprocessor.h
lib/Lex/Preprocessor.cpp
test/Modules/import-decl.cpp