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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131213

Files:
  clang/lib/Headers/stdbool.h


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


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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to