Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/mp/gen.cpp
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In commit "mpgen: Work around c++20 / capnproto 0.8 incompatibility" (c4cb758)

I think commit message is wrong in suggesting that with c++20 the operator== function is buggy and will call itself recursively. It seems the reason this happens is not really because of c++20 but because of a gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53499. See also bitcoin/bitcoin#33176 (comment)

Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static void Generate(kj::StringPtr src_prefix,
const std::vector<kj::Own<const kj::ReadableDirectory>>& import_dirs)
{
std::string output_path;
if (src_prefix == ".") {
if (src_prefix == kj::StringPtr{"."}) {
output_path = src_file;
} else if (!src_file.startsWith(src_prefix) || src_file.size() <= src_prefix.size() ||
src_file[src_prefix.size()] != '/') {
Expand All @@ -156,7 +156,7 @@ static void Generate(kj::StringPtr src_prefix,
}

std::string include_path;
if (include_prefix == ".") {
if (include_prefix == kj::StringPtr{"."}) {
include_path = src_file;
} else if (!src_file.startsWith(include_prefix) || src_file.size() <= include_prefix.size() ||
src_file[include_prefix.size()] != '/') {
Expand Down Expand Up @@ -425,8 +425,8 @@ static void Generate(kj::StringPtr src_prefix,

const std::string method_prefix = Format() << message_namespace << "::" << method_interface.getShortDisplayName()
<< "::" << Cap(method_name);
const bool is_construct = method_name == "construct";
const bool is_destroy = method_name == "destroy";
const bool is_construct = method_name == kj::StringPtr{"construct"};
const bool is_destroy = method_name == kj::StringPtr{"destroy"};

struct Field
{
Expand Down Expand Up @@ -465,7 +465,7 @@ static void Generate(kj::StringPtr src_prefix,
field.result_is_set = true;
}

if (!param && field_name == "result") {
if (!param && field_name == kj::StringPtr{"result"}) {
field.retval = true;
has_result = true;
}
Expand Down