Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jul 2015 10:40:53 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-standards@FreeBSD.org
Subject:   [Bug 201784] [libcxxrt] C++ dynamic_cast does not recognize same types across dynamically loaded modules when downcasting
Message-ID:  <bug-201784-15@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201784

            Bug ID: 201784
           Summary: [libcxxrt] C++ dynamic_cast does not recognize same
                    types across dynamically loaded modules when
                    downcasting
           Product: Base System
           Version: 10.2-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: standards
          Assignee: freebsd-standards@FreeBSD.org
          Reporter: saper@saper.info

Created attachment 159107
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=159107&action=edit
dynamic_cast testcase (shell archive)

dynamic_cast returns 0 when the (apparently same) type is known in the
different runtime modules.

The attached test (just run "make all run" with BSD make or bmake on Linux)
returns:

Parent::something() = 1
Child::something() = 2
library dynamic_cast<Child *>(Parent *) = 0x0
library dynamic_cast<Child *>(Child *) = 0x0
local dynamic_cast<Child *>(Parent *) = 0x0
local dynamic_cast<Child *>(Child *) = 0x7fffffffe580

When using libstdc++.so.6 from gcc48 or newer:

Parent::something() = 1
Child::something() = 2
library dynamic_cast<Child *>(Parent *) = (nil)
library dynamic_cast<Child *>(Child *) = 0x7fffaea254c0
local dynamic_cast<Child *>(Parent *) = (nil)
local dynamic_cast<Child *>(Child *) = 0x7fffaea254c0

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-201784-15>