https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81973
--- Comment #3 from Lorenzo Pistone <blaffablaffa at gmail dot com> ---
That is not the issue, or maybe I don't understand the suggestion. This program
fails just the same:
#include <iostream>
using namespace std;
struct b{
int a;
virtual void f(){
cout<<__PRETTY_FUNCTION__<<' '<<a<<endl;
}
};
struct s : b{
#ifdef VIRT_ALIAS
virtual void f() __attribute__ ((alias ("_ZN1s7f_aliasEv")));
#endif
void g() __attribute__ ((alias ("s_g_alias")));
void f_alias() __attribute__ ((used)) {
cout<<__PRETTY_FUNCTION__<<' '<<a<<endl;
}
};
extern "C"{
void s_g_alias(s* this_){
cout<<__PRETTY_FUNCTION__<<' '<<this_->a<<endl;
}
}
int main(){
s a;
a.a = 123;
a.f();
a.g();
}