This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25555] New: typeof strips cv-qualification
- From: "boris at kolpackov dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Dec 2005 15:31:13 -0000
- Subject: [Bug c++/25555] New: typeof strips cv-qualification
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ cat >test.cxx
#include <iostream>
using std::cerr;
using std::endl;
template <typename X>
struct test
{
static int const r = 0;
};
template <typename X>
struct test<X&>
{
static int const r = 1;
};
template <typename X>
struct test<X*>
{
static int const r = 2;
};
int
main ()
{
int i;
int& ri = i;
int* pi = &i;
cerr << test<typeof (i)>::r << endl;
cerr << test<typeof (ri)>::r << endl;
cerr << test<typeof (pi)>::r << endl;
cerr << test<typeof (int)>::r << endl;
cerr << test<typeof (int&)>::r << endl;
cerr << test<typeof (int*)>::r << endl;
}
$ g++-4.0 --version
g++-4.0 (GCC) 4.0.3 20051201 (prerelease) (Debian 4.0.2-5)
$ g++-4.0 test.cxx
$ ./a.out
0
0
2
0
1
2
--
Summary: typeof strips cv-qualification
Product: gcc
Version: 4.0.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: boris at kolpackov dot net
GCC build triplet: x86_64-linux-gnu
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25555