This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/32066] member/type lookup doesn't work properly with templates
- From: "christian dot bruel at st dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Dec 2009 08:13:32 -0000
- Subject: [Bug c++/32066] member/type lookup doesn't work properly with templates
- References: <bug-32066-10252@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from christian dot bruel at st dot com 2009-12-07 08:13 -------
I'm wondering if this is not an application of the name hiding rule described
in the IEC 14882:1998 (3.3.7) that says here that the class name T::X is hidden
by the object static int T::X i, so T::X y refers to the object's name not the
class. Making the test invalid. Not certain, just a thought.
This could be reduced as
struct A
{
#ifdef X_MEMBER
static int X;
#endif
#ifdef X_NAME
struct X { };
#endif
} ;
void foo(void)
{
#ifdef X_NAME
A::X y;
#endif
#ifdef X_MEMBER
A::X = 1;
#endif
}
if both X_NAME and X_MEMBER are defined the line A::X y; becomes invalid.
--
christian dot bruel at st dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |christian dot bruel at st
| |dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32066