HP Code Advisor Diagnostics Reference Guide (5900-1865, July 2011)

Only static const members of integral or enumeration type can be initialized inline in a class
definition. For other types, provide the initialization outside the class definition.
Example:
int i = 100;
class Init {
static const int *p_i =
};
Action:
Initialize the member outside the class: int i = 100; class Init { static const int *p_i; }; const int*
Init::p_i =
Reference:
ANSI/ISO C++ 9.4.2 9.2(4)
2.62 2322 object of abstract class type %t is not allowed
Cause:
By definition, objects of abstract types cannot be created; any such attempt will be flagged as an
error by the compiler.
Example:
class Base {
virtual void foo() = 0;
};
Base b;
Action:
Either remove the statement that attempts to create an object of an abstract class type or make the
class concrete/ non-abstract by removing the pure virtual functions.
Reference:
ANSI/ISO C++ 10.4(3)
2.63 2323 function returning abstract class %t is not allowed
Cause:
An abstract class cannot be used as a function return type, parameter type or as the type of an
explicit conversion.
Example:
class Base {
virtual void foo() = 0;
};
class Derived : public Base {
Derived bar();
};
Action:
Do not declare a function to accept as paramater or return an abstract class type.
Reference:
ANSI/ISO C++ 10.4(3)
2.64 2325 inline specifier allowed on function declarations only
Cause:
2.62 2322 object of abstract class type %t is not allowed 41