First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 15096
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Mark Mitchell <mark@codesourcery.com>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Wolfgang Roehrl <wolfgang.roehrl@gi-de.com>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 15096 depends on: Show dependency tree
Show dependency graph
Bug 15096 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2004-04-23 13:15 Opened: 2004-04-23 10:54
We use the compiler to generate code for a PowerPc processor. 
Used invokation line for the C++ compiler:

ccppc -c -x c++ -ansi -Wall -Werror -mcpu=8540 -fverbose-asm -mbig -mmultiple
      -mno-string -mstrict-align -O3 -fno-exceptions -fno-rtti
      -I<different include paths>
      -D<differen #define's>
      Z.CPP -oZ.O



// example program 1

template <typename T_>
class C1
{
public:
    C1 ();
    ~C1 ();
    const int C1<T_>::* getPtr () const;

private:
    int x;
    T_ y;
};


template <typename T_>
const int C1<T_>::* C1<T_>::getPtr () const
{ return &C1<T_>::x; }                      // <-- line 17


The compiler gives the following error message:
 
z.CPP:17: error: too few template parameter lists in declaration of `const int 
   C1<T_>::* C1<T_>::getPtr() const'


We get no error message if a typedef is introduced:

// example program 2

template <typename T_>
class C1
{
    typedef const int C1<T_>::* T_C1_INT_PTR;

public:
    C1 ();
    ~C1 ();
    T_C1_INT_PTR getPtr () const;

private:
    int x;
    T_ y;
};


template <typename T_>
typename C1<T_>::T_C1_INT_PTR C1<T_>::getPtr () const
{ return &C1<T_>::x; }

------- Comment #1 From Giovanni Bajo 2004-04-23 13:11 -------
Confirmed, but can anybody test it with 2.95?

------- Comment #2 From Andrew Pinski 2004-04-23 13:15 -------
It worked with 2.95.3

------- Comment #3 From Giovanni Bajo 2004-06-06 03:39 -------
Retargeting to 3.4.1, being a regression on that release branch.

------- Comment #4 From Mark Mitchell 2004-06-12 21:32 -------
Working on a fix.

------- Comment #5 From CVS Commits 2004-06-14 15:52 -------
Subject: Bug 15096

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-06-14 15:52:50

Modified files:
	gcc/cp         : decl.c name-lookup.c ChangeLog 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: friend30.C ptrmem10.C 

Log message:
	PR c++/15096
	* decl.c (grokdeclarator): Ignore pointer-to-members when
	computing template depth.
	
	PR c++/14930
	* name-lookup.c (pushtag): Do not try to put class declarations in
	explicit specialization scopes.
	
	PR c++/15096
	* g++.dg/template/ptrmem10.C: New test.
	
	PR c++/14930
	* g++.dg/template/friend30.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.1174.2.20&r2=1.1174.2.21
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.34.2.15&r2=1.34.2.16
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.122&r2=1.3892.2.123
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.206&r2=1.3389.2.207
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/friend30.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/ptrmem10.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1


------- Comment #6 From CVS Commits 2004-06-14 15:58 -------
Subject: Bug 15096

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-06-14 15:58:54

Modified files:
	gcc/cp         : decl.c name-lookup.c ChangeLog 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: friend30.C ptrmem10.C 

Log message:
	PR c++/15096
	* decl.c (grokdeclarator): Ignore pointer-to-members when
	computing template depth.
	
	PR c++/14930
	* name-lookup.c (pushtag): Do not try to put class declarations in
	explicit specialization scopes.
	
	PR c++/15096
	* g++.dg/template/ptrmem10.C: New test.
	
	PR c++/14930
	* g++.dg/template/friend30.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1214&r2=1.1215
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcc&r1=1.58&r2=1.59
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4094&r2=1.4095
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3854&r2=1.3855
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/friend30.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/ptrmem10.C.diff?cvsroot=gcc&r1=1.1&r2=1.2


------- Comment #7 From Mark Mitchell 2004-06-14 17:15 -------
Fixed in GCC 3.4.1.

First Last Prev Next    No search results available      Search page      Enter new bug