[PATCH] D93101: [Clang][Codegen] Truncate initializers of union bitfield members
    Richard Smith - zygoloid via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Wed Jan 13 10:54:57 PST 2021
    
    
  
rsmith added inline comments.
================
Comment at: clang/lib/AST/ExprConstant.cpp:9801-9804
+    return EvaluateInPlace(Result.getUnionValue(), Info, Subobject, InitExpr) ||
+           (Field->isBitField() &&
+            truncateBitfieldValue(Info, InitExpr, Result.getUnionValue(),
+                                  Field));
----------------
Shouldn't this be `&&` not `||`? These functions return `true` if they succeed (unlike the convention in `Sema` where `true` means an error diagnostic was produced).
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93101/new/
https://reviews.llvm.org/D93101
    
    
More information about the cfe-commits
mailing list