Skip to content

[pull] develop from nlohmann:develop#75

Merged
pull[bot] merged 29 commits intoMu-L:developfrom
nlohmann:develop
Jan 13, 2024
Merged

[pull] develop from nlohmann:develop#75
pull[bot] merged 29 commits intoMu-L:developfrom
nlohmann:develop

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Aug 28, 2023

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@github-actions github-actions bot added the S label Aug 28, 2023
@pull pull bot added ⤵️ pull and removed S labels Aug 28, 2023
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 6005342309

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 98.197%

Totals Coverage Status
Change from base Build 5554411780: 0.0%
Covered Lines: 6046
Relevant Lines: 6046

💛 - Coveralls

felixonmars and others added 9 commits September 10, 2023 21:49
Starting with CMake 3.27, deprecation warnings are issued
when asking for policy settings for CMake 3.4 or earlier.
The cmake_minimum_required() command accepts a version
range, which allows NEW policy settings up to the upper end
of that range to be used, but without raising the minimum
CMake version above the bottom of that range. This means
NEW policy settings will be used where available, without
requiring them. This change updates the project's
cmake_minimum_required() calls to use a version range to
extend the upper policy version to 3.14 where it wasn't already
at that version or higher. This prevents the deprecation warning
from CMake 3.27, and gives breathing space before a future
CMake release will start issuing similar deprecation warnings
again.
@github-actions github-actions bot added the CMake label Sep 25, 2023
@github-actions github-actions bot added the CI label Oct 4, 2023
nlohmann and others added 10 commits November 1, 2023 22:06
#4237)

* Enhance the UDT unit test to expose the issue

Add a new enum type with uint64_t as the underlying type.
Use it in the overall UDT. Not strictly needed, but it helps exercise its expected usage.
Create an object of this enum type with a large value (negative if cast to int64_t).
Perform several checks on this object as converted to `json`, which fail without the fix.

* Fix the issue in the relevant `to_json` overload.

Select the correct json type depending on the signedness of the enum's underlying type.
This fixes the new checks in the unit test.

* Add the fix to the single_include

I ran `make pretty` but that modified 20 files, performing a significant amount of indentation changes, none of them related to my change.
I ran `make amalgamate`, but that did nothing. Apparently, the make rule won't run if the single_include files have already been updated by `make pretty`.
I forced `make amalgamate` to do the work by touching the file with the fix.
I then decided to keep just the minimal needed change: the addition of the fix to the single_include file.

I just am not conversant enough in Linux to know whether I installed astyle correctly (had to clone the source from a beta branch and build, in order to get support for `--squeeze-lines`).

* Resolve CI errors and use qualified `std::uint64_t`

The fix was relying on implicit conversions in the non-taken branch.
- Ordinarily (work on a C++20 codebase) I would have used `if constexpr` here, sidestepping the issue, but that's not available on C++11 so I didn't bother.
- So instead of an `if` statement, I used a compile-time constant to select the correct overload.
- This is arguably better in this case, anyway.

I was using function-style casts for typed constants, which I consider superior for constants, but the CI checks disagree, so changed all to `static_cast`.
- For some reason, the CI checks didn't point at all of them, so I hope I caught them all myself.

Built with clang14 and all unit tests pass.

---------

Co-authored-by: Juan Carlos Arevalo Baeza (JCAB) <jcab@ntdev.microsoft.com>
@pull pull bot merged commit a259ecc into Mu-L:develop Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.