diff options
| author | Ben Langmuir <blangmuir@apple.com> | 2016-05-04 00:53:13 +0000 |
|---|---|---|
| committer | Ben Langmuir <blangmuir@apple.com> | 2016-05-04 00:53:13 +0000 |
| commit | 537c5b5b62c42528fc90914ce6abe7002c3fb4c4 (patch) | |
| tree | 1d85faa427187b73edb925cd0416bc5f2f9d4c08 /clang/test/Modules | |
| parent | 2c5aeabeddd0495dcb4b39134f3ab1e89e0d66e5 (diff) | |
| download | bcm5719-llvm-537c5b5b62c42528fc90914ce6abe7002c3fb4c4.tar.gz bcm5719-llvm-537c5b5b62c42528fc90914ce6abe7002c3fb4c4.zip | |
Fix CodeCompletion & TypoCorrection when combining a PCH with Modules
This commit fixes the IdentifierIterator to actually include identifiers
from a PCH or precompiled preamble when there is also a global module
index. This was causing code-completion (outside of C++) and
typo-correction to be missing global identifiers defined in the
PCH/preamble. Typo-correction has been broken since we first started
using the module index, whereas code-completion only started relying on
identifier iterator in r232793.
rdar://problem/25642879
llvm-svn: 268471
Diffstat (limited to 'clang/test/Modules')
| -rw-r--r-- | clang/test/Modules/Inputs/module.map | 2 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/typo.h | 6 | ||||
| -rw-r--r-- | clang/test/Modules/typo.m | 8 |
3 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.map index 1249387b9d9..66b52e9105e 100644 --- a/clang/test/Modules/Inputs/module.map +++ b/clang/test/Modules/Inputs/module.map @@ -410,3 +410,5 @@ module MethodPoolString1 { module MethodPoolString2 { header "MethodPoolString2.h" } + +module Empty {} diff --git a/clang/test/Modules/Inputs/typo.h b/clang/test/Modules/Inputs/typo.h new file mode 100644 index 00000000000..764c00b7c38 --- /dev/null +++ b/clang/test/Modules/Inputs/typo.h @@ -0,0 +1,6 @@ +@import Empty; + +@interface NSString ++ (id)alloc; +@end + diff --git a/clang/test/Modules/typo.m b/clang/test/Modules/typo.m new file mode 100644 index 00000000000..7e5108df6be --- /dev/null +++ b/clang/test/Modules/typo.m @@ -0,0 +1,8 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -x objective-c-header %S/Inputs/typo.h -emit-pch -o %t.pch +// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -include-pch %t.pch %s -verify + +void test() { + [Nsstring alloc]; // expected-error {{unknown receiver 'Nsstring'; did you mean 'NSString'}} + // expected-note@typo.h:* {{here}} +} |

