[RFC] libstdc++: fix declaration and definition mismatch for _GLIBCXX20_CONSTEXPR
Alexey Lapshin
alexey.lapshin@espressif.com
Mon May 19 11:39:13 GMT 2025
I mean __resize_and_overwrite is defined with "_GLIBCXX20_CONSTEXPR":
https://github.com/gcc-mirror/gcc/blob/025374559b22f5d9148f227b3df800a8e0231f59/libstdc%2B%2B-v3/include/bits/basic_string.h#L1267-L1268
But if __glibcxx_string_resize_and_overwrite is enabled, it now harcoded with "constexpr"
https://github.com/gcc-mirror/gcc/blob/1197f896ae5558f27baa929a10f66447aaafb681/libstdc%2B%2B-v3/include/bits/basic_string.tcc#L604-L606
Or the same for "find":
https://github.com/gcc-mirror/gcc/blob/025374559b22f5d9148f227b3df800a8e0231f59/libstdc%2B%2B-v3/include/bits/basic_string.h#L2922-L2924
https://github.com/gcc-mirror/gcc/blob/1197f896ae5558f27baa929a10f66447aaafb681/libstdc%2B%2B-v3/include/bits/basic_string.tcc#L649-L658
> because that will break *everything*.
I hope it's not true, unless constexpr functions are used for defining array sizes or something similar.
In any case, a compile-time error will occur.
I mean, if the program compiles successfully without the constexpr specifier, it should run normally.
Or did you mean something else?
More information about the Libstdc++
mailing list