Skip to content

Commit

Permalink
Fix ArgsTest accidentally instantiating std::char_traits<non-char-t>
Browse files Browse the repository at this point in the history
  • Loading branch information
eliaskosunen committed May 16, 2024
1 parent 7504df0 commit 506f993
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,14 @@ jobs:
# llvm, ucrt, libc++
- clang32
- clang64
# gcc, cygwin, libstdc++ (64-bit)
- msys

exclude:
# FIXME: bugging out with float parsing
- sys: clang32
- sys: clang64
# Buggy float parsing
- clang32
- clang64
- msys

steps:
- uses: msys2/setup-msys2@v2
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 2.0.3

_Released 2024-05-xx_

## Fixes

* Small CMake adjustments to better support use as a subproject (#113, thanks [@frankmiller (Frank Miller)](https://github.com/frankmiller))
* Fix misplaced include of `GNUInstallDirs` in CMake (#111, thanks [@WangWeiLin-MV](https://github.com/WangWeiLin-MV))
* Allow for externally installed versions for GTest and Google Benchmark (#112, thanks [@xvitaly (Vitaly)](https://github.com/xvitaly))
* Adjust the definition of `SCN_COMPILER` to fix usage with a recent Clang using modules (#109, thanks [@Delta-dev-99 (Armando Martin)](https://github.com/Delta-dev-99))
* Allow for more versions of dependencies (simdutf, fast_float)
* Fix C++23 build failure caused by missing inclusion of `<utility>` for `std::unreachable`

# 2.0.2

_Released 2024-02-19_
Expand Down
3 changes: 3 additions & 0 deletions include/scn/detail/args.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ class arg_value {

template <typename CharT>
struct arg_mapper {
static_assert(std::is_same_v<CharT, char> ||
std::is_same_v<CharT, wchar_t>);

using char_type = CharT;
using other_char_type =
std::conditional_t<std::is_same_v<char_type, char>, wchar_t, char>;
Expand Down
7 changes: 3 additions & 4 deletions tests/unittests/args_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ using ::testing::Test;

TEST(ArgsTest, ArgTypeMapping)
{
static_assert(
scn::detail::mapped_type_constant<int, scn::scan_context>::value ==
scn::detail::arg_type::int_type);
static_assert(scn::detail::mapped_type_constant<int, char>::value ==
scn::detail::arg_type::int_type);
static_assert(scn::detail::mapped_type_constant<scn::detail::dummy_type,
scn::scan_context>::value ==
char>::value ==
scn::detail::arg_type::custom_type);

// narrow context, narrow char -> valid
Expand Down

0 comments on commit 506f993

Please sign in to comment.