[Boost-bugs] [Boost C++ Libraries] #6182: lexical_cast: invalid application of 'sizeof' to incomplete type 'removed_ptr_t'

Subject: [Boost-bugs] [Boost C++ Libraries] #6182: lexical_cast: invalid application of 'sizeof' to incomplete type 'removed_ptr_t'
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-11-29 00:49:45


#6182: lexical_cast: invalid application of 'sizeof' to incomplete type
'removed_ptr_t'
---------------------------------+------------------------------------------
 Reporter: pmachata@… | Owner: nasonov
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: lexical_cast
  Version: Boost 1.48.0 | Severity: Regression
 Keywords: |
---------------------------------+------------------------------------------
 This is triggered by use of incomplete types, as in the following code:

 {{{
 #include <boost/lexical_cast.hpp>
 #include <iostream>
 struct ble;
 typedef struct ble *meh;
 std::ostream &
 operator <<(std::ostream &o, meh m) {
   o << "yay";
 }
 int main(int argc, char *argv[]) {
   meh heh;
   std::cout << boost::lexical_cast<std::string>(heh) << std::endl;
 }
 }}}

 This used to work as expected with boost 1.46.1. With boost 1.48.0, the
 compilation fails with the following message:

 {{{
 In file included from x.cc:1:0:
 /usr/include/boost/lexical_cast.hpp: In static member function 'static
 Target boost::detail::lexical_cast_do_cast<Target,
 Source>::lexical_cast_impl(const Source&) [with Target =
 std::basic_string<char>, Source = ble*]':
 /usr/include/boost/lexical_cast.hpp:1916:50: instantiated from 'Target
 boost::lexical_cast(const Source&) [with Target = std::basic_string<char>,
 Source = ble*]'
 x.cc:16:52: instantiated from here
 /usr/include/boost/lexical_cast.hpp:1742:25: error: invalid application of
 'sizeof' to incomplete type 'removed_ptr_t {aka ble}'
 }}}

 The compiler used is GCC 4.6.1, and I imagine that others would be
 impacted, too.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6182>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC