https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110138
Bug ID: 110138
Summary: Extra constructor called when using
basic_string::operator+
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: wwwhhhyyy333 at gmail dot com
Target Milestone: ---
Created attachment 55268
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55268&action=edit
Simplified test
complied with -std=c++20 -O0
GCC 12.3/Clang 16 outputs:
Alloc: 3
Alloc: 6
Alloc: 9
Alloc: 12
GCC 13.1 outputs:
Alloc: 3
Alloc: 7
Alloc: 11
Alloc: 15