16489 – [3.3/3.4/4.0 Regression] G++ incorrectly rejects use of a null constant integral expression as a null constant pointer (original) (raw)

Description Gabriel Dos Reis 2004-07-12 07:23:06 UTC

Consider

const int NULL = 0;
int main() { double* p = NULL; }

G++ incorrectly rejects the above. This regression is also present in GCC-3.3.x, in direct violation of the C++ standard.

Comment 2 Drea Pinski 2004-07-12 14:06:04 UTC

Here is the result from Phil's regression hunter: Search converges between 2002-11-30-trunk (#150) and 2002-12-02-trunk (#151).

Comment 3 Drea Pinski 2004-07-26 14:46:02 UTC

Note unlike most other constant integral expression 0 is special IIRC.

Comment 4 Gabriel Dos Reis 2004-07-27 10:57:37 UTC

Subject: Re: [3.3/3.4/3.5 Regression] G++ incorrectly rejects use of a null constant integral expression as a null constant pointer

"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| Note unlike most other constant integral expression 0 is special IIRC.

I do not understand what you meant to imply...

-- Gaby

Comment 5 Mark Mitchell 2004-08-01 21:24:49 UTC

Working on a fix.

Comment 8 Mark Mitchell 2004-08-02 02:01:11 UTC

Fixed in GCC 3.4.2 and GCC 3.5.