Issue 170408
Summary Allow `maybe_unused` in pre-C++17 / pre-C23 modes
Labels enhancement
Assignees
Reporter ahatanak
    `[[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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to