HP Code Advisor Diagnostics

References should be initialized to refer to a valid object or a function. In certain contexts, when
rvalues are used for initializing references, the compiler might create a temporary and bind that
to the reference. In such scenarios compiler will issue this diagnostic.
Example:
struct Init {
const int & mem;
Init() : mem(10) {}
};
Action:
Provide a proper object for initializing the reference.
Reference:
ANSI/ISO C++ 8.5.3 12.2
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)
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)
46 Diagnostics Details