Kompilatorfel C2658

"medlem": omdefiniera i anonym struct/union

Anmärkningar

Två anonyma strukturer eller fackföreningar innehöll medlemsdeklarationer med samma identifierare men med olika typer. Under /Za får du även det här felet för medlemmar med samma identifierare och typ.

Example

I följande exempel genereras C2658:

// C2658.cpp
// compile with: /c
struct X {
   union { // can be struct too
      int i;
   };
   union {
      int i;   // Under /Za, C2658
      // int i not needed here because it is defined in the first union
   };
};

struct Z {
   union {
      char *i;
   };

   union {
      void *i;   // C2658 redefinition of 'i'
      // try the following line instead
      // void *ii;
   };
};