https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63650
Bug ID: 63650
Summary: conflicting type attributes specified for ‘virtual..'
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard at netbsd dot org
came across this issue trying to build xulrunner192 on gcc 4.8.1 or 4.9.1
with this test program:
--------------->8----------------------
#ifndef HIDDEN
#define HIDDEN __attribute__((visibility("hidden")))
#ifndef CDECL
#define CDECL __attribute__((regparm(0),cdecl))
#endif
class A
{
virtual HIDDEN int CDECL foo( void *nok) = 0;
};
class B : public A
{
virtual HIDDEN int CDECL foo(void *nok); /* implicitly virtual */
};
class C : public B
{
int foo(void *nok); /* implicitly virtual */
};
--------------->8------------------------------
I get :
richard@omnis:/home/richard/src/tvir$ /opt/gcc-4.8.1/bin/g++ -c tvir1.cpp
tvir1.cpp:20:7: error: conflicting type attributes specified for ‘virtual int
C::foo(void*)’
int foo(void *nok); /* implicitly virtual */
^
tvir1.cpp:15:28: error: overriding ‘virtual int B::foo(void*)’
virtual HIDDEN int CDECL foo(void *nok); /* implicitly virtual */
^
compiling with '-DCDECL=' avoids the problem.
This builds with gcc 4.4.4 and I believe with gcc 4.7.3 so I ask:
Is this a problem with the recent g++ versions or with the older ones?