[PATCH] D116155: [clang][AST][ASTImporter] Set record to complete during import of its members.

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 4 10:57:02 PST 2022


shafik added inline comments.


================
Comment at: clang/lib/AST/ASTImporter.cpp:2021
+  // fields imported) at that time without multiple AST import passes.
+  To->setCompleteDefinition(true);
   // Complete the definition even if error is returned.
----------------
So `DefinitionCompleterScopeExit` will run `To->setCompleteDefinition(false);`  after this function exits but this will be in effect during the import the base classes. I don't see how the tests you added hit that code.


================
Comment at: clang/unittests/AST/ASTImporterTest.cpp:7485
+        static void foo(A x) {
+          (void)&"text"[x.idx];
+        }
----------------
The member function body should be considered `complete-class context` so the correct thing to do would be have all the fields laid out by this point.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116155/new/

https://reviews.llvm.org/D116155



More information about the cfe-commits mailing list