public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19258] New: Incorrect access check for default argument
@ 2005-01-04 19:38 austern at apple dot com
2005-01-04 19:48 ` [Bug c++/19258] [3.4/4.0 Regression] " pinskia at gcc dot gnu dot org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: austern at apple dot com @ 2005-01-04 19:38 UTC (permalink / raw)
To: gcc-bugs
The following code
class X {
template<class T> friend int ff(T*, int y=anX.x) { return y; }
int f() { return ff(&anX); }
static X anX;
int x;
};
X dummy;
gives an error message with mainline:
foo.cc:6: error: 'int X::x' is private
foo.cc:3: error: within this context
That error message doesn't make sense. The only relevant contexts are that of X::f (in which x may be
accessed, since X has access to its own members) and that of ff (which has access because it is a friend
of X.) The analogous non-template case compiles correctlly.
This is a regression from 3.3.
--
Summary: Incorrect access check for default argument
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: austern at apple dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: powerpc-apple-darwin7.7.0
GCC host triplet: powerpc-apple-darwin7.7.0
GCC target triplet: powerpc-apple-darwin7.7.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19258
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19258] [3.4/4.0 Regression] Incorrect access check for default argument
2005-01-04 19:38 [Bug c++/19258] New: Incorrect access check for default argument austern at apple dot com
@ 2005-01-04 19:48 ` pinskia at gcc dot gnu dot org
2005-01-05 10:08 ` lerdsuwa at gcc dot gnu dot org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-04 19:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-04 19:48 -------
: Search converges between 2003-01-02-trunk (#161) and 2003-01-10-trunk (#162).
Note with 3.4.x, we get a different error message:
input.cc:2: error: `anX' was not declared in this scope
The error message changed betwen 20040709 and 20040712.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |rejects-valid
Last reconfirmed|0000-00-00 00:00:00 |2005-01-04 19:48:44
date| |
Summary|Incorrect access check for |[3.4/4.0 Regression]
|default argument |Incorrect access check for
| |default argument
Target Milestone|--- |3.4.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19258
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19258] [3.4/4.0 Regression] Incorrect access check for default argument
2005-01-04 19:38 [Bug c++/19258] New: Incorrect access check for default argument austern at apple dot com
2005-01-04 19:48 ` [Bug c++/19258] [3.4/4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2005-01-05 10:08 ` lerdsuwa at gcc dot gnu dot org
2005-01-05 14:16 ` lerdsuwa at gcc dot gnu dot org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2005-01-05 10:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From lerdsuwa at gcc dot gnu dot org 2005-01-05 10:05 -------
Got it
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |lerdsuwa at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2005-01-04 19:48:44 |2005-01-05 10:05:33
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19258
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19258] [3.4/4.0 Regression] Incorrect access check for default argument
2005-01-04 19:38 [Bug c++/19258] New: Incorrect access check for default argument austern at apple dot com
2005-01-04 19:48 ` [Bug c++/19258] [3.4/4.0 Regression] " pinskia at gcc dot gnu dot org
2005-01-05 10:08 ` lerdsuwa at gcc dot gnu dot org
@ 2005-01-05 14:16 ` lerdsuwa at gcc dot gnu dot org
2005-01-06 15:42 ` cvs-commit at gcc dot gnu dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2005-01-05 14:16 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From lerdsuwa at gcc dot gnu dot org 2005-01-05 14:15 -------
Patch for mainline submitted:
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00271.html
For 3.4 branch, the parser is still broken with respect to default
argument parsing in such friend declaration. Some more work is
required there.
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19258
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19258] [3.4/4.0 Regression] Incorrect access check for default argument
2005-01-04 19:38 [Bug c++/19258] New: Incorrect access check for default argument austern at apple dot com
` (2 preceding siblings ...)
2005-01-05 14:16 ` lerdsuwa at gcc dot gnu dot org
@ 2005-01-06 15:42 ` cvs-commit at gcc dot gnu dot org
2005-01-06 15:46 ` [Bug c++/19258] [3.4 " lerdsuwa at gcc dot gnu dot org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-06 15:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-01-06 15:41 -------
Subject: Bug 19258
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: lerdsuwa@gcc.gnu.org 2005-01-06 15:41:34
Modified files:
gcc/cp : ChangeLog pt.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/lookup: friend6.C
Log message:
PR c++/19258
* pt.c (push_access_scope): Handle friend defined in class.
(pop_access_scope): Likewise.
* g++.dg/lookup/friend6.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4569&r2=1.4570
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.964&r2=1.965
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4854&r2=1.4855
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/friend6.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19258
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19258] [3.4 Regression] Incorrect access check for default argument
2005-01-04 19:38 [Bug c++/19258] New: Incorrect access check for default argument austern at apple dot com
` (3 preceding siblings ...)
2005-01-06 15:42 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-06 15:46 ` lerdsuwa at gcc dot gnu dot org
2005-01-18 14:43 ` lerdsuwa at gcc dot gnu dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2005-01-06 15:46 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From lerdsuwa at gcc dot gnu dot org 2005-01-06 15:46 -------
Fixed in the mainline.
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords|patch |
Summary|[3.4/4.0 Regression] |[3.4 Regression] Incorrect
|Incorrect access check for |access check for default
|default argument |argument
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19258
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19258] [3.4 Regression] Incorrect access check for default argument
2005-01-04 19:38 [Bug c++/19258] New: Incorrect access check for default argument austern at apple dot com
` (4 preceding siblings ...)
2005-01-06 15:46 ` [Bug c++/19258] [3.4 " lerdsuwa at gcc dot gnu dot org
@ 2005-01-18 14:43 ` lerdsuwa at gcc dot gnu dot org
2005-01-19 14:47 ` cvs-commit at gcc dot gnu dot org
2005-01-19 14:47 ` lerdsuwa at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2005-01-18 14:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From lerdsuwa at gcc dot gnu dot org 2005-01-18 14:40 -------
Patch for 3.4 here:
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01120.html
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19258
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19258] [3.4 Regression] Incorrect access check for default argument
2005-01-04 19:38 [Bug c++/19258] New: Incorrect access check for default argument austern at apple dot com
` (5 preceding siblings ...)
2005-01-18 14:43 ` lerdsuwa at gcc dot gnu dot org
@ 2005-01-19 14:47 ` cvs-commit at gcc dot gnu dot org
2005-01-19 14:47 ` lerdsuwa at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-19 14:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-01-19 14:46 -------
Subject: Bug 19258
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_4-branch
Changes by: lerdsuwa@gcc.gnu.org 2005-01-19 14:46:35
Modified files:
gcc/cp : ChangeLog parser.c pt.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/lookup: friend6.C
Log message:
PR c++/19258
* parser.c (cp_parser_late_parsing_default_args): Handle friend
defined in class.
* pt.c (push_access_scope, pop_access_scope): Likewise.
* g++.dg/lookup/friend6.C: New test.
Patches:
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.190&r2=1.3892.2.191
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.48&r2=1.157.2.49
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.48&r2=1.816.2.49
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.348&r2=1.3389.2.349
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/friend6.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.10.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19258
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19258] [3.4 Regression] Incorrect access check for default argument
2005-01-04 19:38 [Bug c++/19258] New: Incorrect access check for default argument austern at apple dot com
` (6 preceding siblings ...)
2005-01-19 14:47 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-19 14:47 ` lerdsuwa at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2005-01-19 14:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From lerdsuwa at gcc dot gnu dot org 2005-01-19 14:47 -------
Fixed in 3.4 branch.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19258
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-01-19 14:47 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-04 19:38 [Bug c++/19258] New: Incorrect access check for default argument austern at apple dot com
2005-01-04 19:48 ` [Bug c++/19258] [3.4/4.0 Regression] " pinskia at gcc dot gnu dot org
2005-01-05 10:08 ` lerdsuwa at gcc dot gnu dot org
2005-01-05 14:16 ` lerdsuwa at gcc dot gnu dot org
2005-01-06 15:42 ` cvs-commit at gcc dot gnu dot org
2005-01-06 15:46 ` [Bug c++/19258] [3.4 " lerdsuwa at gcc dot gnu dot org
2005-01-18 14:43 ` lerdsuwa at gcc dot gnu dot org
2005-01-19 14:47 ` cvs-commit at gcc dot gnu dot org
2005-01-19 14:47 ` lerdsuwa 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).