[clang] [CIR][NFC] Fix a release build warning (PR #170359)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 2 12:06:27 PST 2025
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/170359
This moves a call inside an assert to avoid a warning about the result variable being unused in release builds.
>From 8968cde43ae383b84e7b3fda694d6586a3974899 Mon Sep 17 00:00:00 2001
From: Andy Kaylor <akaylor at nvidia.com>
Date: Tue, 2 Dec 2025 12:04:09 -0800
Subject: [PATCH] [CIR][NFC] Fix a release build warning
This moves a call inside an assert to avoid a warning about the
result variable being unused in release builds.
---
clang/lib/CIR/CodeGen/CIRGenClass.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/clang/lib/CIR/CodeGen/CIRGenClass.cpp b/clang/lib/CIR/CodeGen/CIRGenClass.cpp
index c98d9bb0724f6..ca9fe939139cd 100644
--- a/clang/lib/CIR/CodeGen/CIRGenClass.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenClass.cpp
@@ -126,8 +126,7 @@ static void emitMemberInitializer(CIRGenFunction &cgf,
lhs.isVolatileQualified());
// Ensure that we destroy the objects if an exception is thrown later in
// the constructor.
- QualType::DestructionKind dtorKind = fieldType.isDestructedType();
- assert(!cgf.needsEHCleanup(dtorKind) &&
+ assert(!cgf.needsEHCleanup(fieldType.isDestructedType()) &&
"Arrays of non-record types shouldn't need EH cleanup");
return;
}
More information about the cfe-commits
mailing list