-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is_nothrow_copy_constructible fails for json::const_iterator on MSVC2015 x86 Debug build #1608
Comments
is_nothrow_copy_constructible
fails for json::const_iterator
on MSVC2015 x86 Debug build
Any idea how to proceed here? |
I don't have much experience in this matter but this could be similar to #1536, i.e. some symbol(s) is being added to |
I did some tweaking and it seems the issue can be fixed by adding the following copy constructor to template<typename BasicJsonType>
class iter_impl
{
...
// Adding this fixes the is_nothrow_copy_constructible error
iter_impl(const iter_impl<const BasicJsonType>& other) noexcept
: m_object(other.m_object), m_it(other.m_it) {}
/*!
@note The conventional copy constructor and copy assignment are implicitly
defined. Combined with the following converting constructor and
assignment, they support: (1) copy from iterator to iterator, (2)
copy from const iterator to const iterator, and (3) conversion from
iterator to const iterator. However conversion from const iterator
to iterator is not defined.
*/ Note the prior comment on the implicit copy constructor. There might be a bug in VS 2015 which doesn't generate the I'm by no means expert in template programming and C++ type system and I'm not sure I have done it correctly. And I haven't tested it thoroughly on the other compilers. Any feedback and thoughts on this are very welcomed. |
I've pushed the changes to see how this initial solution plays out. Meanwhile, about the notes where says
Is there any drawbacks of defining them explicitly? |
@nickaein Is there a PR for the fix you mentioned? |
The following check in
unit-concepts
fails on MSVC 2015 x86 Debug mode (log):By borrowing build flags, I have reproduced it here: https://godbolt.org/z/MOkndK
This unit test should pass.
The unit-test fails merely because of x86 debug build on VS2015.
This only fails on MSVC 2015 (msvc 19.0), x86 target in debug mode.
Speculation
This bug slipped under the radar since our Debug mode for x86 was incorrectly configured and was actually building in Release mode #1543. This issue is a blocker for PR #1570 which aims to bring back the Debug build for x86 MSVC 2015.
By playing with build flags in Godbolt, it seems that the presence of
/MDd
flag causes this error. This could be similar to #1536 where the C++ compiler on VS2015 added some definitions and symbols to binary in debug mode. This error only happens on VS2015 (msvc 19.0) Debug build (where/MDd
is present) and doesn't happen in Release build and/or later compiler versions.The text was updated successfully, but these errors were encountered: