This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49808] New: GCC adds an address-of somewhere!
- From: "dave at boost-consulting dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 21 Jul 2011 19:52:47 +0000
- Subject: [Bug c++/49808] New: GCC adds an address-of somewhere!
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49808
Summary: GCC adds an address-of somewhere!
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: dave@boost-consulting.com
Compile the following:
template <class X, X g>
struct A
{
A() { float r = g(0); }
};
struct f_t
{
float operator() (float x) const { return 1; }
};
f_t f;
A<f_t&, f> x;
Now replace "g(0)" with "(*g)(0)". It compiles!
It's almost as though I had written
A<f_t*, &f> x;