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

Table Of Contents
Example:
static union {
private:
int i;
protected:
float f;
};
Action:
Provide public access to all the anonymous union members. For example:
static union {
public:
int i;
float f;
};
Reference:
ANSI/ISO C++ 9.5(3)
2364 invalid anonymous union -- member function is not allowed
Cause:
Anonynous unions cannot have member functions, they can only contain non-static data members.
Example:
static union {
int foo() { return 0; }
};
Action:
Remove the member function from anonymous union.
Reference:
ANSI/ISO C++ 9.5(3)
2365 anonymous union at global or namespace scope must be declared
static
Cause:
Anonynous unions at global or namespace scope should be qualified with static qualifier to limit
them to file scope.
Example:
union {
int i;
};
Action:
Add static storage class to the anonymous union declared at global or namespace scope. For
example:
static union {
int i;
};
Reference:
ANSI/ISO C++ 9.5(3)
2364 invalid anonymous union -- member function is not allowed 43