This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
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; }
Confirmed, but can anybody test it with 2.95?
It worked with 2.95.3
Retargeting to 3.4.1, being a regression on that release branch.
Working on a fix.
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
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
Fixed in GCC 3.4.1.