Bug 3663 - G++ doesn't check access control during template instanation
Summary: G++ doesn't check access control during template instanation
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.0
: P3 normal
Target Milestone: ---
Assignee: Kriang Lerdsuwanakij
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2001-07-12 10:36 UTC by Mark Mitchell
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
test2.C (104 bytes, application/octet-stream)
2003-05-21 15:16 UTC, Mark Mitchell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Mitchell 2001-07-12 10:36:00 UTC
The attached program sould generate an error during
template instantiation since the `S<int>::T' is not
accessible.

Release:
3.0
Comment 1 Nathan Sidwell 2001-12-15 10:10:47 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: yup, doesn't do that either
Comment 2 Kriang Lerdsuwanakij 2002-11-08 02:05:58 UTC
Responsible-Changed-From-To: unassigned->lerdsuwa
Responsible-Changed-Why: Will look at it.
Comment 3 Kriang Lerdsuwanakij 2002-12-16 23:26:16 UTC
From: Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, lerdsuwa@gcc.gnu.org,
        gcc-bugs@gcc.gnu.org, mark@codesourcery.com
Cc:  
Subject: Re: c++/3663: G++ doesn't check access control during template instanation
Date: Mon, 16 Dec 2002 23:26:16 +0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3663
 
 I have submit a patch that fixes this.  It is waiting for approval:
 
    http://gcc.gnu.org/ml/gcc-patches/2002-11/msg00958.html
 
 --Kriang
 

Comment 4 Kriang Lerdsuwanakij 2002-12-19 07:26:44 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed in 3.3 and trunk.
Comment 5 Kriang Lerdsuwanakij 2002-12-19 14:45:19 UTC
From: lerdsuwa@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/3663
Date: 19 Dec 2002 14:45:19 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	lerdsuwa@gcc.gnu.org	2002-12-19 06:45:19
 
 Modified files:
 	gcc/cp         : ChangeLog pt.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/template: access7.C 
 
 Log message:
 	PR c++/3663
 	* pt.c (lookup_template_class): Copy TREE_PRIVATE and
 	TREE_PROTECTED to created decl nodes.
 	
 	* g++.dg/template/access7.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3082&r2=1.3083
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.636&r2=1.637
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2265&r2=1.2266
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/access7.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 
Comment 6 Kriang Lerdsuwanakij 2002-12-19 15:30:15 UTC
From: lerdsuwa@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/3663
Date: 19 Dec 2002 15:30:15 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	lerdsuwa@gcc.gnu.org	2002-12-19 07:30:15
 
 Modified files:
 	gcc/cp         : ChangeLog pt.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/template: access7.C 
 
 Log message:
 	PR c++/3663
 	* pt.c (lookup_template_class): Copy TREE_PRIVATE and
 	TREE_PROTECTED to created decl nodes.
 	
 	* g++.dg/template/access7.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.3&r2=1.3076.2.4
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.635.2.1&r2=1.635.2.2
 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.1&r2=1.2261.2.2
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/access7.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1