From: Douglas Gregor Date: Wed, 16 May 2012 16:31:58 +0000 (+0000) Subject: Fix ASTReader handling of ImportDecls, from Meador Inge! X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0792de17387e949c27f97a5fa4a0b3e82db9b1e;p=clang 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 --- 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(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; +}