On Mon, 14 Jun 2021 at 19:14, Paul Smith via Libstdc++ <libstd...@gcc.gnu.org> wrote: > > std::tuple elements are retrieved via std::get<> (template) not > [] (array); have the generated output string match this.
Both of your patches seem to be based on the idea that the output is supposed to correspond to how you access the tuple, but that isn't meant to be the case. The fact we show [1] isn't suppose to mean you can access that element as tup[1]. For example, the std::set printer shows: $1 = std::set with 3 elements = {[0] = 1, [1] = 2, [2] = 3} This isn't supposed to imply that you can access the member as s[0]. However, it does use a zero-based index! I think using a zero-based index for tuples makes sense too, although your patch will cause testsuite failures, won't it? The test needs to change too.