[Bug libstdc++/86934] New: Feature test macros in <version> should respect _GLIBCXX_HOSTED

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Aug 13 12:33:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86934

            Bug ID: 86934
           Summary: Feature test macros in <version> should respect
                    _GLIBCXX_HOSTED
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

The current <version> 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
<filesystem> isn't always present, even for hsoted builds (but that should
change for GCC 9 anyway).

I'm not sure how to do this cleanly so that <version> is always consistent with
the real values in other headers. We could generate <version> 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.

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
  <version> matches the other definition of it (i.e. either both are
  defined to the same value, or neither is defined).


More information about the Gcc-bugs mailing list