-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Closed as not planned
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"questionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
[[maybe_unused]] is helpful for suppressing warnings about declarations that may or may not be referenced. However, clang currently accepts it only in c++17 (or c23 for C) and later. Users who target older standards often rely on inconvenient workarounds, such as wrapping code in #pragma clang diagnostic push/pop to silence warnings.
It would be useful if clang accepted a spelling like __attribute__((maybe_unused)) for earlier language modes.
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"questionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!