While backporting a commit to gcc-5-branch I noticed this test doesn't build in c++98 mode (the default on gcc-5-branch).
Fixed like so. Tested x86_64-linux, committed to gcc-6-branch.
commit db3afd0ee4833edd3ca967e40aef629a032575b8 Author: Jonathan Wakely <jwak...@redhat.com> Date: Thu May 18 10:07:47 2017 +0100 Fix test to compile in C++98 mode * testsuite/libstdc++-prettyprinters/59161.cc: Fix for C++98 mode. diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/59161.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/59161.cc index d8fef27..a2d7f96 100644 --- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/59161.cc +++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/59161.cc @@ -59,8 +59,7 @@ int main() std::set<C>::iterator siter = s.begin(); // { dg-final { regexp-test siter {ref = @0x.*} } } - std::vector<C> v; - v.push_back(c); + std::vector<C> v(1, c); std::vector<C>::iterator viter = v.begin(); // { dg-final { regexp-test viter {ref = @0x.*} } }