This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/47942] Not possible to initialize a shared_ptr with a class defined in function scope, inheriting from a global scope base class


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47942

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-01 13:37:25 UTC ---
1) GCC 4.1.2 is ancient and unmaintained
2) your example code doesn't compile (should #include <tr1/memory>)
3) in C++03 you cannot use a type without linkage as a template argument
4) You should not use reinterpret_cast, static_cast is correct


Your options are either to use C++0x mode (classes without linkage can be used
as template arguments in C++0x) or to upcast the pointer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]