llvm-project/clang/test/Analysis/Inputs/ctu-cxxdefaultinitexpr-import.cpp
Balázs Kéri c5d83cdca4 [clang][ASTImporter] Fix a bug when importing CXXDefaultInitExpr.
The "in-class initializer" expression should be set in the field of a
default initialization expression before this expression node is created.
The `CXXDefaultInitExpr` objects are created after the AST is loaded and
at import not present in the "To" AST. And the in-class initializers of
the used fields can be missing too, these must be set at import.

This fixes a github issue #54061.

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D120824
2022-03-28 10:55:26 +02:00

27 lines
672 B
C++

namespace QHashPrivate {
template <typename> int b;
struct Data;
} // namespace QHashPrivate
struct QDomNodePrivate {};
template <typename = struct QString> struct QMultiHash {
QHashPrivate::Data *d = nullptr;
};
struct QDomNamedNodeMapPrivate {
QMultiHash<> map;
};
struct QDomElementPrivate : QDomNodePrivate {
QDomElementPrivate();
void importee();
QMultiHash<> *m_attr = nullptr;
};
// --------- common part end ---------
QDomElementPrivate::QDomElementPrivate() : m_attr{new QMultiHash<>} {}
void QDomElementPrivate::importee() { (void)QMultiHash<>{}; }
struct foo {
QDomElementPrivate m = {};
static const int value = (QHashPrivate::b<foo>, 22);
};