diff options
author | Lang Hames <lhames@gmail.com> | 2017-06-17 00:12:38 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2017-06-17 00:12:38 +0000 |
commit | 30060bff5b4cb49e17c27672d1aa60e6bc7a95e8 (patch) | |
tree | 54ca166f6041df1cb7e2b45816b52a6d68a903b0 /test/Import | |
parent | 0c8ec4337896f529c1c807ce66fb2c16817be3d2 (diff) | |
download | clang-30060bff5b4cb49e17c27672d1aa60e6bc7a95e8.tar.gz |
Call setMustBuildLookupTable on TagDecls in ExternalASTMerger
Summary:
setMustBuildLookupTable should be called on imported TagDecls otherwise we may fail
to import their member decls (if they have any).
Not calling the setMustBuildLookupTable method results in a failure in the attached test
case when lookup for the 'x' member fails on struct S, which hasn't had its decls imported
elsewhere. (By contrast the member-in-struct testcase hasn't run into this issue
because the import of its decls is triggered when the struct instance is defined, and the
member access follows this).
Reviewers: spyffe, rsmith
Reviewed By: spyffe, rsmith
Differential Revision: https://reviews.llvm.org/D34253
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305619 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Import')
-rw-r--r-- | test/Import/indirect-struct-member-access/Inputs/S.c | 3 | ||||
-rw-r--r-- | test/Import/indirect-struct-member-access/test.c | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/test/Import/indirect-struct-member-access/Inputs/S.c b/test/Import/indirect-struct-member-access/Inputs/S.c new file mode 100644 index 0000000000..b0876d27df --- /dev/null +++ b/test/Import/indirect-struct-member-access/Inputs/S.c @@ -0,0 +1,3 @@ +struct S { + int a; +}; diff --git a/test/Import/indirect-struct-member-access/test.c b/test/Import/indirect-struct-member-access/test.c new file mode 100644 index 0000000000..cbf7e65ec1 --- /dev/null +++ b/test/Import/indirect-struct-member-access/test.c @@ -0,0 +1,4 @@ +// RUN: clang-import-test -import %S/Inputs/S.c -expression %s +void expr(struct S *MyS) { + MyS->a = 3; +} |