Clang supports the alias attribute from GCC.
While primarily used for C projects on ELF platforms and possibly also windows-gnu, Clang accepts the alias attribute for windows-msvc targets as well.
This scenario is more like "the feature is generic, let's make it available for everyone" rather than "there are active users of this for windows-msvc".
After removing some false positive results from rg '\(_?_?alias|::alias' -l | xargs grep -l windows, there is nearly no test.
I recently added one in clang/test/Sema/alias-unused-win.cpp.
The -Wunused-function diagnostic does not know how to connect an alias target to an internal linkage declaration, so we will get a false positive.
static int f1() { return 42; } // cxx-warning{{unused function 'f1'}}
int g1() __attribute__((alias("?f1@@YAHXZ")));
This can be fixed if #88823 is available.
Note: #88593 is about whether we should mangle an internal linkage function in extern "C" (static wins, no language linkage)
Clang supports the [`alias` attribute](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-alias-function-attribute) from GCC.
While primarily used for C projects on ELF platforms and possibly also windows-gnu, Clang accepts the `alias` attribute for windows-msvc targets as well.
This scenario is more like "the feature is generic, let's make it available for everyone" rather than "there are active users of this for windows-msvc".
After removing some false positive results from `rg '\(_?_?alias|::alias' -l | xargs grep -l windows`, there is nearly no test.
I recently added one in `clang/test/Sema/alias-unused-win.cpp`.
The `-Wunused-function` diagnostic does not know how to connect an alias target to an internal linkage declaration, so we will get a false positive.
```
static int f1() { return 42; } // cxx-warning{{unused function 'f1'}}
int g1() __attribute__((alias("?f1@@YAHXZ")));
```
This can be fixed if #88823 is available.
Clang supports the
alias
attribute from GCC. While primarily used for C projects on ELF platforms and possibly also windows-gnu, Clang accepts thealias
attribute for windows-msvc targets as well.This scenario is more like "the feature is generic, let's make it available for everyone" rather than "there are active users of this for windows-msvc". After removing some false positive results from
rg '\(_?_?alias|::alias' -l | xargs grep -l windows
, there is nearly no test. I recently added one inclang/test/Sema/alias-unused-win.cpp
.The
-Wunused-function
diagnostic does not know how to connect an alias target to an internal linkage declaration, so we will get a false positive.This can be fixed if #88823 is available.
Note: #88593 is about whether we should mangle an internal linkage function in
extern "C"
(static
wins, no language linkage)