public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14768] New: Bad diagnostics for call to dtor without object.
@ 2004-03-29 10:33 dannysmith at users dot sourceforge dot net
2004-03-29 12:08 ` [Bug c++/14768] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: dannysmith at users dot sourceforge dot net @ 2004-03-29 10:33 UTC (permalink / raw)
To: gcc-bugs
The following code:
// dtor.cc
struct Base
{
~Base () { }
};
template <class C>
struct Derived: public Base
{
~Derived ()
{
Base::~Base();
}
};
int main()
{
Derived<int> A;
return 0;
}
seqfaults on 3.3.3 with:
D:\simple>g++-3.3.3 dtor.cc
dtor.cc: In destructor `Derived<C>::~Derived() [with C = int]':
dtor.cc:18: instantiated from here
dtor.cc:2: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.mingw.org/bugs.shtml> for instructions.
On 3.4.0, no segfault. I get this diagnostic instead:
D:\simple>g++-3.4.0 dtor.cc
dtor.cc: In destructor `Derived<C>::~Derived()':
dtor.cc:11: error: too few arguments to function
dtor.cc: In destructor `Derived<C>::~Derived() [with C = int]':
dtor.cc:18: instantiated from here
dtor.cc:11: error: no matching function for call to `Derived<int>::Base()'
dtor.cc:3: note: candidates are: Base::~Base()
Better, but not as good as 2.95.3 which told me this:
D:\simple>g++-2 dtor.cc
dtor.cc: In method `Derived<int>::~Derived()':
dtor.cc:18: instantiated from here
dtor.cc:11: cannot call destructor `Base::~Base' without object
Danny
--
Summary: Bad diagnostics for call to dtor without object.
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dannysmith at users dot sourceforge dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-pc-mingw32
GCC host triplet: i386-pc-mingw32
GCC target triplet: i386-pc-mingw32
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14768
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/14768] Bad diagnostics for call to dtor without object.
2004-03-29 10:33 [Bug c++/14768] New: Bad diagnostics for call to dtor without object dannysmith at users dot sourceforge dot net
@ 2004-03-29 12:08 ` pinskia at gcc dot gnu dot org
2004-03-29 14:25 ` bangerth at dealii dot org
2004-03-30 1:06 ` giovannibajo at libero dot it
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-29 12:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-03-29 12:08 -------
I think this is a dup of bug 12333 because I think this is valid code and should not be rejected at all.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14768
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/14768] Bad diagnostics for call to dtor without object.
2004-03-29 10:33 [Bug c++/14768] New: Bad diagnostics for call to dtor without object dannysmith at users dot sourceforge dot net
2004-03-29 12:08 ` [Bug c++/14768] " pinskia at gcc dot gnu dot org
@ 2004-03-29 14:25 ` bangerth at dealii dot org
2004-03-30 1:06 ` giovannibajo at libero dot it
2 siblings, 0 replies; 4+ messages in thread
From: bangerth at dealii dot org @ 2004-03-29 14:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-03-29 14:25 -------
Indeed.
*** This bug has been marked as a duplicate of 12333 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14768
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/14768] Bad diagnostics for call to dtor without object.
2004-03-29 10:33 [Bug c++/14768] New: Bad diagnostics for call to dtor without object dannysmith at users dot sourceforge dot net
2004-03-29 12:08 ` [Bug c++/14768] " pinskia at gcc dot gnu dot org
2004-03-29 14:25 ` bangerth at dealii dot org
@ 2004-03-30 1:06 ` giovannibajo at libero dot it
2 siblings, 0 replies; 4+ messages in thread
From: giovannibajo at libero dot it @ 2004-03-30 1:06 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-03-30 01:06 -------
To clarify, it's legal code because of DR 272 which was approved with WP
status. This makes it illegale in pure C++-98 but legal under C++-0x. Right now
GCC is striving for C++-0x compatibility, but we will eventually have two
different dialects (-std=c++0x or something).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14768
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-03-30 1:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-29 10:33 [Bug c++/14768] New: Bad diagnostics for call to dtor without object dannysmith at users dot sourceforge dot net
2004-03-29 12:08 ` [Bug c++/14768] " pinskia at gcc dot gnu dot org
2004-03-29 14:25 ` bangerth at dealii dot org
2004-03-30 1:06 ` giovannibajo at libero dot it
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).