[clang] 7cfab6c - [HLSL] add parentheses in assertion to eliminate -Wparentheses warning (#128246)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 21 15:56:41 PST 2025
Author: Oleksandr T.
Date: 2025-02-22T01:56:38+02:00
New Revision: 7cfab6c4eb93f479e024f73647d86f9fc7f4b73f
URL: https://github.com/llvm/llvm-project/commit/7cfab6c4eb93f479e024f73647d86f9fc7f4b73f
DIFF: https://github.com/llvm/llvm-project/commit/7cfab6c4eb93f479e024f73647d86f9fc7f4b73f.diff
LOG: [HLSL] add parentheses in assertion to eliminate -Wparentheses warning (#128246)
Fixes #128210
Added:
Modified:
clang/lib/CodeGen/HLSLBufferLayoutBuilder.cpp
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/HLSLBufferLayoutBuilder.cpp b/clang/lib/CodeGen/HLSLBufferLayoutBuilder.cpp
index 1ae00023ab2bc..97262b76c0164 100644
--- a/clang/lib/CodeGen/HLSLBufferLayoutBuilder.cpp
+++ b/clang/lib/CodeGen/HLSLBufferLayoutBuilder.cpp
@@ -89,9 +89,9 @@ llvm::TargetExtType *HLSLBufferLayoutBuilder::createLayoutType(
RecordTypes.pop_back();
for (const auto *FD : RT->getDecl()->fields()) {
- assert(!Packoffsets || Index < Packoffsets->size() &&
- "number of elements in layout struct does not "
- "match number of packoffset annotations");
+ assert((!Packoffsets || Index < Packoffsets->size()) &&
+ "number of elements in layout struct does not "
+ "match number of packoffset annotations");
if (!layoutField(FD, EndOffset, Layout, LayoutElements,
Packoffsets ? (*Packoffsets)[Index] : -1))
More information about the cfe-commits
mailing list