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++/50817] New: G++ emits errors containing lowered vtable references


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50817

             Bug #: 50817
           Summary: G++ emits errors containing lowered vtable references
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: manu@gcc.gnu.org


struct a {
    virtual int bar();
  };

  struct foo : public virtual a {
  };

  void test(foo *P) {
    return P->bar() + *P;
  }

g++ revision 180166: 

 void test(foo*)
vtable.cc:9:22: error: no match for âoperator+â in â(((a*)P) +
((sizetype)(*(long int*)(P->foo::<anonymous>.a::_vptr.a +
0xffffffffffffffffffffffffffffffe0u))))->a::bar() + * Pâ
vtable.cc:9:22: error: return-statement with a value, in function returning
'void' [-fpermissive]

clang:

 t.cc:9:18: error: invalid operands to binary expression ('int' and 'foo')
    return P->bar() + *P;
           ~~~~~~~~ ^ ~~


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