Hello,  
  
$ uname -a  
Linux pc11-169 2.6.10-1-686 #1 Fri Mar 11 03:55:46 EST 2005 i686 GNU/Linux  
$ g++-3.4 --version  
g++-3.4 (GCC) 3.4.4 20050314 (prerelease) (Debian 3.4.3-12)  
Copyright (C) 2004 Free Software Foundation, Inc.  
This is free software; see the source for copying conditions.  There is NO  
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  
$ cat /tmp/bar.cc  
template <class T>  
struct foo  
{  
  struct bar  
  {  
    int m;  
  };  
  
  // Works if one of these two methods is commented.  
  void  m() const       { }  
  void  m()             { }  
  
  bool  n() const       { return b->m < 42; }  
  
  bar*  b;  
};  
$ g++-3.4 -c /tmp/bar.cc; echo $?  
/tmp/bar.cc: In member function `bool foo<T>::n() const':  
/tmp/bar.cc:13: error: missing `>' to terminate the template argument list  
/tmp/bar.cc:13: error: parse error in template argument list  
1  
$ g++-3.3 --version  
g++-3.3 (GCC) 3.3.5 (Debian 1:3.3.5-12)  
Copyright (C) 2003 Free Software Foundation, Inc.  
This is free software; see the source for copying conditions.  There is NO  
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  
$ g++-3.3 -c /tmp/bar.cc; echo $?  
0  
 
And I am using a Debian unstable. Both g++-3.3 and g++-3.4 come from the 
g++-3.3 and g++-3.4 Debian packages.

-- 
           Summary: Parse error when accessing attributes of an inner class.
                    Enclosing class is template and have methods with the
                    same name.
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: thomas dot claveirole at gmail dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20679

Reply via email to