This documentation is archived and is not being maintained.

Compiler Error C2182

Error Message

'identifier' : illegal use of type 'void'

A variable is declared type void.

The following sample generates C2182:

// C2182.cpp
// compile with: /c
int main() {
   int i = 10;
   void &ir = i;   // C2182 cannot have a reference to type void
   int &ir = i;   // OK