Sdílet prostřednictvím


Chyba kompilátoru C2658

'member': nové definování v anonymní struktuře/sjednocení

Poznámky

Dvě anonymní struktury nebo sjednocení obsahovaly deklarace členů se stejným identifikátorem, ale s různými typy. V části /Za se také zobrazí tato chyba pro členy se stejným identifikátorem a typem.

Example

Následující příklad vygeneruje 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;
   };
};