Skip to content
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

Build failure test-allocator.vcxproj #1651

Closed
linux-admirer opened this issue Jun 24, 2019 · 5 comments
Closed

Build failure test-allocator.vcxproj #1651

linux-admirer opened this issue Jun 24, 2019 · 5 comments
Labels
kind: bug platform: visual studio related to MSVC solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@linux-admirer
Copy link

linux-admirer commented Jun 24, 2019

Compiler used: Visual Studio 2015 (arch: Win32 Debug)
OS: Windows 7
Tag: v3.6.1
Following is the error message:

20>Building Custom Rule D:/GitRepo/json/test/CMakeLists.txt
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0(952): error C2664: 'my_allocator<_Newfirst>::my_allocator(my_allocator<_Newfirst> &&)': cannot convert argument 1 from 'std::_Wrap_alloc<my_allocator<nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>>' to 'const my_allocator<_Newfirst> &'
16>        with
16>        [
16>            _Newfirst=std::_Container_proxy
16>        ]
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0(952): note: Reason: cannot convert from 'std::_Wrap_alloc<my_allocator<nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>>' to 'const my_allocator<_Newfirst>'
16>        with
16>        [
16>            _Newfirst=std::_Container_proxy
16>        ]
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0(952): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector(588): note: see reference to function template instantiation 'std::_Wrap_alloc<my_allocator<_Newfirst>>::_Wrap_alloc<std::_Wrap_alloc<my_allocator<nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>>&>(_Other) noexcept' being compiled
16>        with
16>        [
16>            _Newfirst=std::_Container_proxy,
16>            _Other=std::_Wrap_alloc<my_allocator<nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>> &
16>        ]
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector(588): note: see reference to function template instantiation 'std::_Wrap_alloc<my_allocator<_Newfirst>>::_Wrap_alloc<std::_Wrap_alloc<my_allocator<nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>>&>(_Other) noexcept' being compiled
16>        with
16>        [
16>            _Newfirst=std::_Container_proxy,
16>            _Other=std::_Wrap_alloc<my_allocator<nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>> &
16>        ]
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector(586): note: while compiling class template member function 'void std::_Vector_alloc<std::_Vec_base_types<_Ty,_Alloc>>::_Free_proxy(void)'
16>        with
16>        [
16>            _Ty=nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>,
16>            _Alloc=my_allocator<nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>
16>        ]
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector(559): note: see reference to function template instantiation 'void std::_Vector_alloc<std::_Vec_base_types<_Ty,_Alloc>>::_Free_proxy(void)' being compiled
16>        with
16>        [
16>            _Ty=nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>,
16>            _Alloc=my_allocator<nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>
16>        ]
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector(680): note: see reference to class template instantiation 'std::_Vector_alloc<std::_Vec_base_types<_Ty,_Alloc>>' being compiled
16>        with
16>        [
16>            _Ty=nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>,
16>            _Alloc=my_allocator<nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>
16>        ]
16>D:\GitRepo\json\test\src\unit-allocator.cpp(151): note: see reference to class template instantiation 'std::vector<nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>,my_allocator<nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>>' being compiled
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0(952): error C2664: 'my_allocator<_Newfirst>::my_allocator(my_allocator<_Newfirst> &&)': cannot convert argument 1 from 'std::_Wrap_alloc<my_allocator<_Newfirst>>' to 'const my_allocator<_Newfirst> &'
16>        with
16>        [
16>            _Newfirst=std::_Container_proxy
16>        ]
16>        and
16>        [
16>            _Newfirst=std::_Tree_node<std::pair<const std::string,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>,void *>
16>        ]
16>        and
16>        [
16>            _Newfirst=std::_Container_proxy
16>        ]
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0(952): note: Reason: cannot convert from 'std::_Wrap_alloc<my_allocator<_Newfirst>>' to 'const my_allocator<_Newfirst>'
16>        with
16>        [
16>            _Newfirst=std::_Tree_node<std::pair<const std::string,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>,void *>
16>        ]
16>        and
16>        [
16>            _Newfirst=std::_Container_proxy
16>        ]
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0(952): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtree(783): note: see reference to function template instantiation 'std::_Wrap_alloc<my_allocator<_Newfirst>>::_Wrap_alloc<std::_Wrap_alloc<my_allocator<std::_Tree_node<std::pair<const StringType,nlohmann::basic_json<std::map,std::vector,StringType,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>,void *>>>&>(_Other) noexcept' being compiled
16>        with
16>        [
16>            _Newfirst=std::_Container_proxy,
16>            StringType=std::string,
16>            _Other=std::_Wrap_alloc<my_allocator<std::_Tree_node<std::pair<const std::string,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>,void *>>> &
16>        ]
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtree(783): note: see reference to function template instantiation 'std::_Wrap_alloc<my_allocator<_Newfirst>>::_Wrap_alloc<std::_Wrap_alloc<my_allocator<std::_Tree_node<std::pair<const StringType,nlohmann::basic_json<std::map,std::vector,StringType,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>,void *>>>&>(_Other) noexcept' being compiled
16>        with
16>        [
16>            _Newfirst=std::_Container_proxy,
16>            StringType=std::string,
16>            _Other=std::_Wrap_alloc<my_allocator<std::_Tree_node<std::pair<const std::string,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>,void *>>> &
16>        ]
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtree(781): note: while compiling class template member function 'void std::_Tree_comp_alloc<_Traits>::_Free_proxy(void)'
16>        with
16>        [
16>            _Traits=std::_Tmap_traits<std::string,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>,std::less<std::string>,my_allocator<std::pair<const std::string,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>>,false>
16>        ]
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtree(754): note: see reference to function template instantiation 'void std::_Tree_comp_alloc<_Traits>::_Free_proxy(void)' being compiled
16>        with
16>        [
16>            _Traits=std::_Tmap_traits<std::string,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>,std::less<std::string>,my_allocator<std::pair<const std::string,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>>,false>
16>        ]
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtree(957): note: see reference to class template instantiation 'std::_Tree_comp_alloc<_Traits>' being compiled
16>        with
16>        [
16>            _Traits=std::_Tmap_traits<std::string,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>,std::less<std::string>,my_allocator<std::pair<const std::string,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>>,false>
16>        ]
16>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\map(73): note: see reference to class template instantiation 'std::_Tree<std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,false>>' being compiled
16>        with
16>        [
16>            _Kty=std::string,
16>            _Ty=nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>,
16>            _Pr=std::less<std::string>,
16>            _Alloc=my_allocator<std::pair<const std::string,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>>
16>        ]
16>D:\GitRepo\json\single_include\nlohmann/json.hpp(15778): note: see reference to class template instantiation 'std::map<StringType,nlohmann::basic_json<std::map,std::vector,StringType,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>,std::less<_Kty>,my_allocator<std::pair<const StringType,nlohmann::basic_json<std::map,std::vector,StringType,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>>>>' being compiled
16>        with
16>        [
16>            StringType=std::string,
16>            _Kty=std::string
16>        ]
16>D:\GitRepo\json\test\src\unit-allocator.cpp(150): note: see reference to class template instantiation 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,my_allocator,nlohmann::adl_serializer>' being compiled
16>Done building project "test-allocator.vcxproj" -- FAILED.
@nlohmann
Copy link
Owner

That is strange, because we use AppVeyor with MSVC 2015 in our CI.

@nlohmann
Copy link
Owner

See https://ci.appveyor.com/project/nlohmann/json/build/job/sn7k6j9g89m8013g for the latest build using MSVC 2015 with Debug.

@nickaein
Copy link
Contributor

nickaein commented Jun 28, 2019

This might be related to #1536 which is fixed in devel branch and is scheduled for Release 3.6.2.

Have you tried devel branch to see if the issue is still present?

@linux-admirer
Copy link
Author

Sorry for the delayed response. I did not find time to analyse the build logs.
I compiled branch: 'develop' and it compiles fine.

@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Jun 29, 2019
@nlohmann
Copy link
Owner

Thanks for checking back!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug platform: visual studio related to MSVC solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

3 participants