Skip to content

Compiler error in output serializer due to 'incompatible initializer' #3081

Closed
@Neumann-A

Description

@Neumann-A

What is the issue you have?

Code does not compile in GA (windows-2019 using clang-cl 13.0.0). I see the following compiler error:

D:\a\AllProjects\AllProjects\b\vcpkg_installed\x64-windows-llvm-release\include\nlohmann/detail/output/serializer.hpp(814,25): error: variable 'end' with type 'auto *const' has incompatible initializer of type 'std::_Array_iterator<char, 64>'
            auto* const end = std::remove(number_buffer.begin(),
                        ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\a\AllProjects\AllProjects\b\vcpkg_installed\x64-windows-llvm-release\include\nlohmann/detail/output/serializer.hpp(824,25): error: variable 'dec_pos' with type 'auto *const' has incompatible initializer of type 'std::_Array_iterator<char, 64>'
            auto* const dec_pos = std::find(number_buffer.begin(), number_buffer.end(), decimal_point);
                        ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 2 errors generated.

Which compiler and operating system are you using?

Current GA windows-2019
https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md

  • Compiler: clang-cl 13.0.0
  • Operating system: Windows

Which version of the library did you use?

  • latest release version 3.10.3
  • other release - please state the version: 3.10.2
  • the develop branch

I couldn't reproduce it locally but my setup does not completely match GA. Simply changing the auto* const to auto only will probably solve the problem.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions