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

Compilation issue on OSx with 0.168.1 #348

Closed
andysCaplin opened this issue Jan 21, 2022 · 5 comments
Closed

Compilation issue on OSx with 0.168.1 #348

andysCaplin opened this issue Jan 21, 2022 · 5 comments

Comments

@andysCaplin
Copy link

When I upgrade from 0.168.0 to 0.168.1 I need to update my compilation flags to use C++14 instead of C++11 - but only on OSx.
On Linux I specify C++11 and it still compiles fine.
Also, 0.168.1 also compiles fine on Windows for me.

It's not really an issue for me because I can make this change - I just thought I'd report it for information. This is the platform and compiler information.

build@mac-mini-04 ~ % uname -a
Darwin mac-mini-04.caplin.com 20.4.0 Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:47 PDT 2021; root:xnu-7195.101.2~1/RELEASE_X86_64 x86_64

build@mac-mini-04 ~ % clang++ --version
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: x86_64-apple-darwin20.4.0
Thread model: posix
InstalledDir: /Users/build/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
@danielaparker
Copy link
Owner

Thanks for reporting this. We do want to stay compatible with C++11 for all the supported platforms. Could you post the compilation errors you experienced on OSx?

@andysCaplin
Copy link
Author

andysCaplin commented Jan 21, 2022

Here they are

