Bug ID: 36231
           Summary: -Wswitch ignores [[maybe_unused]]
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs

enum A
    C [[maybe_unused]]

void f(A a)
    switch (a)
        case B: break;

Results into:

<source>:9:13: warning: enumeration value 'C' not handled in switch [-Wswitch]
    switch (a)

[[maybe_unused]] is allowed to be placed at this location and the only use case
I could come up with, does not work.

Some discussion about this can be found on although, no conclusion was
reached on this assumption being right or not.

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to