Fix copy constructor issue on older gcc

This commit is contained in:
John Keiser 2020-06-21 11:49:52 -07:00
parent ae1bd891e7
commit 1b1a122b1f
5 changed files with 16 additions and 26 deletions

View File

@ -143,8 +143,7 @@ public:
private:
document_stream &operator=(const document_stream &) = delete; // Disallow copying
document_stream(document_stream &other) = delete; // Disallow copying
document_stream(const document_stream &other) = delete; // Disallow copying
/**
* Construct a document_stream. Does not allocate or parse anything until the iterator is

View File

@ -1,4 +1,4 @@
/* auto-generated on Sat Jun 20 21:35:29 PDT 2020. Do not edit! */
/* auto-generated on Sun Jun 21 11:49:12 PDT 2020. Do not edit! */
#include <iostream>
#include "simdjson.h"

View File

@ -1,4 +1,4 @@
/* auto-generated on Sat Jun 20 21:35:29 PDT 2020. Do not edit! */
/* auto-generated on Sun Jun 21 11:49:12 PDT 2020. Do not edit! */
/* begin file src/simdjson.cpp */
#include "simdjson.h"

View File

@ -1,4 +1,4 @@
/* auto-generated on Sat Jun 20 21:50:03 PDT 2020. Do not edit! */
/* auto-generated on Sun Jun 21 11:49:12 PDT 2020. Do not edit! */
/* begin file include/simdjson.h */
#ifndef SIMDJSON_H
#define SIMDJSON_H
@ -3778,8 +3778,7 @@ public:
private:
document_stream &operator=(const document_stream &) = delete; // Disallow copying
document_stream(document_stream &other) = delete; // Disallow copying
document_stream(const document_stream &other) = delete; // Disallow copying
/**
* Construct a document_stream. Does not allocate or parse anything until the iterator is
@ -3867,8 +3866,8 @@ private:
#endif // SIMDJSON_THREADS_ENABLED
friend class dom::parser;
friend class simdjson_result<dom::document_stream>;
friend class internal::simdjson_result_base<dom::document_stream>;
friend struct simdjson_result<dom::document_stream>;
friend struct internal::simdjson_result_base<dom::document_stream>;
}; // class document_stream
@ -5574,7 +5573,6 @@ really_inline dom::document_stream::iterator simdjson_result<dom::document_strea
}
#endif // SIMDJSON_EXCEPTIONS
} // namespace simdjson
#endif // SIMDJSON_INLINE_DOCUMENT_STREAM_H
/* end file include/simdjson/inline/document_stream.h */
@ -6302,7 +6300,9 @@ really_inline void simdjson_result_base<T>::tie(T &value, error_code &error) &&
template<typename T>
WARN_UNUSED really_inline error_code simdjson_result_base<T>::get(T &value) && noexcept {
return std::forward<simdjson_result_base<T>>(*this).get(value);
error_code error;
std::forward<simdjson_result_base<T>>(*this).tie(value, error);
return error;
}
template<typename T>

View File

@ -105,12 +105,8 @@ namespace parser_load {
TEST_START();
dom::parser parser;
dom::document_stream stream;
ASSERT_SUCCESS(parser.load_many(NONEXISTENT_FILE).get(stream));
for (auto doc : stream) {
ASSERT_ERROR(doc.error(), IO_ERROR);
TEST_SUCCEED();
}
TEST_FAIL("No documents returned");
ASSERT_ERROR(parser.load_many(NONEXISTENT_FILE).get(stream), IO_ERROR);
TEST_SUCCEED();
}
bool padded_string_load_nonexistent() {
TEST_START();
@ -122,21 +118,16 @@ namespace parser_load {
bool parser_load_chain() {
TEST_START();
dom::parser parser;
auto error = parser.load(NONEXISTENT_FILE)["foo"].get<uint64_t>().error();
ASSERT_ERROR(error, IO_ERROR);
UNUSED uint64_t foo;
ASSERT_ERROR( parser.load(NONEXISTENT_FILE)["foo"].get(foo) , IO_ERROR);
TEST_SUCCEED();
}
bool parser_load_many_chain() {
TEST_START();
dom::parser parser;
dom::document_stream stream;
ASSERT_SUCCESS( parser.load_many(NONEXISTENT_FILE).get(stream) );
for (auto doc : stream) {
auto error = doc["foo"].get<uint64_t>().error();
ASSERT_ERROR(error, IO_ERROR);
TEST_SUCCEED();
}
TEST_FAIL("No documents returned");
ASSERT_ERROR( parser.load_many(NONEXISTENT_FILE).get(stream) , IO_ERROR );
TEST_SUCCEED();
}
bool run() {
return true