https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103853
Bug ID: 103853 Summary: std::forward_list::merge should check if __list != this Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: pavel.kryukov at phystech dot edu Target Milestone: --- Created attachment 52080 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52080&action=edit check if __list==this in std::forward_list::merge C++ standard does not require 'do nothing' if std::forward_list::merge argument equals to 'this', however it does not say 'undefined behavior' or 'infinite loop' too. I've attached my patch to fix and test it, but since I'm not an experienced GCC contributor, I don't know how to run the tests. Following instructions on CONTRIBUTING page builds whole GCC ending with some problems with my machine. I would be grateful if you tell how I can test only libstdc++.