Re: [Boost-bugs] [Boost C++ Libraries] #5487: Trying to get<nullptr_t> from a variant results in error with vs10

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5487: Trying to get<nullptr_t> from a variant results in error with vs10
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-12-10 15:45:19


#5487: Trying to get<nullptr_t> from a variant results in error with vs10
-------------------------------+-----------------------------------------
  Reporter: dd0t@… | Owner: no-maintainer
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: utility
   Version: Boost 1.46.1 | Severity: Problem
Resolution: | Keywords: nullptr_t variant addressof
-------------------------------+-----------------------------------------
Changes (by apolukhin):

 * cc: antoshkka@… (added)
 * owner: ebf => no-maintainer
 * component: variant => utility

Comment:

 Even a simpler example:
 {{{
 #include <boost/utility/addressof.hpp>

 int main() {
     auto p = nullptr;
     boost::addressof(p);
 }
 }}}

 Code above results gives the same error on MSVC11:

 {{{
 F:\boost_1_55_0\boost/utility/addressof.hpp(59): error C2666:
 'boost::detail::addressof_impl<T>::f' : 2 overloads have similar
 conversions
 1> with
 1> [
 1> T=nullptr
 1> ]
 1> F:\boost_1_55_0\boost/utility/addressof.hpp(43): could be
 'nullptr *boost::detail::addressof_impl<T>::f(T *,int)'
 1> with
 1> [
 1> T=nullptr
 1> ]
 1> F:\boost_1_55_0\boost/utility/addressof.hpp(37): or
 'nullptr *boost::detail::addressof_impl<T>::f(T &,long)'
 1> with
 1> [
 1> T=nullptr
 1> ]
 1> while trying to match the argument list
 '(boost::detail::addr_impl_ref<T>, int)'
 1> with
 1> [
 1> T=nullptr
 1> ]
 1> main.cpp(5) : see reference to function template instantiation
 'T *boost::addressof<nullptr>(T &)' being compiled
 1> with
 1> [
 1> T=nullptr
 1> ]
 }}}

 While GCC compiles successfully.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5487#comment:1>
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:15 UTC