operator+ and void*: differences between g++ and msvc

Hi, I am trying to perform an exhaustive testing of the operator traits. I came to the following issue: this code yields an error with msvc and only a warning with g++: int lhs=0; void* rhs=0; lhs + rhs; * msvc (Visual C++ 2010 Express): error C2036: 'void *' : unknown size warning C4552: '+' : operator has no effect; expected operator with side-effect * g++ (4.5.3): warning: pointer of type 'void *' used in arithmetic The standard says: "Either both operands shall have arithmetic or enumeration type, or one operand shall be a pointer to a completely defined object type and the other shall have integral or enumeration type." So it seems to me that an error should be issued by g++. What is your understanding of the standard? If this is so, do you suggest me to file a bug to g++? Frédéric
participants (3)
-
Frédéric Bron
-
Mathias Gaunard
-
Matt Calabrese