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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.06.06 09:53:32
      Known to work|                            |4.5.2
            Summary|c++0x regression: sorry,    |[4.6/4.7 Regression]
                   |unimplemented: unexpected   |[C++0x]  sorry,
                   |ast of kind field_decl      |unimplemented: unexpected
                   |                            |ast of kind field_decl
     Ever Confirmed|0                           |1
      Known to fail|                            |4.6.0, 4.7.0

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-06-06 
09:53:32 UTC ---
reduced:


namespace detail {

template<class Parent, class Member>
inline unsigned offset_from_pointer_to_member(const Member Parent::*
ptr_to_member)
{
   const Parent * const parent = 0;
   const char *const member = reinterpret_cast<const
char*>(&(parent->*ptr_to_member));
   return unsigned(member - reinterpret_cast<const char*>(parent));
}

template<class Parent, class Member>
inline Parent *parent_from_member(Member *member, const Member Parent::*
ptr_to_member)
{
   return (Parent*)((char*)member -
      offset_from_pointer_to_member(ptr_to_member));
}

template<class Parent, class Member>
inline const Parent *parent_from_member(const Member *member, const Member
Parent::* ptr_to_member)
{
   return (const Parent*)((const char*)member -
      offset_from_pointer_to_member(ptr_to_member));
}

}


template<class Config>
class list_impl
{
   struct data_t
   {
   } data_;

   data_t* get();

   static void priv_container_from_end_iterator()
   {
      data_t *d = get();
      (void)detail::parent_from_member<list_impl, data_t>(d,
&list_impl::data_);
   }

};


interface.cc: In static member function 'static void
list_impl<Config>::priv_container_from_end_iterator()':
interface.cc:40:80: sorry, unimplemented: unexpected ast of kind field_decl
interface.cc:40:80: internal compiler error: in
potential_constant_expression_1, at cp/semantics.c:7952

Reply via email to