[PATCH] D32981: [ASTImporter] Improve handling of incomplete types

Sean Callanan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 8 14:56:35 PDT 2017


spyffe created this revision.

`ASTImporter` has some bugs when it's importing types that themselves come from an `ExternalASTSource`.  This is exposed particularly in the behavior when comparing complete TagDecls with forward declarations.  This patch does several things:

- Adds a test case making sure that conflicting forward-declarations are resolved correctly;
- Extends the `clang-import-test` harness to test two-level importing, so that we make sure we complete types when necessary; and
- Fixes a few bugs I found this way.  Failure to complete types was one; however, I also discovered that complete RecordDecls aren't properly added to the `redecls` chain for existing forward declarations.


Repository:
  rL LLVM

https://reviews.llvm.org/D32981

Files:
  include/clang/AST/ExternalASTMerger.h
  lib/AST/ASTImporter.cpp
  lib/AST/ASTStructuralEquivalence.cpp
  lib/AST/ExternalASTMerger.cpp
  test/Import/conflicting-struct/Inputs/S1.cpp
  test/Import/conflicting-struct/Inputs/S2.cpp
  test/Import/conflicting-struct/test.cpp
  tools/clang-import-test/clang-import-test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32981.98216.patch
Type: text/x-patch
Size: 7392 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170508/e4e213de/attachment-0001.bin>


More information about the cfe-commits mailing list