aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSofiane Naci <sofiane.naci@arm.com>2013-03-18 09:07:31 +0000
committerSofiane Naci <sofiane.naci@arm.com>2013-03-18 09:07:31 +0000
commit7bfb354ccf5c19ffd0f0d493f569e81b2d067b69 (patch)
treee127de1bf3f77df9b25a6505863887781e492862
parent5ebfbdb135a4adbac407a8b7348d644f760fae7e (diff)
Merge from gcc-4_7-branch 196530:196668.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ARM/aarch64-4.7-branch@196772 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog18
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/ada/ChangeLog9
-rw-r--r--gcc/ada/seh_init.c8
-rw-r--r--gcc/config/arm/arm.h15
-rw-r--r--gcc/cp/ChangeLog18
-rw-r--r--gcc/cp/decl.c8
-rw-r--r--gcc/cp/init.c2
-rw-r--r--gcc/cp/parser.c10
-rw-r--r--gcc/fortran/ChangeLog14
-rw-r--r--gcc/fortran/check.c2
-rw-r--r--gcc/fortran/expr.c3
-rw-r--r--gcc/fortran/resolve.c2
-rw-r--r--gcc/gcc.c59
-rw-r--r--gcc/testsuite/ChangeLog20
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist-defarg1.C36
-rw-r--r--gcc/testsuite/g++.dg/template/crash115.C3
-rw-r--r--gcc/testsuite/g++.dg/torture/pr56403.C12
-rw-r--r--gcc/testsuite/gfortran.dg/class_56.f9021
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_size_4.f9018
-rw-r--r--libstdc++-v3/ChangeLog15
-rw-r--r--libstdc++-v3/include/bits/vector.tcc3
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/allocator/copy.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/allocator/copy_assign.cc4
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/allocator/minimal.cc1
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc4
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/allocator/swap.cc4
27 files changed, 285 insertions, 28 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 73651dd22dd..0743138f770 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,21 @@
+2013-03-14 Seth LaForge <sethml@google.com>
+
+ PR target/56351
+ Backport from mainline
+ 2012-10-22 Julian Brown <julian@codesourcery.com>
+
+ * config/arm/arm.h (CANNOT_CHANGE_MODE_CLASS): Avoid subreg'ing
+ VFP D registers in big-endian mode.
+
+2013-03-08 Joey Ye <joey.ye@arm.com>
+
+ Backport from mainline
+ 2013-03-06 Joey Ye <joey.ye@arm.com>
+
+ PR lto/50293
+ * gcc.c (convert_white_space): New function.
+ (main): Handles white space in function name.
+
2013-03-06 Oleg Endo <olegendo@gcc.gnu.org>
Backport from mainline
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 1b07c9acf1d..e36c70fcf26 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20130308
+20130315
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index b9be951cc49..f6d83887674 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,9 +1,14 @@
+2013-03-08 Cesar Strauss <cestrauss@gmail.com>
+
+ PR ada/52123
+ * seh_init.c (Raise_From_Signal_Handler): Declare as no-return.
+ (__gnat_SEH_error_handler): Likewise. Remove final return.
+
2013-02-21 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/56258
* gnat-style.texi (@title): Remove @hfill.
- * projects.texi: Avoid line wrapping inside of @pxref or
- @xref.
+ * projects.texi: Avoid line wrapping inside of @pxref or @xref.
2013-02-20 Eric Botcazou <ebotcazou@adacore.com>
diff --git a/gcc/ada/seh_init.c b/gcc/ada/seh_init.c
index a7f3879577a..5e05e95a20c 100644
--- a/gcc/ada/seh_init.c
+++ b/gcc/ada/seh_init.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 2005-2011, Free Software Foundation, Inc. *
+ * Copyright (C) 2005-2013, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -60,7 +60,8 @@ extern struct Exception_Data _abort_signal;
#define Raise_From_Signal_Handler \
ada__exceptions__raise_from_signal_handler
-extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *);
+extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *)
+ ATTRIBUTE_NORETURN;
#if defined (_WIN32)
@@ -71,7 +72,7 @@ extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *);
extern void _global_unwind2 (void *);
EXCEPTION_DISPOSITION __gnat_SEH_error_handler
-(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
+(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*) ATTRIBUTE_NORETURN;
EXCEPTION_DISPOSITION
__gnat_SEH_error_handler (struct _EXCEPTION_RECORD* ExceptionRecord,
@@ -193,7 +194,6 @@ __gnat_SEH_error_handler (struct _EXCEPTION_RECORD* ExceptionRecord,
#endif
Raise_From_Signal_Handler (exception, msg);
- return 0; /* This is never reached, avoid compiler warning */
}
#if defined (_WIN64)
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index a3db5c4d600..fbbf041a4fb 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1126,11 +1126,18 @@ enum reg_class
/* FPA registers can't do subreg as all values are reformatted to internal
precision. In VFPv1, VFP registers could only be accessed in the mode
they were set, so subregs would be invalid there too. However, we don't
- support VFPv1 at the moment, and the restriction was lifted in VFPv2. */
+ support VFPv1 at the moment, and the restriction was lifted in VFPv2.
+ In big-endian mode, modes greater than word size (i.e. DFmode) are stored in
+ VFP registers in little-endian order. We can't describe that accurately to
+ GCC, so avoid taking subregs of such values. */
#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
- (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
- ? reg_classes_intersect_p (FPA_REGS, (CLASS)) \
- : 0)
+ (TARGET_VFP \
+ ? TARGET_BIG_END \
+ && (GET_MODE_SIZE (FROM) > UNITS_PER_WORD \
+ || GET_MODE_SIZE (TO) > UNITS_PER_WORD) \
+ && reg_classes_intersect_p (VFP_REGS, (CLASS)) \
+ : GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
+ && reg_classes_intersect_p (FPA_REGS, (CLASS)))
/* The class value for index registers, and the one for base regs. */
#define INDEX_REG_CLASS (TARGET_THUMB1 ? LO_REGS : GENERAL_REGS)
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3c6c818aebc..acecb5add44 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,21 @@
+2013-03-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/56614
+ * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
+
+2013-03-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/56403
+ * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
+ of CLASS_TYPE_P.
+
+2013-03-09 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/56534
+ * parser.c (cp_parser_elaborated_type_specifier): Don't call
+ check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
+ * decl.c (check_elaborated_type_specifier): Tidy.
+
2013-03-06 Jakub Jelinek <jakub@redhat.com>
PR c++/56543
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index f200483afef..db0c233b8e1 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -10536,9 +10536,8 @@ static tree
local_variable_p_walkfn (tree *tp, int *walk_subtrees,
void *data ATTRIBUTE_UNUSED)
{
- /* Check DECL_NAME to avoid including temporaries. We don't check
- DECL_ARTIFICIAL because we do want to complain about 'this'. */
- if (local_variable_p (*tp) && DECL_NAME (*tp))
+ if (local_variable_p (*tp)
+ && (!DECL_ARTIFICIAL (*tp) || DECL_NAME (*tp) == this_identifier))
return *tp;
else if (TYPE_P (*tp))
*walk_subtrees = 0;
@@ -11461,9 +11460,6 @@ check_elaborated_type_specifier (enum tag_types tag_code,
{
tree type;
- if (decl == error_mark_node)
- return error_mark_node;
-
/* In the case of:
struct S { struct S *p; };
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index afd082c24bc..bb0e618fbee 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -182,7 +182,7 @@ build_zero_init_1 (tree type, tree nelts, bool static_storage_p,
init = convert (type, nullptr_node);
else if (SCALAR_TYPE_P (type))
init = convert (type, integer_zero_node);
- else if (CLASS_TYPE_P (type))
+ else if (RECORD_OR_UNION_CODE_P (TREE_CODE (type)))
{
tree field;
VEC(constructor_elt,gc) *v = NULL;
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index fa82cf2c823..cdb524e2f03 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -14035,12 +14035,14 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
typename_type,
/*complain=*/tf_error);
/* If the `typename' keyword is in effect and DECL is not a type
- decl. Then type is non existant. */
+ decl, then type is non existent. */
else if (tag_type == typename_type && TREE_CODE (decl) != TYPE_DECL)
- type = NULL_TREE;
- else
- type = check_elaborated_type_specifier (tag_type, decl,
+ ;
+ else if (TREE_CODE (decl) == TYPE_DECL)
+ type = check_elaborated_type_specifier (tag_type, decl,
/*allow_template_p=*/true);
+ else if (decl == error_mark_node)
+ type = error_mark_node;
}
if (!type)
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index c2a7a8b8ff0..6ffba521238 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,17 @@
+2013-03-13 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/56575
+ * expr.c (gfc_default_initializer): Check that a class declared
+ type has any components.
+ * resolve.c (resolve_fl_derived0): On failing the test for C437
+ set the type to BT_UNKNOWN to prevent repeat error messages.
+
+2013-03-10 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/55362
+ * check.c (array_check): It is an error if a procedure is
+ passed.
+
2013-02-22 Janus Weil <janus@gcc.gnu.org>
PR fortran/56385
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 32e54635005..d69ba886373 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -256,7 +256,7 @@ array_check (gfc_expr *e, int n)
return SUCCESS;
}
- if (e->rank != 0)
+ if (e->rank != 0 && e->ts.type != BT_PROCEDURE)
return SUCCESS;
gfc_error ("'%s' argument of '%s' intrinsic at %L must be an array",
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 8e52c472bad..0ad7f7b5b9e 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -3759,7 +3759,8 @@ gfc_default_initializer (gfc_typespec *ts)
types (otherwise we could use gfc_has_default_initializer()). */
for (comp = ts->u.derived->components; comp; comp = comp->next)
if (comp->initializer || comp->attr.allocatable
- || (comp->ts.type == BT_CLASS && CLASS_DATA (comp)->attr.allocatable))
+ || (comp->ts.type == BT_CLASS && CLASS_DATA (comp)
+ && CLASS_DATA (comp)->attr.allocatable))
break;
if (!comp)
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 17efdb5b373..8729e1567be 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -11967,6 +11967,8 @@ resolve_fl_derived0 (gfc_symbol *sym)
{
gfc_error ("Component '%s' with CLASS at %L must be allocatable "
"or pointer", c->name, &c->loc);
+ /* Prevent a recurrence of the error. */
+ c->ts.type = BT_UNKNOWN;
return FAILURE;
}
diff --git a/gcc/gcc.c b/gcc/gcc.c
index cc6a08eb091..12ae21ef3e8 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -267,6 +267,7 @@ static const char *compare_debug_dump_opt_spec_function (int, const char **);
static const char *compare_debug_self_opt_spec_function (int, const char **);
static const char *compare_debug_auxbase_opt_spec_function (int, const char **);
static const char *pass_through_libs_spec_func (int, const char **);
+static char *convert_white_space (char *);
/* The Specs Language
@@ -6475,6 +6476,7 @@ main (int argc, char **argv)
X_OK, false);
if (lto_wrapper_file)
{
+ lto_wrapper_file = convert_white_space (lto_wrapper_file);
lto_wrapper_spec = lto_wrapper_file;
obstack_init (&collect_obstack);
obstack_grow (&collect_obstack, "COLLECT_LTO_WRAPPER=",
@@ -6876,12 +6878,13 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
+ strlen (fuse_linker_plugin), 0))
#endif
{
- linker_plugin_file_spec = find_a_file (&exec_prefixes,
- LTOPLUGINSONAME, R_OK,
- false);
- if (!linker_plugin_file_spec)
+ char *temp_spec = find_a_file (&exec_prefixes,
+ LTOPLUGINSONAME, R_OK,
+ false);
+ if (!temp_spec)
fatal_error ("-fuse-linker-plugin, but %s not found",
LTOPLUGINSONAME);
+ linker_plugin_file_spec = convert_white_space (temp_spec);
}
#endif
lto_gcc_spec = argv[0];
@@ -8318,3 +8321,51 @@ pass_through_libs_spec_func (int argc, const char **argv)
}
return prepended;
}
+
+/* Insert backslash before spaces in ORIG (usually a file path), to
+ avoid being broken by spec parser.
+
+ This function is needed as do_spec_1 treats white space (' ' and '\t')
+ as the end of an argument. But in case of -plugin /usr/gcc install/xxx.so,
+ the file name should be treated as a single argument rather than being
+ broken into multiple. Solution is to insert '\\' before the space in a
+ file name.
+
+ This function converts and only converts all occurrence of ' '
+ to '\\' + ' ' and '\t' to '\\' + '\t'. For example:
+ "a b" -> "a\\ b"
+ "a b" -> "a\\ \\ b"
+ "a\tb" -> "a\\\tb"
+ "a\\ b" -> "a\\\\ b"
+
+ orig: input null-terminating string that was allocated by xalloc. The
+ memory it points to might be freed in this function. Behavior undefined
+ if ORIG wasn't xalloced or was freed already at entry.
+
+ Return: ORIG if no conversion needed. Otherwise a newly allocated string
+ that was converted from ORIG. */
+
+static char *
+convert_white_space (char *orig)
+{
+ int len, number_of_space = 0;
+
+ for (len = 0; orig[len]; len++)
+ if (orig[len] == ' ' || orig[len] == '\t') number_of_space++;
+
+ if (number_of_space)
+ {
+ char *new_spec = (char *) xmalloc (len + number_of_space + 1);
+ int j, k;
+ for (j = 0, k = 0; j <= len; j++, k++)
+ {
+ if (orig[j] == ' ' || orig[j] == '\t')
+ new_spec[k++] = '\\';
+ new_spec[k] = orig[j];
+ }
+ free (orig);
+ return new_spec;
+ }
+ else
+ return orig;
+}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index ca8c8f011d0..1d3f9606719 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,23 @@
+2013-03-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/56403
+ * g++.dg/torture/pr56403.C: New test.
+
+2013-03-13 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/56575
+ * gfortran.dg/class_56.f90: New test.
+
+2013-03-10 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/55362
+ * gfortran.dg/intrinsic_size_4.f90 : New test.
+
+2013-03-09 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/56534
+ * g++.dg/template/crash115.C: New.
+
2013-03-06 Jakub Jelinek <jakub@redhat.com>
PR c++/56543
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist-defarg1.C b/gcc/testsuite/g++.dg/cpp0x/initlist-defarg1.C
new file mode 100644
index 00000000000..45eb2d5e1f0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist-defarg1.C
@@ -0,0 +1,36 @@
+// PR c++/56614
+// { dg-require-effective-target c++11 }
+
+#include <initializer_list>
+
+namespace std
+{
+ template<typename T>
+ struct allocator
+ { };
+
+ template<typename T, typename Alloc = std::allocator<T> >
+ struct vector
+ {
+ vector(std::initializer_list<T>, const Alloc& = Alloc()) { }
+ };
+}
+
+void func() { }
+
+enum E { ee };
+
+struct C
+{
+ template<typename T>
+ C(T, std::vector<E> = std::vector<E>({ ee }))
+ { }
+};
+
+struct G
+{
+ void gen()
+ {
+ C c(&func);
+ }
+};
diff --git a/gcc/testsuite/g++.dg/template/crash115.C b/gcc/testsuite/g++.dg/template/crash115.C
new file mode 100644
index 00000000000..5c9f525cd64
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash115.C
@@ -0,0 +1,3 @@
+// PR c++/56534
+
+template < struct template rebind < > // { dg-error "expected" }
diff --git a/gcc/testsuite/g++.dg/torture/pr56403.C b/gcc/testsuite/g++.dg/torture/pr56403.C
new file mode 100644
index 00000000000..27b6eeb8888
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr56403.C
@@ -0,0 +1,12 @@
+// PR c++/56403
+// { dg-do compile }
+
+#include <stdarg.h>
+
+struct S { va_list err_args; };
+
+void *
+foo ()
+{
+ return new S ();
+}
diff --git a/gcc/testsuite/gfortran.dg/class_56.f90 b/gcc/testsuite/gfortran.dg/class_56.f90
new file mode 100644
index 00000000000..7ec4bda4a49
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_56.f90
@@ -0,0 +1,21 @@
+! { dg-do compile }
+! Test fix for PR56575.
+!
+! Contributed by A Kasahara <latlon90180+gcc_bugzilla@gmail.com>
+!
+module lib_container
+ implicit none
+
+ type:: Object
+ end type Object
+
+ type:: Container
+ class(Object):: v ! { dg-error "must be allocatable or pointer" }
+ end type Container
+
+contains
+
+ subroutine proc(self)
+ class(Container), intent(inout):: self
+ end subroutine proc
+end module lib_container
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_size_4.f90 b/gcc/testsuite/gfortran.dg/intrinsic_size_4.f90
new file mode 100644
index 00000000000..6d8e1c0b587
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_size_4.f90
@@ -0,0 +1,18 @@
+! { dg-do compile }
+! Test the fix for PR55362; the error below was missed and an ICE ensued.
+!
+! ! Contributed by Dominique d'Humieres <dominiq@lps.ens.fr>
+!
+program ice_test
+ implicit none
+ write(*,*) 'message: ', &
+ size(Error_Msg),Error_Msg() ! { dg-error "must be an array" }
+ write(*,*) 'message: ', &
+ size(Error_Msg ()),Error_Msg() ! OK of course
+contains
+ function Error_Msg() result(ErrorMsg)
+ character, dimension(:), pointer :: ErrorMsg
+ character, dimension(1), target :: str = '!'
+ ErrorMsg => str
+ end function Error_Msg
+end program ice_test
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index f97792722cf..133dbc9c83f 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,18 @@
+2013-03-09 François Dumont <fdumont@gcc.gnu.org>
+
+ * include/bits/vector.tcc (vector<>operator=(const vector<>&):
+ Reset pointers after deallocation when memory can be reused.
+ * testsuite/23_containers/vector/allocator/minimal.cc: Insert
+ elements to really challenge C++11 allocator integration.
+ * testsuite/23_containers/vector/allocator/copy.cc: Likewise.
+ * testsuite/23_containers/vector/allocator/copy_assign.cc:
+ Likewise.
+ * testsuite/23_containers/vector/allocator/move_assign.cc:
+ Likewise.
+ * testsuite/23_containers/vector/allocator/swap.cc: Likewise and
+ swap vector back before checks on memory/personality mapping are
+ performed.
+
2013-02-26 Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/56012
diff --git a/libstdc++-v3/include/bits/vector.tcc b/libstdc++-v3/include/bits/vector.tcc
index d9c3b659e6b..efa82ee374f 100644
--- a/libstdc++-v3/include/bits/vector.tcc
+++ b/libstdc++-v3/include/bits/vector.tcc
@@ -174,6 +174,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
+ this->_M_impl._M_start = nullptr;
+ this->_M_impl._M_finish = nullptr;
+ this->_M_impl._M_end_of_storage = nullptr;
}
std::__alloc_on_copy(_M_get_Tp_allocator(),
__x._M_get_Tp_allocator());
diff --git a/libstdc++-v3/testsuite/23_containers/vector/allocator/copy.cc b/libstdc++-v3/testsuite/23_containers/vector/allocator/copy.cc
index bcd521efe18..90a951e83cd 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/allocator/copy.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/allocator/copy.cc
@@ -31,6 +31,7 @@ void test01()
typedef propagating_allocator<T, false> alloc_type;
typedef std::vector<T, alloc_type> test_type;
test_type v1(alloc_type(1));
+ v1.push_back(T());
test_type v2(v1);
VERIFY(1 == v1.get_allocator().get_personality());
VERIFY(0 == v2.get_allocator().get_personality());
@@ -42,6 +43,7 @@ void test02()
typedef propagating_allocator<T, true> alloc_type;
typedef std::vector<T, alloc_type> test_type;
test_type v1(alloc_type(1));
+ v1.push_back(T());
test_type v2(v1);
VERIFY(1 == v1.get_allocator().get_personality());
VERIFY(1 == v2.get_allocator().get_personality());
diff --git a/libstdc++-v3/testsuite/23_containers/vector/allocator/copy_assign.cc b/libstdc++-v3/testsuite/23_containers/vector/allocator/copy_assign.cc
index 0e2050e0e3c..4bc518956f4 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/allocator/copy_assign.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/allocator/copy_assign.cc
@@ -31,7 +31,9 @@ void test01()
typedef propagating_allocator<T, false> alloc_type;
typedef std::vector<T, alloc_type> test_type;
test_type v1(alloc_type(1));
+ v1.push_back(T());
test_type v2(alloc_type(2));
+ v2.push_back(T());
v2 = v1;
VERIFY(1 == v1.get_allocator().get_personality());
VERIFY(2 == v2.get_allocator().get_personality());
@@ -43,7 +45,9 @@ void test02()
typedef propagating_allocator<T, true> alloc_type;
typedef std::vector<T, alloc_type> test_type;
test_type v1(alloc_type(1));
+ v1.push_back(T());
test_type v2(alloc_type(2));
+ v2.push_back(T());
v2 = v1;
VERIFY(1 == v1.get_allocator().get_personality());
VERIFY(1 == v2.get_allocator().get_personality());
diff --git a/libstdc++-v3/testsuite/23_containers/vector/allocator/minimal.cc b/libstdc++-v3/testsuite/23_containers/vector/allocator/minimal.cc
index 2d56884a436..f5c3a1898b8 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/allocator/minimal.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/allocator/minimal.cc
@@ -35,6 +35,7 @@ void test01()
typedef std::allocator_traits<alloc_type> traits_type;
typedef std::vector<T, alloc_type> test_type;
test_type v(alloc_type{});
+ v.push_back(T());
VERIFY( v.max_size() == traits_type::max_size(v.get_allocator()) );
}
diff --git a/libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc b/libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc
index 2a792c61c89..def0b1a2ae2 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc
@@ -31,7 +31,9 @@ void test01()
typedef propagating_allocator<T, false> alloc_type;
typedef std::vector<T, alloc_type> test_type;
test_type v1(alloc_type(1));
+ v1.push_back(T());
test_type v2(alloc_type(2));
+ v2.push_back(T());
v2 = std::move(v1);
VERIFY(1 == v1.get_allocator().get_personality());
VERIFY(2 == v2.get_allocator().get_personality());
@@ -43,8 +45,10 @@ void test02()
typedef propagating_allocator<T, true> alloc_type;
typedef std::vector<T, alloc_type> test_type;
test_type v1(alloc_type(1));
+ v1.push_back(T());
test_type v2(alloc_type(2));
v2 = std::move(v1);
+ v2.push_back(T());
VERIFY(0 == v1.get_allocator().get_personality());
VERIFY(1 == v2.get_allocator().get_personality());
}
diff --git a/libstdc++-v3/testsuite/23_containers/vector/allocator/swap.cc b/libstdc++-v3/testsuite/23_containers/vector/allocator/swap.cc
index 808753e7520..79038d43058 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/allocator/swap.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/allocator/swap.cc
@@ -31,10 +31,14 @@ void test01()
typedef propagating_allocator<T, false> alloc_type;
typedef std::vector<T, alloc_type> test_type;
test_type v1(alloc_type(1));
+ v1.push_back(T());
test_type v2(alloc_type(2));
+ v2.push_back(T());
std::swap(v1, v2);
VERIFY(1 == v1.get_allocator().get_personality());
VERIFY(2 == v2.get_allocator().get_personality());
+ // swap back so assertions in uneq_allocator::deallocate don't fail
+ std::swap(v1, v2);
}
void test02()