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 FunctionInfo's assignment operator argument const #6780

Merged
merged 1 commit into from
Jul 23, 2024
Merged

Conversation

dschuff
Copy link
Member

@dschuff dschuff commented Jul 22, 2024

Aside from the fact that there's no need for this to be non-const and this is the usual way to write an assignment operator, this is also needed because of a recent change to std::pair (llvm/llvm-project#89652). This seems to be forcing pair to want the const version of the assignment operator of its members.

Aside from the fact that there's no need for this to be non-const and this is
the usual way to write an assignment operator, this is also needed because of a
recent change to std::pair (llvm/llvm-project#89652).
This seems to be forcing pair to want the const version of the assignment
operator of its members.
@dschuff
Copy link
Member Author

dschuff commented Jul 22, 2024

Error log is at
https://logs.chromium.org/logs/emscripten-releases/buildbucket/cr-buildbucket/8741863354289051889/+/u/Build_Binaryen/stdout

/b/s/w/ir/x/w/install/include/c++/v1/__utility/pair.h:102:31: error: the parameter for this explicitly-defaulted copy assignment operator is const, but a member or base requires it to be non-const
  102 |   _LIBCPP_HIDE_FROM_ABI pair& operator=(const pair&)
      |                               ^
/b/s/w/ir/x/w/install/include/c++/v1/unordered_map:840:14: note: in instantiation of template class 'std::pair<const wasm::Name, wasm::(anonymous namespace)::FunctionInfo>' requested here
  840 |   value_type __cc_;
      |              ^
/b/s/w/ir/x/w/install/include/c++/v1/unordered_map:1730:13: note: in instantiation of template class 'std::__hash_value_type<wasm::Name, wasm::(anonymous namespace)::FunctionInfo>' requested here
 1730 |       .first->__get_value()
      |             ^
/b/s/w/ir/cache/builder/emscripten-releases/binaryen/src/passes/Inlining.cpp:190:10: note: in instantiation of member function 'std::unordered_map<wasm::Name, wasm::(anonymous namespace)::FunctionInfo>::operator[]' requested here
  190 |     infos[getFunction()->name].hasLoops = true;

@dschuff dschuff requested a review from kripken July 22, 2024 23:45
@dschuff dschuff enabled auto-merge (squash) July 22, 2024 23:47
@dschuff dschuff merged commit 0973589 into main Jul 23, 2024
13 checks passed
@dschuff dschuff deleted the operator branch July 23, 2024 00:20
@gkdn gkdn mentioned this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants