id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 9139,attribute_value_set.cpp fails to build correctly in Sun Studio 12.3,Brian Vandenberg ,Andrey Semashev,"When building '''boost::log''', I'm getting the following error: {{{ ""libs/log/src/attribute_value_set.cpp"", line 213: Error: m_pImpl is not accessible from static boost::log::v2_mt_posix::attribute_value_set::implementation::create( boost::rv&, const boost::log::v2_mt_posix::attribute_set&, const boost::log::v2_mt_posix::attribute_set&, unsigned ). }}} The same error happens on line 214 as well. Here's the code in question: {{{ /* ... */ static implementation* create( BOOST_RV_REF(attribute_value_set) source_attrs, attribute_set const& thread_attrs, attribute_set consyt& global_attrs, size_type reserve_count) { -> implementation* p = source_attrs.m_pImpl; -> source_attrs.m_pImpl = NULL; p->m_pThreadAttributes = thread_attrs.m_pImpl; p->m_pGlobalAttributes = global_attrs.m_pImpl; return p; } }}} In '''boost/log/attributes/attribute_value_set.hpp''', on or about line 97, the private struct '''implementation''' is pre-declared but is not marked as a friend. In the body for '''attribute_value_set::implementation::create( ::boost::rv&, /* ... */ )''' (on or about line 208 in '''attribute_value_set.cpp'''), the compiler complains that '''m_pImpl''' is not accessible. This is not reproducible on gcc (3.4.6 and 4.4.6) or clang. If the header for '''attribute_value_set''' is modified to make '''implementation''' a friend class, the problem goes away. The following is a piece of example code that exemplifies the problematic idiom; again, this [so far] is only reproducible in Sun Studio: {{{ // represents 'boost::rv' template class A : public T { }; // represents 'class attribute_value_set' class B { // represents 'struct implementation' struct BS { static void blah( A&b, int y ) { b.x = y; } }; int x; public: B() : x(0) {} void stuff( int y ) { BS::blah( *this, y ); } operator A& () { return *static_cast< A* >( this ); } }; int main( int argc, char *argv[] ) { B b; b.stuff( 3 ); return 0; } }}}",Bugs,closed,To Be Determined,log,Boost 1.54.0,Problem,fixed,,phantall+boost@…