[[maybe_unused]] on enumerator

后端 未结 2 1983
谎友^
谎友^ 2021-02-14 09:00

Looking at the specification of the [[maybe_unused]], it states:

Appears in the declaration of a class, a typedef­, a variable, a non­static data member,

2条回答
  •  遇见更好的自我
    2021-02-14 09:25

    A bug was logged for Clang and marked as resolved: https://bugs.llvm.org/show_bug.cgi?id=36231

    This seems to confirm that the enum value is allowed to be missing in a switch without warning in case it is tagged with [[maybe_unused]]

提交回复
热议问题