diff --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp b/clang/lib/AST/Interp/ByteCodeExprGen.cpp --- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp +++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp @@ -1410,6 +1410,8 @@ return this->VisitCallExpr(CE); } else if (const auto *DIE = dyn_cast(Initializer)) { return this->visitInitializer(DIE->getExpr()); + } else if (const auto *CE = dyn_cast(Initializer)) { + return this->visitInitializer(CE->getSubExpr()); } return false; diff --git a/clang/test/AST/Interp/records.cpp b/clang/test/AST/Interp/records.cpp --- a/clang/test/AST/Interp/records.cpp +++ b/clang/test/AST/Interp/records.cpp @@ -88,6 +88,10 @@ // expected-error {{must be initialized by a constant expression}} \ // ref-error {{without a user-provided default constructor}} +constexpr Ints2 I2 = Ints2{12, 25}; +static_assert(I2.a == 12, ""); +static_assert(I2.b == 25, ""); + class C { public: int a;