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

Reference:
ANSI/ISO C++ 8.5.3 12.2
2.68 2363 invalid anonymous union -- nonpublic member is not allowed
Cause:
Anonynous unions can have only public non-static data members, private or protected members
are not allowed.
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)
2.69 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)
2.70 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:
2.68 2363 invalid anonymous union -- nonpublic member is not allowed 43