mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-28 16:11:29 +00:00
[clang][Interp] Fix record initialization via CallExpr subclasses
We can't just use VisitCallExpr() here, as that doesn't handle CallExpr subclasses such as CXXMemberCallExpr. Differential Revision: https://reviews.llvm.org/D141772
This commit is contained in:
parent
6231ba0eed
commit
cef69ce779
@ -1413,7 +1413,7 @@ bool ByteCodeExprGen<Emitter>::visitRecordInitializer(const Expr *Initializer) {
|
||||
if (!this->emitDupPtr(Initializer))
|
||||
return false;
|
||||
|
||||
return this->VisitCallExpr(CE);
|
||||
return this->visit(CE);
|
||||
} else if (const auto *DIE = dyn_cast<CXXDefaultInitExpr>(Initializer)) {
|
||||
return this->visitInitializer(DIE->getExpr());
|
||||
} else if (const auto *CE = dyn_cast<CastExpr>(Initializer)) {
|
||||
|
@ -98,12 +98,20 @@ class C {
|
||||
int b;
|
||||
|
||||
constexpr C() : a(100), b(200) {}
|
||||
|
||||
constexpr C get() const {
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
constexpr C c;
|
||||
static_assert(c.a == 100, "");
|
||||
static_assert(c.b == 200, "");
|
||||
|
||||
constexpr C c2 = C().get();
|
||||
static_assert(c.a == 100, "");
|
||||
static_assert(c.b == 200, "");
|
||||
|
||||
constexpr int getB() {
|
||||
C c;
|
||||
int &j = c.b;
|
||||
|
Loading…
Reference in New Issue
Block a user