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

            Bug ID: 105269
           Summary: missing some library feature test macros in c++20 and
                    c++23
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cooky.ykooc922 at gmail dot com
  Target Milestone: ---

Given the code:

#include <version>

#ifndef __cpp_lib_constexpr_vector
#   warning "__cpp_lib_constexpr_vector is not defined"
#endif

#ifndef __cpp_lib_stdatomic_h
#   warning "__cpp_lib_stdatomic_h is not defined"
#endif 

#ifdef __cpp_lib_monadic_optional
#   warning "__cpp_lib_monadic_optional shouldn't be defined since LWG3621"
#   if __cpp_lib_optional != 202110L
#       warning "__cpp_lib_optional value should be adjusted to 202110L since
LWG3621"
#   endif
#endif

all warnings are emitted:
<source>:4:5: warning: #warning "__cpp_lib_constexpr_vector is not defined"
[-Wcpp]
    4 | #   warning "__cpp_lib_constexpr_vector is not defined"
      |     ^~~~~~~
<source>:8:5: warning: #warning "__cpp_lib_stdatomic_h is not defined" [-Wcpp]
    8 | #   warning "__cpp_lib_stdatomic_h is not defined"
      |     ^~~~~~~
<source>:12:5: warning: #warning "__cpp_lib_monadic_optional shouldn't be
defined since LWG3621" [-Wcpp]
   12 | #   warning "__cpp_lib_monadic_optional shouldn't be defined since
LWG3621"
      |     ^~~~~~~
<source>:14:9: warning: #warning "__cpp_lib_optional value should be adjusted
to 202110L since LWG3621" [-Wcpp]
   14 | #       warning "__cpp_lib_optional value should be adjusted to 202110L
since LWG3621"
      |         ^~~~~~~
Compiler returned: 0

godbolt link: https://godbolt.org/z/Y9Wqccnv3

since:
 -
https://github.com/gcc-mirror/gcc/commit/1ae8edf5f73ca5c3bf132cc52825dc1f709499dd
is committed to implementing constexpr std::vector (C++20)
-
https://github.com/gcc-mirror/gcc/commit/d7f2a09e98520c4e4927f460ad96803b05a205b1
is committed to implementing <stdatomic.h> (P0943 has __cpp_lib_stdatomic_h
provided) (C++23)
-
https://github.com/gcc-mirror/gcc/commit/82b2e4f8cf5a01c6724fe3f465a77ee03cfcaae2
is commited to implementing monadic operations (before LWG3621 is adopted)
(C++23)

Reply via email to