This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/32066] member/type lookup doesn't work properly with templates



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]