Compiler Warning (level 1) C4813
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Warning (level 1) C4813

Error Message

'function' : a friend function of a local class must have been previously declared

A friend function in an inner class was not declared in the outer class.

The following sample generates C4813:

// C4813.cpp
// compile with: /W1 /LD
void MyClass()
   // void func();
   class InnerClass
      friend void func();   // C4813 uncomment declaration above
© 2015 Microsoft