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

            Bug ID: 124563
           Summary: Non-reserved names in ext/concurrence.h: wait and
                    wait_recursive
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

In ext/concurrence.h we have __gnu_cxx::__cond::wait and
__gnu_cxx::__cond::wait_recursive, which use non-reserved names.

That means we reject this valid program:

#define wait 1
#define wait_recursive 2
#include <memory>
int main() { }

$ g++ cond.cc
cond.cc:1:14: error: expected unqualified-id before numeric constant
    1 | #define wait 1
      |              ^
cond.cc:2:24: error: expected unqualified-id before numeric constant
    2 | #define wait_recursive 2
      |                        ^


Nothing in our headers uses __cond, so we could just move it to a private
header in libsupc++ which is used by guard.cc and not installed.

Reply via email to