[clang] [clang] Replace LLVM_ATTRIBUTE_UNUSED with [[maybe_unused]] (NFC) (PR #163914)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 17 09:51:09 PDT 2025


erichkeane wrote:

> > This is causing a regression for me:
> > ```
> > In file included from /local/home/ekeane/llvm-project/clang/lib/CIR/CodeGen/CIRGenDeclOpenACC.cpp:13:
> > In file included from /local/home/ekeane/llvm-project/clang/lib/CIR/CodeGen/CIRGenFunction.h:17:
> > In file included from /local/home/ekeane/llvm-project/clang/lib/CIR/CodeGen/CIRGenCall.h:17:
> > /local/home/ekeane/llvm-project/clang/lib/CIR/CodeGen/CIRGenValue.h:311:3: error: an attribute list cannot appear here
> >   311 |   [[maybe_unused]] unsigned destructedFlag : 1;
> > ```
> 
> I ran into that problem before: #143994
> 
> I guess maybe I fixed it in the wrong way. Does moving `[[maybe_unused]]` before `LLVM_PREFERRED_TYPE` fix this for you?

Yep, re-ordering is one of the options that works for me, `[[maybe_unused]]` being first 'fixes' the problem.

https://github.com/llvm/llvm-project/pull/163914


More information about the cfe-commits mailing list