public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15096] New: parse error with templates and pointer to const member
@ 2004-04-23 11:05 wolfgang dot roehrl at de dot gi-de dot com
  2004-04-23 14:03 ` [Bug c++/15096] " giovannibajo at libero dot it
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: wolfgang dot roehrl at de dot gi-de dot com @ 2004-04-23 11:05 UTC (permalink / raw)
  To: gcc-bugs

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

-- 
           Summary: parse error with templates and pointer to const member
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wolfgang dot roehrl at de dot gi-de dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: sparc-sun-solaris2.5.1
  GCC host triplet: i386-pc-mingw32
GCC target triplet: powerpc-wrs-vxworks


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/15096] parse error with templates and pointer to const member
  2004-04-23 11:05 [Bug c++/15096] New: parse error with templates and pointer to const member wolfgang dot roehrl at de dot gi-de dot com
@ 2004-04-23 14:03 ` giovannibajo at libero dot it
  2004-04-23 14:24 ` [Bug c++/15096] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-04-23 14:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-04-23 13:11 -------
Confirmed, but can anybody test it with 2.95?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
      Known to fail|                            |3.2.3 3.3.3 3.4.0 3.5.0


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/15096] [3.3/3.4/3.5 Regression] parse error with templates and pointer to const member
  2004-04-23 11:05 [Bug c++/15096] New: parse error with templates and pointer to const member wolfgang dot roehrl at de dot gi-de dot com
  2004-04-23 14:03 ` [Bug c++/15096] " giovannibajo at libero dot it
@ 2004-04-23 14:24 ` pinskia at gcc dot gnu dot org
  2004-06-06  3:39 ` giovannibajo at libero dot it
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-23 14:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-23 13:15 -------
It worked with 2.95.3

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to work|                            |2.95.3
   Last reconfirmed|0000-00-00 00:00:00         |2004-04-23 13:15:39
               date|                            |
            Summary|parse error with templates  |[3.3/3.4/3.5 Regression]
                   |and pointer to const member |parse error with templates
                   |                            |and pointer to const member
   Target Milestone|---                         |3.3.4


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/15096] [3.3/3.4/3.5 Regression] parse error with templates and pointer to const member
  2004-04-23 11:05 [Bug c++/15096] New: parse error with templates and pointer to const member wolfgang dot roehrl at de dot gi-de dot com
  2004-04-23 14:03 ` [Bug c++/15096] " giovannibajo at libero dot it
  2004-04-23 14:24 ` [Bug c++/15096] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-06-06  3:39 ` giovannibajo at libero dot it
  2004-06-12 21:32 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-06-06  3:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-06-06 03:39 -------
Retargeting to 3.4.1, being a regression on that release branch.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gdr at gcc dot gnu dot org
   Target Milestone|3.3.4                       |3.4.1


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/15096] [3.3/3.4/3.5 Regression] parse error with templates and pointer to const member
  2004-04-23 11:05 [Bug c++/15096] New: parse error with templates and pointer to const member wolfgang dot roehrl at de dot gi-de dot com
                   ` (2 preceding siblings ...)
  2004-06-06  3:39 ` giovannibajo at libero dot it
@ 2004-06-12 21:32 ` mmitchel at gcc dot gnu dot org
  2004-06-14 15:53 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-06-12 21:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-06-12 21:32 -------
Working on a fix.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/15096] [3.3/3.4/3.5 Regression] parse error with templates and pointer to const member
  2004-04-23 11:05 [Bug c++/15096] New: parse error with templates and pointer to const member wolfgang dot roehrl at de dot gi-de dot com
                   ` (3 preceding siblings ...)
  2004-06-12 21:32 ` mmitchel at gcc dot gnu dot org
@ 2004-06-14 15:53 ` cvs-commit at gcc dot gnu dot org
  2004-06-14 15:59 ` cvs-commit at gcc dot gnu dot org
  2004-06-14 17:15 ` mmitchel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-14 15:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  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



-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/15096] [3.3/3.4/3.5 Regression] parse error with templates and pointer to const member
  2004-04-23 11:05 [Bug c++/15096] New: parse error with templates and pointer to const member wolfgang dot roehrl at de dot gi-de dot com
                   ` (4 preceding siblings ...)
  2004-06-14 15:53 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-14 15:59 ` cvs-commit at gcc dot gnu dot org
  2004-06-14 17:15 ` mmitchel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-14 15:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  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



-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/15096] [3.3/3.4/3.5 Regression] parse error with templates and pointer to const member
  2004-04-23 11:05 [Bug c++/15096] New: parse error with templates and pointer to const member wolfgang dot roehrl at de dot gi-de dot com
                   ` (5 preceding siblings ...)
  2004-06-14 15:59 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-14 17:15 ` mmitchel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-06-14 17:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-06-14 17:15 -------
Fixed in GCC 3.4.1.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-06-14 17:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-23 11:05 [Bug c++/15096] New: parse error with templates and pointer to const member wolfgang dot roehrl at de dot gi-de dot com
2004-04-23 14:03 ` [Bug c++/15096] " giovannibajo at libero dot it
2004-04-23 14:24 ` [Bug c++/15096] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-06-06  3:39 ` giovannibajo at libero dot it
2004-06-12 21:32 ` mmitchel at gcc dot gnu dot org
2004-06-14 15:53 ` cvs-commit at gcc dot gnu dot org
2004-06-14 15:59 ` cvs-commit at gcc dot gnu dot org
2004-06-14 17:15 ` mmitchel at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).