================ @@ -1103,7 +1103,15 @@ static void InitializePredefinedMacros(const TargetInfo &TI, assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far"); Builder.defineMacro("__CHAR_BIT__", Twine(TI.getCharWidth())); - Builder.defineMacro("__BOOL_WIDTH__", Twine(TI.getBoolWidth())); + // The macro is specifying the number of bits in the width, not the number of + // bits the object requires for its in-memory representation, which is what + // getBoolWidth() will return. The bool/_Bool data type is only ever one bit + // wide. See C23 6.2.6.2p2 for the rules in C. Note that + // C++23 [basic.fundamental]p10 allows an implementation-defined value + // representation for bool; when lowing to LLVM, Clang represents bool as an ---------------- tbaederr wrote:
```suggestion // representation for bool; when lowering to LLVM, Clang represents bool as an ``` https://github.com/llvm/llvm-project/pull/117364 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits