Skip to content

Ridiculous error after #if defined(__COUNTER__), error: '__COUNTER__' is a C2y extension #196474

@rnichollx

Description

@rnichollx
/home/rpnx/quxlang/dev-workspace/sources/benchmark/include/benchmark/benchmark.h:1483:30: error: '__COUNTER__' is a C2y extension [-Werror,-Wc2y-extensions]
 1483 | #if defined(__COUNTER__) && (__COUNTER__ + 1 == __COUNTER__ + 0)

Clang should not error when __COUNTER__ is disabled by compiler flags, the defined clause should return false and then clang should continue on without an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c2yclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions