[Bug libstdc++/86934] Feature test macros in should respect _GLIBCXX_HOSTED

2021-02-24 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86934

Jonathan Wakely  changed:

   What|Removed |Added

   Target Milestone|--- |9.4
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Jonathan Wakely  ---
I think this is fixed since r277849 for gcc-10.1 and has been backported to the
gcc-9 branch.

[Bug libstdc++/86934] Feature test macros in should respect _GLIBCXX_HOSTED

2019-01-16 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86934

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
(In reply to Jonathan Wakely from comment #1)
> That should be simple, just include  and  and
> compile with -Wsystem-headers to check for redefinition warnings.

As discussed on IRC,
for i in 98 11 14 17 2a; do echo '#include ' | g++
-D_GLIBCXX_VERSION_INCLUDED -E -std=c++$i -dD -xc++ - | grep
'^[[:blank:]]*#[[:blank:]]*define[[:blank:]]*__cpp_' | sort -u > /tmp/1; echo
'#include ' | g++ -E -std=c++$i -dD -xc++ - | grep
'^[[:blank:]]*#[[:blank:]]*define[[:blank:]]*__cpp_' | sort -u > /tmp/2; diff
-up /tmp/1 /tmp/2; done
is a more thorough way of checking not just the case where both  and
other headers define the same __cpp_lib* macro differently, but also when one
defines one and the other doesn't.

[Bug libstdc++/86934] Feature test macros in should respect _GLIBCXX_HOSTED

2019-01-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86934

--- Comment #1 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #0)
> The current  header doesn't account for the fact that many features
> are not defined for freestanding builds.
> 
> Also, the --enable-libstdcxx-filesystem-ts configure option means that
>  isn't always present, even for hsoted builds (but that should
> change for GCC 9 anyway).

That was PR 86756 and is fixed now.

> I'm not sure how to do this cleanly so that  is always consistent
> with the real values in other headers. We could generate  from a
> script that processes the headers (separately for freestanding and hosted
> headers) and just extracts the __cpp_lib_* macros and the preprocessor
> conditions they depend on.

Or maybe just a script that generates the file from input like:

filesystem 201703 c++17
launder 201606 c++17 _GLIBCXX_HAVE_BUILTIN_LAUNDER
shared_timed_mutex 201402 c++14 _GLIBCXX_HAS_GTHREADS



> Also, in https://gcc.gnu.org/ml/libstdc++/2018-07/msg00128.html I said:
> 
>   It would be nice if we had tests to check that every macro in
>matches the other definition of it (i.e. either both are
>   defined to the same value, or neither is defined).

That should be simple, just include  and  and compile
with -Wsystem-headers to check for redefinition warnings.

[Bug libstdc++/86934] Feature test macros in should respect _GLIBCXX_HOSTED

2018-08-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86934

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-08-13
 Ever confirmed|0   |1