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

Nathan Sidwell nathan@codesourcery.com
Thu May 15 13:06:00 GMT 2003

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 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

More information about the Gcc-bugs mailing list