This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/10646: [3.3/3.4 regression] non-const reference is incorrectly matched in a "const T" partial specialization
- From: giovannibajo at libero dot it
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, notbob at tessellation dot com
- Date: 7 May 2003 00:17:50 -0000
- Subject: Re: c++/10646: [3.3/3.4 regression] non-const reference is incorrectly matched in a "const T" partial specialization
- Reply-to: giovannibajo at libero dot it, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, notbob at tessellation dot com, gcc-gnats at gcc dot gnu dot org
Old Synopsis: is_const<T> treats references and functions as const
New Synopsis: [3.3/3.4 regression] non-const reference is incorrectly matched in a "const T" partial specialization
State-Changed-From-To: open->analyzed
State-Changed-By: bajo
State-Changed-When: Wed May 7 00:17:50 2003
State-Changed-Why:
The bug for function types is confirmed in 3.2 but it's
fixed in 3.3 (20030503) and 3.4 (20030503). It might be
fixed in 3.2.3 as well, I don't have that version.
There still is a bug with references, though:
---------------------------------
template <typename T>
struct is_const
{
typedef int type;
};
template <typename T>
struct is_const<const T>
{};
is_const<bool&>::type a;
---------------------------------
This should compile (but I'm not 100% sure because this
very part of the standard is still a bit misterious for me),
and it does on MSVC71 and Comeau/EDG, but fails with GCC
3.3 and 3.4. Since it worked in 2.95, I rate this as a
regression.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10646