[clang][ASTImporter] Add VaList declaration to lookup table.
authorBalázs Kéri <1.int32@gmail.com>
Mon, 6 Mar 2023 07:55:19 +0000 (08:55 +0100)
committerBalázs Kéri <1.int32@gmail.com>
Mon, 6 Mar 2023 08:32:02 +0000 (09:32 +0100)
commit29a4ed80bb4c8aadc76718924f80a5f532b1ffce
tree500f576f1fcce150b6de9fdfa160706e8b5fcb7a
parenta048df8707a1724093f7c442f8b78cd49583f470
[clang][ASTImporter] Add VaList declaration to lookup table.

The declaration of __builtin_va_list seems to be handled specially
by ASTContext and/or Sema. The normal AST traversal probably can
not find it, therefore it is not added to ASTImporterLookupTable.
If it is not added, errors can occur because a duplicated
VaList declaration is created at import. To fix the problem the
VaList declaration is added manually to ASTImporterLookupTable
at construction.
In special cases this declaration is inside a "invisible" 'std'
namespace that behaves the same way. This namespace must be added
to the table too.

Reviewed By: vabridgers, donat.nagy

Differential Revision: https://reviews.llvm.org/D144273
clang/lib/AST/ASTImporterLookupTable.cpp
clang/test/Import/cxx-valist/Inputs/I1.cpp [new file with mode: 0644]
clang/test/Import/cxx-valist/test.cpp [new file with mode: 0644]
clang/unittests/AST/ASTImporterTest.cpp