[STDERR] In file included from ../../libs/jsoncons/include/jsoncons/json.hpp:10:
[STDERR] In file included from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:25:
[STDERR] In file included from ../../libs/jsoncons/include/jsoncons/json_type.hpp:11:
[STDERR] ../../libs/jsoncons/include/jsoncons/config/jsoncons_config.hpp:124:16: error: no member named 'make_unique' in namespace 'std'
[STDERR] using std::make_unique;
[STDERR] ~~~~~^
[STDERR] In file included from ../src/jsonob.cpp:31:
[STDERR] In file included from ../../libs/jsoncons/include/jsoncons/json.hpp:10:
[STDERR] In file included from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:29:
[STDERR] In file included from ../../libs/jsoncons/include/jsoncons/pretty_print.hpp:20:
[STDERR] ../../libs/jsoncons/include/jsoncons/json_type_traits.hpp:1148:82: error: no member named 'make_unique' in namespace 'jsoncons'
[STDERR] return j.is_null() ? std::unique_ptr<ValueType>(nullptr) : jsoncons::make_unique<ValueType>(j.template as<ValueType>());
[STDERR] ~~~~~~~~~~^
[STDERR] ../../libs/jsoncons/include/jsoncons/json_type_traits.hpp:1148:94: error: 'ValueType' does not refer to a value
[STDERR] return j.is_null() ? std::unique_ptr<ValueType>(nullptr) : jsoncons::make_unique<ValueType>(j.template as<ValueType>());
[STDERR] ^
[STDERR] ../../libs/jsoncons/include/jsoncons/json_type_traits.hpp:1135:32: note: declared here
[STDERR] template<class Json, class ValueType>
[STDERR] ^
[STDERR] In file included from ../src/jsonob.cpp:34:
[STDERR] In file included from ../../libs/jsoncons/include/jsoncons_ext/jsonpath/json_query.hpp:11:
[STDERR] In file included from ../../libs/jsoncons/include/jsoncons_ext/jsonpath/jsonpath_expression.hpp:20:
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2227:35: error: no member named 'make_unique' in namespace 'jsoncons'
[STDERR] auto temp = jsoncons::make_unique<Json>(std::forward<Args>(args)...);
[STDERR] ~~~~~~~~~~^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2227:47: error: 'Json' does not refer to a value
[STDERR] auto temp = jsoncons::make_unique<Json>(std::forward<Args>(args)...);
[STDERR] ^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2194:21: note: declared here
[STDERR] template <class Json, class JsonReference>
[STDERR] ^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2227:77: error: expected ')'
[STDERR] auto temp = jsoncons::make_unique<Json>(std::forward<Args>(args)...);
[STDERR] ^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2227:52: note: to match this '('
[STDERR] auto temp = jsoncons::make_unique<Json>(std::forward<Args>(args)...);
[STDERR] ^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2248:35: error: no member named 'make_unique' in namespace 'jsoncons'
[STDERR] auto temp = jsoncons::make_unique<json_location_node_type>(std::forward<Args>(args)...);
[STDERR] ~~~~~~~~~~^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2248:47: error: unexpected type name 'json_location_node_type': expected expression
[STDERR] auto temp = jsoncons::make_unique<json_location_node_type>(std::forward<Args>(args)...);
[STDERR] ^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2248:96: error: expected ')'
[STDERR] auto temp = jsoncons::make_unique<json_location_node_type>(std::forward<Args>(args)...);
[STDERR] ^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2248:71: note: to match this '('
[STDERR] auto temp = jsoncons::make_unique<json_location_node_type>(std::forward<Args>(args)...);
[STDERR] ^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2355:53: error: no member named 'make_unique' in namespace 'jsoncons'
[STDERR] jsoncons::make_unique<decorator_function<Json>>(item.arity(),item.function()));
[STDERR] ~~~~~~~~~~^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2355:89: error: expected '(' for function-style cast or type construction
[STDERR] jsoncons::make_unique<decorator_function<Json>>(item.arity(),item.function()));
[STDERR] ~~~~~~~~~~~~~~~~~~~~~~~~^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2445:50: error: no member named 'make_unique' in namespace 'jsoncons'
[STDERR] unary_operators_.push_back(jsoncons::make_unique<regex_operator<Json,JsonReference>>(std::move(pattern)));
[STDERR] ~~~~~~~~~~^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2445:96: error: expected '(' for function-style cast or type construction
[STDERR] unary_operators_.push_back(jsoncons::make_unique<regex_operator<Json,JsonReference>>(std::move(pattern)));
[STDERR] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2532:47: error: no member named 'make_unique' in namespace 'jsoncons'
[STDERR] selectors_.emplace_back(jsoncons::make_unique<T>(std::forward<T>(val)));
[STDERR] ~~~~~~~~~~^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2532:59: error: 'T' does not refer to a value
[STDERR] selectors_.emplace_back(jsoncons::make_unique<T>(std::forward<T>(val)));
[STDERR] ^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2529:28: note: declared here
[STDERR] template <typename T>
[STDERR] ^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2539:35: error: no member named 'make_unique' in namespace 'jsoncons'
[STDERR] auto temp = jsoncons::make_unique<Json>(std::forward<Args>(args)...);
[STDERR] ~~~~~~~~~~^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2539:47: error: 'Json' does not refer to a value
[STDERR] auto temp = jsoncons::make_unique<Json>(std::forward<Args>(args)...);
[STDERR] ^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2331:21: note: declared here
[STDERR] template <class Json, class JsonReference>
[STDERR] ^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2539:77: error: expected ')'
[STDERR] auto temp = jsoncons::make_unique<Json>(std::forward<Args>(args)...);
[STDERR] ^
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/expression.hpp:2539:52: note: to match this '('
[STDERR] auto temp = jsoncons::make_unique<Json>(std::forward<Args>(args)...);
[STDERR] ^
[STDERR] In file included from ../src/jsonob.cpp:34:
[STDERR] In file included from ../../libs/jsoncons/include/jsoncons_ext/jsonpath/json_query.hpp:11:
[STDERR] ../../libs/jsoncons/include/jsoncons_ext/jsonpath/jsonpath_expression.hpp:2279:69: error: no member named 'make_unique' in namespace 'jsoncons'
[STDERR] output_stack_.emplace_back(token_type(jsoncons::make_unique<expression_type>(std::move(toks))));
[STDERR] ~~~~~~~~~~^
[STDERR] fatal error: too many errors emitted, stopping now [-ferror-limit=]

If you intend to fix this I may hold up on upgrading so we don't have to use C++14.

We have no urgency to go to 0.168.2, the version we have works fine for what we're doing

danielaparker added a commit that referenced this issue Jan 21, 2022
@danielaparker
Copy link
Owner

Could you check if it's still an issue with the code on master?

@andysCaplin
Copy link
Author

Looks good. I repeated the error with 0.168.2 by restoring the C++11 flag and then rebuilt with the same flag and the master branch of the jsoncons files and didn't get any error.

@danielaparker
Copy link
Owner

Fixed in release 0.168.3

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

No branches or pull requests

2 participants