https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110138
Hongyu Wang <wwwhhhyyy333 at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #4 from Hongyu Wang <wwwhhhyyy333 at gmail dot com> --- (In reply to Jonathan Wakely from comment #3) > (In reply to Hongyu Wang from comment #0) > > GCC 12.3/Clang 16 outputs: > > Alloc: 3 > > Alloc: 6 > > Alloc: 9 > > Alloc: 12 > > "Clang 16" here actually means "Any version of Clang with libstdc++ headers > from GCC 12". > > The figures for Clang's own libc++ are different: > > Alloc: 0 > Alloc: 4 > Alloc: 8 > Alloc: 12 > > But again, this is meaningless. Nobody cares how many times an allocator is > copied. The original test intends to verify P1165R1 implementation and it uses a global counter on allocator constructor to see if it is correctly selected, and current change makes it copied twice so the result is not expected. But yes, I agree the allocator constructor for string should be cheap, and the original test should not rely on how many times the constructor was called to verify P1165R1 (I suppose checks if soccc was called instead). Thanks for the explanation, I will close this as invalid.