public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/4248: reinterpret_cast in template
@ 2001-09-07 21:50 rodrigc
  0 siblings, 0 replies; 3+ messages in thread
From: rodrigc @ 2001-09-07 21:50 UTC (permalink / raw)
  To: Volker.Denkhaus, gcc-bugs, gcc-prs, nobody, rodrigc

Synopsis: reinterpret_cast in template

State-Changed-From-To: open->feedback
State-Changed-By: rodrigc
State-Changed-When: Fri Sep  7 21:50:20 2001
State-Changed-Why:
    Your testcase is a bit too short.  Can you provide
    a fuller, compilable testcase which demonstrates your
    problem?
    
    Thanks.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4248&database=gcc


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

* Re: c++/4248: reinterpret_cast in template
@ 2001-09-17  5:46 nathan
  0 siblings, 0 replies; 3+ messages in thread
From: nathan @ 2001-09-17  5:46 UTC (permalink / raw)
  To: Volker.Denkhaus, gcc-bugs, gcc-prs, nobody, rodrigc

Synopsis: reinterpret_cast in template

State-Changed-From-To: feedback->closed
State-Changed-By: nathan
State-Changed-When: Mon Sep 17 05:46:49 2001
State-Changed-Why:
    confirmed as user error

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4248&database=gcc


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

* c++/4248: reinterpret_cast in template
@ 2001-09-06  7:26 Volker.Denkhaus
  0 siblings, 0 replies; 3+ messages in thread
From: Volker.Denkhaus @ 2001-09-06  7:26 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4248
>Category:       c++
>Synopsis:       reinterpret_cast in template
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 06 07:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Volker Denkhaus
>Release:        gcc 2.95.3
>Organization:
>Environment:
Suse 7.1 DCOM
>Description:
Hi,
I have a problem with a method call after a reinterpret_cats in a template class.

This is the code:
template <class Base>
class CComTearOffObject : public Base
{
public:
 CComTearOffObject(void* pv)
        {
                ATLASSERT(m_pOwner == NULL);
                this->m_pOwner = reinterpret_cast<CComObject<typename Base::_OwnerClass>*>(p
v);
                this->m_pOwner->AddRef();
        }

The AddRef call ends up in a segmentation fault. In the debugger I can see that the address of the function AddRef which can be found in the vtable is calculated wrong.

Has anyone ever had a similar problem? Or is something wrong with the cast?

Volker Denkhaus
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2001-09-17  5:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-07 21:50 c++/4248: reinterpret_cast in template rodrigc
  -- strict thread matches above, loose matches on Subject: below --
2001-09-17  5:46 nathan
2001-09-06  7:26 Volker.Denkhaus

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