Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 997 Bytes

compiler-warning-level-1-c4822.md

File metadata and controls

35 lines (27 loc) · 997 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 1) C4822
Compiler Warning (level 1) C4822
11/04/2016
C4822
C4822
0f231a30-2eb0-4722-aaa0-e2d19d3e7eea

Compiler Warning (level 1) C4822

'member' : local class member function does not have a body

Remarks

A local class member function was declared but not defined in the class. To use a local class member function, you must define it in the class. You can't declare it in class and define it out of class.

Any out-of-class definition for a local class member function is an error.

In Visual Studio 2019 and later, C4822 is an off-by-default warning.

Example

The following sample generates C4822:

// C4822.cpp
// compile with: /W1
int main() {
   struct C {
      void func1(int);   // C4822
      // try the following line instead
      // void func1(int){}
  };
}