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

            Bug ID: 125655
           Summary: Invalid __VA_ARGS__ or __VA_OPT__ in #elif is accepted
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: luigighiron at gmail dot com
  Target Milestone: ---

GCC incorrectly accepts the following:

#if 0
#elif __VA_ARGS__
#endif

The same applies to __VA_OPT__. It is rejected in #if, so it should be rejected
in #elif too if it was not skipped. Clang rejects it even in skipped #elif
directives (replace 0 with 1 in the above), though I think that should not be
done.

Reply via email to