HP-UX Cadvise Diagnostics Reference Guide (5900-1865, August 2012)

Table Of Contents
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)
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)
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)
2321 data member initializer is not allowed
Cause:
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 =
};
40 Diagnostics Details