Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make_expression with ec broken in v0.172.0 #470

Closed
meierfra-ergon opened this issue Nov 28, 2023 · 3 comments · Fixed by microsoft/vcpkg#36163
Closed

make_expression with ec broken in v0.172.0 #470

meierfra-ergon opened this issue Nov 28, 2023 · 3 comments · Fixed by microsoft/vcpkg#36163

Comments

@meierfra-ergon
Copy link
Contributor

meierfra-ergon commented Nov 28, 2023

after update to 0.172.0 my code using following make_expression() function

template <class Json>
jsonpath_expression<Json> make_expression(const Json::string_view_type& expr,
    std::error_code& ec);

(https://github.com/danielaparker/jsoncons/blob/v0.172.0/doc/ref/jsonpath/make_expression.md)
does not compile anymore. it seems a wrapper function is missing in jsonpath_expression.hpp
something like:

template <class Json>
auto make_expression(const typename Json::string_view_type& expr, std::error_code& ec) {
  return make_expression<Json>(combine_allocators(), expr, custom_functions<Json>(), ec);
}

** What is the expected behavior?**
code should compile with make_expression(expr, ec)

What is the actual behavior?
compile error -> "no matching function for call to 'make_expression'"

Enumerate the steps to reproduce the bug

Include a small, self-contained example if possible

What compiler, architecture, and operating system?

  • Compiler: clang14
  • Architecture x86, x64
  • Operating system: linux

What jsoncons library version?

  • Latest release 0.172.0
@meierfra-ergon
Copy link
Contributor Author

meierfra-ergon commented Nov 28, 2023

BTW I think I found another bug, while writing the wrapper with make_expression(combine_allocators(), expr, ec) (using the 3 argument variant), it would not compile either.

Changing the inner call to make_expression()

return make_expression(alloc_set, expr, custom_functions<Json>(), ec);

to return make_expression<Json>(alloc_set, expr, custom_functions<Json>(), ec);
fixes this

@danielaparker
Copy link
Owner

Yes, thanks for reporting this, fixed on master.

@danielaparker
Copy link
Owner

Fixed in 0.172.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants