summaryrefslogtreecommitdiff
path: root/libstdc++-v3/libsupc++
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-05-02 14:43:35 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-05-02 14:43:35 +0000
commit34efdaf078b01a7387007c4e6bde6db86384c4b7 (patch)
treed503eaf41d085669d1481bb46ec038bc866fece6 /libstdc++-v3/libsupc++
parentf733cf303bcdc952c92b81dd62199a40a1f555ec (diff)
downloadgcc-tarball-master.tar.gz
gcc-7.1.0gcc-7.1.0
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r--libstdc++-v3/libsupc++/Makefile.am36
-rw-r--r--libstdc++-v3/libsupc++/Makefile.in51
-rw-r--r--libstdc++-v3/libsupc++/array_type_info.cc2
-rw-r--r--libstdc++-v3/libsupc++/atexit_arm.cc2
-rw-r--r--libstdc++-v3/libsupc++/atexit_thread.cc8
-rw-r--r--libstdc++-v3/libsupc++/atomic_lockfree_defines.h2
-rw-r--r--libstdc++-v3/libsupc++/bad_alloc.cc2
-rw-r--r--libstdc++-v3/libsupc++/bad_array_length.cc2
-rw-r--r--libstdc++-v3/libsupc++/bad_array_new.cc2
-rw-r--r--libstdc++-v3/libsupc++/bad_cast.cc2
-rw-r--r--libstdc++-v3/libsupc++/bad_typeid.cc2
-rw-r--r--libstdc++-v3/libsupc++/class_type_info.cc2
-rw-r--r--libstdc++-v3/libsupc++/cxxabi.h14
-rw-r--r--libstdc++-v3/libsupc++/cxxabi_forced.h2
-rw-r--r--libstdc++-v3/libsupc++/cxxabi_init_exception.h77
-rw-r--r--libstdc++-v3/libsupc++/del_op.cc2
-rw-r--r--libstdc++-v3/libsupc++/del_opa.cc58
-rw-r--r--libstdc++-v3/libsupc++/del_opant.cc33
-rw-r--r--libstdc++-v3/libsupc++/del_opnt.cc2
-rw-r--r--libstdc++-v3/libsupc++/del_ops.cc2
-rw-r--r--libstdc++-v3/libsupc++/del_opsa.cc33
-rw-r--r--libstdc++-v3/libsupc++/del_opv.cc2
-rw-r--r--libstdc++-v3/libsupc++/del_opva.cc36
-rw-r--r--libstdc++-v3/libsupc++/del_opvant.cc33
-rw-r--r--libstdc++-v3/libsupc++/del_opvnt.cc2
-rw-r--r--libstdc++-v3/libsupc++/del_opvs.cc2
-rw-r--r--libstdc++-v3/libsupc++/del_opvsa.cc33
-rw-r--r--libstdc++-v3/libsupc++/dyncast.cc2
-rw-r--r--libstdc++-v3/libsupc++/eh_alloc.cc2
-rw-r--r--libstdc++-v3/libsupc++/eh_arm.cc2
-rw-r--r--libstdc++-v3/libsupc++/eh_atomics.h84
-rw-r--r--libstdc++-v3/libsupc++/eh_aux_runtime.cc2
-rw-r--r--libstdc++-v3/libsupc++/eh_call.cc2
-rw-r--r--libstdc++-v3/libsupc++/eh_catch.cc2
-rw-r--r--libstdc++-v3/libsupc++/eh_exception.cc2
-rw-r--r--libstdc++-v3/libsupc++/eh_globals.cc2
-rw-r--r--libstdc++-v3/libsupc++/eh_personality.cc2
-rw-r--r--libstdc++-v3/libsupc++/eh_ptr.cc58
-rw-r--r--libstdc++-v3/libsupc++/eh_term_handler.cc2
-rw-r--r--libstdc++-v3/libsupc++/eh_terminate.cc2
-rw-r--r--libstdc++-v3/libsupc++/eh_throw.cc36
-rw-r--r--libstdc++-v3/libsupc++/eh_tm.cc7
-rw-r--r--libstdc++-v3/libsupc++/eh_type.cc2
-rw-r--r--libstdc++-v3/libsupc++/eh_unex_handler.cc2
-rw-r--r--libstdc++-v3/libsupc++/enum_type_info.cc2
-rw-r--r--libstdc++-v3/libsupc++/exception34
-rw-r--r--libstdc++-v3/libsupc++/exception.h78
-rw-r--r--libstdc++-v3/libsupc++/exception_defines.h2
-rw-r--r--libstdc++-v3/libsupc++/exception_ptr.h31
-rw-r--r--libstdc++-v3/libsupc++/function_type_info.cc2
-rw-r--r--libstdc++-v3/libsupc++/fundamental_type_info.cc2
-rw-r--r--libstdc++-v3/libsupc++/guard.cc3
-rw-r--r--libstdc++-v3/libsupc++/guard_error.cc2
-rw-r--r--libstdc++-v3/libsupc++/hash_bytes.cc10
-rw-r--r--libstdc++-v3/libsupc++/hash_bytes.h2
-rw-r--r--libstdc++-v3/libsupc++/initializer_list2
-rw-r--r--libstdc++-v3/libsupc++/nested_exception.cc4
-rw-r--r--libstdc++-v3/libsupc++/nested_exception.h94
-rw-r--r--libstdc++-v3/libsupc++/new69
-rw-r--r--libstdc++-v3/libsupc++/new_handler.cc2
-rw-r--r--libstdc++-v3/libsupc++/new_op.cc2
-rw-r--r--libstdc++-v3/libsupc++/new_opa.cc112
-rw-r--r--libstdc++-v3/libsupc++/new_opant.cc42
-rw-r--r--libstdc++-v3/libsupc++/new_opnt.cc2
-rw-r--r--libstdc++-v3/libsupc++/new_opv.cc2
-rw-r--r--libstdc++-v3/libsupc++/new_opva.cc33
-rw-r--r--libstdc++-v3/libsupc++/new_opvant.cc42
-rw-r--r--libstdc++-v3/libsupc++/new_opvnt.cc2
-rw-r--r--libstdc++-v3/libsupc++/pbase_type_info.cc42
-rw-r--r--libstdc++-v3/libsupc++/pmem_type_info.cc2
-rw-r--r--libstdc++-v3/libsupc++/pointer_type_info.cc2
-rw-r--r--libstdc++-v3/libsupc++/pure.cc2
-rw-r--r--libstdc++-v3/libsupc++/si_class_type_info.cc2
-rw-r--r--libstdc++-v3/libsupc++/tinfo.cc2
-rw-r--r--libstdc++-v3/libsupc++/tinfo.h2
-rw-r--r--libstdc++-v3/libsupc++/tinfo2.cc2
-rw-r--r--libstdc++-v3/libsupc++/typeinfo4
-rw-r--r--libstdc++-v3/libsupc++/unwind-cxx.h2
-rw-r--r--libstdc++-v3/libsupc++/vec.cc2
-rw-r--r--libstdc++-v3/libsupc++/vmi_class_type_info.cc2
-rw-r--r--libstdc++-v3/libsupc++/vterminate.cc2
-rw-r--r--libstdc++-v3/libsupc++/vtv_stubs.cc2
82 files changed, 1062 insertions, 239 deletions
diff --git a/libstdc++-v3/libsupc++/Makefile.am b/libstdc++-v3/libsupc++/Makefile.am
index b45b5ae2eb..1b36187682 100644
--- a/libstdc++-v3/libsupc++/Makefile.am
+++ b/libstdc++-v3/libsupc++/Makefile.am
@@ -1,6 +1,6 @@
## Makefile for the GNU C++ Support library.
##
-## Copyright (C) 2000-2016 Free Software Foundation, Inc.
+## Copyright (C) 2000-2017 Free Software Foundation, Inc.
##
## Process this file with automake to produce Makefile.in.
##
@@ -35,7 +35,7 @@ std_HEADERS = \
bits_HEADERS = \
atomic_lockfree_defines.h cxxabi_forced.h \
- exception_defines.h exception_ptr.h hash_bytes.h nested_exception.h
+ exception_defines.h exception_ptr.h hash_bytes.h nested_exception.h exception.h cxxabi_init_exception.h
headers = $(std_HEADERS) $(bits_HEADERS)
@@ -88,6 +88,16 @@ sources = \
new_opnt.cc \
new_opv.cc \
new_opvnt.cc \
+ new_opa.cc \
+ new_opant.cc \
+ new_opva.cc \
+ new_opvant.cc \
+ del_opa.cc \
+ del_opant.cc \
+ del_opsa.cc \
+ del_opva.cc \
+ del_opvant.cc \
+ del_opvsa.cc \
pbase_type_info.cc \
pmem_type_info.cc \
pointer_type_info.cc \
@@ -189,6 +199,28 @@ del_opvs.lo: del_opvs.cc
del_opvs.o: del_opvs.cc
$(CXXCOMPILE) -std=gnu++14 -Wno-sized-deallocation -c $<
+# Use special rules for the C++17 sources so that the proper flags are passed.
+new_opa.lo: new_opa.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+new_opant.lo: new_opant.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+new_opva.lo: new_opva.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+new_opvant.lo: new_opvant.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+del_opa.lo: del_opa.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+del_opant.lo: del_opant.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+del_opsa.lo: del_opsa.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+del_opva.lo: del_opva.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+del_opvant.lo: del_opvant.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+del_opvsa.lo: del_opvsa.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+
# AM_CXXFLAGS needs to be in each subdirectory so that it can be
# modified in a per-library or per-sub-library way. Need to manually
# set this option because CONFIG_CXXFLAGS has to be after
diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
index f3648ac475..4c46eeccb9 100644
--- a/libstdc++-v3/libsupc++/Makefile.in
+++ b/libstdc++-v3/libsupc++/Makefile.in
@@ -60,6 +60,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../config/futex.m4 \
+ $(top_srcdir)/../config/hwcaps.m4 \
$(top_srcdir)/../config/iconv.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/lib-ld.m4 \
@@ -125,9 +126,11 @@ am__objects_1 = array_type_info.lo atexit_arm.lo atexit_thread.lo \
function_type_info.lo fundamental_type_info.lo guard.lo \
guard_error.lo hash_bytes.lo nested_exception.lo \
new_handler.lo new_op.lo new_opnt.lo new_opv.lo new_opvnt.lo \
- pbase_type_info.lo pmem_type_info.lo pointer_type_info.lo \
- pure.lo si_class_type_info.lo tinfo.lo tinfo2.lo vec.lo \
- vmi_class_type_info.lo vterminate.lo
+ new_opa.lo new_opant.lo new_opva.lo new_opvant.lo del_opa.lo \
+ del_opant.lo del_opsa.lo del_opva.lo del_opvant.lo \
+ del_opvsa.lo pbase_type_info.lo pmem_type_info.lo \
+ pointer_type_info.lo pure.lo si_class_type_info.lo tinfo.lo \
+ tinfo2.lo vec.lo vmi_class_type_info.lo vterminate.lo
@GLIBCXX_HOSTED_TRUE@am__objects_2 = cp-demangle.lo
@ENABLE_VTABLE_VERIFY_TRUE@@VTV_CYGMIN_FALSE@am__objects_3 = \
@ENABLE_VTABLE_VERIFY_TRUE@@VTV_CYGMIN_FALSE@ vtv_stubs.lo
@@ -220,7 +223,7 @@ FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
-HWCAP_FLAGS = @HWCAP_FLAGS@
+HWCAP_CFLAGS = @HWCAP_CFLAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -234,6 +237,7 @@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
+LONG_DOUBLE_COMPAT_FLAGS = @LONG_DOUBLE_COMPAT_FLAGS@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
@@ -303,6 +307,7 @@ dvidir = @dvidir@
enable_shared = @enable_shared@
enable_static = @enable_static@
exec_prefix = @exec_prefix@
+get_gcc_base_ver = @get_gcc_base_ver@
glibcxx_MOFILES = @glibcxx_MOFILES@
glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@
glibcxx_POFILES = @glibcxx_POFILES@
@@ -359,7 +364,7 @@ toplevel_builddir = @toplevel_builddir@
toplevel_srcdir = @toplevel_srcdir@
# May be used by various substitution variables.
-gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
MAINT_CHARSET = latin1
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
PWD_COMMAND = $${PWDCMD-pwd}
@@ -374,7 +379,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
CONFIG_CXXFLAGS = \
- $(SECTION_FLAGS) $(HWCAP_FLAGS) -frandom-seed=$@
+ $(SECTION_FLAGS) $(HWCAP_CFLAGS) -frandom-seed=$@
WARN_CXXFLAGS = \
$(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once
@@ -395,7 +400,7 @@ std_HEADERS = \
bits_HEADERS = \
atomic_lockfree_defines.h cxxabi_forced.h \
- exception_defines.h exception_ptr.h hash_bytes.h nested_exception.h
+ exception_defines.h exception_ptr.h hash_bytes.h nested_exception.h exception.h cxxabi_init_exception.h
headers = $(std_HEADERS) $(bits_HEADERS)
@GLIBCXX_HOSTED_TRUE@c_sources = \
@@ -445,6 +450,16 @@ sources = \
new_opnt.cc \
new_opv.cc \
new_opvnt.cc \
+ new_opa.cc \
+ new_opant.cc \
+ new_opva.cc \
+ new_opvant.cc \
+ del_opa.cc \
+ del_opant.cc \
+ del_opsa.cc \
+ del_opva.cc \
+ del_opvant.cc \
+ del_opvsa.cc \
pbase_type_info.cc \
pmem_type_info.cc \
pointer_type_info.cc \
@@ -916,6 +931,28 @@ del_opvs.lo: del_opvs.cc
del_opvs.o: del_opvs.cc
$(CXXCOMPILE) -std=gnu++14 -Wno-sized-deallocation -c $<
+# Use special rules for the C++17 sources so that the proper flags are passed.
+new_opa.lo: new_opa.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+new_opant.lo: new_opant.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+new_opva.lo: new_opva.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+new_opvant.lo: new_opvant.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+del_opa.lo: del_opa.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+del_opant.lo: del_opant.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+del_opsa.lo: del_opsa.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+del_opva.lo: del_opva.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+del_opvant.lo: del_opvant.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+del_opvsa.lo: del_opvsa.cc
+ $(LTCXXCOMPILE) -std=gnu++1z -c $<
+
install-stdHEADERS: $(std_HEADERS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(stddir)
diff --git a/libstdc++-v3/libsupc++/array_type_info.cc b/libstdc++-v3/libsupc++/array_type_info.cc
index 4f7e6f196a..01df95f179 100644
--- a/libstdc++-v3/libsupc++/array_type_info.cc
+++ b/libstdc++-v3/libsupc++/array_type_info.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/atexit_arm.cc b/libstdc++-v3/libsupc++/atexit_arm.cc
index 98c7eebe64..8794ad083f 100644
--- a/libstdc++-v3/libsupc++/atexit_arm.cc
+++ b/libstdc++-v3/libsupc++/atexit_arm.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016 Free Software Foundation, Inc.
+// Copyright (C) 2007-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/atexit_thread.cc b/libstdc++-v3/libsupc++/atexit_thread.cc
index e6520c1094..923a070755 100644
--- a/libstdc++-v3/libsupc++/atexit_thread.cc
+++ b/libstdc++-v3/libsupc++/atexit_thread.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2016 Free Software Foundation, Inc.
+// Copyright (C) 2012-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -30,7 +30,11 @@
#include <windows.h>
#endif
-#if _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL
+#if _GLIBCXX_HAVE___CXA_THREAD_ATEXIT
+
+// Libc provides __cxa_thread_atexit definition.
+
+#elif _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL
extern "C" int __cxa_thread_atexit_impl (void (*func) (void *),
void *arg, void *d);
diff --git a/libstdc++-v3/libsupc++/atomic_lockfree_defines.h b/libstdc++-v3/libsupc++/atomic_lockfree_defines.h
index 53cf4e72f1..9aa4142f61 100644
--- a/libstdc++-v3/libsupc++/atomic_lockfree_defines.h
+++ b/libstdc++-v3/libsupc++/atomic_lockfree_defines.h
@@ -1,6 +1,6 @@
// -*- C++ -*- header.
-// Copyright (C) 2008-2016 Free Software Foundation, Inc.
+// Copyright (C) 2008-2017 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
diff --git a/libstdc++-v3/libsupc++/bad_alloc.cc b/libstdc++-v3/libsupc++/bad_alloc.cc
index 677e054322..598b840297 100644
--- a/libstdc++-v3/libsupc++/bad_alloc.cc
+++ b/libstdc++-v3/libsupc++/bad_alloc.cc
@@ -1,6 +1,6 @@
// Implementation file for the -*- C++ -*- dynamic memory management header.
-// Copyright (C) 2010-2016 Free Software Foundation, Inc.
+// Copyright (C) 2010-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/bad_array_length.cc b/libstdc++-v3/libsupc++/bad_array_length.cc
index 87dde6b5f2..e6c916f2a9 100644
--- a/libstdc++-v3/libsupc++/bad_array_length.cc
+++ b/libstdc++-v3/libsupc++/bad_array_length.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016 Free Software Foundation, Inc.
+// Copyright (C) 2013-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/bad_array_new.cc b/libstdc++-v3/libsupc++/bad_array_new.cc
index 5430f52208..8450708b42 100644
--- a/libstdc++-v3/libsupc++/bad_array_new.cc
+++ b/libstdc++-v3/libsupc++/bad_array_new.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016 Free Software Foundation, Inc.
+// Copyright (C) 2013-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/bad_cast.cc b/libstdc++-v3/libsupc++/bad_cast.cc
index 26b20c6749..25384bfaef 100644
--- a/libstdc++-v3/libsupc++/bad_cast.cc
+++ b/libstdc++-v3/libsupc++/bad_cast.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/bad_typeid.cc b/libstdc++-v3/libsupc++/bad_typeid.cc
index 1a3736ba54..6c2d900c14 100644
--- a/libstdc++-v3/libsupc++/bad_typeid.cc
+++ b/libstdc++-v3/libsupc++/bad_typeid.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/class_type_info.cc b/libstdc++-v3/libsupc++/class_type_info.cc
index e0dabe691d..18726df105 100644
--- a/libstdc++-v3/libsupc++/class_type_info.cc
+++ b/libstdc++-v3/libsupc++/class_type_info.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/cxxabi.h b/libstdc++-v3/libsupc++/cxxabi.h
index 11ff9e568d..b66d6d194b 100644
--- a/libstdc++-v3/libsupc++/cxxabi.h
+++ b/libstdc++-v3/libsupc++/cxxabi.h
@@ -1,6 +1,6 @@
// ABI Support -*- C++ -*-
-// Copyright (C) 2000-2016 Free Software Foundation, Inc.
+// Copyright (C) 2000-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -49,10 +49,7 @@
#include <bits/c++config.h>
#include <bits/cxxabi_tweaks.h>
#include <bits/cxxabi_forced.h>
-
-#ifndef _GLIBCXX_CDTOR_CALLABI
-#define _GLIBCXX_CDTOR_CALLABI
-#endif
+#include <bits/cxxabi_init_exception.h>
#ifdef __cplusplus
namespace __cxxabiv1
@@ -282,7 +279,8 @@ namespace __cxxabiv1
__restrict_mask = 0x4,
__incomplete_mask = 0x8,
__incomplete_class_mask = 0x10,
- __transaction_safe_mask = 0x20
+ __transaction_safe_mask = 0x20,
+ __noexcept_mask = 0x40
};
protected:
@@ -608,10 +606,6 @@ namespace __cxxabiv1
__cxa_eh_globals*
__cxa_get_globals_fast() _GLIBCXX_NOTHROW __attribute__ ((__const__));
- // Allocate memory for the primary exception plus the thrown object.
- void*
- __cxa_allocate_exception(size_t) _GLIBCXX_NOTHROW;
-
// Free the space allocated for the primary exception.
void
__cxa_free_exception(void*) _GLIBCXX_NOTHROW;
diff --git a/libstdc++-v3/libsupc++/cxxabi_forced.h b/libstdc++-v3/libsupc++/cxxabi_forced.h
index 04a65b8b97..40c9a16451 100644
--- a/libstdc++-v3/libsupc++/cxxabi_forced.h
+++ b/libstdc++-v3/libsupc++/cxxabi_forced.h
@@ -1,6 +1,6 @@
// cxxabi.h subset for cancellation -*- C++ -*-
-// Copyright (C) 2007-2016 Free Software Foundation, Inc.
+// Copyright (C) 2007-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/cxxabi_init_exception.h b/libstdc++-v3/libsupc++/cxxabi_init_exception.h
new file mode 100644
index 0000000000..bf7b4bada8
--- /dev/null
+++ b/libstdc++-v3/libsupc++/cxxabi_init_exception.h
@@ -0,0 +1,77 @@
+// ABI Support -*- C++ -*-
+
+// Copyright (C) 2016-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC 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.
+//
+// GCC 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.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/cxxabi_init_exception.h
+ * This is an internal header file, included by other library headers.
+ * Do not attempt to use it directly.
+ */
+
+#ifndef _CXXABI_INIT_EXCEPTION_H
+#define _CXXABI_INIT_EXCEPTION_H 1
+
+#pragma GCC system_header
+
+#pragma GCC visibility push(default)
+
+#include <stddef.h>
+#include <bits/c++config.h>
+
+#ifndef _GLIBCXX_CDTOR_CALLABI
+#define _GLIBCXX_CDTOR_CALLABI
+#define _GLIBCXX_HAVE_CDTOR_CALLABI 0
+#else
+#define _GLIBCXX_HAVE_CDTOR_CALLABI 1
+#endif
+
+#ifdef __cplusplus
+
+namespace std
+{
+ class type_info;
+}
+
+namespace __cxxabiv1
+{
+ struct __cxa_refcounted_exception;
+
+ extern "C"
+ {
+ // Allocate memory for the primary exception plus the thrown object.
+ void*
+ __cxa_allocate_exception(size_t) _GLIBCXX_NOTHROW;
+
+ // Initialize exception (this is a GNU extension)
+ __cxa_refcounted_exception*
+ __cxa_init_primary_exception(void *object, std::type_info *tinfo,
+ void (_GLIBCXX_CDTOR_CALLABI *dest) (void *)) _GLIBCXX_NOTHROW;
+
+ }
+} // namespace __cxxabiv1
+
+#endif
+
+#pragma GCC visibility pop
+
+#endif // _CXXABI_INIT_EXCEPTION_H
diff --git a/libstdc++-v3/libsupc++/del_op.cc b/libstdc++-v3/libsupc++/del_op.cc
index 98b632e0cf..4e3a67fd74 100644
--- a/libstdc++-v3/libsupc++/del_op.cc
+++ b/libstdc++-v3/libsupc++/del_op.cc
@@ -1,6 +1,6 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997-2016 Free Software Foundation, Inc.
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/del_opa.cc b/libstdc++-v3/libsupc++/del_opa.cc
new file mode 100644
index 0000000000..f7bf7a4a1d
--- /dev/null
+++ b/libstdc++-v3/libsupc++/del_opa.cc
@@ -0,0 +1,58 @@
+// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC 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.
+//
+// GCC 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.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#include <bits/c++config.h>
+
+#if !_GLIBCXX_HOSTED
+// A freestanding C runtime may not provide "free" -- but there is no
+// other reasonable way to implement "operator delete".
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+ extern "C" void free(void*);
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+#else
+# include <cstdlib>
+#endif
+
+#include "new"
+
+// The sized deletes are defined in other files.
+#pragma GCC diagnostic ignored "-Wsized-deallocation"
+
+_GLIBCXX_WEAK_DEFINITION void
+operator delete(void* ptr, std::align_val_t) _GLIBCXX_USE_NOEXCEPT
+{
+#if _GLIBCXX_HAVE_ALIGNED_ALLOC || _GLIBCXX_HAVE_POSIX_MEMALIGN \
+ || _GLIBCXX_HAVE_MEMALIGN
+ std::free (ptr);
+#elif _GLIBCXX_HAVE__ALIGNED_MALLOC
+ _aligned_free (ptr);
+#else
+ if (ptr)
+ std::free (((void **) ptr)[-1]); // See aligned_alloc in new_opa.cc
+#endif
+}
diff --git a/libstdc++-v3/libsupc++/del_opant.cc b/libstdc++-v3/libsupc++/del_opant.cc
new file mode 100644
index 0000000000..0245efc5dd
--- /dev/null
+++ b/libstdc++-v3/libsupc++/del_opant.cc
@@ -0,0 +1,33 @@
+// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC 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.
+//
+// GCC 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.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#include <bits/c++config.h>
+#include "new"
+
+_GLIBCXX_WEAK_DEFINITION void
+operator delete (void *ptr, std::align_val_t al, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
+{
+ ::operator delete (ptr, al);
+}
diff --git a/libstdc++-v3/libsupc++/del_opnt.cc b/libstdc++-v3/libsupc++/del_opnt.cc
index 2dadb5988e..c3ea38ad4a 100644
--- a/libstdc++-v3/libsupc++/del_opnt.cc
+++ b/libstdc++-v3/libsupc++/del_opnt.cc
@@ -1,6 +1,6 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997-2016 Free Software Foundation, Inc.
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/del_ops.cc b/libstdc++-v3/libsupc++/del_ops.cc
index d41374d91c..5978eb9f3c 100644
--- a/libstdc++-v3/libsupc++/del_ops.cc
+++ b/libstdc++-v3/libsupc++/del_ops.cc
@@ -1,6 +1,6 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997-2016 Free Software Foundation, Inc.
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/del_opsa.cc b/libstdc++-v3/libsupc++/del_opsa.cc
new file mode 100644
index 0000000000..a3bdd58911
--- /dev/null
+++ b/libstdc++-v3/libsupc++/del_opsa.cc
@@ -0,0 +1,33 @@
+// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC 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.
+//
+// GCC 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.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#include <bits/c++config.h>
+#include "new"
+
+_GLIBCXX_WEAK_DEFINITION void
+operator delete(void* ptr, std::size_t, std::align_val_t al) _GLIBCXX_USE_NOEXCEPT
+{
+ ::operator delete (ptr, al);
+}
diff --git a/libstdc++-v3/libsupc++/del_opv.cc b/libstdc++-v3/libsupc++/del_opv.cc
index b461508bc8..4fc62f3465 100644
--- a/libstdc++-v3/libsupc++/del_opv.cc
+++ b/libstdc++-v3/libsupc++/del_opv.cc
@@ -1,6 +1,6 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997-2016 Free Software Foundation, Inc.
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/del_opva.cc b/libstdc++-v3/libsupc++/del_opva.cc
new file mode 100644
index 0000000000..d15ec2171a
--- /dev/null
+++ b/libstdc++-v3/libsupc++/del_opva.cc
@@ -0,0 +1,36 @@
+// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC 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.
+//
+// GCC 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.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#include <bits/c++config.h>
+#include "new"
+
+// The sized deletes are defined in other files.
+#pragma GCC diagnostic ignored "-Wsized-deallocation"
+
+_GLIBCXX_WEAK_DEFINITION void
+operator delete[] (void *ptr, std::align_val_t al) _GLIBCXX_USE_NOEXCEPT
+{
+ ::operator delete (ptr, al);
+}
diff --git a/libstdc++-v3/libsupc++/del_opvant.cc b/libstdc++-v3/libsupc++/del_opvant.cc
new file mode 100644
index 0000000000..c5c9db7efb
--- /dev/null
+++ b/libstdc++-v3/libsupc++/del_opvant.cc
@@ -0,0 +1,33 @@
+// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC 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.
+//
+// GCC 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.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#include <bits/c++config.h>
+#include "new"
+
+_GLIBCXX_WEAK_DEFINITION void
+operator delete[] (void *ptr, std::align_val_t al, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
+{
+ ::operator delete[] (ptr, al);
+}
diff --git a/libstdc++-v3/libsupc++/del_opvnt.cc b/libstdc++-v3/libsupc++/del_opvnt.cc
index 9d897838b1..446cf36603 100644
--- a/libstdc++-v3/libsupc++/del_opvnt.cc
+++ b/libstdc++-v3/libsupc++/del_opvnt.cc
@@ -1,6 +1,6 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997-2016 Free Software Foundation, Inc.
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/del_opvs.cc b/libstdc++-v3/libsupc++/del_opvs.cc
index 3103111d7e..a63115785b 100644
--- a/libstdc++-v3/libsupc++/del_opvs.cc
+++ b/libstdc++-v3/libsupc++/del_opvs.cc
@@ -1,6 +1,6 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997-2016 Free Software Foundation, Inc.
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/del_opvsa.cc b/libstdc++-v3/libsupc++/del_opvsa.cc
new file mode 100644
index 0000000000..5b3a2c257d
--- /dev/null
+++ b/libstdc++-v3/libsupc++/del_opvsa.cc
@@ -0,0 +1,33 @@
+// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC 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.
+//
+// GCC 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.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#include <bits/c++config.h>
+#include "new"
+
+_GLIBCXX_WEAK_DEFINITION void
+operator delete[] (void *ptr, std::size_t, std::align_val_t al) _GLIBCXX_USE_NOEXCEPT
+{
+ ::operator delete[] (ptr, al);
+}
diff --git a/libstdc++-v3/libsupc++/dyncast.cc b/libstdc++-v3/libsupc++/dyncast.cc
index 760817b6b4..be10271d5e 100644
--- a/libstdc++-v3/libsupc++/dyncast.cc
+++ b/libstdc++-v3/libsupc++/dyncast.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/eh_alloc.cc b/libstdc++-v3/libsupc++/eh_alloc.cc
index d362e406cc..d03cbcef9b 100644
--- a/libstdc++-v3/libsupc++/eh_alloc.cc
+++ b/libstdc++-v3/libsupc++/eh_alloc.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- Allocate exception objects.
-// Copyright (C) 2001-2016 Free Software Foundation, Inc.
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/eh_arm.cc b/libstdc++-v3/libsupc++/eh_arm.cc
index ad453a1f51..552de2c9c6 100644
--- a/libstdc++-v3/libsupc++/eh_arm.cc
+++ b/libstdc++-v3/libsupc++/eh_arm.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- ARM specific Exception handling support routines.
-// Copyright (C) 2004-2016 Free Software Foundation, Inc.
+// Copyright (C) 2004-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/eh_atomics.h b/libstdc++-v3/libsupc++/eh_atomics.h
new file mode 100644
index 0000000000..22a45c1b06
--- /dev/null
+++ b/libstdc++-v3/libsupc++/eh_atomics.h
@@ -0,0 +1,84 @@
+// Exception Handling support header for -*- C++ -*-
+
+// Copyright (C) 2016-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC 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.
+//
+// GCC 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.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file eh_atomics.h
+ * This is an internal header file, included by library source files.
+ * Do not attempt to use it directly.
+ */
+
+#ifndef _EH_ATOMICS_H
+#define _EH_ATOMICS_H 1
+
+#include <bits/c++config.h>
+#include <bits/atomic_word.h>
+#include <bits/atomic_lockfree_defines.h>
+#if ATOMIC_INT_LOCK_FREE <= 1
+# include <ext/atomicity.h>
+#endif
+
+#pragma GCC visibility push(default)
+extern "C++" {
+namespace __gnu_cxx
+{
+ void
+ __eh_atomic_inc (_Atomic_word* __count) __attribute__((always_inline));
+
+ bool
+ __eh_atomic_dec (_Atomic_word* __count) __attribute__((always_inline));
+
+ // Increments the count.
+ inline void
+ __eh_atomic_inc (_Atomic_word* __count)
+ {
+#if ATOMIC_INT_LOCK_FREE > 1
+ __atomic_add_fetch (__count, 1, __ATOMIC_ACQ_REL);
+#else
+ _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE (__count);
+ __gnu_cxx::__atomic_add_dispatch (__count, 1);
+ _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER (__count);
+#endif
+ }
+
+ // Decrements the count and returns true if it reached zero.
+ inline bool
+ __eh_atomic_dec (_Atomic_word* __count)
+ {
+#if ATOMIC_INT_LOCK_FREE > 1
+ return __atomic_sub_fetch (__count, 1, __ATOMIC_ACQ_REL) == 0;
+#else
+ _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE (__count);
+ if (__gnu_cxx::__exchange_and_add_dispatch (__count, -1) == 1)
+ {
+ _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER (__count);
+ return true;
+ }
+ return false;
+#endif
+ }
+} // namespace __gnu_cxx
+}
+#pragma GCC visibility pop
+
+#endif // _EH_ATOMICS_H
diff --git a/libstdc++-v3/libsupc++/eh_aux_runtime.cc b/libstdc++-v3/libsupc++/eh_aux_runtime.cc
index dc483affee..c3285353d8 100644
--- a/libstdc++-v3/libsupc++/eh_aux_runtime.cc
+++ b/libstdc++-v3/libsupc++/eh_aux_runtime.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- Common throw conditions.
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/eh_call.cc b/libstdc++-v3/libsupc++/eh_call.cc
index 3d3005e01c..4aa4763bc8 100644
--- a/libstdc++-v3/libsupc++/eh_call.cc
+++ b/libstdc++-v3/libsupc++/eh_call.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- Helpers for calling unextected and terminate
-// Copyright (C) 2001-2016 Free Software Foundation, Inc.
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/eh_catch.cc b/libstdc++-v3/libsupc++/eh_catch.cc
index 3b66c19641..5f0aa1829a 100644
--- a/libstdc++-v3/libsupc++/eh_catch.cc
+++ b/libstdc++-v3/libsupc++/eh_catch.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- Exception handling routines for catching.
-// Copyright (C) 2001-2016 Free Software Foundation, Inc.
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/eh_exception.cc b/libstdc++-v3/libsupc++/eh_exception.cc
index 32f9df73a6..11f3e133b0 100644
--- a/libstdc++-v3/libsupc++/eh_exception.cc
+++ b/libstdc++-v3/libsupc++/eh_exception.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- std::exception implementation.
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/eh_globals.cc b/libstdc++-v3/libsupc++/eh_globals.cc
index 23644fe698..72b62ed7ac 100644
--- a/libstdc++-v3/libsupc++/eh_globals.cc
+++ b/libstdc++-v3/libsupc++/eh_globals.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- Manage the thread-local exception globals.
-// Copyright (C) 2001-2016 Free Software Foundation, Inc.
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc
index 5274b0f27a..5c381d9d33 100644
--- a/libstdc++-v3/libsupc++/eh_personality.cc
+++ b/libstdc++-v3/libsupc++/eh_personality.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- The GNU C++ exception personality routine.
-// Copyright (C) 2001-2016 Free Software Foundation, Inc.
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/eh_ptr.cc b/libstdc++-v3/libsupc++/eh_ptr.cc
index 3b8e0a01ed..12d8d70268 100644
--- a/libstdc++-v3/libsupc++/eh_ptr.cc
+++ b/libstdc++-v3/libsupc++/eh_ptr.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- Implement the members of exception_ptr.
-// Copyright (C) 2008-2016 Free Software Foundation, Inc.
+// Copyright (C) 2008-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -23,9 +23,7 @@
// <http://www.gnu.org/licenses/>.
#include <bits/c++config.h>
-#include <bits/atomic_lockfree_defines.h>
-
-#if ATOMIC_INT_LOCK_FREE > 1
+#include "eh_atomics.h"
#define _GLIBCXX_EH_PTR_COMPAT
@@ -63,33 +61,31 @@ static_assert( adjptr<__cxa_exception>()
#endif
}
-std::__exception_ptr::exception_ptr::exception_ptr() _GLIBCXX_USE_NOEXCEPT
+std::__exception_ptr::exception_ptr::exception_ptr() noexcept
: _M_exception_object(0) { }
-std::__exception_ptr::exception_ptr::exception_ptr(void* obj)
-_GLIBCXX_USE_NOEXCEPT
+std::__exception_ptr::exception_ptr::exception_ptr(void* obj) noexcept
: _M_exception_object(obj) { _M_addref(); }
-std::__exception_ptr::exception_ptr::exception_ptr(__safe_bool)
-_GLIBCXX_USE_NOEXCEPT
+std::__exception_ptr::exception_ptr::exception_ptr(__safe_bool) noexcept
: _M_exception_object(0) { }
std::__exception_ptr::
-exception_ptr::exception_ptr(const exception_ptr& other) _GLIBCXX_USE_NOEXCEPT
+exception_ptr::exception_ptr(const exception_ptr& other) noexcept
: _M_exception_object(other._M_exception_object)
{ _M_addref(); }
-std::__exception_ptr::exception_ptr::~exception_ptr() _GLIBCXX_USE_NOEXCEPT
+std::__exception_ptr::exception_ptr::~exception_ptr() noexcept
{ _M_release(); }
std::__exception_ptr::exception_ptr&
std::__exception_ptr::
-exception_ptr::operator=(const exception_ptr& other) _GLIBCXX_USE_NOEXCEPT
+exception_ptr::operator=(const exception_ptr& other) noexcept
{
exception_ptr(other).swap(*this);
return *this;
@@ -97,25 +93,25 @@ exception_ptr::operator=(const exception_ptr& other) _GLIBCXX_USE_NOEXCEPT
void
-std::__exception_ptr::exception_ptr::_M_addref() _GLIBCXX_USE_NOEXCEPT
+std::__exception_ptr::exception_ptr::_M_addref() noexcept
{
if (_M_exception_object)
{
__cxa_refcounted_exception *eh =
__get_refcounted_exception_header_from_obj (_M_exception_object);
- __atomic_add_fetch (&eh->referenceCount, 1, __ATOMIC_ACQ_REL);
+ __gnu_cxx::__eh_atomic_inc (&eh->referenceCount);
}
}
void
-std::__exception_ptr::exception_ptr::_M_release() _GLIBCXX_USE_NOEXCEPT
+std::__exception_ptr::exception_ptr::_M_release() noexcept
{
if (_M_exception_object)
{
__cxa_refcounted_exception *eh =
__get_refcounted_exception_header_from_obj (_M_exception_object);
- if (__atomic_sub_fetch (&eh->referenceCount, 1, __ATOMIC_ACQ_REL) == 0)
+ if (__gnu_cxx::__eh_atomic_dec (&eh->referenceCount))
{
if (eh->exc.exceptionDestructor)
eh->exc.exceptionDestructor (_M_exception_object);
@@ -128,13 +124,12 @@ std::__exception_ptr::exception_ptr::_M_release() _GLIBCXX_USE_NOEXCEPT
void*
-std::__exception_ptr::exception_ptr::_M_get() const _GLIBCXX_USE_NOEXCEPT
+std::__exception_ptr::exception_ptr::_M_get() const noexcept
{ return _M_exception_object; }
void
-std::__exception_ptr::exception_ptr::swap(exception_ptr &other)
- _GLIBCXX_USE_NOEXCEPT
+std::__exception_ptr::exception_ptr::swap(exception_ptr &other) noexcept
{
void *tmp = _M_exception_object;
_M_exception_object = other._M_exception_object;
@@ -144,27 +139,24 @@ std::__exception_ptr::exception_ptr::swap(exception_ptr &other)
// Retained for compatibility with CXXABI_1.3.
void
-std::__exception_ptr::exception_ptr::_M_safe_bool_dummy()
- _GLIBCXX_USE_NOEXCEPT { }
+std::__exception_ptr::exception_ptr::_M_safe_bool_dummy() noexcept { }
// Retained for compatibility with CXXABI_1.3.
bool
-std::__exception_ptr::exception_ptr::operator!() const _GLIBCXX_USE_NOEXCEPT
+std::__exception_ptr::exception_ptr::operator!() const noexcept
{ return _M_exception_object == 0; }
// Retained for compatibility with CXXABI_1.3.
-std::__exception_ptr::exception_ptr::operator __safe_bool() const
-_GLIBCXX_USE_NOEXCEPT
+std::__exception_ptr::exception_ptr::operator __safe_bool() const noexcept
{
return _M_exception_object ? &exception_ptr::_M_safe_bool_dummy : 0;
}
const std::type_info*
-std::__exception_ptr::exception_ptr::__cxa_exception_type() const
- _GLIBCXX_USE_NOEXCEPT
+std::__exception_ptr::exception_ptr::__cxa_exception_type() const noexcept
{
__cxa_exception *eh = __get_exception_header_from_obj (_M_exception_object);
return eh->exceptionType;
@@ -172,19 +164,17 @@ std::__exception_ptr::exception_ptr::__cxa_exception_type() const
bool std::__exception_ptr::operator==(const exception_ptr& lhs,
- const exception_ptr& rhs)
- _GLIBCXX_USE_NOEXCEPT
+ const exception_ptr& rhs) noexcept
{ return lhs._M_exception_object == rhs._M_exception_object; }
bool std::__exception_ptr::operator!=(const exception_ptr& lhs,
- const exception_ptr& rhs)
- _GLIBCXX_USE_NOEXCEPT
+ const exception_ptr& rhs) noexcept
{ return !(lhs == rhs);}
std::exception_ptr
-std::current_exception() _GLIBCXX_USE_NOEXCEPT
+std::current_exception() noexcept
{
__cxa_eh_globals *globals = __cxa_get_globals ();
__cxa_exception *header = globals->caughtExceptions;
@@ -219,7 +209,7 @@ __gxx_dependent_exception_cleanup(_Unwind_Reason_Code code,
__cxa_free_dependent_exception (dep);
- if (__atomic_sub_fetch (&header->referenceCount, 1, __ATOMIC_ACQ_REL) == 0)
+ if (__gnu_cxx::__eh_atomic_dec (&header->referenceCount))
{
if (header->exc.exceptionDestructor)
header->exc.exceptionDestructor (header + 1);
@@ -238,7 +228,7 @@ std::rethrow_exception(std::exception_ptr ep)
__cxa_dependent_exception *dep = __cxa_allocate_dependent_exception ();
dep->primaryException = obj;
- __atomic_add_fetch (&eh->referenceCount, 1, __ATOMIC_ACQ_REL);
+ __gnu_cxx::__eh_atomic_inc (&eh->referenceCount);
dep->unexpectedHandler = get_unexpected ();
dep->terminateHandler = get_terminate ();
@@ -260,5 +250,3 @@ std::rethrow_exception(std::exception_ptr ep)
}
#undef _GLIBCXX_EH_PTR_COMPAT
-
-#endif
diff --git a/libstdc++-v3/libsupc++/eh_term_handler.cc b/libstdc++-v3/libsupc++/eh_term_handler.cc
index 82078be04d..d3d4b274f1 100644
--- a/libstdc++-v3/libsupc++/eh_term_handler.cc
+++ b/libstdc++-v3/libsupc++/eh_term_handler.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- std::terminate handler
-// Copyright (C) 2002-2016 Free Software Foundation, Inc.
+// Copyright (C) 2002-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/eh_terminate.cc b/libstdc++-v3/libsupc++/eh_terminate.cc
index fd6ccc1c1f..3bf5498db6 100644
--- a/libstdc++-v3/libsupc++/eh_terminate.cc
+++ b/libstdc++-v3/libsupc++/eh_terminate.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- std::terminate, std::unexpected and friends.
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/eh_throw.cc b/libstdc++-v3/libsupc++/eh_throw.cc
index 9aac218527..13428d92da 100644
--- a/libstdc++-v3/libsupc++/eh_throw.cc
+++ b/libstdc++-v3/libsupc++/eh_throw.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- Exception handling routines for throwing.
-// Copyright (C) 2001-2016 Free Software Foundation, Inc.
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -24,6 +24,7 @@
#include <bits/c++config.h>
#include "unwind-cxx.h"
+#include "eh_atomics.h"
using namespace __cxxabiv1;
@@ -42,19 +43,31 @@ __gxx_exception_cleanup (_Unwind_Reason_Code code, _Unwind_Exception *exc)
if (code != _URC_FOREIGN_EXCEPTION_CAUGHT && code != _URC_NO_REASON)
__terminate (header->exc.terminateHandler);
-#if ATOMIC_INT_LOCK_FREE > 1
- if (__atomic_sub_fetch (&header->referenceCount, 1, __ATOMIC_ACQ_REL) == 0)
+ if (__gnu_cxx::__eh_atomic_dec (&header->referenceCount))
{
-#endif
if (header->exc.exceptionDestructor)
header->exc.exceptionDestructor (header + 1);
__cxa_free_exception (header + 1);
-#if ATOMIC_INT_LOCK_FREE > 1
}
-#endif
}
+extern "C" __cxa_refcounted_exception*
+__cxxabiv1::__cxa_init_primary_exception(void *obj, std::type_info *tinfo,
+ void (_GLIBCXX_CDTOR_CALLABI *dest) (void *))
+{
+ __cxa_refcounted_exception *header
+ = __get_refcounted_exception_header_from_obj (obj);
+ header->referenceCount = 0;
+ header->exc.exceptionType = tinfo;
+ header->exc.exceptionDestructor = dest;
+ header->exc.unexpectedHandler = std::get_unexpected ();
+ header->exc.terminateHandler = std::get_terminate ();
+ __GXX_INIT_PRIMARY_EXCEPTION_CLASS(header->exc.unwindHeader.exception_class);
+ header->exc.unwindHeader.exception_cleanup = __gxx_exception_cleanup;
+
+ return header;
+}
extern "C" void
__cxxabiv1::__cxa_throw (void *obj, std::type_info *tinfo,
@@ -64,17 +77,10 @@ __cxxabiv1::__cxa_throw (void *obj, std::type_info *tinfo,
__cxa_eh_globals *globals = __cxa_get_globals ();
globals->uncaughtExceptions += 1;
-
// Definitely a primary.
- __cxa_refcounted_exception *header
- = __get_refcounted_exception_header_from_obj (obj);
+ __cxa_refcounted_exception *header =
+ __cxa_init_primary_exception(obj, tinfo, dest);
header->referenceCount = 1;
- header->exc.exceptionType = tinfo;
- header->exc.exceptionDestructor = dest;
- header->exc.unexpectedHandler = std::get_unexpected ();
- header->exc.terminateHandler = std::get_terminate ();
- __GXX_INIT_PRIMARY_EXCEPTION_CLASS(header->exc.unwindHeader.exception_class);
- header->exc.unwindHeader.exception_cleanup = __gxx_exception_cleanup;
#ifdef __USING_SJLJ_EXCEPTIONS__
_Unwind_SjLj_RaiseException (&header->exc.unwindHeader);
diff --git a/libstdc++-v3/libsupc++/eh_tm.cc b/libstdc++-v3/libsupc++/eh_tm.cc
index c05f611d33..ffb5ef6ccf 100644
--- a/libstdc++-v3/libsupc++/eh_tm.cc
+++ b/libstdc++-v3/libsupc++/eh_tm.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- Exception handling routines for Transactional Memory.
-// Copyright (C) 2009-2016 Free Software Foundation, Inc.
+// Copyright (C) 2009-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -24,6 +24,7 @@
#include <cstdlib>
#include "unwind-cxx.h"
+#include "eh_atomics.h"
using namespace __cxxabiv1;
@@ -45,9 +46,7 @@ free_any_cxa_exception (_Unwind_Exception *eo)
__cxa_free_dependent_exception (dep);
}
-#if __GCC_ATOMIC_INT_LOCK_FREE > 1
- if (__atomic_sub_fetch (&h->referenceCount, 1, __ATOMIC_ACQ_REL) == 0)
-#endif
+ if (__gnu_cxx::__eh_atomic_dec (&h->referenceCount))
__cxa_free_exception (h + 1);
}
diff --git a/libstdc++-v3/libsupc++/eh_type.cc b/libstdc++-v3/libsupc++/eh_type.cc
index a1c3218d2e..f23dd7f7db 100644
--- a/libstdc++-v3/libsupc++/eh_type.cc
+++ b/libstdc++-v3/libsupc++/eh_type.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- Exception handling routines for catching.
-// Copyright (C) 2001-2016 Free Software Foundation, Inc.
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/eh_unex_handler.cc b/libstdc++-v3/libsupc++/eh_unex_handler.cc
index 429cafe127..bd9e0d63f2 100644
--- a/libstdc++-v3/libsupc++/eh_unex_handler.cc
+++ b/libstdc++-v3/libsupc++/eh_unex_handler.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- std::unexpected handler
-// Copyright (C) 2002-2016 Free Software Foundation, Inc.
+// Copyright (C) 2002-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/enum_type_info.cc b/libstdc++-v3/libsupc++/enum_type_info.cc
index 9a0c2100e0..0f495e73f8 100644
--- a/libstdc++-v3/libsupc++/enum_type_info.cc
+++ b/libstdc++-v3/libsupc++/enum_type_info.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/exception b/libstdc++-v3/libsupc++/exception
index 63631f6d1d..e51d31c938 100644
--- a/libstdc++-v3/libsupc++/exception
+++ b/libstdc++-v3/libsupc++/exception
@@ -1,6 +1,6 @@
// Exception Handling support header for -*- C++ -*-
-// Copyright (C) 1995-2016 Free Software Foundation, Inc.
+// Copyright (C) 1995-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -35,40 +35,12 @@
#pragma GCC visibility push(default)
#include <bits/c++config.h>
-#include <bits/atomic_lockfree_defines.h>
+#include <bits/exception.h>
extern "C++" {
namespace std
{
- /**
- * @defgroup exceptions Exceptions
- * @ingroup diagnostics
- *
- * Classes and functions for reporting errors via exception classes.
- * @{
- */
-
- /**
- * @brief Base class for all library exceptions.
- *
- * This is the base class for all exceptions thrown by the standard
- * library, and by certain language expressions. You are free to derive
- * your own %exception classes, or use a different hierarchy, or to
- * throw non-class data (e.g., fundamental types).
- */
- class exception
- {
- public:
- exception() _GLIBCXX_USE_NOEXCEPT { }
- virtual ~exception() _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
-
- /** Returns a C-style character string describing the general cause
- * of the current error. */
- virtual const char*
- what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
- };
-
/** If an %exception is thrown which is not listed in a function's
* %exception specification, one of these may be thrown. */
class bad_exception : public exception
@@ -166,7 +138,7 @@ _GLIBCXX_END_NAMESPACE_VERSION
#pragma GCC visibility pop
-#if (__cplusplus >= 201103L) && (ATOMIC_INT_LOCK_FREE > 1)
+#if (__cplusplus >= 201103L)
#include <bits/exception_ptr.h>
#include <bits/nested_exception.h>
#endif
diff --git a/libstdc++-v3/libsupc++/exception.h b/libstdc++-v3/libsupc++/exception.h
new file mode 100644
index 0000000000..bfb6a06498
--- /dev/null
+++ b/libstdc++-v3/libsupc++/exception.h
@@ -0,0 +1,78 @@
+// Exception Handling support header for -*- C++ -*-
+
+// Copyright (C) 2016-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC 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.
+//
+// GCC 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.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/exception.h
+ * This is an internal header file, included by other library headers.
+ * Do not attempt to use it directly.
+ */
+
+#ifndef __EXCEPTION_H
+#define __EXCEPTION_H 1
+
+#pragma GCC system_header
+
+#pragma GCC visibility push(default)
+
+#include <bits/c++config.h>
+
+extern "C++" {
+
+namespace std
+{
+ /**
+ * @defgroup exceptions Exceptions
+ * @ingroup diagnostics
+ *
+ * Classes and functions for reporting errors via exception classes.
+ * @{
+ */
+
+ /**
+ * @brief Base class for all library exceptions.
+ *
+ * This is the base class for all exceptions thrown by the standard
+ * library, and by certain language expressions. You are free to derive
+ * your own %exception classes, or use a different hierarchy, or to
+ * throw non-class data (e.g., fundamental types).
+ */
+ class exception
+ {
+ public:
+ exception() _GLIBCXX_USE_NOEXCEPT { }
+ virtual ~exception() _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
+
+ /** Returns a C-style character string describing the general cause
+ * of the current error. */
+ virtual const char*
+ what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
+ };
+
+} // namespace std
+
+}
+
+#pragma GCC visibility pop
+
+#endif
diff --git a/libstdc++-v3/libsupc++/exception_defines.h b/libstdc++-v3/libsupc++/exception_defines.h
index 53f90d8432..3668a37436 100644
--- a/libstdc++-v3/libsupc++/exception_defines.h
+++ b/libstdc++-v3/libsupc++/exception_defines.h
@@ -1,6 +1,6 @@
// -fno-exceptions Support -*- C++ -*-
-// Copyright (C) 2001-2016 Free Software Foundation, Inc.
+// Copyright (C) 2001-2017 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
diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h
index 783e539764..0ece81d813 100644
--- a/libstdc++-v3/libsupc++/exception_ptr.h
+++ b/libstdc++-v3/libsupc++/exception_ptr.h
@@ -1,6 +1,6 @@
// Exception Handling support header (exception_ptr class) for -*- C++ -*-
-// Copyright (C) 2008-2016 Free Software Foundation, Inc.
+// Copyright (C) 2008-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -35,10 +35,9 @@
#include <bits/c++config.h>
#include <bits/exception_defines.h>
-
-#if ATOMIC_INT_LOCK_FREE < 2
-# error This platform does not support exception propagation.
-#endif
+#include <bits/cxxabi_init_exception.h>
+#include <typeinfo>
+#include <new>
extern "C++" {
@@ -63,6 +62,9 @@ namespace std
*/
exception_ptr current_exception() _GLIBCXX_USE_NOEXCEPT;
+ template<typename _Ex>
+ exception_ptr make_exception_ptr(_Ex) _GLIBCXX_USE_NOEXCEPT;
+
/// Throw the object pointed to by the exception_ptr.
void rethrow_exception(exception_ptr) __attribute__ ((__noreturn__));
@@ -87,6 +89,8 @@ namespace std
friend exception_ptr std::current_exception() _GLIBCXX_USE_NOEXCEPT;
friend void std::rethrow_exception(exception_ptr);
+ template<typename _Ex>
+ friend exception_ptr std::make_exception_ptr(_Ex) _GLIBCXX_USE_NOEXCEPT;
public:
exception_ptr() _GLIBCXX_USE_NOEXCEPT;
@@ -162,8 +166,12 @@ namespace std
swap(exception_ptr& __lhs, exception_ptr& __rhs)
{ __lhs.swap(__rhs); }
- } // namespace __exception_ptr
+ template<typename _Ex>
+ inline void
+ __dest_thunk(void* __x)
+ { static_cast<_Ex*>(__x)->~_Ex(); }
+ } // namespace __exception_ptr
/// Obtain an exception_ptr pointing to a copy of the supplied object.
template<typename _Ex>
@@ -173,7 +181,16 @@ namespace std
#if __cpp_exceptions
try
{
- throw __ex;
+#if __cpp_rtti && !_GLIBCXX_HAVE_CDTOR_CALLABI
+ void *__e = __cxxabiv1::__cxa_allocate_exception(sizeof(_Ex));
+ (void)__cxxabiv1::__cxa_init_primary_exception(
+ __e, const_cast<std::type_info*>(&typeid(__ex)),
+ __exception_ptr::__dest_thunk<_Ex>);
+ ::new (__e) _Ex(__ex);
+ return exception_ptr(__e);
+#else
+ throw __ex;
+#endif
}
catch(...)
{
diff --git a/libstdc++-v3/libsupc++/function_type_info.cc b/libstdc++-v3/libsupc++/function_type_info.cc
index ea1f5aa581..0347a8d13b 100644
--- a/libstdc++-v3/libsupc++/function_type_info.cc
+++ b/libstdc++-v3/libsupc++/function_type_info.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/fundamental_type_info.cc b/libstdc++-v3/libsupc++/fundamental_type_info.cc
index 465d16bab3..d0f000be27 100644
--- a/libstdc++-v3/libsupc++/fundamental_type_info.cc
+++ b/libstdc++-v3/libsupc++/fundamental_type_info.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/guard.cc b/libstdc++-v3/libsupc++/guard.cc
index 9b617998ff..19953bc52f 100644
--- a/libstdc++-v3/libsupc++/guard.cc
+++ b/libstdc++-v3/libsupc++/guard.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2002-2016 Free Software Foundation, Inc.
+// Copyright (C) 2002-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -30,6 +30,7 @@
#include <new>
#include <ext/atomicity.h>
#include <ext/concurrence.h>
+#include <bits/atomic_lockfree_defines.h>
#if defined(__GTHREADS) && defined(__GTHREAD_HAS_COND) \
&& (ATOMIC_INT_LOCK_FREE > 1) && defined(_GLIBCXX_HAVE_LINUX_FUTEX)
# include <climits>
diff --git a/libstdc++-v3/libsupc++/guard_error.cc b/libstdc++-v3/libsupc++/guard_error.cc
index 8cb5e39a05..89b489459e 100644
--- a/libstdc++-v3/libsupc++/guard_error.cc
+++ b/libstdc++-v3/libsupc++/guard_error.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2016 Free Software Foundation, Inc.
+// Copyright (C) 2011-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/hash_bytes.cc b/libstdc++-v3/libsupc++/hash_bytes.cc
index 2e5bbfaca1..8ef982dbc2 100644
--- a/libstdc++-v3/libsupc++/hash_bytes.cc
+++ b/libstdc++-v3/libsupc++/hash_bytes.cc
@@ -1,6 +1,6 @@
// Definition of _Hash_bytes. -*- C++ -*-
-// Copyright (C) 2010-2016 Free Software Foundation, Inc.
+// Copyright (C) 2010-2017 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
@@ -95,8 +95,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
case 3:
hash ^= static_cast<unsigned char>(buf[2]) << 16;
+ [[gnu::fallthrough]];
case 2:
hash ^= static_cast<unsigned char>(buf[1]) << 8;
+ [[gnu::fallthrough]];
case 1:
hash ^= static_cast<unsigned char>(buf[0]);
hash *= m;
@@ -110,6 +112,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
// Implementation of FNV hash for 32-bit size_t.
+ // N.B. This function should work on unsigned char, otherwise it does not
+ // correctly implement the FNV-1a algorithm (see PR59406).
+ // The existing behaviour is retained for backwards compatibility.
size_t
_Fnv_hash_bytes(const void* ptr, size_t len, size_t hash)
{
@@ -155,6 +160,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
// Implementation of FNV hash for 64-bit size_t.
+ // N.B. This function should work on unsigned char, otherwise it does not
+ // correctly implement the FNV-1a algorithm (see PR59406).
+ // The existing behaviour is retained for backwards compatibility.
size_t
_Fnv_hash_bytes(const void* ptr, size_t len, size_t hash)
{
diff --git a/libstdc++-v3/libsupc++/hash_bytes.h b/libstdc++-v3/libsupc++/hash_bytes.h
index cbffde0e4d..f9b98a032b 100644
--- a/libstdc++-v3/libsupc++/hash_bytes.h
+++ b/libstdc++-v3/libsupc++/hash_bytes.h
@@ -1,6 +1,6 @@
// Declarations for hash functions. -*- C++ -*-
-// Copyright (C) 2010-2016 Free Software Foundation, Inc.
+// Copyright (C) 2010-2017 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
diff --git a/libstdc++-v3/libsupc++/initializer_list b/libstdc++-v3/libsupc++/initializer_list
index c2fd34866d..6279e0de58 100644
--- a/libstdc++-v3/libsupc++/initializer_list
+++ b/libstdc++-v3/libsupc++/initializer_list
@@ -1,6 +1,6 @@
// std::initializer_list support -*- C++ -*-
-// Copyright (C) 2008-2016 Free Software Foundation, Inc.
+// Copyright (C) 2008-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/nested_exception.cc b/libstdc++-v3/libsupc++/nested_exception.cc
index c1a7b7ad46..7e1b545184 100644
--- a/libstdc++-v3/libsupc++/nested_exception.cc
+++ b/libstdc++-v3/libsupc++/nested_exception.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2016 Free Software Foundation, Inc.
+// Copyright (C) 2011-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -25,7 +25,5 @@
namespace std
{
-#if ATOMIC_INT_LOCK_FREE > 1
nested_exception::~nested_exception() noexcept = default;
-#endif
} // namespace std
diff --git a/libstdc++-v3/libsupc++/nested_exception.h b/libstdc++-v3/libsupc++/nested_exception.h
index 377b803302..43970b4ef8 100644
--- a/libstdc++-v3/libsupc++/nested_exception.h
+++ b/libstdc++-v3/libsupc++/nested_exception.h
@@ -1,6 +1,6 @@
// Nested Exception support header (nested_exception class) for -*- C++ -*-
-// Copyright (C) 2009-2016 Free Software Foundation, Inc.
+// Copyright (C) 2009-2017 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
@@ -39,10 +39,6 @@
#include <bits/c++config.h>
#include <bits/move.h>
-#if ATOMIC_INT_LOCK_FREE < 2
-# error This platform does not support exception propagation.
-#endif
-
extern "C++" {
namespace std
@@ -92,41 +88,21 @@ namespace std
{ }
};
- template<typename _Tp,
- bool __with_nested = !__is_base_of(nested_exception, _Tp)>
- struct _Throw_with_nested_impl
- {
- template<typename _Up>
- static void _S_throw(_Up&& __t)
- { throw _Nested_exception<_Tp>{static_cast<_Up&&>(__t)}; }
- };
-
+ // [except.nested]/8
+ // Throw an exception of unspecified type that is publicly derived from
+ // both remove_reference_t<_Tp> and nested_exception.
template<typename _Tp>
- struct _Throw_with_nested_impl<_Tp, false>
+ inline void
+ __throw_with_nested_impl(_Tp&& __t, true_type)
{
- template<typename _Up>
- static void _S_throw(_Up&& __t)
- { throw static_cast<_Up&&>(__t); }
- };
-
- template<typename _Tp, bool = __is_class(_Tp) && !__is_final(_Tp)>
- struct _Throw_with_nested_helper : _Throw_with_nested_impl<_Tp>
- { };
-
- template<typename _Tp>
- struct _Throw_with_nested_helper<_Tp, false>
- : _Throw_with_nested_impl<_Tp, false>
- { };
-
- template<typename _Tp>
- struct _Throw_with_nested_helper<_Tp&, false>
- : _Throw_with_nested_helper<_Tp>
- { };
+ using _Up = typename remove_reference<_Tp>::type;
+ throw _Nested_exception<_Up>{std::forward<_Tp>(__t)};
+ }
template<typename _Tp>
- struct _Throw_with_nested_helper<_Tp&&, false>
- : _Throw_with_nested_helper<_Tp>
- { };
+ inline void
+ __throw_with_nested_impl(_Tp&& __t, false_type)
+ { throw std::forward<_Tp>(__t); }
/// If @p __t is derived from nested_exception, throws @p __t.
/// Else, throws an implementation-defined object derived from both.
@@ -135,33 +111,43 @@ namespace std
inline void
throw_with_nested(_Tp&& __t)
{
- _Throw_with_nested_helper<_Tp>::_S_throw(static_cast<_Tp&&>(__t));
+ using _Up = typename decay<_Tp>::type;
+ using _CopyConstructible
+ = __and_<is_copy_constructible<_Up>, is_move_constructible<_Up>>;
+ static_assert(_CopyConstructible::value,
+ "throw_with_nested argument must be CopyConstructible");
+ using __nest = __and_<is_class<_Up>, __bool_constant<!__is_final(_Up)>,
+ __not_<is_base_of<nested_exception, _Up>>>;
+ std::__throw_with_nested_impl(std::forward<_Tp>(__t), __nest{});
}
- template<typename _Tp, bool = __is_polymorphic(_Tp)>
- struct _Rethrow_if_nested_impl
- {
- static void _S_rethrow(const _Tp& __t)
- {
- if (auto __tp =
- dynamic_cast<const nested_exception*>(std::__addressof(__t)))
- __tp->rethrow_nested();
- }
- };
-
+ // Determine if dynamic_cast<const nested_exception&> would be well-formed.
template<typename _Tp>
- struct _Rethrow_if_nested_impl<_Tp, false>
+ using __rethrow_if_nested_cond = typename enable_if<
+ __and_<is_polymorphic<_Tp>,
+ __or_<__not_<is_base_of<nested_exception, _Tp>>,
+ is_convertible<_Tp*, nested_exception*>>>::value
+ >::type;
+
+ // Attempt dynamic_cast to nested_exception and call rethrow_nested().
+ template<typename _Ex>
+ inline __rethrow_if_nested_cond<_Ex>
+ __rethrow_if_nested_impl(const _Ex* __ptr)
{
- static void _S_rethrow(const _Tp&) { }
- };
+ if (auto __ne_ptr = dynamic_cast<const nested_exception*>(__ptr))
+ __ne_ptr->rethrow_nested();
+ }
+
+ // Otherwise, no effects.
+ inline void
+ __rethrow_if_nested_impl(const void*)
+ { }
/// If @p __ex is derived from nested_exception, @p __ex.rethrow_nested().
template<typename _Ex>
inline void
rethrow_if_nested(const _Ex& __ex)
- {
- _Rethrow_if_nested_impl<_Ex>::_S_rethrow(__ex);
- }
+ { std::__rethrow_if_nested_impl(std::__addressof(__ex)); }
// @} group exceptions
} // namespace std
diff --git a/libstdc++-v3/libsupc++/new b/libstdc++-v3/libsupc++/new
index 5cd62695be..04f172cebd 100644
--- a/libstdc++-v3/libsupc++/new
+++ b/libstdc++-v3/libsupc++/new
@@ -1,6 +1,6 @@
// The -*- C++ -*- dynamic memory management header.
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
// This file is part of GCC.
//
@@ -79,6 +79,10 @@ namespace std
};
#endif
+#if __cpp_aligned_new
+ enum class align_val_t: size_t {};
+#endif
+
struct nothrow_t
{
#if __cplusplus >= 201103L
@@ -135,12 +139,30 @@ void operator delete(void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
__attribute__((__externally_visible__));
void operator delete[](void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
__attribute__((__externally_visible__));
-#if __cpp_sized_deallocation
-void operator delete(void*, std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
+#if __cpp_aligned_new
+void* operator new(std::size_t, std::align_val_t)
__attribute__((__externally_visible__));
-void operator delete[](void*, std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
+void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
+ _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
+void operator delete(void*, std::align_val_t)
+ _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
+void operator delete(void*, std::align_val_t, const std::nothrow_t&)
+ _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
+void* operator new[](std::size_t, std::align_val_t)
__attribute__((__externally_visible__));
-#endif
+void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
+ _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
+void operator delete[](void*, std::align_val_t)
+ _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
+void operator delete[](void*, std::align_val_t, const std::nothrow_t&)
+ _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
+#if __cpp_sized_deallocation
+void operator delete(void*, std::size_t, std::align_val_t)
+ _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
+void operator delete[](void*, std::size_t, std::align_val_t)
+ _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
+#endif // __cpp_sized_deallocation
+#endif // __cpp_aligned_new
// Default placement versions of operator new.
inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
@@ -154,6 +176,43 @@ inline void operator delete[](void*, void*) _GLIBCXX_USE_NOEXCEPT { }
//@}
} // extern "C++"
+#if __cplusplus > 201402L
+#if __GNUC__ >= 7
+# define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1
+#elif defined __has_builtin
+// For non-GNU compilers:
+# if __has_builtin(__builtin_launder)
+# define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1
+# endif
+#endif
+
+#ifdef _GLIBCXX_HAVE_BUILTIN_LAUNDER
+namespace std
+{
+#define __cpp_lib_launder 201606
+ /// Pointer optimization barrier [ptr.launder]
+ template<typename _Tp>
+ constexpr _Tp*
+ launder(_Tp* __p) noexcept
+ { return __builtin_launder(__p); }
+
+ // The program is ill-formed if T is a function type or
+ // (possibly cv-qualified) void.
+
+ template<typename _Ret, typename... _Args _GLIBCXX_NOEXCEPT_PARM>
+ void launder(_Ret (*)(_Args...) _GLIBCXX_NOEXCEPT_QUAL) = delete;
+ template<typename _Ret, typename... _Args _GLIBCXX_NOEXCEPT_PARM>
+ void launder(_Ret (*)(_Args......) _GLIBCXX_NOEXCEPT_QUAL) = delete;
+
+ void launder(void*) = delete;
+ void launder(const void*) = delete;
+ void launder(volatile void*) = delete;
+ void launder(const volatile void*) = delete;
+}
+#endif // _GLIBCXX_HAVE_BUILTIN_LAUNDER
+#undef _GLIBCXX_HAVE_BUILTIN_LAUNDER
+#endif // C++17
+
#pragma GCC visibility pop
#endif
diff --git a/libstdc++-v3/libsupc++/new_handler.cc b/libstdc++-v3/libsupc++/new_handler.cc
index 11f1193167..7196dbe376 100644
--- a/libstdc++-v3/libsupc++/new_handler.cc
+++ b/libstdc++-v3/libsupc++/new_handler.cc
@@ -1,6 +1,6 @@
// Implementation file for the -*- C++ -*- dynamic memory management header.
-// Copyright (C) 1996-2016 Free Software Foundation, Inc.
+// Copyright (C) 1996-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/new_op.cc b/libstdc++-v3/libsupc++/new_op.cc
index edad9b3263..1c19d44776 100644
--- a/libstdc++-v3/libsupc++/new_op.cc
+++ b/libstdc++-v3/libsupc++/new_op.cc
@@ -1,6 +1,6 @@
// Support routines for the -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997-2016 Free Software Foundation, Inc.
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/new_opa.cc b/libstdc++-v3/libsupc++/new_opa.cc
new file mode 100644
index 0000000000..e2a0d2f537
--- /dev/null
+++ b/libstdc++-v3/libsupc++/new_opa.cc
@@ -0,0 +1,112 @@
+// Support routines for the -*- C++ -*- dynamic memory management.
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC 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.
+//
+// GCC 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.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#include <bits/c++config.h>
+#include <stdlib.h>
+#include <bits/exception_defines.h>
+#include "new"
+
+using std::new_handler;
+using std::bad_alloc;
+
+#if !_GLIBCXX_HAVE_ALIGNED_ALLOC
+#if _GLIBCXX_HAVE__ALIGNED_MALLOC
+#define aligned_alloc(al,sz) _aligned_malloc(sz,al)
+#elif _GLIBCXX_HAVE_POSIX_MEMALIGN
+static inline void*
+aligned_alloc (std::size_t al, std::size_t sz)
+{
+ void *ptr;
+ // The value of alignment shall be a power of two multiple of sizeof(void *).
+ if (al < sizeof(void*))
+ al = sizeof(void*);
+ int ret = posix_memalign (&ptr, al, sz);
+ if (ret == 0)
+ return ptr;
+ return nullptr;
+}
+#elif _GLIBCXX_HAVE_MEMALIGN
+#if _GLIBCXX_HOSTED
+#include <malloc.h>
+#else
+extern "C" void *memalign(std::size_t boundary, std::size_t size);
+#endif
+#define aligned_alloc memalign
+#else
+#include <stdint.h>
+// The C library doesn't provide any aligned allocation functions, define one.
+// This is a modified version of code from gcc/config/i386/gmm_malloc.h
+static inline void*
+aligned_alloc (std::size_t al, std::size_t sz)
+{
+ // Alignment must be a power of two.
+ if (al & (al - 1))
+ return nullptr;
+ else if (!sz)
+ return nullptr;
+
+ // We need extra bytes to store the original value returned by malloc.
+ if (al < sizeof(void*))
+ al = sizeof(void*);
+ void* const malloc_ptr = malloc(sz + al);
+ if (!malloc_ptr)
+ return nullptr;
+ // Align to the requested value, leaving room for the original malloc value.
+ void* const aligned_ptr = (void *) (((uintptr_t) malloc_ptr + al) & -al);
+
+ // Store the original malloc value where it can be found by operator delete.
+ ((void **) aligned_ptr)[-1] = malloc_ptr;
+
+ return aligned_ptr;
+}
+#endif
+#endif
+
+_GLIBCXX_WEAK_DEFINITION void *
+operator new (std::size_t sz, std::align_val_t al)
+{
+ void *p;
+ std::size_t align = (std::size_t)al;
+
+ /* malloc (0) is unpredictable; avoid it. */
+ if (sz == 0)
+ sz = 1;
+
+#if _GLIBCXX_HAVE_ALIGNED_ALLOC
+ /* C11: the value of size shall be an integral multiple of alignment. */
+ if (std::size_t rem = sz & (align - 1))
+ sz += align - rem;
+#endif
+
+ while (__builtin_expect ((p = aligned_alloc (align, sz)) == 0, false))
+ {
+ new_handler handler = std::get_new_handler ();
+ if (! handler)
+ _GLIBCXX_THROW_OR_ABORT(bad_alloc());
+ handler ();
+ }
+
+ return p;
+}
diff --git a/libstdc++-v3/libsupc++/new_opant.cc b/libstdc++-v3/libsupc++/new_opant.cc
new file mode 100644
index 0000000000..dde3e2b9aa
--- /dev/null
+++ b/libstdc++-v3/libsupc++/new_opant.cc
@@ -0,0 +1,42 @@
+// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC 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.
+//
+// GCC 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.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#include <bits/c++config.h>
+#include <bits/exception_defines.h>
+#include "new"
+
+_GLIBCXX_WEAK_DEFINITION void*
+operator new(std::size_t sz, std::align_val_t al, const std::nothrow_t&)
+ _GLIBCXX_USE_NOEXCEPT
+{
+ __try
+ {
+ return operator new(sz, al);
+ }
+ __catch(...)
+ {
+ return 0;
+ }
+}
diff --git a/libstdc++-v3/libsupc++/new_opnt.cc b/libstdc++-v3/libsupc++/new_opnt.cc
index 63a95f7df2..7f0d6470b0 100644
--- a/libstdc++-v3/libsupc++/new_opnt.cc
+++ b/libstdc++-v3/libsupc++/new_opnt.cc
@@ -1,5 +1,5 @@
// Support routines for the -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997-2016 Free Software Foundation, Inc.
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/new_opv.cc b/libstdc++-v3/libsupc++/new_opv.cc
index 88f43233c2..1c59a6f5a1 100644
--- a/libstdc++-v3/libsupc++/new_opv.cc
+++ b/libstdc++-v3/libsupc++/new_opv.cc
@@ -1,6 +1,6 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997-2016 Free Software Foundation, Inc.
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/new_opva.cc b/libstdc++-v3/libsupc++/new_opva.cc
new file mode 100644
index 0000000000..2eecc7f519
--- /dev/null
+++ b/libstdc++-v3/libsupc++/new_opva.cc
@@ -0,0 +1,33 @@
+// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC 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.
+//
+// GCC 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.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#include <bits/c++config.h>
+#include "new"
+
+_GLIBCXX_WEAK_DEFINITION void*
+operator new[] (std::size_t sz, std::align_val_t al)
+{
+ return ::operator new(sz, al);
+}
diff --git a/libstdc++-v3/libsupc++/new_opvant.cc b/libstdc++-v3/libsupc++/new_opvant.cc
new file mode 100644
index 0000000000..b1b66ad790
--- /dev/null
+++ b/libstdc++-v3/libsupc++/new_opvant.cc
@@ -0,0 +1,42 @@
+// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC 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.
+//
+// GCC 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.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#include <bits/c++config.h>
+#include <bits/exception_defines.h>
+#include "new"
+
+_GLIBCXX_WEAK_DEFINITION void*
+operator new[] (std::size_t sz, std::align_val_t al, const std::nothrow_t&)
+ _GLIBCXX_USE_NOEXCEPT
+{
+ __try
+ {
+ return ::operator new[](sz, al);
+ }
+ __catch(...)
+ {
+ return 0;
+ }
+}
diff --git a/libstdc++-v3/libsupc++/new_opvnt.cc b/libstdc++-v3/libsupc++/new_opvnt.cc
index 61f8b34e5a..a582b16693 100644
--- a/libstdc++-v3/libsupc++/new_opvnt.cc
+++ b/libstdc++-v3/libsupc++/new_opvnt.cc
@@ -1,6 +1,6 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997-2016 Free Software Foundation, Inc.
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/pbase_type_info.cc b/libstdc++-v3/libsupc++/pbase_type_info.cc
index d47fb23a4e..b79cb54117 100644
--- a/libstdc++-v3/libsupc++/pbase_type_info.cc
+++ b/libstdc++-v3/libsupc++/pbase_type_info.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -38,6 +38,33 @@ __do_catch (const type_info *thr_type,
return true; // same type
#if __cpp_rtti
+ if (*thr_type == typeid (nullptr))
+ {
+ // A catch handler for any pointer type matches nullptr_t.
+ if (typeid (*this) == typeid(__pointer_type_info))
+ {
+ *thr_obj = nullptr;
+ return true;
+ }
+ else if (typeid (*this) == typeid(__pointer_to_member_type_info))
+ {
+ if (__pointee->__is_function_p ())
+ {
+ using pmf_type = void (__pbase_type_info::*)();
+ static const pmf_type pmf = nullptr;
+ *thr_obj = const_cast<pmf_type*>(&pmf);
+ return true;
+ }
+ else
+ {
+ using pm_type = int __pbase_type_info::*;
+ static const pm_type pm = nullptr;
+ *thr_obj = const_cast<pm_type*>(&pm);
+ return true;
+ }
+ }
+ }
+
if (typeid (*this) != typeid (*thr_type))
return false; // not both same kind of pointers
#endif
@@ -53,12 +80,13 @@ __do_catch (const type_info *thr_type,
unsigned tflags = thrown_type->__flags;
- bool throw_tx = (tflags & __transaction_safe_mask);
- bool catch_tx = (__flags & __transaction_safe_mask);
- if (throw_tx && !catch_tx)
- /* Catch can perform a transaction-safety conversion. */
- tflags &= ~__transaction_safe_mask;
- if (catch_tx && !throw_tx)
+ const unsigned fqual_mask = __transaction_safe_mask|__noexcept_mask;
+ unsigned throw_fqual = (tflags & fqual_mask);
+ unsigned catch_fqual = (__flags & fqual_mask);
+ if (throw_fqual & ~catch_fqual)
+ /* Catch can perform a function pointer conversion. */
+ tflags &= catch_fqual;
+ if (catch_fqual & ~throw_fqual)
/* But not the reverse. */
return false;
diff --git a/libstdc++-v3/libsupc++/pmem_type_info.cc b/libstdc++-v3/libsupc++/pmem_type_info.cc
index 080a54864b..9263b78c6e 100644
--- a/libstdc++-v3/libsupc++/pmem_type_info.cc
+++ b/libstdc++-v3/libsupc++/pmem_type_info.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/pointer_type_info.cc b/libstdc++-v3/libsupc++/pointer_type_info.cc
index 47344e0bb7..77b47eff83 100644
--- a/libstdc++-v3/libsupc++/pointer_type_info.cc
+++ b/libstdc++-v3/libsupc++/pointer_type_info.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/pure.cc b/libstdc++-v3/libsupc++/pure.cc
index fdd4fc98b0..e004c118d9 100644
--- a/libstdc++-v3/libsupc++/pure.cc
+++ b/libstdc++-v3/libsupc++/pure.cc
@@ -1,5 +1,5 @@
// -*- C++ -*-
-// Copyright (C) 2000-2016 Free Software Foundation, Inc.
+// Copyright (C) 2000-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/si_class_type_info.cc b/libstdc++-v3/libsupc++/si_class_type_info.cc
index 2d44b2581b..19e1132e2b 100644
--- a/libstdc++-v3/libsupc++/si_class_type_info.cc
+++ b/libstdc++-v3/libsupc++/si_class_type_info.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc
index 2fc4390173..04d101f5c2 100644
--- a/libstdc++-v3/libsupc++/tinfo.cc
+++ b/libstdc++-v3/libsupc++/tinfo.cc
@@ -1,5 +1,5 @@
// Methods for type_info for -*- C++ -*- Run Time Type Identification.
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/tinfo.h b/libstdc++-v3/libsupc++/tinfo.h
index f30bcb25f9..bf41399112 100644
--- a/libstdc++-v3/libsupc++/tinfo.h
+++ b/libstdc++-v3/libsupc++/tinfo.h
@@ -1,5 +1,5 @@
// RTTI support internals for -*- C++ -*-
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/tinfo2.cc b/libstdc++-v3/libsupc++/tinfo2.cc
index 8f9b187b99..ad6a241a50 100644
--- a/libstdc++-v3/libsupc++/tinfo2.cc
+++ b/libstdc++-v3/libsupc++/tinfo2.cc
@@ -1,6 +1,6 @@
// Methods for type_info for -*- C++ -*- Run Time Type Identification.
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/typeinfo b/libstdc++-v3/libsupc++/typeinfo
index baedf01021..059016c35a 100644
--- a/libstdc++-v3/libsupc++/typeinfo
+++ b/libstdc++-v3/libsupc++/typeinfo
@@ -1,5 +1,5 @@
// RTTI support for -*- C++ -*-
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -31,7 +31,7 @@
#pragma GCC system_header
-#include <exception>
+#include <bits/exception.h>
#if __cplusplus >= 201103L
#include <bits/hash_bytes.h>
#endif
diff --git a/libstdc++-v3/libsupc++/unwind-cxx.h b/libstdc++-v3/libsupc++/unwind-cxx.h
index 91219343e9..7fa3e342aa 100644
--- a/libstdc++-v3/libsupc++/unwind-cxx.h
+++ b/libstdc++-v3/libsupc++/unwind-cxx.h
@@ -1,5 +1,5 @@
// -*- C++ -*- Exception handling and frame unwind runtime interface routines.
-// Copyright (C) 2001-2016 Free Software Foundation, Inc.
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/vec.cc b/libstdc++-v3/libsupc++/vec.cc
index 38847bd8e1..0490e304d4 100644
--- a/libstdc++-v3/libsupc++/vec.cc
+++ b/libstdc++-v3/libsupc++/vec.cc
@@ -1,6 +1,6 @@
// New abi Support -*- C++ -*-
-// Copyright (C) 2000-2016 Free Software Foundation, Inc.
+// Copyright (C) 2000-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/vmi_class_type_info.cc b/libstdc++-v3/libsupc++/vmi_class_type_info.cc
index 5ee2d48525..77de433b1a 100644
--- a/libstdc++-v3/libsupc++/vmi_class_type_info.cc
+++ b/libstdc++-v3/libsupc++/vmi_class_type_info.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 1994-2016 Free Software Foundation, Inc.
+// Copyright (C) 1994-2017 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
diff --git a/libstdc++-v3/libsupc++/vterminate.cc b/libstdc++-v3/libsupc++/vterminate.cc
index 7d12534cf4..3c334bc416 100644
--- a/libstdc++-v3/libsupc++/vterminate.cc
+++ b/libstdc++-v3/libsupc++/vterminate.cc
@@ -1,6 +1,6 @@
// Verbose terminate_handler -*- C++ -*-
-// Copyright (C) 2001-2016 Free Software Foundation, Inc.
+// Copyright (C) 2001-2017 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
diff --git a/libstdc++-v3/libsupc++/vtv_stubs.cc b/libstdc++-v3/libsupc++/vtv_stubs.cc
index 0fa7c6246b..5d90726fa2 100644
--- a/libstdc++-v3/libsupc++/vtv_stubs.cc
+++ b/libstdc++-v3/libsupc++/vtv_stubs.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2016 Free Software Foundation, Inc.
+// Copyright (C) 2012-2017 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