diff options
author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-24 20:56:40 +0000 |
---|---|---|
committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-24 20:56:40 +0000 |
commit | 8fc0073bfb9975d34c0f9314d2ee1da1ad27461d (patch) | |
tree | a5bf73d7edf36c2971cea3efb947f4c72e53a4f1 /libstdc++-v3 | |
parent | e39efcefc5fba7c339ea9dca6bcfa103b5adfbea (diff) | |
download | gcc-8fc0073bfb9975d34c0f9314d2ee1da1ad27461d.tar.gz |
C++11 explicitly forbids macros for bool, true and false.
gcc:
* ginclude/stdbool.h: Do not define bool, true or false in C++11.
libstdc++-v3:
* testsuite/18_support/headers/cstdbool/macros.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216679 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 4 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/18_support/headers/cstdbool/macros.cc | 37 |
2 files changed, 41 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c2f185921f1..27e31bb7126 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2014-10-24 Jonathan Wakely <jwakely@redhat.com> + + * testsuite/18_support/headers/cstdbool/macros.cc: New. + 2014-10-24 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/atomic_base.h: Avoid including <stdbool.h>. diff --git a/libstdc++-v3/testsuite/18_support/headers/cstdbool/macros.cc b/libstdc++-v3/testsuite/18_support/headers/cstdbool/macros.cc new file mode 100644 index 00000000000..df2e24568ff --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/cstdbool/macros.cc @@ -0,0 +1,37 @@ +// { dg-do compile } +// { dg-options "-std=gnu++11" } + +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <cstdbool> + +#ifndef __bool_true_false_are_defined +# error "The header <cstdbool> fails to define a macro named __bool_true_false_are_defined" +#endif + +#ifdef bool +# error "The header <cstdbool> defines a macro named bool" +#endif + +#ifdef true +# error "The header <cstdbool> defines a macro named true" +#endif + +#ifdef false +# error "The header <cstdbool> defines a macro named false" +#endif |