[PATCH] D102492: [clang][AST] Add support for BindingDecl to ASTImporter.

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 18 07:55:27 PDT 2021


balazske added a comment.

This change in itself is not enough to support `BindingDecl`. The tests pass but the resulting AST is not correct because `DecompositionDecl` is not imported yet. Still no visible problem happens, the `DecompositionDecl` is just visited and imported as a `VarDecl`. The import of `DecompositionDecl` can be added later (but I am not sure if without it the new import of `BindingDecl` will not cause hidden problems).



================
Comment at: clang/unittests/AST/ASTImporterTest.cpp:873
+  MatchVerifier<Decl> Verifier;
+  testImport("int a[2] = {1, 2};"
+             "auto [declToImport, x] = a;",
----------------
shafik wrote:
> Can we add a larger variety of tests? Given how simple the `BindingDecl` case seems to be I don't expect any surprises but it would be good to verify that cases like mixed types, references and bit-fields work as expected. 
Improved the test variety a bit. (`std::tuple` is more difficult to handle because need for namespace `std`.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102492



More information about the cfe-commits mailing list