https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78979
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2017-01-03 Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Rainer Orth from comment #0) > The 27_io/headers/cstdio/functions_neg.cc testcase started to FAIL on Solaris > between between 20160930 and 20161003: > > FAIL: 27_io/headers/cstdio/functions_neg.cc (test for errors, line 24) > > This is > > using std::gets; // { dg-error "has not been declared" } > > obviously caused by > > 2016-09-30 Jonathan Wakely <jwak...@redhat.com> > > PR libstdc++/77795 > * acinclude.m4 (GLIBCXX_CHECK_STDIO_PROTO): Use -std=gnu++11 to check > for gets. > * config.h.in: Regenerate. > * configure: Regenerate. > * include/c_global/cstdio [!_GLIBCXX_HAVE_GETS] (gets): Only declare > for C++98 and C++11. > * include/c_std/cstdio [!_GLIBCXX_HAVE_GETS] (gets): Likewise. > * testsuite/27_io/headers/cstdio/functions_neg.cc: New test. > > Ultimately, this happens because config/sol2.h (TARGET_OS_CPP_BUILTINS) > always > has > > if (c_dialect_cxx ()) \ > { \ > builtin_define ("__STDC_VERSION__=199901L");\ That should be fine for C++11 and C++14, because they use the C99 standard library. For C++17 that should define 201112L instead. > so enabling the gets decl in <iso/stdio_iso.h>, which is > > #if __STDC_VERSION__ < 201112L > extern char *gets(char *) __ATTR_DEPRECATED; > #endif > > even for C++11 mode. Oh, and the Solaris header also puts it in namespace std, right? I think we should just XFAIL the test for Solaris. We can't prevent the Solaris header from declaring std::gets, so we shouldn't expect the test to pass.