Skip to content

Commit 66b3136

Browse files
authored
CI Fixes and updates for C++26 reflection (#466)
* Simplify CMake options and update CI configuration Unified DAW_NO_FLATTEN option handling by enabling it unconditionally. Improved compatibility checks for AppleClang in compiler flags. Dropped Ubuntu 20.04 from CI matrix to focus on Ubuntu 22.04 for testing. * Refactor reflection macros for cleaner syntax. Removed `DAW_REFL` and `DAW_SPLICE` macros, replacing their usage with direct inline symbols (`^^` and `[:]`) to simplify and clarify the reflection code now that the tokens are standard * Updated to latest reflection as in draft std. Refactor reflection utilities to use DAW_REFLECT and DAW_SPLICE macros to fix clang-format issues * Remove unnecessary `static_assert` for `daw::is_arithmetic_v<int>` in tests. * Bump `DAW_JSON_VER` to `v3_30_3` to reflect anticipated ABI changes. * Update Windows CI workflow to use only windows-2022, remove windows-2019 configurations
1 parent af2d6dc commit 66b3136

8 files changed

Lines changed: 71 additions & 72 deletions

File tree

.github/workflows/ci_ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
cpp_version: [ 17, 20 ]
3131
build_type: [ Debug, Release ]
3232
except_type: [ exceptions_on, exceptions_off ]
33-
os: [ ubuntu-20.04, ubuntu-22.04 ]
33+
os: [ ubuntu-22.04 ]
3434
toolset: [ g++-9, g++-10, g++-11, g++-12, clang++-8, clang++-9, clang++-10, clang++-11, clang++-12, clang++-13, clang++-14, clang++-15, clang++-16, clang++-17 ]
3535
exclude:
3636
- toolset: clang++-8

.github/workflows/ci_windows.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
branches-ignore: develop
1212

1313
jobs:
14-
Windows2019:
14+
Windows:
1515
permissions:
1616
actions: none
1717
checks: none
@@ -30,14 +30,6 @@ jobs:
3030
fail-fast: false
3131
matrix:
3232
config:
33-
- { cpp_version: 17, build_type: Debug, arch: x64, os: windows-2019, toolset: MSVC, cmake_flags: "-GNinja" }
34-
- { cpp_version: 17, build_type: Release, arch: x64, os: windows-2019, toolset: MSVC, cmake_flags: "-GNinja" }
35-
- { cpp_version: 17, build_type: Debug, arch: Win32, os: windows-2019, toolset: MSVC, cmake_flags: "-GNinja" }
36-
- { cpp_version: 17, build_type: Release, arch: Win32, os: windows-2019, toolset: MSVC, cmake_flags: "-GNinja" }
37-
- { cpp_version: 17, build_type: Debug, arch: x64, os: windows-2019, toolset: ClangCL, cmake_flags: "-T ClangCL -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe" }
38-
- { cpp_version: 17, build_type: Release, arch: x64, os: windows-2019, toolset: ClangCL, cmake_flags: "-T ClangCL -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe" }
39-
- { cpp_version: 20, build_type: Debug, arch: x64, os: windows-2019, toolset: ClangCL, cmake_flags: " -T ClangCL -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe" }
40-
- { cpp_version: 20, build_type: Release, arch: x64, os: windows-2019, toolset: ClangCL, cmake_flags: "-T ClangCL -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe" }
4133
- { cpp_version: 17, build_type: Debug, arch: x64, os: windows-2022, toolset: MSVC, cmake_flags: "-GNinja" }
4234
- { cpp_version: 17, build_type: Release, arch: x64, os: windows-2022, toolset: MSVC, cmake_flags: "-GNinja" }
4335
- { cpp_version: 20, build_type: Debug, arch: x64, os: windows-2022, toolset: MSVC, cmake_flags: "-GNinja" }

CMakeLists.txt

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,19 @@ if( DAW_JSON_ENABLE_FULL_RVO )
3232
add_compile_definitions( DAW_JSON_ENABLE_FULL_RVO )
3333
endif()
3434

35-
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC" )
36-
option( DAW_NO_FLATTEN "Define: Disable function flattening optimization" ON )
37-
elseif( DEFINED ( CMAKE_BUILD_TYPE ))
38-
if( ${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
39-
option( DAW_NO_FLATTEN "Define: Disable function flattening optimization" ON )
40-
else()
41-
option( DAW_NO_FLATTEN "Define: Disable function flattening optimization" OFF )
42-
endif()
43-
else()
44-
option( DAW_NO_FLATTEN "Define: Disable function flattening optimization" OFF )
45-
endif()
35+
option( DAW_NO_FLATTEN "Define: Disable function flattening optimization" ON )
36+
37+
#if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC" )
38+
# option( DAW_NO_FLATTEN "Define: Disable function flattening optimization" ON )
39+
#elseif( DEFINED ( CMAKE_BUILD_TYPE ))
40+
# if( ${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
41+
# option( DAW_NO_FLATTEN "Define: Disable function flattening optimization" ON )
42+
# else()
43+
# option( DAW_NO_FLATTEN "Define: Disable function flattening optimization" OFF )
44+
# endif()
45+
#else()
46+
# option( DAW_NO_FLATTEN "Define: Disable function flattening optimization" OFF )
47+
#endif()
4648

4749
option( DAW_JSON_FORCE_INT128 "Define: Force support for 128bit int" OFF )
4850
if( CMAKE_CXX_FLAGS MATCHES "-fno-exceptions" )

include/daw/json/daw_json_reflection.h

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
#include <utility>
1919
#include <vector>
2020

21-
#define DAW_REFL( ... ) ^^__VA_ARGS__
21+
// This gets around clang-format issues
22+
#define DAW_REFLECT( ... ) ^^__VA_ARGS__
23+
#define DAW_SPLICE( ... ) [:__VA_ARGS__:]
2224
#define DAW_SPLICE( ... ) [:__VA_ARGS__:]
2325

2426
namespace daw::json::inline DAW_JSON_VER {
@@ -60,7 +62,8 @@ namespace daw::json::inline DAW_JSON_VER {
6062
/// Get the public non-static data members
6163
consteval std::vector<std::meta::info>
6264
pub_nsdm_of( std::meta::info type_class ) {
63-
auto members = std::meta::nonstatic_data_members_of( type_class );
65+
auto members = std::meta::nonstatic_data_members_of(
66+
type_class, std::meta::access_context::unprivileged( ) );
6467
std::erase_if( members, []( std::meta::info const &i ) {
6568
return not std::meta::is_public( i );
6669
} );
@@ -71,15 +74,15 @@ namespace daw::json::inline DAW_JSON_VER {
7174
consteval auto expand( R range ) {
7275
auto args = std::vector<std::meta::info>( );
7376
for( auto r : range ) {
74-
args.push_back( std::meta::reflect_value( r ) );
77+
args.push_back( std::meta::reflect_constant( r ) );
7578
}
76-
return std::meta::substitute( DAW_REFL( replicator ), args );
79+
return std::meta::substitute( DAW_REFLECT( replicator ), args );
7780
}
7881

7982
template<typename T>
8083
consteval std::optional<T> get_annotaion( std::meta::info r ) {
8184
for( std::meta::info a : std::meta::annotations_of( r ) ) {
82-
if( std::meta::type_of( a ) == DAW_REFL( T ) ) {
85+
if( std::meta::type_of( a ) == DAW_REFLECT( T ) ) {
8386
return std::meta::extract<T>( a );
8487
}
8588
}
@@ -88,9 +91,9 @@ namespace daw::json::inline DAW_JSON_VER {
8891

8992
template<typename T>
9093
consteval bool has_annotation( std::meta::info r, T const &value ) {
91-
auto expected = std::meta::reflect_value( value );
94+
auto expected = std::meta::reflect_constant( value );
9295
for( std::meta::info a : std::meta::annotations_of( r ) ) {
93-
if( value_of( a ) == expected ) {
96+
if( constant_of( a ) == expected ) {
9497
return true;
9598
}
9699
}
@@ -99,20 +102,20 @@ namespace daw::json::inline DAW_JSON_VER {
99102

100103
template<typename T, std::size_t... Is>
101104
consteval auto to_tuple( T const &value, std::index_sequence<Is...> )
102-
-> decltype( std::tuple(
103-
value.DAW_SPLICE( pub_nsdm_of( DAW_REFL( T ) )[Is] )... ) ) {
104-
return std::tuple(
105-
value.DAW_SPLICE( pub_nsdm_of( DAW_REFL( T ) )[Is] )... );
105+
-> decltype( std::tuple{
106+
value.DAW_SPLICE( pub_nsdm_of( DAW_REFLECT( T ) )[Is] )... } ) {
107+
return std::tuple{
108+
value.DAW_SPLICE( pub_nsdm_of( DAW_REFLECT( T ) )[Is] )... };
106109
}
107110

108111
template<typename T>
109-
consteval auto
110-
to_tuple( T const &value ) -> decltype( refl_details::to_tuple(
111-
value,
112-
std::make_index_sequence<pub_nsdm_of( DAW_REFL( T ) ).size( )>{ } ) ) {
112+
consteval auto to_tuple( T const &value )
113+
-> decltype( refl_details::to_tuple(
114+
value, std::make_index_sequence<
115+
pub_nsdm_of( DAW_REFLECT( T ) ).size( )>{ } ) ) {
113116
return refl_details::to_tuple(
114-
value,
115-
std::make_index_sequence<pub_nsdm_of( DAW_REFL( T ) ).size( )>{ } );
117+
value, std::make_index_sequence<
118+
pub_nsdm_of( DAW_REFLECT( T ) ).size( )>{ } );
116119
}
117120

118121
template<JSONNAMETYPE Name, typename T>
@@ -126,7 +129,8 @@ namespace daw::json::inline DAW_JSON_VER {
126129

127130
template<typename T, std::size_t Idx>
128131
consteval auto get_member_link_func( ) {
129-
static constexpr auto member_info = pub_nsdm_of( DAW_REFL( T ) )[Idx];
132+
static constexpr auto member_info =
133+
pub_nsdm_of( DAW_REFLECT( T ) )[Idx];
130134
static constexpr auto annot_rename =
131135
get_annotaion<daw::json::refl_rename>( member_info );
132136

@@ -147,14 +151,14 @@ namespace daw::json::inline DAW_JSON_VER {
147151
return refl_map_as_annot;
148152
} else if constexpr( refl_enum_string_annot ) {
149153
using json_member_no_name =
150-
daw::json::enum_string<DAW_SPLICE(
154+
daw::json::enum_string<typename DAW_SPLICE(
151155
std::meta::type_of( member_info ) ),
152156
refl_enum_string_annot->Options>;
153157
static constexpr auto info =
154-
DAW_REFL( typename json_member_no_name::template with_name<
155-
json_name<name.size( ) + 1>(
156-
name.data( ),
157-
std::make_index_sequence<name.size( ) + 1>{ } )> );
158+
DAW_REFLECT( typename json_member_no_name::template with_name<
159+
json_name<name.size( ) + 1>(
160+
name.data( ),
161+
std::make_index_sequence<name.size( ) + 1>{ } )> );
158162
return std::optional<refl_map_as>{ refl_map_as{ info } };
159163
} else {
160164
return false;
@@ -166,7 +170,7 @@ namespace daw::json::inline DAW_JSON_VER {
166170
not annot_rename,
167171
"Do not use reflect.rename and reflect.map_as at the same time" );
168172
static constexpr auto result =
169-
daw::traits::identity<DAW_SPLICE( annot_map_as->type )>{ };
173+
daw::traits::identity<typename DAW_SPLICE( annot_map_as->type )>{ };
170174
return result;
171175
} else {
172176
return daw::traits::identity<deduce_t<
@@ -206,15 +210,15 @@ namespace daw::json::inline DAW_JSON_VER {
206210

207211
DAW_ATTRIB_INLINE static constexpr auto to_json_data( T const &value ) {
208212
return daw::forward_nonrvalue_as_tuple(
209-
value.DAW_SPLICE( pub_nsdm_of( DAW_REFL( T ) )[Is] )... );
213+
value.DAW_SPLICE( pub_nsdm_of( DAW_REFLECT( T ) )[Is] )... );
210214
}
211215
};
212216

213217
template<typename E>
214218
requires std::is_enum_v<E> constexpr E
215219
enum_from_string( std::string_view name ) {
216220
template for( constexpr auto enumerator :
217-
std::meta::enumerators_of( DAW_REFL( E ) ) ) {
221+
std::meta::enumerators_of( DAW_REFLECT( E ) ) ) {
218222
if( name == std::meta::identifier_of( enumerator ) ) {
219223
return DAW_SPLICE( enumerator );
220224
}
@@ -227,7 +231,7 @@ namespace daw::json::inline DAW_JSON_VER {
227231
requires std::is_enum_v<E>
228232
constexpr std::string_view enum_to_string( E value ) {
229233
template for( constexpr auto enumerator: std::meta::enumerators_of(
230-
DAW_REFL( E ) ) ) { if( value == DAW_SPLICE( enumerator ) ) { return
234+
DAW_REFLECT( E ) ) ) { if( value == DAW_SPLICE( enumerator ) ) { return
231235
std::meta::identifier_of( enumerator );
232236
}
233237
}
@@ -238,7 +242,7 @@ namespace daw::json::inline DAW_JSON_VER {
238242
requires std::is_enum_v<E> constexpr std::string_view
239243
enum_to_string( E value ) {
240244
auto result = std::string_view{ };
241-
DAW_SPLICE( expand( std::meta::enumerators_of( DAW_REFL( E ) ) ) ) >>
245+
DAW_SPLICE( expand( std::meta::enumerators_of( DAW_REFLECT( E ) ) ) ) >>
242246
[&]<auto e> {
243247
if( value == DAW_SPLICE( e ) ) {
244248
result = std::meta::identifier_of( e );
@@ -271,7 +275,9 @@ namespace daw::json::inline DAW_JSON_VER {
271275
}
272276

273277
template<typename JsonMember>
274-
static constexpr auto map_as = refl_map_as{ DAW_REFL( JsonMember ) };
278+
static consteval auto map_as( ) {
279+
return refl_map_as{ DAW_REFLECT( JsonMember ) };
280+
}
275281

276282
static constexpr auto ignore_with_default =
277283
daw::json::refl_ignore_with_default{ };
@@ -292,17 +298,16 @@ namespace daw::json::inline DAW_JSON_VER {
292298
// Trait that specifies a type is to be reflected on for parse info
293299
template<refl_details::Reflectable T>
294300
inline constexpr bool is_reflectible_type_v =
295-
refl_details::has_annotation( DAW_REFL( T ), reflect );
301+
refl_details::has_annotation( DAW_REFLECT( T ), reflect );
296302
} // namespace experimental
297303

298304
template<typename T>
299305
requires is_reflectible_type_v<T> //
300306
struct json_data_contract<T>
301307
: refl_details::make_data_contract<
302308
T, std::make_index_sequence<
303-
refl_details::pub_nsdm_of( DAW_REFL( T ) ).size( )>> {};
309+
refl_details::pub_nsdm_of( DAW_REFLECT( T ) ).size( )>> {};
304310

305311
} // namespace daw::json::inline DAW_JSON_VER
306312

307-
#undef DAW_REFL
308313
#undef DAW_SPLICE

include/daw/json/impl/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
#if not defined( DAW_JSON_VER_OVERRIDE )
1818
// Should be updated when a potential ABI break is anticipated
1919
#if defined( DEBUG ) or not defined( NDEBUG )
20-
#define DAW_JSON_VER v3_30_2d
20+
#define DAW_JSON_VER v3_30_3d
2121
#else
22-
#define DAW_JSON_VER v3_30_2
22+
#define DAW_JSON_VER v3_30_3
2323
#endif
2424
#else
2525
#define DAW_JSON_VER DAW_JSON_VER_OVERRIDE

tests/cmake/test_compiler_options.cmake

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQU
1212
message( STATUS "Clang-CL ${CMAKE_CXX_COMPILER_VERSION} detected" )
1313
add_definitions( -DNOMINMAX -DD_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS )
1414

15-
if( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19 )
15+
if( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19 OR ( ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17 ))
1616
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG /permissive- /EHsc -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE" )
1717
else()
1818
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG /permissive- /EHsc -D_LIBCPP_ENABLE_ASSERTIONS=1" )
@@ -38,23 +38,24 @@ if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQU
3838
-Weverything
3939
-ftemplate-backtrace-limit=0
4040
-Wincompatible-pointer-types-discards-qualifiers
41+
-Wno-c++2b-extensions
4142
-Wno-c++98-compat
4243
-Wno-c++98-compat-pedantic
4344
-Wno-covered-switch-default
4445
-Wno-documentation
4546
-Wno-exit-time-destructors
4647
-Wno-float-equal
48+
-Wno-global-constructors
4749
-Wno-missing-prototypes
50+
# This is for when specializing things like tuple_size and each implementer gets to choose struct/class
51+
-Wno-mismatched-tags
4852
-Wno-newline-eof
53+
-Wno-nullability-extension
4954
-Wno-padded
5055
-Wno-redundant-parens
5156
-Wno-switch-default
5257
-Wno-unused-template
5358
-Wno-weak-vtables
54-
# This is for when specializing things like tuple_size and each implementer gets to choose struct/class
55-
-Wno-mismatched-tags
56-
-Wno-global-constructors
57-
-Wno-nullability-extension
5859
)
5960
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" )
6061
if( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14 )
@@ -126,15 +127,15 @@ if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQU
126127
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"
127128
AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9 )
128129

129-
if( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19 )
130+
if( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19 OR ( ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17 ))
130131
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -DDEBUG -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_CONCEPT_CHECKS -D_FORTIFY_SOURCE=2" )
131132
else()
132133
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -DDEBUG -D_LIBCPP_ENABLE_ASSERTIONS=1 -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_CONCEPT_CHECKS -D_FORTIFY_SOURCE=2" )
133134
endif()
134135
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -g -DNDEBUG -D_GLIBCXX_CONCEPT_CHECKS" )
135136
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -g -DNDEBUG -D_GLIBCXX_CONCEPT_CHECKS" )
136137
else()
137-
if( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19 )
138+
if( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19 OR ( ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17 ))
138139
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -DDEBUG -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE" )
139140
else()
140141
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -DDEBUG -D_LIBCPP_ENABLE_ASSERTIONS=1" )

tests/src/daw_json_link_reflection_test.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
using daw::json::reflect;
2020

2121
struct[[= reflect]] X {
22-
[[= reflect.map_as<daw::json::json_number<"member1", int>>]] int m1;
22+
[[= reflect.map_as<daw::json::json_number<"member1", int>>( )]] int m1;
2323

24-
[[= reflect.rename( "member2" )]] int m2;
24+
//[[= reflect.rename( "member2" )]] int m2;
25+
int member2;
2526
};
2627

2728
struct[[= reflect]] Y {
@@ -94,7 +95,7 @@ int main( ) {
9495
)json";
9596
constexpr auto val0 = daw::json::from_json<X>( json_doc0 );
9697
daw_ensure( val0.m1 == 55 );
97-
daw_ensure( val0.m2 == 123 );
98+
daw_ensure( val0./*m2*/member2 == 123 );
9899
auto const val0_json = daw::json::to_json( val0 );
99100
daw::println( "json: {}", val0_json );
100101

@@ -106,7 +107,7 @@ int main( ) {
106107
)json";
107108
auto const val1 = daw::json::from_json<Y>( json_doc1 );
108109
daw_ensure( val1.m0.m1 == 55 );
109-
daw_ensure( val1.m0.m2 == 123 );
110+
daw_ensure( val1.m0./*m2*/member2 == 123 );
110111
daw_ensure( val1.m1 == "Hello World!" );
111112
daw::println( "json: {}", daw::json::to_json( val1 ) );
112113

@@ -138,9 +139,9 @@ int main( ) {
138139
daw_ensure( not val3.m0 );
139140
daw_ensure( val3.m1.size( ) == 2 );
140141
daw_ensure( val3.m1[0].m1 == 0 );
141-
daw_ensure( val3.m1[0].m2 == 1 );
142+
daw_ensure( val3.m1[0]./*m2*/member2 == 1 );
142143
daw_ensure( val3.m1[1].m1 == 2 );
143-
daw_ensure( val3.m1[1].m2 == 3 );
144+
daw_ensure( val3.m1[1]./*m2*/member2 == 3 );
144145
daw::println( "json: {}", daw::json::to_json( val3 ) );
145146

146147
using namespace daw::json::options;
@@ -151,9 +152,9 @@ int main( ) {
151152
daw_ensure( not val3b.m0 );
152153
daw_ensure( val3b.m1.size( ) == 2 );
153154
daw_ensure( val3b.m1[0].m1 == 0 );
154-
daw_ensure( val3b.m1[0].m2 == 1 );
155+
daw_ensure( val3b.m1[0]./*m2*/member2 == 1 );
155156
daw_ensure( val3b.m1[1].m1 == 2 );
156-
daw_ensure( val3b.m1[1].m2 == 3 );
157+
daw_ensure( val3b.m1[1]./*m2*/member2 == 3 );
157158

158159
static constexpr daw::string_view json_doc4 = R"json({"value": "42"})json";
159160
daw::println( "json_doc4: {}", json_doc4 );

tests/src/daw_json_link_test.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ Temporarily disable the constexpr tests in MSVC when C++20
5151
#define DAW_JSON_NO_CONST_EXPR
5252
#endif
5353

54-
static_assert( daw::is_arithmetic_v<int> );
55-
5654
struct NumberX {
5755
int x;
5856
};

0 commit comments

Comments
 (0)