Author: Timm Bäder Date: 2024-03-14T13:50:05+01:00 New Revision: 72d300adad4022b150c24e4a44488d3b9334e999
URL: https://github.com/llvm/llvm-project/commit/72d300adad4022b150c24e4a44488d3b9334e999 DIFF: https://github.com/llvm/llvm-project/commit/72d300adad4022b150c24e4a44488d3b9334e999.diff LOG: [clang][Interp][NFC] Move a varible declaration in the closest scope Added: Modified: clang/lib/AST/Interp/Pointer.cpp Removed: ################################################################################ diff --git a/clang/lib/AST/Interp/Pointer.cpp b/clang/lib/AST/Interp/Pointer.cpp index 3f85635f43674d..af60ced0e10e9e 100644 --- a/clang/lib/AST/Interp/Pointer.cpp +++ b/clang/lib/AST/Interp/Pointer.cpp @@ -320,10 +320,10 @@ std::optional<APValue> Pointer::toRValue(const Context &Ctx) const { // Complex types. if (const auto *CT = Ty->getAs<ComplexType>()) { QualType ElemTy = CT->getElementType(); - std::optional<PrimType> ElemT = Ctx.classify(ElemTy); - assert(ElemT); if (ElemTy->isIntegerType()) { + std::optional<PrimType> ElemT = Ctx.classify(ElemTy); + assert(ElemT); INT_TYPE_SWITCH(*ElemT, { auto V1 = Ptr.atIndex(0).deref<T>(); auto V2 = Ptr.atIndex(1).deref<T>(); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits