You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It will produce too many error informations occupying the entire screen, and user may be can't understand.
admin@bryan-mbam2 yltexample % clang++ -std=c++20 main.cpp -I ~/repos/yalantinglibs/include
In file included from main.cpp:1:
In file included from /Users/admin/repos/yalantinglibs/include/struct_pack/struct_pack.hpp:22:
In file included from /Users/admin/repos/yalantinglibs/include/struct_pack/struct_pack/struct_pack_impl.hpp:41:
/Users/admin/repos/yalantinglibs/include/struct_pack/struct_pack/reflection.hpp:459:7: error: static_assert failed due to requirement '!sizeof(person)' "empty struct/class is not allowed!"
static_assert(!sizeof(type), "empty struct/class is not allowed!");
^ ~~~~~~~~~~~~~
... 省略编译错误信息 ...
/Users/admin/repos/yalantinglibs/include/struct_pack/struct_pack/struct_pack_impl.hpp:1640:32: error: call to consteval function 'struct_pack::detail::packer<struct_pack::detail::memory_writer, person>::calculate_hash_head<{0}, person>' is not a constant expression
constexpr auto hash_head = calculate_hash_head<conf, T, Args...>() |
^
/Users/admin/repos/yalantinglibs/include/struct_pack/struct_pack/struct_pack_impl.hpp:1643:19: error: constexpr if condition is not a constant expression
if constexpr (hash_head % 2) { // has more metainfo
^~~~~~~~~~~~~
/Users/admin/repos/yalantinglibs/include/struct_pack/struct_pack/struct_pack_impl.hpp:1643:19: note: initializer of 'hash_head' is not a constant expression
/Users/admin/repos/yalantinglibs/include/struct_pack/struct_pack/struct_pack_impl.hpp:1640:20: note: declared here
constexpr auto hash_head = calculate_hash_head<conf, T, Args...>() |
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Report diagnostic errors on user interfaces would be better for user, for example:
admin@bryan-mbam2 yltexample % clang++ -std=c++20 main.cpp -I ~/repos/yalantinglibs/include -DDIAGNOSTIC_REQUIRED
main.cpp:17:5: error: no matching function for call to 'serialize'
serialize(person{});
^~~~~~~~~
main.cpp:11:6: note: candidate template ignored: constraints not satisfied [with T = person]
void serialize(T&& t) {
^
main.cpp:10:10: note: because 'std::is_aggregate_v<person>' evaluated to false
requires std::is_aggregate_v<T>
^
1 error generated.
Reproduction way
Anything else
Are you willing to submit a PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered:
Well, We are trying to add some method so that struct_pack could support non-aggregate-type. But you are right, there are too many error now, and we should add some concept to simply the compile error output.
Search before asking
What happened + What you expected to happen
It will produce too many error informations occupying the entire screen, and user may be can't understand.
Report diagnostic errors on user interfaces would be better for user, for example:
Reproduction way
Anything else
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: