[Boost-bugs] [Boost C++ Libraries] #2289: Problem with BOOST_AUTO and this keyword on VC8/9

Subject: [Boost-bugs] [Boost C++ Libraries] #2289: Problem with BOOST_AUTO and this keyword on VC8/9
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-09-05 10:57:15


#2289: Problem with BOOST_AUTO and this keyword on VC8/9
---------------------------------------------------------+------------------
 Reporter: Richard Webb <Richard.Webb_at_[hidden]> | Owner: burbelgruff
     Type: Bugs | Status: new
Milestone: Boost 1.37.0 | Component: typeof
  Version: Boost 1.36.0 | Severity: Problem
 Keywords: |
---------------------------------------------------------+------------------
 On both VC8SP1 and VC9SP1, the code

 {{{
 struct foo
 {
         int i;

         foo::foo()
         {
                 BOOST_AUTO(j, this->i);
         }
 };
 }}}


 results in the compiler error

 {{{

 error C2355: 'this' : can only be referenced inside non-static member
 functions
 error C2227: left of '->i' must point to class/struct/union/generic type

 error C2955: 'boost::type_of::msvc_typeid_wrapper' : use of class template
 requires template argument list
         e:\boostsvn\boost\typeof\msvc\typeof_impl.hpp(209) : see
 declaration of 'boost::type_of::msvc_typeid_wrapper'
 }}}

 In both cases, changing it to simply BOOST_AUTO(j, i); allows it to
 compile.

 The foreach lib used to have a similar problem (Ticket #1652), possibly
 down to the same compiler bug?

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2289>
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:49:58 UTC