Bug 20679 - [3.4 Regression] Parse error when accessing attributes of an inner class. Enclosing class is template and have methods with the same name.
Summary: [3.4 Regression] Parse error when accessing attributes of an inner class. Enc...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.4
: P2 normal
Target Milestone: 3.4.4
Assignee: Mark Mitchell
URL:
Keywords: rejects-valid
Depends on: 10200
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-29 09:07 UTC by Thomas Claveirole
Modified: 2005-04-04 23:44 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-03-29 14:22:02


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Claveirole 2005-03-29 09:07:53 UTC
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.
Comment 1 Andrew Pinski 2005-03-29 14:22:01 UTC
Confirmed, something is definitely wrong.  This is most likely related to PR 10200.
Comment 3 CVS Commits 2005-04-04 19:11:21 UTC
Subject: Bug 20679

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2005-04-04 19:11:08

Modified files:
	gcc/cp         : ChangeLog parser.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: overload4.C 

Log message:
	PR c++/20679
	* parser.c (cp_parser_template_name): Fix thinko.
	
	PR c++/20679
	* g++.dg/template/overload4.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4687&r2=1.4688
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.325&r2=1.326
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5278&r2=1.5279
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/overload4.C.diff?cvsroot=gcc&r1=1.1&r2=1.2

Comment 4 Mark Mitchell 2005-04-04 19:14:40 UTC
Fixed in 4.0, 4.1.
Comment 6 Mark Mitchell 2005-04-04 23:44:21 UTC
Fixed in 3.4.4.