public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness.
[not found] <20010307052600.2204.gdr@codesourcery.com>
@ 2003-06-15 18:03 ` pinskia@physics.uc.edu
2004-02-09 4:37 ` giovannibajo at libero dot it
` (9 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: pinskia@physics.uc.edu @ 2003-06-15 18:03 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2204
pinskia@physics.uc.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2003-05-05 00:00:00 |2003-06-15 18:03:27
date| |
------- Additional Comments From pinskia@physics.uc.edu 2003-06-15 18:03 -------
Still happens on the mainline (20030615).
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness.
[not found] <20010307052600.2204.gdr@codesourcery.com>
2003-06-15 18:03 ` [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness pinskia@physics.uc.edu
@ 2004-02-09 4:37 ` giovannibajo at libero dot it
2004-02-09 5:03 ` gdr at integrable-solutions dot net
` (8 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-09 4:37 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-02-09 04:37 -------
The problem is that we currently check for abstractness of parameter types in
gorkparms, which is way too early for the current class. Putting it into
start_function is a stop-gap, but 10.4/3 says that *declarations* are ill-
formed, there is no need for a definition.
I tried another approacch, which is doing the check in finish_struct_1, after
CLASSTYPE_PURE_VIRTUALS has been properly calculated. But this does not cure
testcases like:
---------------------------------
struct X;
struct Y {
void g(X x);
};
struct X : Y {
virtual void xfunc(void) = 0;
};
---------------------------------
which should be rejected as well. Also, abstract_virtual_errors should be
enhanced to go through array types, because the following is accepted:
---------------------------------
struct X {
virtual void xfunc(void) = 0;
};
void g(X x[2]);
---------------------------------
There is some code to properly strip array/pointer types within cp_finish_decl
(strip_array_types is too weak and won't work in the general case, see
g++.dg/other/abstract1.C).
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |giovannibajo at libero dot
| |it
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2204
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness.
[not found] <20010307052600.2204.gdr@codesourcery.com>
2003-06-15 18:03 ` [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness pinskia@physics.uc.edu
2004-02-09 4:37 ` giovannibajo at libero dot it
@ 2004-02-09 5:03 ` gdr at integrable-solutions dot net
2004-02-09 16:39 ` giovannibajo at libero dot it
` (7 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-02-09 5:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at integrable-solutions dot net 2004-02-09 05:03 -------
Subject: Re: G++ doesn't check (member) function parameter for abstract-ness.
"giovannibajo at libero dot it" <gcc-bugzilla@gcc.gnu.org> writes:
| The problem is that we currently check for abstractness of parameter types in
| gorkparms, which is way too early for the current class. Putting it into
| start_function is a stop-gap, but 10.4/3 says that *declarations* are ill-
| formed, there is no need for a definition.
|
| I tried another approacch, which is doing the check in finish_struct_1, after
| CLASSTYPE_PURE_VIRTUALS has been properly calculated. But this does not cure
| testcases like:
If I recall correctly, Jason suggested we put those things onto a list
that we walk latter, either after class-scope completed or
instantiation time. I don't have a reference to Jason's message but
it should be reachable through Google.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2204
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness.
[not found] <20010307052600.2204.gdr@codesourcery.com>
` (2 preceding siblings ...)
2004-02-09 5:03 ` gdr at integrable-solutions dot net
@ 2004-02-09 16:39 ` giovannibajo at libero dot it
2004-02-09 16:39 ` giovannibajo at libero dot it
` (6 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-09 16:39 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-02-09 16:39 -------
Subject: Re: G++ doesn't check (member) function parameter for abstract-ness.
gdr at integrable-solutions dot net wrote:
> If I recall correctly, Jason suggested we put those things onto a list
> that we walk latter, either after class-scope completed or
> instantiation time. I don't have a reference to Jason's message but
> it should be reachable through Google.
We could put those into incomplete_vars. I'll give it a try.
Giovanni Bajo
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2204
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness.
[not found] <20010307052600.2204.gdr@codesourcery.com>
` (3 preceding siblings ...)
2004-02-09 16:39 ` giovannibajo at libero dot it
@ 2004-02-09 16:39 ` giovannibajo at libero dot it
2004-02-10 0:42 ` giovannibajo at libero dot it
` (5 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-09 16:39 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |giovannibajo at libero dot
|dot org |it
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2204
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness.
[not found] <20010307052600.2204.gdr@codesourcery.com>
` (4 preceding siblings ...)
2004-02-09 16:39 ` giovannibajo at libero dot it
@ 2004-02-10 0:42 ` giovannibajo at libero dot it
2004-02-14 12:10 ` giovannibajo at libero dot it
` (4 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-10 0:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-02-10 00:42 -------
A first partial patch is available here:
http://gcc.gnu.org/ml/gcc-patches/2004-02/msg00873.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2204
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness.
[not found] <20010307052600.2204.gdr@codesourcery.com>
` (5 preceding siblings ...)
2004-02-10 0:42 ` giovannibajo at libero dot it
@ 2004-02-14 12:10 ` giovannibajo at libero dot it
2004-06-11 12:07 ` giovannibajo at libero dot it
` (3 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-14 12:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-02-14 12:10 -------
Updated patch here:
http://gcc.gnu.org/ml/gcc-patches/2004-02/msg00953.html
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2204
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness.
[not found] <20010307052600.2204.gdr@codesourcery.com>
` (6 preceding siblings ...)
2004-02-14 12:10 ` giovannibajo at libero dot it
@ 2004-06-11 12:07 ` giovannibajo at libero dot it
2004-07-12 10:07 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: giovannibajo at libero dot it @ 2004-06-11 12:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-06-11 12:07 -------
Updated patch, fix most cases:
http://gcc.gnu.org/ml/gcc-patches/2004-06/msg00732.html
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |2.95.3 3.0.4 3.3.3 3.4.0
| |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2204
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness.
[not found] <20010307052600.2204.gdr@codesourcery.com>
` (7 preceding siblings ...)
2004-06-11 12:07 ` giovannibajo at libero dot it
@ 2004-07-12 10:07 ` cvs-commit at gcc dot gnu dot org
2004-07-12 11:36 ` giovannibajo at libero dot it
2005-09-09 12:51 ` rguenth at gcc dot gnu dot org
10 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-07-12 10:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-07-12 10:07 -------
Subject: Bug 2204
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: giovannibajo@gcc.gnu.org 2004-07-12 10:07:30
Modified files:
gcc/cp : ChangeLog config-lang.in Make-lang.in cp-tree.h
typeck2.c decl.c class.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/other: abstract2.C
Log message:
PR c++/2204
* config-lang.in (gtfiles): Add typeck2.c.
* Make-lang.in: Tweak typeck2.c dependencies, and add rule for
gt-cp-typeck2.h.
* cp-tree.h: Declare complete_type_check_abstract.
* typeck2.c (pat_calc_hash, pat_compare,
complete_type_check_abstract): New functions.
(abstract_virtuals_error): If the type is abstract, register the
declaration within abstract_pending_vars for further checks.
Inspect also dependent types. Handle IDENTIFIER_NODEs as decl.
* decl.c (cp_finish_decl): Do not strip array types.
(create_array_type_for_decl): Check for abstractness of the element
type.
(complete_vars): Call complete_type_check_abstract.
* class.c (finish_struct): Prepare a list of virtual functions for
template types, and call complete_vars on it to check for abstractness.
PR c++/2204
* g++.dg/other/abstract2.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4188&r2=1.4189
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/config-lang.in.diff?cvsroot=gcc&r1=1.22&r2=1.23
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/Make-lang.in.diff?cvsroot=gcc&r1=1.187&r2=1.188
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.1001&r2=1.1002
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&r1=1.163&r2=1.164
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1242&r2=1.1243
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&r1=1.628&r2=1.629
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3988&r2=1.3989
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/abstract2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2204
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness.
[not found] <20010307052600.2204.gdr@codesourcery.com>
` (8 preceding siblings ...)
2004-07-12 10:07 ` cvs-commit at gcc dot gnu dot org
@ 2004-07-12 11:36 ` giovannibajo at libero dot it
2005-09-09 12:51 ` rguenth at gcc dot gnu dot org
10 siblings, 0 replies; 13+ messages in thread
From: giovannibajo at libero dot it @ 2004-07-12 11:36 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-07-12 11:36 -------
The patch was approved here:
http://gcc.gnu.org/ml/gcc-patches/2004-07/msg01188.html
There are a few other cases where we still fail to detect abstract types in the
declarations. I will update this bug shortly to reflect this.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2204
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness.
[not found] <20010307052600.2204.gdr@codesourcery.com>
` (9 preceding siblings ...)
2004-07-12 11:36 ` giovannibajo at libero dot it
@ 2005-09-09 12:51 ` rguenth at gcc dot gnu dot org
10 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-09-09 12:51 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at gcc dot gnu dot org 2005-09-09 12:51 -------
Still EDG accepts it, too ;)
So, what's with your update Giovanni? If there are no issues left we can close
this bug.
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|2.95.3 3.0.4 3.3.3 3.4.0 |2.95.3 3.0.4 3.3.3 3.4.0
| |3.4.4
Known to work| |4.0.0 4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2204
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness.
[not found] <bug-2204-17@http.gcc.gnu.org/bugzilla/>
2007-04-12 22:12 ` pedro dot lamarao at mndfck dot org
@ 2007-04-16 18:02 ` bangerth at dealii dot org
1 sibling, 0 replies; 13+ messages in thread
From: bangerth at dealii dot org @ 2007-04-16 18:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from bangerth at dealii dot org 2007-04-16 19:02 -------
True. This has been fixed since 4.0.x.
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.0.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2204
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness.
[not found] <bug-2204-17@http.gcc.gnu.org/bugzilla/>
@ 2007-04-12 22:12 ` pedro dot lamarao at mndfck dot org
2007-04-16 18:02 ` bangerth at dealii dot org
1 sibling, 0 replies; 13+ messages in thread
From: pedro dot lamarao at mndfck dot org @ 2007-04-12 22:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from pedro dot lamarao at mndfck dot org 2007-04-12 23:12 -------
This bug is not reproducible with current mainline.
I suspect it was closed years ago and should be closed by now.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2204
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2007-04-16 18:02 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20010307052600.2204.gdr@codesourcery.com>
2003-06-15 18:03 ` [Bug c++/2204] G++ doesn't check (member) function parameter for abstract-ness pinskia@physics.uc.edu
2004-02-09 4:37 ` giovannibajo at libero dot it
2004-02-09 5:03 ` gdr at integrable-solutions dot net
2004-02-09 16:39 ` giovannibajo at libero dot it
2004-02-09 16:39 ` giovannibajo at libero dot it
2004-02-10 0:42 ` giovannibajo at libero dot it
2004-02-14 12:10 ` giovannibajo at libero dot it
2004-06-11 12:07 ` giovannibajo at libero dot it
2004-07-12 10:07 ` cvs-commit at gcc dot gnu dot org
2004-07-12 11:36 ` giovannibajo at libero dot it
2005-09-09 12:51 ` rguenth at gcc dot gnu dot org
[not found] <bug-2204-17@http.gcc.gnu.org/bugzilla/>
2007-04-12 22:12 ` pedro dot lamarao at mndfck dot org
2007-04-16 18:02 ` bangerth at dealii 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).