Index: clang/lib/AST/Interp/ByteCodeExprGen.cpp =================================================================== --- clang/lib/AST/Interp/ByteCodeExprGen.cpp +++ clang/lib/AST/Interp/ByteCodeExprGen.cpp @@ -764,8 +764,11 @@ template bool ByteCodeExprGen::VisitConstantExpr(const ConstantExpr *E) { - // TODO: Check if the ConstantExpr already has a value set and if so, - // use that instead of evaluating it again. + std::optional T = classify(E->getType()); + if (T && E->hasAPValueResult() && + this->visitAPValue(E->getAPValueResult(), *T, E)) + return true; + return this->delegate(E->getSubExpr()); }