+2019-07-29 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/51333
+ * libsupc++/cxxabi.h (__gnu_cxx::recursive_init_error): Do not define
+ constructor inline.
+ * libsupc++/guard_error.cc (__gnu_cxx::recursive_init_error): Define
+ constructor.
+ * testsuite/18_support/51333.cc: New test.
+
2019-07-28 Gerald Pfeifer <gerald@pfeifer.com>
* doc/xml/manual/documentation_hacking.xml: Fix broken reference
* @brief Exception thrown by __cxa_guard_acquire.
* @ingroup exceptions
*
- * 6.7[stmt.dcl]/4: If control re-enters the declaration (recursively)
- * while the object is being initialized, the behavior is undefined.
+ * C++ 2011 6.7 [stmt.dcl]/4: If control re-enters the declaration
+ * recursively while the variable is being initialized, the behavior
+ * is undefined.
*
* Since we already have a library function to handle locking, we might
* as well check for this situation and throw an exception.
class recursive_init_error: public std::exception
{
public:
- recursive_init_error() throw() { }
- virtual ~recursive_init_error() throw ();
+ recursive_init_error() _GLIBCXX_NOTHROW;
+ virtual ~recursive_init_error() _GLIBCXX_NOTHROW;
};
}
#endif // __cplusplus
namespace __gnu_cxx
{
- recursive_init_error::~recursive_init_error() throw() { }
+ recursive_init_error::recursive_init_error() noexcept { }
+ recursive_init_error::~recursive_init_error() noexcept { }
}
-
--- /dev/null
+// Copyright (C) 2019 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-fkeep-inline-functions" }
+// { dg-do link }
+
+#include <cxxabi.h>
+int main() { } // PR libstdc++/51333