Follow Us
Contribute
  • Register
Errorbase is a collaborative writing project, that aims to build the largest trouble-shooting guide about all kinds of error messages.

Categories

0 votes

Multiple inherited structures contain the member you referenced with super. Ex:


struct B1 {
   int i;
};

struct B2 {
   int i;
};

struct D : B1, B2 {
   void g() {
      __super::i = 4; // C2798
   }
};

requested by (170k points)

2 Solutions

0 votes

This article is a derivative work based on http://msdn.microsoft.com/en-us/library/cbshbd77.aspx" title="http://msdn.microsoft.com/en-us/library/cbshbd77.aspx" target="_blank">Compiler Error C2798 which is provided by http://msdn.microsoft.com/en-us/library/60k1461a.aspx" title="http://msdn.microsoft.com/en-us/library/60k1461a.aspx" target="_blank">MSDN Community Content - Visual C++.

solved by (170k points)
0 votes

Possible resolutions:


  1. Removing B1 or B2 from the inheritance list of D.

  2. Changing the name of the data member in B1 or B2.



solved by (170k points)
...