Usage in an annotation is no odr-use, so I think there needs to be no
definition. Upside is that in practice one will get linker errors if it
is actually odr-used instead of calling a function that returns 0.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Unit Tests
Event Timeline
Comment Actions
LGTM! It took me a minute to convince myself it wasn't really an ODR use (the argument goes through the usual expression evaluation parsing and sema bits), but because the arguments to these attributes never wind up being used in codegen, they're not really a use as far as the ODR is concerned.
Comment Actions
Right, the standard doesn't know about our attributes. My reasoning was that they are basically an unevaluated context like a sizeof expression.
Comment Actions
Nonstandard attributes are wholly up to the implementation for what their semantic effects are, so they can be unevaluated *or* constant evaluated *or* runtime evaluated depending on need. I mostly just needed to make sure we weren't accidentally marking these uses as ODR uses, and happily, we weren't.