public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/2567: gcc: incorrect calling of template class destructor produces internal error
@ 2002-10-30 18:20 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2002-10-30 18:20 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, guido, nobody

Synopsis: gcc: incorrect calling of template class destructor produces internal error

State-Changed-From-To: analyzed->closed
State-Changed-By: bangerth
State-Changed-When: Wed Oct 30 18:20:43 2002
State-Changed-Why:
    Branch and CVS give
    tmp/g> /home/bangerth/bin/gcc-3.2.1-pre/bin/c++ x.cc
    x.cc: In function `void freeclass(class_1*)':
    x.cc:20: destructor name `~template<class Type> class class_2' does not match
       type `class_1' of expression

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=2567


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c++/2567: gcc: incorrect calling of template class destructor produces internal error
@ 2001-04-17  1:56 guido
  0 siblings, 0 replies; 2+ messages in thread
From: guido @ 2001-04-17  1:56 UTC (permalink / raw)
  To: gcc-gnats

>Number:         2567
>Category:       c++
>Synopsis:       gcc: incorrect calling of template class destructor produces internal error
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 17 01:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Guido Pieper
>Release:        gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
Linux Kernel 2.2.16 (SuSE Linux 7.0)
>Description:
"gcc -Wall x.cpp" prints this error message:

x.cpp: In function `void freeclass(class_1 *)':
x.cpp:20: Internal compiler error 980605.
x.cpp:20: Please submit a full bug report.
x.cpp:20: See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.

>How-To-Repeat:
#include <stdlib.h>

class class_1 {
  public:
    class_1(void) {};
    virtual ~class_1(void) {};
};

template<class Type> class class_2 {
  public:
    class_2(void) {};
    virtual ~class_2(void) {};
};

void freeclass(class_1 *p)
{
  if (p) {
  
    // Internal compiler error 980605:
    p->~class_2();

    // correct:
    // p->~class_1();

    // correct error message:
    // p->~class_2<int>();

    free(p);
  }
}

int main(void)
{
  class_1 v1;
  class_2<int> v2;
  // same error:
  // v1.~class_2();
  return(0);
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="x.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="x.cpp"

I2luY2x1ZGUgPHN0ZGxpYi5oPgoKY2xhc3MgY2xhc3NfMSB7CiAgcHVibGljOgogICAgY2xhc3Nf
MSh2b2lkKSB7fTsKICAgIHZpcnR1YWwgfmNsYXNzXzEodm9pZCkge307Cn07Cgp0ZW1wbGF0ZTxj
bGFzcyBUeXBlPiBjbGFzcyBjbGFzc18yIHsKICBwdWJsaWM6CiAgICBjbGFzc18yKHZvaWQpIHt9
OwogICAgdmlydHVhbCB+Y2xhc3NfMih2b2lkKSB7fTsKfTsKCnZvaWQgZnJlZWNsYXNzKGNsYXNz
XzEgKnApCnsKICBpZiAocCkgewogIAogICAgLy8gSW50ZXJuYWwgY29tcGlsZXIgZXJyb3IgOTgw
NjA1OgogICAgcC0+fmNsYXNzXzIoKTsKCiAgICAvLyBjb3JyZWN0OgogICAgLy8gcC0+fmNsYXNz
XzEoKTsKCiAgICAvLyBjb3JyZWN0IGVycm9yIG1lc3NhZ2U6CiAgICAvLyBwLT5+Y2xhc3NfMjxp
bnQ+KCk7CgogICAgZnJlZShwKTsKICB9Cn0KCmludCBtYWluKHZvaWQpCnsKICBjbGFzc18xIHYx
OwogIGNsYXNzXzI8aW50PiB2MjsKICAvLyBzYW1lIGVycm9yOgogIC8vIHYxLn5jbGFzc18yKCk7
CiAgcmV0dXJuKDApOwp9Cg==


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-31  2:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-30 18:20 c++/2567: gcc: incorrect calling of template class destructor produces internal error bangerth
  -- strict thread matches above, loose matches on Subject: below --
2001-04-17  1:56 guido

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).