aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-07-31 23:31:14 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2018-07-31 23:31:14 +0100
commitff273400466f44c64a19b917151641706318c268 (patch)
tree7aca7e266e60c46d792cca9f1a6d266a14f9a630 /gcc
parentb348c78aa4ab72ea533a01ad24311f45b0b4f4cb (diff)
downloadgcc-ff273400466f44c64a19b917151641706318c268.zip
gcc-ff273400466f44c64a19b917151641706318c268.tar.gz
gcc-ff273400466f44c64a19b917151641706318c268.tar.bz2
Don't unconditionally define feature test macros in <version>
The macro definitions in <version> should depend on the same preprocessor conditions as the original macros in other headers. Otherwise <version> can define macros that imply the availability of features that are not actually defined. This fix is incomplete, as __cpp_lib_filesystem should depend on whether libstdc++fs.a is supported, and several macros should only be defined when _GLIBCXX_HOSTED is defined. Also, the feature test macros should define their value as type long, but most are type int. * include/bits/c++config (_GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP) (_GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE): Move definitions here. (_GLIBCXX_HAVE_BUILTIN_LAUNDER): Likewise. Use !__is_identifier instead of __has_builtin. * include/std/type_traits (_GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP) (_GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE): Remove definitions from here. * include/std/version [!_GLIBCXX_HAS_GTHREADS] (__cpp_lib_shared_timed_mutex, __cpp_lib_scoped_lock) (__cpp_lib_shared_mutex): Don't define when Gthreads not in use. [!_GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP] (__cpp_lib_has_unique_object_representations): Don't define when builtin not available. [!_GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE] (__cpp_lib_is_aggregate): Likewise. [!_GLIBCXX_HAVE_BUILTIN_LAUNDER] (__cpp_lib_launder): Likewise. * libsupc++/new (_GLIBCXX_HAVE_BUILTIN_LAUNDER): Remove definition from here. From-SVN: r263184
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions