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

            Bug ID: 87193
           Summary: symbols in <version> have inconsistent types
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: webrown.cpp at gmail dot com
  Target Milestone: ---

In the new <version> header, most symbols are given a value of type int, rather
than a value of type long as mandated by [support.limits.general] Table 35 of
N4762.

For example, we find these consecutive macro def'ns:

#define __cpp_lib_is_final 201402L
#define __cpp_lib_make_reverse_iterator 201402

in which the values are to be identical, yet have distinct types.


Code such as:

#include <version>
static_assert( std::is_same_v<long, decltype(__cpp_lib_is_final)> );
static_assert( std::is_same_v<long, decltype(__cpp_lib_make_reverse_iterator)>
);

will detect the difference.

Reply via email to