diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-20 09:01:05 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-20 09:01:05 +0000 |
commit | ad046ecfafd816611ab5ecdb1319e052f425c50e (patch) | |
tree | 4875c49c0290393fc8a599cef2d366da0599caab /libstdc++-v3 | |
parent | 4aa8e549a47056781bea0481347468e8f9367a3a (diff) | |
download | gcc-ad046ecfafd816611ab5ecdb1319e052f425c50e.tar.gz |
2012-01-20 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 183326 using svnmerge
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@183327 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 28 | ||||
-rw-r--r-- | libstdc++-v3/Makefile.in | 27 | ||||
-rw-r--r-- | libstdc++-v3/acinclude.m4 | 16 | ||||
-rw-r--r-- | libstdc++-v3/aclocal.m4 | 53 | ||||
-rwxr-xr-x | libstdc++-v3/configure | 90 | ||||
-rw-r--r-- | libstdc++-v3/configure.ac | 9 | ||||
-rw-r--r-- | libstdc++-v3/doc/Makefile.in | 19 | ||||
-rw-r--r-- | libstdc++-v3/include/Makefile.in | 19 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/hashtable.h | 21 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/Makefile.in | 25 | ||||
-rw-r--r-- | libstdc++-v3/po/Makefile.in | 19 | ||||
-rw-r--r-- | libstdc++-v3/python/Makefile.in | 29 | ||||
-rw-r--r-- | libstdc++-v3/src/Makefile.in | 25 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/unordered_multimap/erase/51845-multimap.cc | 72 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/51866.cc | 87 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/unordered_multiset/insert/51866.cc | 87 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/Makefile.in | 19 |
17 files changed, 481 insertions, 164 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b1b62a2ea0a..fa3523b5392 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,31 @@ +2012-01-19 Jakub Jelinek <jakub@redhat.com> + + PR libstdc++/51845 + * include/bits/hashtable.h + (_Hashtable<>::erase(const_iterator, const_iterator)): Also update + _M_buckets[__n_bkt] if __is_bucket_begin. + * testsuite/23_containers/unordered_multimap/erase/51845-multimap.cc: + New test. + +2012-01-18 Benjamin Kosnik <bkoz@redhat.com> + + * acinclude (GLIBCXX_CONFIGURE_DOCBOOK): Fix quoting. + +2012-01-18 Benjamin Kosnik <bkoz@redhat.com> + + * configure.ac: Move epub checks... + * acinclude (GLIBCXX_CONFIGURE_DOCBOOK): ...here, use + test -f instead of AC_CHECK_FILES. + +2012-01-18 François Dumont <fdumont@gcc.gnu.org> + Roman Kononov <roman@binarylife.net> + + PR libstdc++/51866 + * include/bits/hashtable.h (_Hashtable<>::_M_insert(_Arg, false_type)): + Do not keep a reference to a potentially moved instance. + * testsuite/23_containers/unordered_multiset/insert/51866.cc: New. + * testsuite/23_containers/unordered_multimap/insert/51866.cc: New. + 2012-01-17 Benjamin Kosnik <bkoz@redhat.com> * doc/html/*: Regenerate. diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in index ba19d09fdb1..2707c53a164 100644 --- a/libstdc++-v3/Makefile.in +++ b/libstdc++-v3/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -376,7 +376,7 @@ all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/fragment.am $(am__configure_deps) @for dep in $?; do \ @@ -412,10 +412,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -572,10 +570,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 9d08178c35e..3fc14c91419 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -631,7 +631,7 @@ AC_DEFUN([GLIBCXX_CONFIGURE_TESTSUITE], [ dnl -dnl Does any necessary configuration of the documentation directory. +dnl Does any necessary configuration for docbook in the docs directory. dnl dnl XSLTPROC must be set before this dnl @@ -642,7 +642,7 @@ dnl XSL_STYLE_DIR dnl AC_DEFUN([GLIBCXX_CONFIGURE_DOCBOOK], [ -AC_MSG_CHECKING([for stylesheets used in generation of documentation]) +AC_MSG_CHECKING([for docbook stylesheets for documentation creation]) glibcxx_stylesheets=no if test x${XSLTPROC} = xyes && echo '<title/>' | xsltproc --noout --nonet --xinclude http://docbook.sourceforge.net/release/xsl-ns/current/xhtml-1_1/docbook.xsl - 2>/dev/null; then glibcxx_stylesheets=yes @@ -669,6 +669,18 @@ if test x"$glibcxx_local_stylesheets" = x"yes"; then else glibcxx_stylesheets=no fi + +# Check for epub3 dependencies. +AC_MSG_CHECKING([for epub3 stylesheets for documentation creation]) +glibcxx_epub_stylesheets=no +if test x"$glibcxx_local_stylesheets" = x"yes"; then + if test -f "$XSL_STYLE_DIR/epub3/chunk.xsl"; then + glibcxx_epub_stylesheets=yes + fi +fi +AC_MSG_RESULT($glibcxx_epub_stylesheets) +AM_CONDITIONAL(BUILD_EPUB, test x"$glibcxx_epub_stylesheets" = x"yes") + ]) diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4 index 60b7ccb5912..7f4a4676505 100644 --- a/libstdc++-v3/aclocal.m4 +++ b/libstdc++-v3/aclocal.m4 @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.2 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,12 +20,15 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -34,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], +m4_if([$1], [1.11.2], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,19 +54,21 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl +[AM_AUTOMAKE_VERSION([1.11.2])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. @@ -283,12 +289,15 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -307,8 +316,8 @@ AC_SUBST(install_sh)]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, +# 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -328,7 +337,7 @@ AC_DEFUN([AM_MAINTAINER_MODE], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful @@ -387,12 +396,15 @@ else fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. @@ -415,13 +427,14 @@ esac # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -429,13 +442,13 @@ AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -511,12 +524,14 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't @@ -539,13 +554,13 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -554,7 +569,7 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- +# -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 5b7cacfef7e..64f102b398c 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -618,8 +618,6 @@ CPU_DEFINES_SRCDIR ATOMIC_FLAGS ATOMIC_WORD_SRCDIR ATOMICITY_SRCDIR -BUILD_EPUB_FALSE -BUILD_EPUB_TRUE BUILD_PDF_FALSE BUILD_PDF_TRUE PDFLATEX @@ -630,6 +628,8 @@ BUILD_HTML_FALSE BUILD_HTML_TRUE BUILD_XML_FALSE BUILD_XML_TRUE +BUILD_EPUB_FALSE +BUILD_EPUB_TRUE XSL_STYLE_DIR XMLLINT XSLTPROC @@ -65753,8 +65753,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stylesheets used in generation of documentation" >&5 -$as_echo_n "checking for stylesheets used in generation of documentation... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for docbook stylesheets for documentation creation" >&5 +$as_echo_n "checking for docbook stylesheets for documentation creation... " >&6; } glibcxx_stylesheets=no if test x${XSLTPROC} = xyes && echo '<title/>' | xsltproc --noout --nonet --xinclude http://docbook.sourceforge.net/release/xsl-ns/current/xhtml-1_1/docbook.xsl - 2>/dev/null; then glibcxx_stylesheets=yes @@ -65786,6 +65786,27 @@ else glibcxx_stylesheets=no fi +# Check for epub3 dependencies. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for epub3 stylesheets for documentation creation" >&5 +$as_echo_n "checking for epub3 stylesheets for documentation creation... " >&6; } +glibcxx_epub_stylesheets=no +if test x"$glibcxx_local_stylesheets" = x"yes"; then + if test -f "$XSL_STYLE_DIR/epub3/chunk.xsl"; then + glibcxx_epub_stylesheets=yes + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_epub_stylesheets" >&5 +$as_echo "$glibcxx_epub_stylesheets" >&6; } + if test x"$glibcxx_epub_stylesheets" = x"yes"; then + BUILD_EPUB_TRUE= + BUILD_EPUB_FALSE='#' +else + BUILD_EPUB_TRUE='#' + BUILD_EPUB_FALSE= +fi + + + # Check for xml/html dependencies. if test $ac_cv_prog_DOXYGEN = "yes" && @@ -65912,59 +65933,6 @@ else fi -# Check for epub dependencies. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/epub3/chunk.xsl" >&5 -$as_echo_n "checking for /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/epub3/chunk.xsl... " >&6; } -if test "${ac_cv_file__usr_share_xml_docbook_stylesheet_docbook_xsl_ns_epub3_chunk_xsl+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "/usr/share/xml/docbook/stylesheet/docbook-xsl-ns/epub3/chunk.xsl"; then - ac_cv_file__usr_share_xml_docbook_stylesheet_docbook_xsl_ns_epub3_chunk_xsl=yes -else - ac_cv_file__usr_share_xml_docbook_stylesheet_docbook_xsl_ns_epub3_chunk_xsl=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_xml_docbook_stylesheet_docbook_xsl_ns_epub3_chunk_xsl" >&5 -$as_echo "$ac_cv_file__usr_share_xml_docbook_stylesheet_docbook_xsl_ns_epub3_chunk_xsl" >&6; } -if test "x$ac_cv_file__usr_share_xml_docbook_stylesheet_docbook_xsl_ns_epub3_chunk_xsl" = x""yes; then : - ac_cv_file_epub3_a=yes -else - ac_cv_file_epub3_a=no -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/sgml/docbook/xsl-ns-stylesheets/epub3/chunk.xsl" >&5 -$as_echo_n "checking for /usr/share/sgml/docbook/xsl-ns-stylesheets/epub3/chunk.xsl... " >&6; } -if test "${ac_cv_file__usr_share_sgml_docbook_xsl_ns_stylesheets_epub3_chunk_xsl+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "/usr/share/sgml/docbook/xsl-ns-stylesheets/epub3/chunk.xsl"; then - ac_cv_file__usr_share_sgml_docbook_xsl_ns_stylesheets_epub3_chunk_xsl=yes -else - ac_cv_file__usr_share_sgml_docbook_xsl_ns_stylesheets_epub3_chunk_xsl=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_sgml_docbook_xsl_ns_stylesheets_epub3_chunk_xsl" >&5 -$as_echo "$ac_cv_file__usr_share_sgml_docbook_xsl_ns_stylesheets_epub3_chunk_xsl" >&6; } -if test "x$ac_cv_file__usr_share_sgml_docbook_xsl_ns_stylesheets_epub3_chunk_xsl" = x""yes; then : - ac_cv_file_epub3_b=yes -else - ac_cv_file_epub3_b=no -fi - - if test $ac_cv_file_epub3_a = "yes" || - test $ac_cv_file_epub3_b = "yes"; then - BUILD_EPUB_TRUE= - BUILD_EPUB_FALSE='#' -else - BUILD_EPUB_TRUE='#' - BUILD_EPUB_FALSE= -fi - - # Propagate the target-specific source directories through the build chain. ATOMICITY_SRCDIR=config/${atomicity_dir} @@ -66556,6 +66524,10 @@ if test -z "${BUILD_INFO_TRUE}" && test -z "${BUILD_INFO_FALSE}"; then as_fn_error "conditional \"BUILD_INFO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${BUILD_EPUB_TRUE}" && test -z "${BUILD_EPUB_FALSE}"; then + as_fn_error "conditional \"BUILD_EPUB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${BUILD_XML_TRUE}" && test -z "${BUILD_XML_FALSE}"; then as_fn_error "conditional \"BUILD_XML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -66572,10 +66544,6 @@ if test -z "${BUILD_PDF_TRUE}" && test -z "${BUILD_PDF_FALSE}"; then as_fn_error "conditional \"BUILD_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${BUILD_EPUB_TRUE}" && test -z "${BUILD_EPUB_FALSE}"; then - as_fn_error "conditional \"BUILD_EPUB\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 1c62aeadb46..2429f04d811 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -380,15 +380,6 @@ AM_CONDITIONAL(BUILD_PDF, test $ac_cv_prog_DBLATEX = "yes" && test $ac_cv_prog_PDFLATEX = "yes") -# Check for epub dependencies. -AC_CHECK_FILE(/usr/share/xml/docbook/stylesheet/docbook-xsl-ns/epub3/chunk.xsl, - ac_cv_file_epub3_a=yes, ac_cv_file_epub3_a=no) -AC_CHECK_FILE(/usr/share/sgml/docbook/xsl-ns-stylesheets/epub3/chunk.xsl, - ac_cv_file_epub3_b=yes, ac_cv_file_epub3_b=no) -AM_CONDITIONAL(BUILD_EPUB, - test $ac_cv_file_epub3_a = "yes" || - test $ac_cv_file_epub3_b = "yes") - # Propagate the target-specific source directories through the build chain. ATOMICITY_SRCDIR=config/${atomicity_dir} diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in index 7a5498e84e8..1a3ae31a188 100644 --- a/libstdc++-v3/doc/Makefile.in +++ b/libstdc++-v3/doc/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -618,10 +618,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index a50b6282756..ccec9d99c6b 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -1207,10 +1207,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h index 37672a26b6f..d4f2aedfccd 100644 --- a/libstdc++-v3/include/bits/hashtable.h +++ b/libstdc++-v3/include/bits/hashtable.h @@ -1227,7 +1227,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION = this->_M_hash_code(__k); this->_M_store_code(__new_node, __code); - // Second, do rehash if necessary. + // Second, do rehash if necessary. if (__do_rehash.first) _M_rehash(__do_rehash.second, __saved_state); @@ -1347,21 +1347,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION = _M_rehash_policy._M_need_rehash(_M_bucket_count, _M_element_count, 1); - const key_type& __k = this->_M_extract()(__v); - typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k); + // First compute the hash code so that we don't do anything if it throws. + typename _Hashtable::_Hash_code_type __code + = this->_M_hash_code(this->_M_extract()(__v)); _Node* __new_node = nullptr; __try { - // First allocate new node so that we don't rehash if it throws. + // Second allocate new node so that we don't rehash if it throws. __new_node = _M_allocate_node(std::forward<_Arg>(__v)); this->_M_store_code(__new_node, __code); if (__do_rehash.first) _M_rehash(__do_rehash.second, __saved_state); - // Second, find the node before an equivalent one. - size_type __n = _M_bucket_index(__k, __code); - _BaseNode* __prev = _M_find_before_node(__n, __k, __code); + // Third, find the node before an equivalent one. + size_type __bkt = _M_bucket_index(__new_node); + _BaseNode* __prev + = _M_find_before_node(__bkt, this->_M_extract()(__new_node->_M_v), + __code); if (__prev) { // Insert after the node before the equivalent one. @@ -1372,7 +1375,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // The inserted node has no equivalent in the hashtable. We must // insert the new node at the beginning of the bucket to preserve // equivalent elements relative positions. - _M_insert_bucket_begin(__n, __new_node); + _M_insert_bucket_begin(__bkt, __new_node); ++_M_element_count; return iterator(__new_node); } @@ -1541,7 +1544,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __bkt = __n_bkt; } - if (__n && __n_bkt != __bkt) + if (__n && (__n_bkt != __bkt || __is_bucket_begin)) _M_buckets[__n_bkt] = __prev_n; __prev_n->_M_nxt = __n; return iterator(__n); diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in index e5af706be41..f91e72f9eb3 100644 --- a/libstdc++-v3/libsupc++/Makefile.in +++ b/libstdc++-v3/libsupc++/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -86,6 +86,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(bitsdir)" \ "$(DESTDIR)$(stddir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES) @@ -655,10 +661,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in index e428385a757..18f686d78f9 100644 --- a/libstdc++-v3/po/Makefile.in +++ b/libstdc++-v3/po/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -349,10 +349,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in index 2948f873dcb..f9045c842ca 100644 --- a/libstdc++-v3/python/Makefile.in +++ b/libstdc++-v3/python/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -88,6 +88,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(pythondir)" DATA = $(nobase_python_DATA) ABI_TWEAKS_SRCDIR = @ABI_TWEAKS_SRCDIR@ @@ -362,9 +368,7 @@ uninstall-nobase_pythonDATA: @$(NORMAL_UNINSTALL) @list='$(nobase_python_DATA)'; test -n "$(pythondir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pythondir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pythondir)" && rm -f $$files + dir='$(DESTDIR)$(pythondir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: @@ -388,10 +392,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index ef4d0a2f1e3..40394341156 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -85,6 +85,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(toolexeclibdir)" LTLIBRARIES = $(toolexeclib_LTLIBRARIES) am__DEPENDENCIES_1 = @@ -681,10 +687,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/erase/51845-multimap.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/erase/51845-multimap.cc new file mode 100644 index 00000000000..450fb6faadf --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/erase/51845-multimap.cc @@ -0,0 +1,72 @@ +// { dg-options "-std=gnu++0x" } + +// 2012-01-19 Jakub Jelinek <jakub@redhat.com> +// +// Copyright (C) 2012 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/>. + +#include <unordered_map> +#include <testsuite_hooks.h> + +// libstdc++/51845 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::unordered_multimap<int, int> Mmap; + typedef Mmap::iterator iterator; + typedef Mmap::const_iterator const_iterator; + typedef Mmap::value_type value_type; + + Mmap mm1; + + mm1.insert(value_type(11135, 1)); + mm1.insert(value_type(11135, 17082)); + mm1.insert(value_type(9644, 24135)); + mm1.insert(value_type(9644, 9644)); + mm1.insert(value_type(13984, 19841)); + mm1.insert(value_type(9644, 1982)); + mm1.insert(value_type(13984, 1945)); + mm1.insert(value_type(7, 1982)); + mm1.insert(value_type(7, 1945)); + VERIFY( mm1.size() == 9 ); + + iterator it1 = mm1.begin(); + ++it1; + iterator it2 = it1; + ++it2; + ++it2; + iterator it3 = mm1.erase(it1, it2); + VERIFY( mm1.size() == 7 ); + VERIFY( it3 == it2 ); + VERIFY( *it3 == *it2 ); + + const_iterator it4 = mm1.begin(); + ++it4; + const_iterator it5 = it4; + ++it5; + const_iterator it6 = mm1.erase(it4); + VERIFY( mm1.size() == 6 ); + VERIFY( it6 == it5 ); + VERIFY( *it6 == *it5 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/51866.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/51866.cc new file mode 100644 index 00000000000..aa85c4b1d5a --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/51866.cc @@ -0,0 +1,87 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2012 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/>. + +#include <unordered_map> +#include <testsuite_hooks.h> + +struct num +{ + int value; + num(int n) : value(n) {} + num(num const&) = default; + num& operator=(num const&) = default; + num(num&& o) : value(o.value) + { o.value = -1; } + num& operator=(num&& o) + { + if (this != &o) + { + value = o.value; + o.value = -1; + } + return *this; + } +}; + +struct num_hash +{ + size_t operator()(num const& a) const + { return a.value; } +}; + +struct num_equal +{ + static bool _S_called_on_moved_instance; + bool operator()(num const& a, num const& b) const + { + if (a.value == -1 || b.value == -1) + _S_called_on_moved_instance = true; + return a.value == b.value; + } +}; + +bool num_equal::_S_called_on_moved_instance = false; + +// libstdc++/51866 +void test01() +{ + bool test __attribute__((unused)) = true; + + std::unordered_multimap<num, int, num_hash, num_equal> mmap; + mmap.insert(std::make_pair(num(1), 1)); + mmap.insert(std::make_pair(num(2), 2)); + mmap.insert(std::make_pair(num(1), 3)); + mmap.insert(std::make_pair(num(2), 4)); + VERIFY( mmap.size() == 4 ); + auto iter = mmap.cbegin(); + auto x0 = (iter++)->first.value; + auto x1 = (iter++)->first.value; + auto x2 = (iter++)->first.value; + auto x3 = (iter++)->first.value; + VERIFY( iter == mmap.cend() ); + VERIFY( (x0 == 1 && x1 == 1 && x2 == 2 && x3 == 2) + || (x0 == 2 && x1 == 2 && x2 == 1 && x3 == 1) ); + VERIFY( !num_equal::_S_called_on_moved_instance ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/insert/51866.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/insert/51866.cc new file mode 100644 index 00000000000..7ee0dce3a45 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/insert/51866.cc @@ -0,0 +1,87 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2012 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/>. + +#include <unordered_set> +#include <testsuite_hooks.h> + +struct num +{ + int value; + num(int n) : value(n) {} + num(num const&) = default; + num& operator=(num const&) = default; + num(num&& o) : value(o.value) + { o.value = -1; } + num& operator=(num&& o) + { + if (this != &o) + { + value = o.value; + o.value = -1; + } + return *this; + } +}; + +struct num_hash +{ + size_t operator()(num const& a) const + { return a.value; } +}; + +struct num_equal +{ + static bool _S_called_on_moved_instance; + bool operator()(num const& a, num const& b) const + { + if (a.value == -1 || b.value == -1) + _S_called_on_moved_instance = true; + return a.value == b.value; + } +}; + +bool num_equal::_S_called_on_moved_instance = false; + +// libstdc++/51866 +void test01() +{ + bool test __attribute__((unused)) = true; + + std::unordered_multiset<num, num_hash, num_equal> mset; + mset.insert(num(1)); + mset.insert(num(2)); + mset.insert(num(1)); + mset.insert(num(2)); + VERIFY( mset.size() == 4 ); + auto iter = mset.cbegin(); + int x0 = (iter++)->value; + int x1 = (iter++)->value; + int x2 = (iter++)->value; + int x3 = (iter++)->value; + VERIFY( iter == mset.cend() ); + VERIFY( (x0 == 1 && x1 == 1 && x2 == 2 && x3 == 2) + || (x0 == 2 && x1 == 2 && x2 == 1 && x3 == 1) ); + VERIFY( !num_equal::_S_called_on_moved_instance ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in index b56c639bbcc..0278be50a7d 100644 --- a/libstdc++-v3/testsuite/Makefile.in +++ b/libstdc++-v3/testsuite/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -380,10 +380,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: |