This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/3518: [2003-05-03] default conversion applied too soon
- From: giovannibajo at libero dot it
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nathan at codesourcery dot com, nobody at gcc dot gnu dot org
- Date: 15 May 2003 11:00:11 -0000
- Subject: Re: c++/3518: [2003-05-03] default conversion applied too soon
- Reply-to: giovannibajo at libero dot it, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nathan at codesourcery dot com, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Old Synopsis: [2003-01-02] default conversion applied too soon
New Synopsis: [2003-05-03] default conversion applied too soon
State-Changed-From-To: analyzed->feedback
State-Changed-By: bajo
State-Changed-When: Thu May 15 11:00:10 2003
State-Changed-Why:
Nathan, I see what you are saying but I think the code is
still legal. The applicable ctor is attempting to create
a const qualified _reference_ to function type, which is
a valid type. In fact, other compilers like Comeau/EDG
instanciate the constructor with [T = void(void)].
GCC compiles the code, but applies the default conversion
too soon, so instanciates the template with [T = (void)(*)(void)]
which is wrong. If you agree, we can rework a code snippet
which fails if T is a function pointer so that we can
properly detect the bug.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3518