编译器警告(等级 1)C4813

“function”:局部类的友元函数必须之前已经声明

内部类中的友元函数未在外部类中声明。

以下示例生成 C4813:

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