This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/81812] New: Empty virtual function fails to compile


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]