You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<stdin>:6:3: error: 'f' is unavailable f(p); ^<stdin>:12:3: note: in instantiation of function template specialization 'call_it<char>' requested here call_it(p); ^<stdin>:2:6: note: 'f' has been explicitly marked unavailable herevoid f(char*) { } ^1 error generated.
This is annoying because top_level is an inline function that never gets called and is marked as unavailable, yet the availability attribute on the leaf function f() still triggers an error. This means that we need to poison all the functions in the stack from top_level() to f() with the availability attribute, which could be many many functions. Instead, it seems that inline functions should have their availability attribute treated a bit more lazily.
Basically, __availability__ should be an attribute on symbols required from a TU. If there is no dependency of the program on the f symbol (in this case aka if there was no codegen for top_level()), there should be no diagnostic because the program doesn't actually depend on f().
The text was updated successfully, but these errors were encountered:
I don't honestly recall if this is expected behavior or not -- the unavailable attribute predates Attr.td even existing and it has no documentation associated with it. I haven't been able to track down who added it to see what the review looks like for it.
Changing the behavior of the attribute seems risky because we might break long-standing expectations from someone, but it's really hard to say.
The following code snippet fails to compile:
The compiler issues the following error:
This is annoying because
top_level
is an inline function that never gets called and is marked asunavailable
, yet the availability attribute on the leaf functionf()
still triggers an error. This means that we need to poison all the functions in the stack fromtop_level()
tof()
with the availability attribute, which could be many many functions. Instead, it seems thatinline
functions should have their availability attribute treated a bit more lazily.Basically,
__availability__
should be an attribute on symbols required from a TU. If there is no dependency of the program on thef
symbol (in this case aka if there was no codegen fortop_level()
), there should be no diagnostic because the program doesn't actually depend onf()
.The text was updated successfully, but these errors were encountered: