Re: [Boost-bugs] [Boost C++ Libraries] #8813: compiler errors with gcc in c++11 mode

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8813: compiler errors with gcc in c++11 mode
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-07-17 15:41:57


#8813: compiler errors with gcc in c++11 mode
--------------------------------+-----------------------
  Reporter: oleg.alexandrov@… | Owner: pdimov
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: smart_ptr
   Version: Boost 1.54.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------+-----------------------

Comment (by oleg.alexandrov@…):

 I had more time to study this in more detail. The problem is real, but
 apparently it is also compiler version dependent. Here's the exact way to
 reproduce it. It shows up with gcc 4.7.0 but it does not show up with gcc
 4.4.4.

 #include <boost/shared_array.hpp>

 template <class T>
 class MyClass{
   boost::shared_array<T> m_data;

   typedef typename boost::shared_array<T>::unspecified_bool_type
 unspecified_bool_type;
   operator unspecified_bool_type() const {
     return m_data;
   }
 public:
   int get(){ return 2; }
 };

 int main(){

   MyClass<int> M;
   std::cout << "value is " << M.get() << std::endl;
   return 0;
 }

 /shared/gcc/4.7.0/bin/g++ -c -std=gnu++0x -Iinclude/boost-1_54 bug.cc
 bug.cc: In instantiation of 'class MyClass<int>':
 bug.cc:20:16: required from here
 bug.cc:7:66: error: no type named 'unspecified_bool_type' in 'class
 boost::shared_array<int>'

 If I remove the -std=gnu++0x or switch to gcc 4.4.4 then it works.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8813#comment:4>
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:13 UTC