summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-05-16 16:31:58 +0000
committerDouglas Gregor <dgregor@apple.com>2012-05-16 16:31:58 +0000
commitc48eafea50ae2195f290c590007bde719ec35ff3 (patch)
tree286ef213dce9ce211b8253185b40f10f71b8436d
parent0a9f4e0b72083a21e7744c10022742eaf39adaba (diff)
downloadbcm5719-llvm-c48eafea50ae2195f290c590007bde719ec35ff3.tar.gz
bcm5719-llvm-c48eafea50ae2195f290c590007bde719ec35ff3.zip
Fix ASTReader handling of ImportDecls, from Meador Inge!
llvm-svn: 156923
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp1
-rw-r--r--clang/test/Modules/Inputs/import-decl.h1
-rw-r--r--clang/test/Modules/Inputs/module.map3
-rw-r--r--clang/test/Modules/import-decl.cpp10
4 files changed, 14 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index 512b070620a..5870fba36c2 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/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/clang/test/Modules/Inputs/import-decl.h b/clang/test/Modules/Inputs/import-decl.h
new file mode 100644
index 00000000000..9741d6c543e
--- /dev/null
+++ b/clang/test/Modules/Inputs/import-decl.h
@@ -0,0 +1 @@
+struct T {};
diff --git a/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.map
index e8d1f2c666f..79056cb5180 100644
--- a/clang/test/Modules/Inputs/module.map
+++ b/clang/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/clang/test/Modules/import-decl.cpp b/clang/test/Modules/import-decl.cpp
new file mode 100644
index 00000000000..76966934acc
--- /dev/null
+++ b/clang/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;
+}
OpenPOWER on IntegriCloud