Compiler Error C2182
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Compiler Error C2182.
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
}
Show: