diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-05-16 16:31:58 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-05-16 16:31:58 +0000 |
commit | d0792de17387e949c27f97a5fa4a0b3e82db9b1e (patch) | |
tree | f76c1f881800fa41a7f0ff1dbe9a58c78fe3c3e4 | |
parent | 50de5e3247a20e0e548dc47022a011250e6e4e8f (diff) |
Fix ASTReader handling of ImportDecls, from Meador Inge!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156923 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Serialization/ASTReaderDecl.cpp | 1 | ||||
-rw-r--r-- | test/Modules/Inputs/import-decl.h | 1 | ||||
-rw-r--r-- | test/Modules/Inputs/module.map | 3 | ||||
-rw-r--r-- | test/Modules/import-decl.cpp | 10 |
4 files changed, 14 insertions, 1 deletions
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 512b070620..5870fba36c 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -1249,7 +1249,6 @@ void ASTDeclReader::VisitImportDecl(ImportDecl *D) { SourceLocation *StoredLocs = reinterpret_cast<SourceLocation *>(D + 1); for (unsigned I = 0, N = Record.back(); I != N; ++I) StoredLocs[I] = ReadSourceLocation(Record, Idx); - ++Idx; } void ASTDeclReader::VisitAccessSpecDecl(AccessSpecDecl *D) { diff --git a/test/Modules/Inputs/import-decl.h b/test/Modules/Inputs/import-decl.h new file mode 100644 index 0000000000..9741d6c543 --- /dev/null +++ b/test/Modules/Inputs/import-decl.h @@ -0,0 +1 @@ +struct T {}; diff --git a/test/Modules/Inputs/module.map b/test/Modules/Inputs/module.map index e8d1f2c666..79056cb518 100644 --- a/test/Modules/Inputs/module.map +++ b/test/Modules/Inputs/module.map @@ -84,3 +84,6 @@ module MethodPoolA { module MethodPoolB { header "MethodPoolB.h" } +module import_decl { + header "import-decl.h" +} diff --git a/test/Modules/import-decl.cpp b/test/Modules/import-decl.cpp new file mode 100644 index 0000000000..76966934ac --- /dev/null +++ b/test/Modules/import-decl.cpp @@ -0,0 +1,10 @@ +// RUN: rm -rf %t +// RUN: %clang -fmodule-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 + +@__experimental_modules_import import_decl; +// CHECK: struct T + +int main() { + return 0; +} |