Opened 8 years ago
Closed 8 years ago
#10882 closed Bugs (fixed)
error C2668: 'boost::swap' : ambiguous call to overloaded function (MSVC)
Reported by: | Owned by: | Antony Polukhin | |
---|---|---|---|
Milestone: | Boost 1.58.0 | Component: | variant |
Version: | Boost 1.56.0 | Severity: | Problem |
Keywords: | compile error | Cc: |
Description
The attached source file does not compile with a specific version of MSVC compiler. It complains about 'boost::swap' ambiguous call to overloaded function, which could be void boost::swap or void boost::detail::variant::move_swap_fallback::swap. Compiler output and compiler version output attached.
Attachments (5)
Change History (12)
by , 8 years ago
Attachment: | boost_variant_bug.cpp added |
---|
by , 8 years ago
Attachment: | compiler_output added |
---|
by , 8 years ago
Attachment: | compiler_version added |
---|
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Milestone: | To Be Determined → Boost 1.58.0 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 8 years ago
Fixed in develop branch. tests added in this commit. Will be merged to the master branch soon.
follow-up: 5 comment:4 by , 8 years ago
Since which Boost version this issue is present? At least 1.56, but what about earlier versions (like 1.55)?
And does this ambiguous call resolution cause a risk on other compilers (like gcc)? Does it work by luck on gcc? Is this luck stable? Or is there a risk that under some more complicated scenario the issue could happen on gcc too (without the fix)?
follow-up: 6 comment:5 by , 8 years ago
Replying to Thomas Riccardi <riccardi@…>:
Since which Boost version this issue is present? At least 1.56, but what about earlier versions (like 1.55)?
Looks like this issue exists from the very beginning of the Varinat library.
And does this ambiguous call resolution cause a risk on other compilers (like gcc)?
Yes
Does it work by luck on gcc? Is this luck stable? Or is there a risk that under some more complicated scenario the issue could happen on gcc too (without the fix)?
Issue happen if a class located in boost::
namespace is being swapped and boost/swap.hpp
is included. Anyway, it's a compile-time error, so you'll definitely know if you are hit by this issue.
by , 8 years ago
fix backported on boost 1.57.0
by , 8 years ago
fix backported on boost 1.55.0
comment:6 by , 8 years ago
Replying to apolukhin:
Replying to Thomas Riccardi <riccardi@…>:
Since which Boost version this issue is present? At least 1.56, but what about earlier versions (like 1.55)?
Looks like this issue exists from the very beginning of the Varinat library.
And does this ambiguous call resolution cause a risk on other compilers (like gcc)?
Yes
Does it work by luck on gcc? Is this luck stable? Or is there a risk that under some more complicated scenario the issue could happen on gcc too (without the fix)?
Issue happen if a class located in
boost::
namespace is being swapped andboost/swap.hpp
is included. Anyway, it's a compile-time error, so you'll definitely know if you are hit by this issue.
Thank you for all your precise answers.
I added to this ticket 2 patches that backport the fix for this issue on boost 1.55.0 and 1.57.0.
comment:7 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Possibly related to: https://svn.boost.org/trac/boost/ticket/2839