Compiling the following program:
#define STDCALL __attribute__((stdcall))
struct B1 {
int x;
virtual int STDCALL bar(int x) = 0;
};
struct B2 {
int x;
virtual int STDCALL foo(int x) = 0;
};
struct D: B1, B2 {
int a;
int STDCALL bar(int n);
int STDCALL foo(int n);
};
int STDCALL
D::bar(int n) {
return a + n;
}
int STDCALL
D::foo(int n) {
return a + n;
}
with "gcc -x c++ gccbug5.c" on MinGW results in the following error message:
gccbug5.c:26: error: 'int *LTHUNK0(int)' aliased to undefined symbol
'_ZN1D3fooEi'
--
Summary: Bad thunk alias to stdcall method
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rridge at csclub dot uwaterloo dot ca
GCC build triplet: i386-pc-mingw32
GCC host triplet: i386-pc-mingw32
GCC target triplet: i386-pc-mingw32
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27636