This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14360] New: Failure to compile when variables shadow functions.
- From: "mattyt-bugzilla at tpg dot com dot au" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Mar 2004 09:36:33 -0000
- Subject: [Bug c++/14360] New: Failure to compile when variables shadow functions.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code:
namespace ns {
struct A {
void operator() (A *);
A (int);
};
A m ();
}
struct B {
B() {
ns::A m (0);
m ((ns::A *)0);
}
};
gives errors under G++-3.4:
new25.C: In constructor `B::B()':
new25.C:11: error: `m' is not a function,
new25.C:6: error: conflict with `ns::A ns::m()'
new25.C:12: error: in call to `m'
whereas it compiles with g++-3.3 -c. I would expect the m variable to shadow
the m function, so it would compile.
--
Summary: Failure to compile when variables shadow functions.
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mattyt-bugzilla at tpg dot com dot au
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14360