[llvm] [mlir] eliminating g++ warnings (PR #105520)
Renato Golin via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 22 03:49:55 PDT 2024
================
@@ -893,7 +893,7 @@ FlatLinearValueConstraints::FlatLinearValueConstraints(IntegerSet set,
set.getNumDims(), set.getNumSymbols(),
/*numLocals=*/0) {
assert(operands.empty() ||
- set.getNumInputs() == operands.size() && "operand count mismatch");
+ (set.getNumInputs() == operands.size() && "operand count mismatch"));
----------------
rengolin wrote:
Personally, I've always been a fan of over-bracing instead of under-bracing, especially in cases where compilers have "doubts".
IIUC, the GGC warning isn't because it doesn't know what to do, but that it recognises that this is a common bug pattern that people don't usually get the semantics right.
Adding the braces in the right place would make it easier for humans to read and all agree on the semantics, which is a good strategy regardless of warnings.
https://github.com/llvm/llvm-project/pull/105520
More information about the llvm-commits
mailing list