'identifier' : member function definition looks like a ctor, but name does not match enclosing class
The inline definition of a member function in a class or a structure looks like a constructor, but the name of the member function is not the same as the class or structure name enclosing it. This member function is assumed to have a default return type of int. For example:
class MyClass1;
class MyClass2 {
MyClass1() {...};
}
The member function X()
is treated as int X()
.
Make sure the constructor of this class is not misspelled. Misspelled constructors can lead to run time errors that are hard to isolate. If this member function is not intended to be a constructor, you can avoid this warning by explicitly specifying the return type of the member function.