[PATCH] D131213: [clang][Headers] Fix unintentional error in D130800

Dominic Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 4 15:48:49 PDT 2022

ddcc created this revision.
ddcc added reviewers: aaron.ballman, iana.
Herald added a project: All.
ddcc requested review of this revision.
Herald added a project: clang.

Undefined macros evaluate to zero, so when checking for a smaller value,
we need to include the case when the macro is undefined.

  rG LLVM Github Monorepo



Index: clang/lib/Headers/stdbool.h
--- clang/lib/Headers/stdbool.h
+++ clang/lib/Headers/stdbool.h
@@ -23,7 +23,7 @@
 #elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
 /* Define _Bool as a GNU extension. */
 #define _Bool bool
-#if defined(__cplusplus) && __cplusplus < 201103L
+#if !defined(__cplusplus) || __cplusplus < 201103L
 /* For C++98, define bool, false, true as a GNU extension. */
 #define bool bool
 #define false false

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131213.450158.patch
Type: text/x-patch
Size: 505 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220804/3430714b/attachment.bin>

More information about the cfe-commits mailing list