This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81812] New: Empty virtual function fails to compile
- From: "woodard at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 Aug 2017 22:40:05 +0000
- Subject: [Bug c++/81812] New: Empty virtual function fails to compile
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81812
Bug ID: 81812
Summary: Empty virtual function fails to compile
Product: gcc
Version: 7.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: woodard at redhat dot com
Target Milestone: ---
-95 ~]$ cat testg++.C
#include <stdio.h>
class Error {
public:
virtual void error( int, int, const char *, ... ) const;
};
void Error::error(int a, int b, const char * c, ...) const {
}
class ChildNode : public virtual Error {
public:
void error( int, int, const char *, ... ) const;
};
void ChildNode::error( int, int, const char *, ... ) const
{
// Uncomment leads to succesful compelation.
//printf("hello world");
}
int main () {}
[ben@li392-95 ~]$ g++ testg++.C -O2 -o testg++
testg++.C:22:14: error: generic thunk code fails for method ‘virtual void
ChildNode::_ZTv0_n24_NK9ChildNode5errorEiiPKcz(int, int, const char*, ...)
const’ which uses ‘...’
int main () {}
^
While if you compile with -O0 it compiles fine.