[Bug preprocessor/94753] New: -undef, c++20 and feature-test macros

2020-04-24 Thread r_new at rambler dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94753

Bug ID: 94753
   Summary: -undef, c++20 and feature-test macros
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: preprocessor
  Assignee: unassigned at gcc dot gnu.org
  Reporter: r_new at rambler dot ru
  Target Milestone: ---

In c++20 feature-test macros (_­_­cpp_­attributes, _­_­cpp_­constexpr, ...) are
standard predefined macros, must be predefined even with -undef.

g++ -undef -std=c++2a -E -dM -x c++ - < /dev/null 
#define __STDC_HOSTED__ 1
#define __STDC_IEC_559__ 1
#define __STDC_ISO_10646__ 201706L
#define __STDC_UTF_16__ 1
#define __cplusplus 201709L
#define _STDC_PREDEF_H 1
#define __STDC_IEC_559_COMPLEX__ 1
#define __STDC_UTF_32__ 1
#define __STDC__ 1
#define _GNU_SOURCE 1

gcc version 10.0.1 20200423 (experimental) (Compiler-Explorer-Build) and gcc
version 9.3.0 (Arch Linux 9.3.0-1)

[Bug c++/94753] -undef, c++20 and feature-test macros

2024-04-25 Thread r_new at rambler dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94753

--- Comment #3 from r_new at rambler dot ru ---
Don't know gcc code, but

/* For C++11+ __cpp_constexpr and __cpp_static_assert should be defined. */
#if __cplusplus >= 201103L

is not true.
All standard predefined macros listed in chapter "16.8 Predefined macro names"
C++11 standard.

But for C++20 it's true.