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

The cv qualifiers ( const and volatile qualifiers) of the object should be compatible with the cv
qualifiers of member functions that it calls. For example, any attempt to call a non-const member
function on a const object will result in an error.
Example:
int main() {
struct X {
void foo();
};
const X s;
s.foo();
}
Action:
Ensure that the cv qualifiers of the object are not stricter than cv qualifiers of the methods that called
through it.
Reference:
ANSI/ISO C++ 9.3.2(4)
2.59 2319 pure specifier ("= 0") allowed only on virtual functions
Cause:
Only virtual functions can be declared as pure; other functions cannot have pure specifier as it is
meaningless.
Example:
class base {
public:
static int foo() = 0;
};
Action:
Provide the pure specifier only for virtual functions.
Reference:
ANSI/ISO C++ 9.3.1(4)
2.60 2320 badly-formed pure specifier (only "= 0" is allowed)
Cause:
Pure virtual functions are declared by a pure specifier indicated by = 0 ; = 0 does not indicate
initialization or assignment, hence 0 cannot be replaced by other values.
Example:
class base {
public:
virtual int foo() = 1;
};
Action:
Provide the pure specifier only as "= 0", for example: virtual int foo() = 0;
Reference:
ANSI/ISO C++ 9.2, 10.4(2)
2.61 2321 data member initializer is not allowed
Cause:
40 Diagnostics Details