Since r216679 these macros have only been defined in C++98 mode, rather
than all modes. That is permitted as a GNU extension because that header
doesn't exist in the C++ standard until C++11, so we can make it do
whatever we want for C++98. But as discussed in the PR c++/60304
comments, these macros shouldn't ever be defined for C++.
This patch removes the macro definitions for C++98 too.
The new test already passed for C++98 (and the conversion is ill-formed
in C++11 and later) so this new test is arguably unnecessary.
gcc/ChangeLog:
PR c++/60304
* ginclude/stdbool.h (bool, false, true): Never define for C++.
gcc/testsuite/ChangeLog:
PR c++/60304
* g++.dg/warn/Wconversion-null-5.C: New test.
/* Supporting _Bool in C++ is a GCC extension. */
#define _Bool bool
-#if __cplusplus < 201103L
-/* Defining these macros in C++98 is a GCC extension. */
-#define bool bool
-#define false false
-#define true true
-#endif
-
#endif /* __cplusplus */
/* Signal that all the definitions are present. */
--- /dev/null
+// PR c++/60304
+// { dg-do compile { target c++98_only } }
+// { dg-options "-Wconversion-null" }
+
+#include <stdbool.h>
+int * foo() {return false;} // { dg-warning "converting 'false' to pointer" }