Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 10849
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Kriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Giovanni Bajo <giovannibajo@libero.it>
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 10849 depends on: Show dependency tree
Show dependency graph
Bug 10849 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2003-07-06 10:47 Opened: 2003-05-18 21:56
Reported by Ole Laursen here:
http://gcc.gnu.org/ml/gcc/2003-05/msg01686.html

---------------------------------------------
class X
{
private:
    template <typename T> struct Y;
};

template <> 
struct X::Y<int>
{};
---------------------------------------------
gccbug5.cpp:4: error: `template<class T> struct X::Y' is private
gccbug5.cpp:9: error: within this context

Regression on the 3.3 branch and mainline (3.2.2 and 2.95
worked fine).

Release:
3.3 and 3.4 (CVS 20030503)

Environment:
i686-pc-cygwin

How-To-Repeat:
Compile the above snippet

------- Comment #1 From Giovanni Bajo 2003-05-18 22:08 -------
Responsible-Changed-From-To: unassigned->lerdsuwa
Responsible-Changed-Why: Kriang said that he will take care of this.

------- Comment #2 From Giovanni Bajo 2003-05-18 22:08 -------
State-Changed-From-To: open->analyzed
State-Changed-Why: Already analyzed by Gaby and Kriang, and reconfirmed by me.

------- Comment #3 From Kriang Lerdsuwanakij 2003-05-24 17:54 -------
Patch submitted:

  http://gcc.gnu.org/ml/gcc-patches/2003-05/msg02152.html

------- Comment #4 From Kriang Lerdsuwanakij 2003-05-24 17:58 -------
*** Bug 10969 has been marked as a duplicate of this bug. ***

------- Comment #5 From Kriang Lerdsuwanakij 2003-05-25 10:35 -------
Fixed in the 3.3 branch.

------- Comment #6 From Debian GCC Maintainers 2003-06-29 08:44 -------
[forwarded from http://bugs.debian.org/193830]

fyi,  
 
gcc version 3.3.1 20030626 (Debian prerelease) 
(aka '3.3.1-0pre0' in debian) 
 
improves a bit on the situation: 
 
class Foo { 
  template <class T> struct InFoo; 
  template <class T, class U> struct InFoo2; 
}; 
 
template<> 
struct Foo::InFoo<int> { 
  // ...this works now... (didn't work with 3.3.0) 
}; 
 
template<class T> 
struct Foo::InFoo2<T, int> { 
  // ...this still triggers error 
}; 


------- Comment #7 From Giovanni Bajo 2003-06-29 08:57 -------
Confirmed. Kriang, your 3.3 workaround is not complete because 
processing_specialization is set only for explicit specializations, not for 
partial specializations.

------- Comment #8 From Kriang Lerdsuwanakij 2003-07-06 10:47 -------
Look like it needs a real fix, not just my workaround.

------- Comment #9 From Kriang Lerdsuwanakij 2003-07-07 15:14 -------
Patch submitted:

  http://gcc.gnu.org/ml/gcc-patches/2003-07/msg00693.html

------- Comment #10 From CVS Commits 2003-07-10 12:43 -------
Subject: Bug 10849

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	lerdsuwa@gcc.gnu.org	2003-07-10 12:43:17

Modified files:
	gcc/cp         : ChangeLog cp-tree.h decl2.c parse.y search.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: access12.C 

Log message:
	PR c++/10849
	* decl2.c (handle_class_head_apparent_template): New function.
	* cp-tree.h (handle_class_head_apparent_template): Add declaration.
	* parse.y (class_head_defn): Use it.
	* search.c (type_access_control): Revert my 2003-05-25 change.
	
	* g++.dg/template/access12.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.176&r2=1.3076.2.177
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.776.2.24&r2=1.776.2.25
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.575.2.33&r2=1.575.2.34
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parse.y.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.284.2.6&r2=1.284.2.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/search.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.243.2.12&r2=1.243.2.13
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.223&r2=1.2261.2.224
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/access12.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1


------- Comment #11 From CVS Commits 2003-07-10 12:48 -------
Subject: Bug 10849

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	lerdsuwa@gcc.gnu.org	2003-07-10 12:48:17

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: access12.C 

Log message:
	PR c++/10849
	* g++.dg/template/access12.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2857&r2=1.2858
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/access12.C.diff?cvsroot=gcc&r1=1.1&r2=1.2


------- Comment #12 From Kriang Lerdsuwanakij 2003-07-10 13:43 -------
Fixed.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug