This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/3518: [2003-05-03] default conversion applied too soon


giovannibajo@libero.it wrote:
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.
sure. Thre are two other issues that gcc might not
have got right then.
1) you can ignore the cv qualifier on a reference when that reference
is introduced by a typedef or template type parm
2) DR 295 made the same change for function types

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]