[clang] Enable unguarded availability diagnostic on instantiated template functions (PR #91699)
Amy Huang via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 6 10:04:37 PDT 2024
amykhuang wrote:
here's a reduced example of what we ran into in Chrome. I guess the attribute is being applied to a function that's passed to `f()`, and the warning points to the call in the definition of `f`.
```
#define a(b) __attribute__((__availability__(android, introduced = b)))
#define c(b) (a(b), apply_to = function)
template <typename callback> void f(callback cb) {
cb();
}
#pragma clang attribute push c(29)
void test() {
f([](){});
}
#pragma clang attribute pop
```
https://github.com/llvm/llvm-project/pull/91699
More information about the cfe-commits
mailing list