diff -Nrcpad gcc-4.6.1/gcc/cp/ChangeLog gcc-4.6.2/gcc/cp/ChangeLog
*** gcc-4.6.1/gcc/cp/ChangeLog	Mon Jun 27 10:02:36 2011
--- gcc-4.6.2/gcc/cp/ChangeLog	Wed Oct 26 09:05:24 2011
***************
*** 1,3 ****
--- 1,291 ----
+ 2011-10-26  Release Manager
+ 
+ 	* GCC 4.6.2 released.
+ 
+ 2011-10-19  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/50793
+ 	* tree.c (bot_manip): Propagate AGGR_INIT_ZERO_FIRST.
+ 
+ 2011-10-19  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/50787
+ 	* parser.c (cp_parser_initializer_clause): Don't call
+ 	maybe_constant_value here.
+ 
+ 2011-10-18  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/50531
+ 	* pt.c (instantiate_decl): Recognize when a function defaulted
+ 	outside the class is already instantiated.
+ 
+ 2011-10-15  Nicola Pero  <nicola.pero@meta-innovation.com>
+ 
+ 	Backport from mainline
+ 	2011-06-06  Nicola Pero  <nicola.pero@meta-innovation.com>,
+ 
+ 	PR obj-c++/48275
+ 	* parser.c (cp_parser_objc_at_property_declaration): Allow setter
+ 	and getter names to use all the allowed method names.
+ 
+ 2011-10-13  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/50618
+ 	* init.c (expand_aggr_init_1): Don't zero-initialize virtual
+ 	bases of a base subobject.
+ 
+ 2011-10-11  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/49216
+ 	* init.c (build_vec_init): Avoid crash on new int[1]{}.
+ 
+ 	PR c++/49855
+ 	PR c++/49896
+ 	* call.c (perform_implicit_conversion_flags): Do perform
+ 	scalar conversions in templates.
+ 	* pt.c (tsubst_copy, tsubst_copy_and_build): Handle CONVERT_EXPR.
+ 
+ 2011-10-11  Janis Johnson  <janisjo@codesourcery.com>
+ 
+ 	PR c++/44473
+ 	* mangle.c (write_type): Handle CV qualifiers for decimal classes.
+ 
+ 2011-10-11  Paolo Carlini  <paolo.carlini@oracle.com>
+ 
+ 	PR c++/50611
+ 	* pt.c (tsubst_copy_and_build): If (complain & tf_error) is false
+ 	do not call unqualified_name_lookup_error.
+ 
+ 2011-10-09  Jakub Jelinek  <jakub@redhat.com>
+ 	    Diego Novillo  <dnovillo@google.com>
+ 
+ 	* pt.c (reregister_specialization): Use htab_find instead of
+ 	htab_find_slot with INSERT.
+ 
+ 2011-09-26  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/46105
+ 	* typeck.c (structural_comptypes): Ignore cv-quals on typename scope.
+ 
+ 	PR c++/50508
+ 	* semantics.c (cxx_eval_logical_expression): Use tree_int_cst_equal
+ 	rather than ==.
+ 
+ 2011-09-23  Jason Merrill  <jason@redhat.com>
+ 
+ 	Core 253 - allow const objects with no initializer or
+ 	user-provided default constructor if the defaulted constructor
+ 	initializes all the subobjects.
+ 	PR c++/20039
+ 	PR c++/42844
+ 	* class.c (default_init_uninitialized_part): New.
+ 	* cp-tree.h: Declare it.
+ 	* decl.c (check_for_uninitialized_const_var): Use it.
+ 	* init.c (perform_member_init): Likewise.
+ 	(build_new_1): Likewise.
+ 	* method.c (walk_field_subobs): Likewise.
+ 
+ 2011-09-22  Paolo Carlini  <paolo.carlini@oracle.com>
+ 
+ 	PR c++/50491
+ 	* semantics.c (potential_constant_expression_1): Handle USING_DECL.
+ 
+ 2011-09-17  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/50442
+ 	Revert:
+ 	PR c++/49267
+ 	* call.c (compare_ics): rvaluedness_matches_p can differ
+ 	based on the source type, not just target.
+ 
+ 2011-09-16  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/50424
+ 	* tree.c (bot_manip): Set cp_function_chain->can_throw.
+ 
+ 2011-09-13  Dodji Seketeli  <dodji@redhat.com>
+ 
+ 	PR c++/48320
+ 	* pt.c (template_parameter_pack_p):  Support TEMPLATE_PARM_INDEX
+ 	nodes.  Add a comment.
+ 	(arg_from_parm_pack_p): New static function, factorized out from
+ 	tsubst_pack_expansion and extended to support non-type parameter
+ 	packs represented with TEMPLATE_PARM_INDEX nodes.
+ 	(tsubst_pack_expansion): Use arg_from_parm_pack_p.
+ 
+ 2011-09-08  Jakub Jelinek  <jakub@redhat.com>
+ 
+ 	PR c++/50255
+ 	* method.c (use_thunk): If emitting thunk into the same section
+ 	as function, use the same DECL_COMDAT_GROUP as well.
+ 
+ 2011-09-07  Paolo Carlini  <paolo.carlini@oracle.com>
+ 
+ 	PR c++/50309
+ 	* decl.c (grokdeclarator): Check u.function.exception_specification
+ 	for error_mark_node.
+ 
+ 2011-09-04  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/49267
+ 	* call.c (compare_ics): rvaluedness_matches_p can differ
+ 	based on the source type, not just target.
+ 
+ 2011-08-29  Jakub Jelinek  <jakub@redhat.com>
+ 	    Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/50207
+ 	* class.c (finish_struct_1): Complain if the first field is
+ 	artificial.
+ 
+ 2011-08-30  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/50089
+ 	* semantics.c (finish_id_expression): Use
+ 	current_nonlambda_class_type for qualified-ids.
+ 
+ 	PR c++/50220
+ 	* semantics.c (add_capture): Call complete_type for copy.
+ 
+ 	PR c++/50234
+ 	* semantics.c (cxx_eval_component_reference): Handle
+ 	value-initialization for omitted initializers.
+ 
+ 2011-08-29  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/50224
+ 	* semantics.c (finish_id_expression): Mark captured variables used.
+ 
+ 2011-08-25  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/50157
+ 	* call.c (convert_like_real): Exit early if bad and !tf_error.
+ 
+ 2011-08-23  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/50024
+ 	* semantics.c (maybe_constant_value): Don't try to fold { }.
+ 	* pt.c (build_non_dependent_expr): Don't wrap { }.
+ 	* init.c (build_value_init): Allow scalar value-init in templates.
+ 
+ 2011-08-23  Jakub Jelinek  <jakub@redhat.com>
+ 
+ 	PR c++/46862
+ 	* class.c (finish_struct_1): If TYPE_TRANSPARENT_AGGR is set on a type
+ 	which doesn't have any fields, clear it and diagnose.
+ 
+ 2011-08-16  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/50086
+ 	* pt.c (unify_pack_expansion): Correct overloaded unification
+ 	logic.
+ 
+ 	PR c++/50054
+ 	* typeck2.c (cxx_incomplete_type_diagnostic): Handle
+ 	init_list_type_node.
+ 
+ 2011-08-12  David Li  <davidxl@google.com>
+ 
+ 	* class.c (update_vtable_entry_for_fn): Set
+ 	LOST_PRIMARY bit properly.
+ 
+ 2011-08-05  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/48993
+ 	* semantics.c (potential_constant_expression_1) [CALL_EXPR]: Sorry
+ 	on 'this' in a constructor.
+ 
+ 	PR c++/49921
+ 	* semantics.c (finish_decltype_type): Call invalid_nonstatic_memfn_p.
+ 
+ 	PR c++/49669
+ 	* init.c (perform_member_init): Handle invalid array initializer.
+ 
+ 	PR c++/49988
+ 	* semantics.c (cxx_eval_array_reference): Handle failure to
+ 	reduce the array operand to something we can work with.
+ 
+ 2011-08-02  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/43886
+ 	* parser.c (cp_parser_lambda_body): Clear local_variables_forbidden_p.
+ 
+ 	PR c++/49593
+ 	* pt.c (find_parameter_packs_r): Handle CONSTRUCTOR.
+ 
+ 	PR c++/49803
+ 	* init.c (sort_mem_initializers): Initialize uses_unions_p here.
+ 	(build_field_list): Not here.
+ 
+ 	PR c++/49924
+ 	* semantics.c (cxx_eval_vec_init_1): Fix logic.
+ 
+ 	PR c++/49260
+ 	* call.c (build_call_a): Set cp_function_chain->can_throw here.
+ 	(build_cxx_call): Not here.
+ 
+ 2011-07-27  Jeffrey Yasskin  <jyasskin@google.com>
+ 
+ 	* pt.c (build_template_decl): Copy the function_decl's
+ 	source location to the new template_decl.
+ 
+ 2011-07-19  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/49785
+ 	* pt.c (coerce_template_parms): Handle non-pack after pack.
+ 
+ 2011-07-11  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/49672
+ 	* pt.c (extract_fnparm_pack): Split out from...
+ 	(make_fnparm_pack): ...here.
+ 	(instantiate_decl): Handle non-pack parms after a pack.
+ 	* semantics.c (maybe_add_lambda_conv_op): Don't in a template.
+ 
+ 2011-07-09  Jason Merrill  <jason@redhat.com>
+ 
+ 	* tree.c (build_vec_init_elt): Strip TARGET_EXPR.
+ 
+ 	* tree.c (build_vec_init_expr): Don't add TARGET_EXPR.
+ 	* typeck2.c (digest_init_r): Handle VEC_INIT_EXPR.
+ 	* semantics.c (cxx_eval_vec_init_1): Correct type.
+ 
+ 2011-07-07  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/48157
+ 	* pt.c (tsubst_qualified_id): Preserve TEMPLATE_ID_EXPR in
+ 	partial instantiation.
+ 
+ 2011-07-07  Jakub Jelinek  <jakub@redhat.com>
+ 
+ 	PR c/49644
+ 	* typeck.c (cp_build_binary_op): For MULT_EXPR and TRUNC_DIV_EXPR with
+ 	one non-complex and one complex argument, call save_expr on both
+ 	operands.
+ 
+ 2011-07-05  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/49598
+ 	* semantics.c (finish_id_expression): convert_from_reference.
+ 
+ 	* error.c (type_to_string): Avoid redundant akas.
+ 
+ 2011-06-27  Jason Merrill  <jason@redhat.com>
+ 
+ 	PR c++/49528
+ 	* semantics.c (potential_constant_expression_1): A TARGET_EXPR
+ 	of non-literal type isn't constant.
+ 	(cxx_eval_constant_expression): Likewise.
+ 	* init.c (expand_default_init): Use maybe_constant_init.
+ 
+ 	PR c++/49440
+ 	* class.c (set_linkage_according_to_type): Hand off to
+ 	determine_visibility.
+ 
+ 	PR c++/49418
+ 	* call.c (cxx_type_promotes_to): Don't strip cv-quals.
+ 	* semantics.c (lambda_return_type): Strip them here.
+ 
  2011-06-27  Release Manager
  
  	* GCC 4.6.1 released.
diff -Nrcpad gcc-4.6.1/gcc/cp/call.c gcc-4.6.2/gcc/cp/call.c
*** gcc-4.6.1/gcc/cp/call.c	Tue Jun 14 22:13:36 2011
--- gcc-4.6.2/gcc/cp/call.c	Tue Oct 11 18:18:25 2011
*************** build_call_a (tree function, int n, tree
*** 351,356 ****
--- 351,359 ----
    nothrow = ((decl && TREE_NOTHROW (decl))
  	     || TYPE_NOTHROW_P (TREE_TYPE (TREE_TYPE (function))));
  
+   if (!nothrow && at_function_scope_p () && cfun && cp_function_chain)
+     cp_function_chain->can_throw = 1;
+ 
    if (decl && TREE_THIS_VOLATILE (decl) && cfun && cp_function_chain)
      current_function_returns_abnormally = 1;
  
*************** type_decays_to (tree type)
*** 2554,2561 ****
      return build_pointer_type (TREE_TYPE (type));
    if (TREE_CODE (type) == FUNCTION_TYPE)
      return build_pointer_type (type);
-   if (!MAYBE_CLASS_TYPE_P (type))
-     type = cv_unqualified (type);
    return type;
  }
  
--- 2557,2562 ----
*************** convert_like_real (conversion *convs, tr
*** 5328,5333 ****
--- 5329,5337 ----
    diagnostic_t diag_kind;
    int flags;
  
+   if (convs->bad_p && !(complain & tf_error))
+     return error_mark_node;
+ 
    if (convs->bad_p
        && convs->kind != ck_user
        && convs->kind != ck_list
*************** convert_like_real (conversion *convs, tr
*** 5363,5377 ****
  	  else if (t->kind == ck_identity)
  	    break;
  	}
!       if (complain & tf_error)
! 	{
! 	  permerror (input_location, "invalid conversion from %qT to %qT", TREE_TYPE (expr), totype);
! 	  if (fn)
! 	    permerror (DECL_SOURCE_LOCATION (fn),
! 		       "  initializing argument %P of %qD", argnum, fn);
! 	}
!       else
! 	return error_mark_node;
  
        return cp_convert (totype, expr);
      }
--- 5367,5378 ----
  	  else if (t->kind == ck_identity)
  	    break;
  	}
! 
!       permerror (input_location, "invalid conversion from %qT to %qT",
! 		 TREE_TYPE (expr), totype);
!       if (fn)
! 	permerror (DECL_SOURCE_LOCATION (fn),
! 		   "  initializing argument %P of %qD", argnum, fn);
  
        return cp_convert (totype, expr);
      }
*************** build_cxx_call (tree fn, int nargs, tree
*** 6459,6469 ****
  
    /* If this call might throw an exception, note that fact.  */
    fndecl = get_callee_fndecl (fn);
-   if ((!fndecl || !TREE_NOTHROW (fndecl))
-       && at_function_scope_p ()
-       && cfun
-       && cp_function_chain)
-     cp_function_chain->can_throw = 1;
  
    /* Check that arguments to builtin functions match the expectations.  */
    if (fndecl
--- 6460,6465 ----
*************** perform_implicit_conversion_flags (tree 
*** 8072,8078 ****
  	}
        expr = error_mark_node;
      }
!   else if (processing_template_decl)
      {
        /* In a template, we are only concerned about determining the
  	 type of non-dependent expressions, so we do not have to
--- 8068,8075 ----
  	}
        expr = error_mark_node;
      }
!   else if (processing_template_decl
! 	   && !(SCALAR_TYPE_P (type) && SCALAR_TYPE_P (TREE_TYPE (expr))))
      {
        /* In a template, we are only concerned about determining the
  	 type of non-dependent expressions, so we do not have to
diff -Nrcpad gcc-4.6.1/gcc/cp/class.c gcc-4.6.2/gcc/cp/class.c
*** gcc-4.6.1/gcc/cp/class.c	Tue Jun 14 22:13:29 2011
--- gcc-4.6.2/gcc/cp/class.c	Sun Sep 25 20:29:04 2011
***************
*** 1,6 ****
  /* Functions related to building classes and their related objects.
     Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
!    1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
     Free Software Foundation, Inc.
     Contributed by Michael Tiemann (tiemann@cygnus.com)
  
--- 1,6 ----
  /* Functions related to building classes and their related objects.
     Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
!    1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
     Free Software Foundation, Inc.
     Contributed by Michael Tiemann (tiemann@cygnus.com)
  
*************** get_vtable_name (tree type)
*** 677,697 ****
     the abstract.  */
  
  void
! set_linkage_according_to_type (tree type, tree decl)
  {
!   /* If TYPE involves a local class in a function with internal
!      linkage, then DECL should have internal linkage too.  Other local
!      classes have no linkage -- but if their containing functions
!      have external linkage, it makes sense for DECL to have external
!      linkage too.  That will allow template definitions to be merged,
!      for example.  */
!   if (no_linkage_check (type, /*relaxed_p=*/true))
!     {
!       TREE_PUBLIC (decl) = 0;
!       DECL_INTERFACE_KNOWN (decl) = 1;
!     }
!   else
!     TREE_PUBLIC (decl) = 1;
  }
  
  /* Create a VAR_DECL for a primary or secondary vtable for CLASS_TYPE.
--- 677,686 ----
     the abstract.  */
  
  void
! set_linkage_according_to_type (tree type ATTRIBUTE_UNUSED, tree decl)
  {
!   TREE_PUBLIC (decl) = 1;
!   determine_visibility (decl);
  }
  
  /* Create a VAR_DECL for a primary or secondary vtable for CLASS_TYPE.
*************** update_vtable_entry_for_fn (tree t, tree
*** 2306,2313 ****
    else
      BV_VCALL_INDEX (*virtuals) = NULL_TREE;
  
!   if (lost)
!     BV_LOST_PRIMARY (*virtuals) = true;
  }
  
  /* Called from modify_all_vtables via dfs_walk.  */
--- 2295,2301 ----
    else
      BV_VCALL_INDEX (*virtuals) = NULL_TREE;
  
!   BV_LOST_PRIMARY (*virtuals) = lost;
  }
  
  /* Called from modify_all_vtables via dfs_walk.  */
*************** type_has_user_provided_default_construct
*** 4358,4363 ****
--- 4346,4385 ----
    return false;
  }
  
+ /* If default-initialization leaves part of TYPE uninitialized, returns
+    a DECL for the field or TYPE itself (DR 253).  */
+ 
+ tree
+ default_init_uninitialized_part (tree type)
+ {
+   tree t, r, binfo;
+   int i;
+ 
+   type = strip_array_types (type);
+   if (!CLASS_TYPE_P (type))
+     return type;
+   if (type_has_user_provided_default_constructor (type))
+     return NULL_TREE;
+   for (binfo = TYPE_BINFO (type), i = 0;
+        BINFO_BASE_ITERATE (binfo, i, t); ++i)
+     {
+       r = default_init_uninitialized_part (BINFO_TYPE (t));
+       if (r)
+ 	return r;
+     }
+   for (t = TYPE_FIELDS (type); t; t = DECL_CHAIN (t))
+     if (TREE_CODE (t) == FIELD_DECL
+ 	&& !DECL_ARTIFICIAL (t)
+ 	&& !DECL_INITIAL (t))
+       {
+ 	r = default_init_uninitialized_part (TREE_TYPE (t));
+ 	if (r)
+ 	  return DECL_P (r) ? r : t;
+       }
+ 
+   return NULL_TREE;
+ }
+ 
  /* Returns true iff for class T, a synthesized default constructor
     would be constexpr.  */
  
*************** finish_struct_1 (tree t)
*** 5715,5720 ****
--- 5737,5763 ----
  
    /* Finish debugging output for this type.  */
    rest_of_type_compilation (t, ! LOCAL_CLASS_P (t));
+ 
+   if (TYPE_TRANSPARENT_AGGR (t))
+     {
+       tree field = first_field (t);
+       if (field == NULL_TREE || error_operand_p (field))
+ 	{
+ 	  error ("type transparent class %qT does not have any fields", t);
+ 	  TYPE_TRANSPARENT_AGGR (t) = 0;
+ 	}
+       else if (DECL_ARTIFICIAL (field))
+ 	{
+ 	  if (DECL_FIELD_IS_BASE (field))
+ 	    error ("type transparent class %qT has base classes", t);
+ 	  else
+ 	    {
+ 	      gcc_checking_assert (DECL_VIRTUAL_P (field));
+ 	      error ("type transparent class %qT has virtual functions", t);
+ 	    }
+ 	  TYPE_TRANSPARENT_AGGR (t) = 0;
+ 	}
+     }
  }
  
  /* When T was built up, the member declarations were added in reverse
diff -Nrcpad gcc-4.6.1/gcc/cp/cp-tree.h gcc-4.6.2/gcc/cp/cp-tree.h
*** gcc-4.6.1/gcc/cp/cp-tree.h	Thu May 19 08:00:50 2011
--- gcc-4.6.2/gcc/cp/cp-tree.h	Sun Sep 25 20:29:04 2011
*************** extern tree in_class_defaulted_default_c
*** 4715,4720 ****
--- 4715,4721 ----
  extern bool user_provided_p			(tree);
  extern bool type_has_user_provided_constructor  (tree);
  extern bool type_has_user_provided_default_constructor (tree);
+ extern tree default_init_uninitialized_part (tree);
  extern bool synthesized_default_constructor_is_constexpr (tree);
  extern bool type_has_constexpr_default_constructor (tree);
  extern bool type_has_virtual_destructor		(tree);
diff -Nrcpad gcc-4.6.1/gcc/cp/decl.c gcc-4.6.2/gcc/cp/decl.c
*** gcc-4.6.1/gcc/cp/decl.c	Sat May 28 03:22:31 2011
--- gcc-4.6.2/gcc/cp/decl.c	Sun Sep 25 20:29:04 2011
*************** check_for_uninitialized_const_var (tree 
*** 4834,4848 ****
    if (TREE_CODE (decl) == VAR_DECL
        && TREE_CODE (type) != REFERENCE_TYPE
        && CP_TYPE_CONST_P (type)
-       && (!TYPE_NEEDS_CONSTRUCTING (type)
- 	  || !type_has_user_provided_default_constructor (type))
        && !DECL_INITIAL (decl))
      {
        permerror (DECL_SOURCE_LOCATION (decl),
  		 "uninitialized const %qD", decl);
  
!       if (CLASS_TYPE_P (type)
! 	  && !type_has_user_provided_default_constructor (type))
  	{
  	  tree defaulted_ctor;
  
--- 4834,4849 ----
    if (TREE_CODE (decl) == VAR_DECL
        && TREE_CODE (type) != REFERENCE_TYPE
        && CP_TYPE_CONST_P (type)
        && !DECL_INITIAL (decl))
      {
+       tree field = default_init_uninitialized_part (type);
+       if (!field)
+ 	return;
+ 
        permerror (DECL_SOURCE_LOCATION (decl),
  		 "uninitialized const %qD", decl);
  
!       if (CLASS_TYPE_P (type))
  	{
  	  tree defaulted_ctor;
  
*************** check_for_uninitialized_const_var (tree 
*** 4853,4858 ****
--- 4854,4861 ----
  	    inform (DECL_SOURCE_LOCATION (defaulted_ctor),
  		    "constructor is not user-provided because it is "
  		    "explicitly defaulted in the class body");
+ 	  inform (0, "and the implicitly-defined constructor does not "
+ 		  "initialize %q+#D", field);
  	}
      }
  }
*************** grokdeclarator (const cp_declarator *dec
*** 8749,8754 ****
--- 8752,8761 ----
  
  	    /* Pick up the exception specifications.  */
  	    raises = declarator->u.function.exception_specification;
+ 	    /* If the exception-specification is ill-formed, let's pretend
+ 	       there wasn't one.  */
+ 	    if (raises == error_mark_node)
+ 	      raises = NULL_TREE;
  
  	    /* Say it's a definition only for the CALL_EXPR
  	       closest to the identifier.  */
diff -Nrcpad gcc-4.6.1/gcc/cp/error.c gcc-4.6.2/gcc/cp/error.c
*** gcc-4.6.1/gcc/cp/error.c	Tue Jun 14 22:13:45 2011
--- gcc-4.6.2/gcc/cp/error.c	Tue Jul  5 14:51:46 2011
*************** type_to_string (tree typ, int verbose)
*** 2618,2631 ****
--- 2618,2645 ----
  
    reinit_cxx_pp ();
    dump_type (typ, flags);
+   /* If we're printing a type that involves typedefs, also print the
+      stripped version.  But sometimes the stripped version looks
+      exactly the same, so we don't want it after all.  To avoid printing
+      it in that case, we play ugly obstack games.  */
    if (typ && TYPE_P (typ) && typ != TYPE_CANONICAL (typ)
        && !uses_template_parms (typ))
      {
+       int aka_start; char *p;
+       struct obstack *ob = pp_base (cxx_pp)->buffer->obstack;
+       /* Remember the end of the initial dump.  */
+       int len = obstack_object_size (ob);
        tree aka = strip_typedefs (typ);
        pp_string (cxx_pp, " {aka");
        pp_cxx_whitespace (cxx_pp);
+       /* And remember the start of the aka dump.  */
+       aka_start = obstack_object_size (ob);
        dump_type (aka, flags);
        pp_character (cxx_pp, '}');
+       p = (char*)obstack_base (ob);
+       /* If they are identical, cut off the aka with a NUL.  */
+       if (memcmp (p, p+aka_start, len) == 0)
+ 	p[len] = '\0';
      }
    return pp_formatted_text (cxx_pp);
  }
diff -Nrcpad gcc-4.6.1/gcc/cp/init.c gcc-4.6.2/gcc/cp/init.c
*** gcc-4.6.1/gcc/cp/init.c	Wed May 25 20:52:15 2011
--- gcc-4.6.2/gcc/cp/init.c	Thu Oct 13 18:02:10 2011
*************** build_value_init (tree type, tsubst_flag
*** 332,338 ****
       constructor.  */
  
    /* The AGGR_INIT_EXPR tweaking below breaks in templates.  */
!   gcc_assert (!processing_template_decl);
  
    if (CLASS_TYPE_P (type))
      {
--- 332,338 ----
       constructor.  */
  
    /* The AGGR_INIT_EXPR tweaking below breaks in templates.  */
!   gcc_assert (!processing_template_decl || SCALAR_TYPE_P (type));
  
    if (CLASS_TYPE_P (type))
      {
*************** perform_member_init (tree member, tree i
*** 526,533 ****
  	{
  	  if (init)
  	    {
! 	      gcc_assert (TREE_CHAIN (init) == NULL_TREE);
! 	      init = TREE_VALUE (init);
  	      if (BRACE_ENCLOSED_INITIALIZER_P (init))
  		init = digest_init (type, init);
  	    }
--- 526,535 ----
  	{
  	  if (init)
  	    {
! 	      if (TREE_CHAIN (init))
! 		init = error_mark_node;
! 	      else
! 		init = TREE_VALUE (init);
  	      if (BRACE_ENCLOSED_INITIALIZER_P (init))
  		init = digest_init (type, init);
  	    }
*************** perform_member_init (tree member, tree i
*** 549,555 ****
  	    flags |= LOOKUP_DEFAULTED;
  	  if (CP_TYPE_CONST_P (type)
  	      && init == NULL_TREE
! 	      && !type_has_user_provided_default_constructor (type))
  	    /* TYPE_NEEDS_CONSTRUCTING can be set just because we have a
  	       vtable; still give this diagnostic.  */
  	    permerror (DECL_SOURCE_LOCATION (current_function_decl),
--- 551,557 ----
  	    flags |= LOOKUP_DEFAULTED;
  	  if (CP_TYPE_CONST_P (type)
  	      && init == NULL_TREE
! 	      && default_init_uninitialized_part (type))
  	    /* TYPE_NEEDS_CONSTRUCTING can be set just because we have a
  	       vtable; still give this diagnostic.  */
  	    permerror (DECL_SOURCE_LOCATION (current_function_decl),
*************** build_field_list (tree t, tree list, int
*** 627,634 ****
  {
    tree fields;
  
-   *uses_unions_p = 0;
- 
    /* Note whether or not T is a union.  */
    if (TREE_CODE (t) == UNION_TYPE)
      *uses_unions_p = 1;
--- 629,634 ----
*************** sort_mem_initializers (tree t, tree mem_
*** 682,688 ****
    tree next_subobject;
    VEC(tree,gc) *vbases;
    int i;
!   int uses_unions_p;
  
    /* Build up a list of initializations.  The TREE_PURPOSE of entry
       will be the subobject (a FIELD_DECL or BINFO) to initialize.  The
--- 682,688 ----
    tree next_subobject;
    VEC(tree,gc) *vbases;
    int i;
!   int uses_unions_p = 0;
  
    /* Build up a list of initializations.  The TREE_PURPOSE of entry
       will be the subobject (a FIELD_DECL or BINFO) to initialize.  The
*************** expand_default_init (tree binfo, tree tr
*** 1492,1498 ****
        tree fn = get_callee_fndecl (rval);
        if (fn && DECL_DECLARED_CONSTEXPR_P (fn))
  	{
! 	  tree e = maybe_constant_value (rval);
  	  if (TREE_CONSTANT (e))
  	    rval = build2 (INIT_EXPR, type, exp, e);
  	}
--- 1492,1498 ----
        tree fn = get_callee_fndecl (rval);
        if (fn && DECL_DECLARED_CONSTEXPR_P (fn))
  	{
! 	  tree e = maybe_constant_init (rval);
  	  if (TREE_CONSTANT (e))
  	    rval = build2 (INIT_EXPR, type, exp, e);
  	}
*************** expand_aggr_init_1 (tree binfo, tree tru
*** 1561,1567 ****
  	 zero out the object first.  */
        else if (TYPE_NEEDS_CONSTRUCTING (type))
  	{
! 	  init = build_zero_init (type, NULL_TREE, /*static_storage_p=*/false);
  	  init = build2 (INIT_EXPR, type, exp, init);
  	  finish_expr_stmt (init);
  	  /* And then call the constructor.  */
--- 1561,1572 ----
  	 zero out the object first.  */
        else if (TYPE_NEEDS_CONSTRUCTING (type))
  	{
! 	  tree field_size = NULL_TREE;
! 	  if (exp != true_exp && CLASSTYPE_AS_BASE (type) != type)
! 	    /* Don't clobber already initialized virtual bases.  */
! 	    field_size = TYPE_SIZE (CLASSTYPE_AS_BASE (type));
! 	  init = build_zero_init_1 (type, NULL_TREE, /*static_storage_p=*/false,
! 				    field_size);
  	  init = build2 (INIT_EXPR, type, exp, init);
  	  finish_expr_stmt (init);
  	  /* And then call the constructor.  */
*************** build_new_1 (VEC(tree,gc) **placement, t
*** 2084,2090 ****
      }
  
    if (CP_TYPE_CONST_P (elt_type) && *init == NULL
!       && !type_has_user_provided_default_constructor (elt_type))
      {
        if (complain & tf_error)
          error ("uninitialized const in %<new%> of %q#T", elt_type);
--- 2089,2095 ----
      }
  
    if (CP_TYPE_CONST_P (elt_type) && *init == NULL
!       && default_init_uninitialized_part (elt_type))
      {
        if (complain & tf_error)
          error ("uninitialized const in %<new%> of %q#T", elt_type);
*************** build_vec_init (tree base, tree maxindex
*** 3067,3074 ****
        unsigned HOST_WIDE_INT idx;
        tree field, elt;
        /* Should we try to create a constant initializer?  */
!       bool try_const = (literal_type_p (inner_elt_type)
! 			|| TYPE_HAS_CONSTEXPR_CTOR (inner_elt_type));
        bool saw_non_const = false;
        bool saw_const = false;
        /* If we're initializing a static array, we want to do static
--- 3072,3080 ----
        unsigned HOST_WIDE_INT idx;
        tree field, elt;
        /* Should we try to create a constant initializer?  */
!       bool try_const = (TREE_CODE (atype) == ARRAY_TYPE
! 			&& (literal_type_p (inner_elt_type)
! 			    || TYPE_HAS_CONSTEXPR_CTOR (inner_elt_type)));
        bool saw_non_const = false;
        bool saw_const = false;
        /* If we're initializing a static array, we want to do static
diff -Nrcpad gcc-4.6.1/gcc/cp/mangle.c gcc-4.6.2/gcc/cp/mangle.c
*** gcc-4.6.1/gcc/cp/mangle.c	Fri Jun  3 20:21:38 2011
--- gcc-4.6.2/gcc/cp/mangle.c	Tue Oct 11 17:02:42 2011
*************** write_type (tree type)
*** 1790,1800 ****
    if (find_substitution (type))
      return;
  
-   /* According to the C++ ABI, some library classes are passed the
-      same as the scalar type of their single member and use the same
-      mangling.  */
-   if (TREE_CODE (type) == RECORD_TYPE && TYPE_TRANSPARENT_AGGR (type))
-     type = TREE_TYPE (first_field (type));
  
    if (write_CV_qualifiers_for_type (type) > 0)
      /* If TYPE was CV-qualified, we just wrote the qualifiers; now
--- 1790,1795 ----
*************** write_type (tree type)
*** 1814,1819 ****
--- 1809,1820 ----
        /* See through any typedefs.  */
        type = TYPE_MAIN_VARIANT (type);
  
+       /* According to the C++ ABI, some library classes are passed the
+ 	 same as the scalar type of their single member and use the same
+ 	 mangling.  */
+       if (TREE_CODE (type) == RECORD_TYPE && TYPE_TRANSPARENT_AGGR (type))
+ 	type = TREE_TYPE (first_field (type));
+ 
        if (TYPE_PTRMEM_P (type))
  	write_pointer_to_member_type (type);
        else
diff -Nrcpad gcc-4.6.1/gcc/cp/method.c gcc-4.6.2/gcc/cp/method.c
*** gcc-4.6.1/gcc/cp/method.c	Thu May 19 08:00:50 2011
--- gcc-4.6.2/gcc/cp/method.c	Sun Sep 25 20:29:04 2011
*************** use_thunk (tree thunk_fndecl, bool emit_
*** 360,365 ****
--- 360,367 ----
  
  	  /* Output the thunk into the same section as function.  */
  	  DECL_SECTION_NAME (thunk_fndecl) = DECL_SECTION_NAME (function);
+ 	  if (DECL_COMDAT_GROUP (function))
+ 	    make_decl_one_only (thunk_fndecl, DECL_COMDAT_GROUP (function));
  	}
      }
  
*************** walk_field_subobs (tree fields, tree fnn
*** 1007,1014 ****
  	{
  	  bool bad = true;
  	  if (CP_TYPE_CONST_P (mem_type)
! 	      && (!CLASS_TYPE_P (mem_type)
! 		  || !type_has_user_provided_default_constructor (mem_type)))
  	    {
  	      if (msg)
  		error ("uninitialized non-static const member %q#D",
--- 1009,1015 ----
  	{
  	  bool bad = true;
  	  if (CP_TYPE_CONST_P (mem_type)
! 	      && default_init_uninitialized_part (mem_type))
  	    {
  	      if (msg)
  		error ("uninitialized non-static const member %q#D",
diff -Nrcpad gcc-4.6.1/gcc/cp/parser.c gcc-4.6.2/gcc/cp/parser.c
*** gcc-4.6.1/gcc/cp/parser.c	Fri May 27 20:48:24 2011
--- gcc-4.6.2/gcc/cp/parser.c	Wed Oct 19 20:30:50 2011
*************** static void
*** 7940,7947 ****
--- 7940,7950 ----
  cp_parser_lambda_body (cp_parser* parser, tree lambda_expr)
  {
    bool nested = (current_function_decl != NULL_TREE);
+   bool local_variables_forbidden_p = parser->local_variables_forbidden_p;
    if (nested)
      push_function_context ();
+   /* Clear this in case we're in the middle of a default argument.  */
+   parser->local_variables_forbidden_p = false;
  
    /* Finish the function call operator
       - class_specifier
*************** cp_parser_lambda_body (cp_parser* parser
*** 8028,8033 ****
--- 8031,8037 ----
      expand_or_defer_fn (finish_function (/*inline*/2));
    }
  
+   parser->local_variables_forbidden_p = local_variables_forbidden_p;
    if (nested)
      pop_function_context();
  }
*************** cp_parser_initializer_clause (cp_parser*
*** 16572,16587 ****
  	= cp_parser_constant_expression (parser,
  					/*allow_non_constant_p=*/true,
  					non_constant_p);
-       if (!*non_constant_p)
- 	{
- 	  /* We only want to fold if this is really a constant
- 	     expression.  FIXME Actually, we don't want to fold here, but in
- 	     cp_finish_decl.  */
- 	  tree folded = fold_non_dependent_expr (initializer);
- 	  folded = maybe_constant_value (folded);
- 	  if (TREE_CONSTANT (folded))
- 	    initializer = folded;
- 	}
      }
    else
      initializer = cp_parser_braced_list (parser, non_constant_p);
--- 16576,16581 ----
*************** cp_parser_objc_at_property_declaration (
*** 23172,23178 ****
  		  break;
  		}
  	      cp_lexer_consume_token (parser->lexer); /* eat the = */
! 	      if (cp_lexer_next_token_is_not (parser->lexer, CPP_NAME))
  		{
  		  cp_parser_error (parser, "expected identifier");
  		  syntax_error = true;
--- 23166,23172 ----
  		  break;
  		}
  	      cp_lexer_consume_token (parser->lexer); /* eat the = */
! 	      if (!cp_parser_objc_selector_p (cp_lexer_peek_token (parser->lexer)->type))
  		{
  		  cp_parser_error (parser, "expected identifier");
  		  syntax_error = true;
*************** cp_parser_objc_at_property_declaration (
*** 23181,23190 ****
  	      if (keyword == RID_SETTER)
  		{
  		  if (property_setter_ident != NULL_TREE)
! 		    cp_parser_error (parser, "the %<setter%> attribute may only be specified once");
  		  else
! 		    property_setter_ident = cp_lexer_peek_token (parser->lexer)->u.value;
! 		  cp_lexer_consume_token (parser->lexer);
  		  if (cp_lexer_next_token_is_not (parser->lexer, CPP_COLON))
  		    cp_parser_error (parser, "setter name must terminate with %<:%>");
  		  else
--- 23175,23186 ----
  	      if (keyword == RID_SETTER)
  		{
  		  if (property_setter_ident != NULL_TREE)
! 		    {
! 		      cp_parser_error (parser, "the %<setter%> attribute may only be specified once");
! 		      cp_lexer_consume_token (parser->lexer);
! 		    }
  		  else
! 		    property_setter_ident = cp_parser_objc_selector (parser);
  		  if (cp_lexer_next_token_is_not (parser->lexer, CPP_COLON))
  		    cp_parser_error (parser, "setter name must terminate with %<:%>");
  		  else
*************** cp_parser_objc_at_property_declaration (
*** 23193,23202 ****
  	      else
  		{
  		  if (property_getter_ident != NULL_TREE)
! 		    cp_parser_error (parser, "the %<getter%> attribute may only be specified once");
  		  else
! 		    property_getter_ident = cp_lexer_peek_token (parser->lexer)->u.value;
! 		  cp_lexer_consume_token (parser->lexer);
  		}
  	      break;
  	    default:
--- 23189,23200 ----
  	      else
  		{
  		  if (property_getter_ident != NULL_TREE)
! 		    {
! 		      cp_parser_error (parser, "the %<getter%> attribute may only be specified once");
! 		      cp_lexer_consume_token (parser->lexer);
! 		    }
  		  else
! 		    property_getter_ident = cp_parser_objc_selector (parser);
  		}
  	      break;
  	    default:
diff -Nrcpad gcc-4.6.1/gcc/cp/pt.c gcc-4.6.2/gcc/cp/pt.c
*** gcc-4.6.1/gcc/cp/pt.c	Fri Jun 17 01:06:50 2011
--- gcc-4.6.2/gcc/cp/pt.c	Tue Oct 18 19:36:29 2011
*************** static void append_type_to_template_for_
*** 191,196 ****
--- 191,197 ----
  static tree listify (tree);
  static tree listify_autos (tree, tree);
  static tree template_parm_to_arg (tree t);
+ static bool arg_from_parm_pack_p (tree, tree);
  static tree current_template_args (void);
  static tree fixup_template_type_parm_type (tree, int);
  static tree fixup_template_parm_index (tree, tree, int);
*************** iterative_hash_template_arg (tree arg, h
*** 1626,1644 ****
  bool
  reregister_specialization (tree spec, tree tinfo, tree new_spec)
  {
!   spec_entry **slot;
    spec_entry elt;
  
    elt.tmpl = most_general_template (TI_TEMPLATE (tinfo));
    elt.args = TI_ARGS (tinfo);
    elt.spec = NULL_TREE;
  
!   slot = (spec_entry **) htab_find_slot (decl_specializations, &elt, INSERT);
!   if (*slot)
      {
!       gcc_assert ((*slot)->spec == spec || (*slot)->spec == new_spec);
        gcc_assert (new_spec != NULL_TREE);
!       (*slot)->spec = new_spec;
        return 1;
      }
  
--- 1627,1645 ----
  bool
  reregister_specialization (tree spec, tree tinfo, tree new_spec)
  {
!   spec_entry *entry;
    spec_entry elt;
  
    elt.tmpl = most_general_template (TI_TEMPLATE (tinfo));
    elt.args = TI_ARGS (tinfo);
    elt.spec = NULL_TREE;
  
!   entry = (spec_entry *) htab_find (decl_specializations, &elt);
!   if (entry != NULL)
      {
!       gcc_assert (entry->spec == spec || entry->spec == new_spec);
        gcc_assert (new_spec != NULL_TREE);
!       entry->spec = new_spec;
        return 1;
      }
  
*************** template_parameter_pack_p (const_tree pa
*** 2729,2740 ****
--- 2730,2744 ----
    if (TREE_CODE (parm) == PARM_DECL)
      return (DECL_TEMPLATE_PARM_P (parm) 
              && TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (parm)));
+   if (TREE_CODE (parm) == TEMPLATE_PARM_INDEX)
+     return TEMPLATE_PARM_PARAMETER_PACK (parm);
  
    /* If this is a list of template parameters, we could get a
       TYPE_DECL or a TEMPLATE_DECL.  */ 
    if (TREE_CODE (parm) == TYPE_DECL || TREE_CODE (parm) == TEMPLATE_DECL)
      parm = TREE_TYPE (parm);
  
+   /* Otherwise it must be a type template parameter.  */
    return ((TREE_CODE (parm) == TEMPLATE_TYPE_PARM
  	   || TREE_CODE (parm) == TEMPLATE_TEMPLATE_PARM)
  	  && TEMPLATE_TYPE_PARAMETER_PACK (parm));
*************** find_parameter_packs_r (tree *tp, int *w
*** 3013,3018 ****
--- 3017,3023 ----
        *walk_subtrees = 0;
        return NULL_TREE;
  
+     case CONSTRUCTOR:
      case TEMPLATE_DECL:
        cp_walk_tree (&TREE_TYPE (t),
  		    &find_parameter_packs_r, ppd, ppd->visited);
*************** template_parm_to_arg (tree t)
*** 3992,3997 ****
--- 3997,4059 ----
    return t;
  }
  
+ /* This function returns TRUE if PARM_PACK is a template parameter
+    pack and if ARG_PACK is what template_parm_to_arg returned when
+    passed PARM_PACK.  */
+ 
+ static bool
+ arg_from_parm_pack_p (tree arg_pack, tree parm_pack)
+ {
+   /* For clarity in the comments below let's use the representation
+      argument_pack<elements>' to denote an argument pack and its
+      elements.
+ 
+      In the 'if' block below, we want to detect cases where
+      ARG_PACK is argument_pack<PARM_PACK...>.  I.e, we want to
+      check if ARG_PACK is an argument pack which sole element is
+      the expansion of PARM_PACK.  That argument pack is typically
+      created by template_parm_to_arg when passed a parameter
+      pack.  */
+ 
+   if (arg_pack
+       && TREE_VEC_LENGTH (ARGUMENT_PACK_ARGS (arg_pack)) == 1
+       && PACK_EXPANSION_P (TREE_VEC_ELT (ARGUMENT_PACK_ARGS (arg_pack), 0)))
+     {
+       tree expansion = TREE_VEC_ELT (ARGUMENT_PACK_ARGS (arg_pack), 0);
+       tree pattern = PACK_EXPANSION_PATTERN (expansion);
+       /* So we have an argument_pack<P...>.  We want to test if P
+ 	 is actually PARM_PACK.  We will not use cp_tree_equal to
+ 	 test P and PARM_PACK because during type fixup (by
+ 	 fixup_template_parm) P can be a pre-fixup version of a
+ 	 type and PARM_PACK be its post-fixup version.
+ 	 cp_tree_equal would consider them as different even
+ 	 though we would want to consider them compatible for our
+ 	 precise purpose here.
+ 
+ 	 Thus we are going to consider that P and PARM_PACK are
+ 	 compatible if they have the same DECL.  */
+       if ((/* If ARG_PACK is a type parameter pack named by the
+ 	      same DECL as parm_pack ...  */
+ 	   (TYPE_P (pattern)
+ 	    && TYPE_P (parm_pack)
+ 	    && TYPE_NAME (pattern) == TYPE_NAME (parm_pack))
+ 	   /* ... or if PARM_PACK is a non-type parameter named by the
+ 	      same DECL as ARG_PACK.  Note that PARM_PACK being a
+ 	      non-type parameter means it's either a PARM_DECL or a
+ 	      TEMPLATE_PARM_INDEX.  */
+ 	   || (TREE_CODE (pattern) == TEMPLATE_PARM_INDEX
+ 	       && ((TREE_CODE (parm_pack) == PARM_DECL
+ 		    && (TEMPLATE_PARM_DECL (pattern)
+ 			== TEMPLATE_PARM_DECL (DECL_INITIAL (parm_pack))))
+ 		   || (TREE_CODE (parm_pack) == TEMPLATE_PARM_INDEX
+ 		       && (TEMPLATE_PARM_DECL (pattern)
+ 			   == TEMPLATE_PARM_DECL (parm_pack))))))
+ 	  && template_parameter_pack_p (pattern))
+ 	return true;
+     }
+   return false;
+ }
+ 
  /* Within the declaration of a template, return all levels of template
     parameters that apply.  The template parameters are represented as
     a TREE_VEC, in the form documented in cp-tree.h for template
*************** build_template_decl (tree decl, tree par
*** 4109,4114 ****
--- 4171,4177 ----
    tree tmpl = build_lang_decl (TEMPLATE_DECL, DECL_NAME (decl), NULL_TREE);
    DECL_TEMPLATE_PARMS (tmpl) = parms;
    DECL_CONTEXT (tmpl) = DECL_CONTEXT (decl);
+   DECL_SOURCE_LOCATION (tmpl) = DECL_SOURCE_LOCATION (decl);
    DECL_MEMBER_TEMPLATE_P (tmpl) = member_template_p;
  
    return tmpl;
*************** coerce_template_parms (tree parms,
*** 6295,6300 ****
--- 6358,6364 ----
       subtract it from nparms to get the number of non-variadic
       parameters.  */
    int variadic_p = 0;
+   int post_variadic_parms = 0;
  
    if (args == error_mark_node)
      return error_mark_node;
*************** coerce_template_parms (tree parms,
*** 6305,6323 ****
    for (parm_idx = 0; parm_idx < nparms; ++parm_idx)
      {
        tree tparm = TREE_VALUE (TREE_VEC_ELT (parms, parm_idx));
        if (template_parameter_pack_p (tparm))
  	++variadic_p;
      }
  
    inner_args = INNERMOST_TEMPLATE_ARGS (args);
!   /* If there are 0 or 1 parameter packs, we need to expand any argument
!      packs so that we can deduce a parameter pack from some non-packed args
!      followed by an argument pack, as in variadic85.C.  If there are more
!      than that, we need to leave argument packs intact so the arguments are
!      assigned to the right parameter packs.  This should only happen when
!      dealing with a nested class inside a partial specialization of a class
!      template, as in variadic92.C.  */
!   if (variadic_p <= 1)
      inner_args = expand_template_argument_pack (inner_args);
  
    nargs = inner_args ? NUM_TMPL_ARGS (inner_args) : 0;
--- 6369,6390 ----
    for (parm_idx = 0; parm_idx < nparms; ++parm_idx)
      {
        tree tparm = TREE_VALUE (TREE_VEC_ELT (parms, parm_idx));
+       if (variadic_p)
+ 	++post_variadic_parms;
        if (template_parameter_pack_p (tparm))
  	++variadic_p;
      }
  
    inner_args = INNERMOST_TEMPLATE_ARGS (args);
!   /* If there are no parameters that follow a parameter pack, we need to
!      expand any argument packs so that we can deduce a parameter pack from
!      some non-packed args followed by an argument pack, as in variadic85.C.
!      If there are such parameters, we need to leave argument packs intact
!      so the arguments are assigned properly.  This can happen when dealing
!      with a nested class inside a partial specialization of a class
!      template, as in variadic92.C, or when deducing a template parameter pack
!      from a sub-declarator, as in variadic114.C.  */
!   if (!post_variadic_parms)
      inner_args = expand_template_argument_pack (inner_args);
  
    nargs = inner_args ? NUM_TMPL_ARGS (inner_args) : 0;
*************** tsubst_template_arg (tree t, tree args, 
*** 8620,8630 ****
    return r;
  }
  
! /* Give a chain SPEC_PARM of PARM_DECLs, pack them into a
!    NONTYPE_ARGUMENT_PACK.  */
  
  static tree
! make_fnparm_pack (tree spec_parm)
  {
    /* Collect all of the extra "packed" parameters into an
       argument pack.  */
--- 8687,8698 ----
    return r;
  }
  
! /* Given a function parameter pack TMPL_PARM and some function parameters
!    instantiated from it at *SPEC_P, return a NONTYPE_ARGUMENT_PACK of them
!    and set *SPEC_P to point at the next point in the list.  */
  
  static tree
! extract_fnparm_pack (tree tmpl_parm, tree *spec_p)
  {
    /* Collect all of the extra "packed" parameters into an
       argument pack.  */
*************** make_fnparm_pack (tree spec_parm)
*** 8632,8642 ****
    tree parmtypevec;
    tree argpack = make_node (NONTYPE_ARGUMENT_PACK);
    tree argtypepack = cxx_make_type (TYPE_ARGUMENT_PACK);
!   int i, len = list_length (spec_parm);
  
    /* Fill in PARMVEC and PARMTYPEVEC with all of the parameters.  */
    parmvec = make_tree_vec (len);
    parmtypevec = make_tree_vec (len);
    for (i = 0; i < len; i++, spec_parm = DECL_CHAIN (spec_parm))
      {
        TREE_VEC_ELT (parmvec, i) = spec_parm;
--- 8700,8717 ----
    tree parmtypevec;
    tree argpack = make_node (NONTYPE_ARGUMENT_PACK);
    tree argtypepack = cxx_make_type (TYPE_ARGUMENT_PACK);
!   tree spec_parm = *spec_p;
!   int i, len;
! 
!   for (len = 0; spec_parm; ++len, spec_parm = TREE_CHAIN (spec_parm))
!     if (tmpl_parm
! 	&& !function_parameter_expanded_from_pack_p (spec_parm, tmpl_parm))
!       break;
  
    /* Fill in PARMVEC and PARMTYPEVEC with all of the parameters.  */
    parmvec = make_tree_vec (len);
    parmtypevec = make_tree_vec (len);
+   spec_parm = *spec_p;
    for (i = 0; i < len; i++, spec_parm = DECL_CHAIN (spec_parm))
      {
        TREE_VEC_ELT (parmvec, i) = spec_parm;
*************** make_fnparm_pack (tree spec_parm)
*** 8647,8655 ****
    SET_ARGUMENT_PACK_ARGS (argpack, parmvec);
    SET_ARGUMENT_PACK_ARGS (argtypepack, parmtypevec);
    TREE_TYPE (argpack) = argtypepack;
  
    return argpack;
! }        
  
  /* Substitute ARGS into T, which is an pack expansion
     (i.e. TYPE_PACK_EXPANSION or EXPR_PACK_EXPANSION). Returns a
--- 8722,8740 ----
    SET_ARGUMENT_PACK_ARGS (argpack, parmvec);
    SET_ARGUMENT_PACK_ARGS (argtypepack, parmtypevec);
    TREE_TYPE (argpack) = argtypepack;
+   *spec_p = spec_parm;
  
    return argpack;
! }
! 
! /* Give a chain SPEC_PARM of PARM_DECLs, pack them into a
!    NONTYPE_ARGUMENT_PACK.  */
! 
! static tree
! make_fnparm_pack (tree spec_parm)
! {
!   return extract_fnparm_pack (NULL_TREE, &spec_parm);
! }
  
  /* Substitute ARGS into T, which is an pack expansion
     (i.e. TYPE_PACK_EXPANSION or EXPR_PACK_EXPANSION). Returns a
*************** tsubst_pack_expansion (tree t, tree args
*** 8724,8776 ****
  	  return result;
  	}
  
!       /* For clarity in the comments below let's use the
! 	 representation 'argument_pack<elements>' to denote an
! 	 argument pack and its elements.
! 
! 	 In the 'if' block below, we want to detect cases where
! 	 ARG_PACK is argument_pack<PARM_PACK...>.  I.e, we want to
! 	 check if ARG_PACK is an argument pack which sole element is
! 	 the expansion of PARM_PACK.  That argument pack is typically
! 	 created by template_parm_to_arg when passed a parameter
! 	 pack.  */
!       if (arg_pack
!           && TREE_VEC_LENGTH (ARGUMENT_PACK_ARGS (arg_pack)) == 1
!           && PACK_EXPANSION_P (TREE_VEC_ELT (ARGUMENT_PACK_ARGS (arg_pack), 0)))
!         {
!           tree expansion = TREE_VEC_ELT (ARGUMENT_PACK_ARGS (arg_pack), 0);
!           tree pattern = PACK_EXPANSION_PATTERN (expansion);
! 	  /* So we have an argument_pack<P...>.  We want to test if P
! 	     is actually PARM_PACK.  We will not use cp_tree_equal to
! 	     test P and PARM_PACK because during type fixup (by
! 	     fixup_template_parm) P can be a pre-fixup version of a
! 	     type and PARM_PACK be its post-fixup version.
! 	     cp_tree_equal would consider them as different even
! 	     though we would want to consider them compatible for our
! 	     precise purpose here.
! 
! 	     Thus we are going to consider that P and PARM_PACK are
! 	     compatible if they have the same DECL.  */
! 	  if ((/* If ARG_PACK is a type parameter pack named by the
! 		  same DECL as parm_pack ...  */
! 	       (TYPE_P (pattern)
! 		&& TYPE_P (parm_pack)
! 		&& TYPE_NAME (pattern) == TYPE_NAME (parm_pack))
! 	       /* ... or if ARG_PACK is a non-type parameter
! 		  named by the same DECL as parm_pack ...  */
! 	       || (TREE_CODE (pattern) == TEMPLATE_PARM_INDEX
! 		   && TREE_CODE (parm_pack) == PARM_DECL
! 		   && TEMPLATE_PARM_DECL (pattern)
! 		   == TEMPLATE_PARM_DECL (DECL_INITIAL (parm_pack))))
! 	      && template_parameter_pack_p (pattern))
!             /* ... then the argument pack that the parameter maps to
!                is just an expansion of the parameter itself, such as
!                one would find in the implicit typedef of a class
!                inside the class itself.  Consider this parameter
!                "unsubstituted", so that we will maintain the outer
!                pack expansion.  */
!             arg_pack = NULL_TREE;
!         }
            
        if (arg_pack)
          {
--- 8809,8821 ----
  	  return result;
  	}
  
!       if (arg_from_parm_pack_p (arg_pack, parm_pack))
! 	/* The argument pack that the parameter maps to is just an
! 	   expansion of the parameter itself, such as one would find
! 	   in the implicit typedef of a class inside the class itself.
! 	   Consider this parameter "unsubstituted", so that we will
! 	   maintain the outer pack expansion.  */
! 	arg_pack = NULL_TREE;
            
        if (arg_pack)
          {
*************** tsubst_qualified_id (tree qualified_id, 
*** 11200,11207 ****
      expr = name;
  
    if (dependent_scope_p (scope))
!     return build_qualified_name (NULL_TREE, scope, expr,
! 				 QUALIFIED_NAME_IS_TEMPLATE (qualified_id));
  
    if (!BASELINK_P (name) && !DECL_P (expr))
      {
--- 11245,11256 ----
      expr = name;
  
    if (dependent_scope_p (scope))
!     {
!       if (is_template)
! 	expr = build_min_nt (TEMPLATE_ID_EXPR, expr, template_args);
!       return build_qualified_name (NULL_TREE, scope, expr,
! 				   QUALIFIED_NAME_IS_TEMPLATE (qualified_id));
!     }
  
    if (!BASELINK_P (name) && !DECL_P (expr))
      {
*************** tsubst_copy (tree t, tree args, tsubst_f
*** 11437,11442 ****
--- 11486,11492 ----
      case STATIC_CAST_EXPR:
      case DYNAMIC_CAST_EXPR:
      case NOP_EXPR:
+     case CONVERT_EXPR:
        return build1
  	(code, tsubst (TREE_TYPE (t), args, complain, in_decl),
  	 tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl));
*************** tsubst_copy_and_build (tree t,
*** 12537,12543 ****
  	if (error_msg)
  	  error (error_msg);
  	if (!function_p && TREE_CODE (decl) == IDENTIFIER_NODE)
! 	  decl = unqualified_name_lookup_error (decl);
  	return decl;
        }
  
--- 12587,12597 ----
  	if (error_msg)
  	  error (error_msg);
  	if (!function_p && TREE_CODE (decl) == IDENTIFIER_NODE)
! 	  {
! 	    if (complain & tf_error)
! 	      unqualified_name_lookup_error (decl);
! 	    decl = error_mark_node;
! 	  }
  	return decl;
        }
  
*************** tsubst_copy_and_build (tree t,
*** 12588,12593 ****
--- 12642,12653 ----
  	(tsubst (TREE_TYPE (t), args, complain, in_decl),
  	 RECUR (TREE_OPERAND (t, 0)));
  
+     case CONVERT_EXPR:
+       return build1
+ 	(CONVERT_EXPR,
+ 	 tsubst (TREE_TYPE (t), args, complain, in_decl),
+ 	 RECUR (TREE_OPERAND (t, 0)));
+ 
      case CAST_EXPR:
      case REINTERPRET_CAST_EXPR:
      case CONST_CAST_EXPR:
*************** unify_pack_expansion (tree tparms, tree 
*** 14772,14778 ****
          tree arg = TREE_VEC_ELT (packed_args, i);
  	tree arg_expr = NULL_TREE;
          int arg_strict = strict;
-         bool skip_arg_p = false;
  
          if (call_args_p)
            {
--- 14832,14837 ----
*************** unify_pack_expansion (tree tparms, tree 
*** 14815,14833 ****
                      if (resolve_overloaded_unification
                          (tparms, targs, parm, arg,
  			 (unification_kind_t) strict,
! 			 sub_strict)
!                         != 0)
!                       return 1;
!                     skip_arg_p = true;
                    }
  
!                 if (!skip_arg_p)
!                   {
! 		    arg_expr = arg;
!                     arg = unlowered_expr_type (arg);
!                     if (arg == error_mark_node)
!                       return 1;
!                   }
                }
        
              arg_strict = sub_strict;
--- 14874,14888 ----
                      if (resolve_overloaded_unification
                          (tparms, targs, parm, arg,
  			 (unification_kind_t) strict,
! 			 sub_strict))
! 		      goto unified;
! 		    return 1;
                    }
  
! 		arg_expr = arg;
! 		arg = unlowered_expr_type (arg);
! 		if (arg == error_mark_node)
! 		  return 1;
                }
        
              arg_strict = sub_strict;
*************** unify_pack_expansion (tree tparms, tree 
*** 14838,14853 ****
  						  &parm, &arg, arg_expr);
            }
  
!         if (!skip_arg_p)
!           {
! 	    /* For deduction from an init-list we need the actual list.  */
! 	    if (arg_expr && BRACE_ENCLOSED_INITIALIZER_P (arg_expr))
! 	      arg = arg_expr;
!             if (unify (tparms, targs, parm, arg, arg_strict))
!               return 1;
!           }
        }
  
        /* For each parameter pack, collect the deduced value.  */
        for (pack = packs; pack; pack = TREE_CHAIN (pack))
          {
--- 14893,14906 ----
  						  &parm, &arg, arg_expr);
            }
  
! 	/* For deduction from an init-list we need the actual list.  */
! 	if (arg_expr && BRACE_ENCLOSED_INITIALIZER_P (arg_expr))
! 	  arg = arg_expr;
! 	if (unify (tparms, targs, parm, arg, arg_strict))
! 	  return 1;
        }
  
+     unified:
        /* For each parameter pack, collect the deduced value.  */
        for (pack = packs; pack; pack = TREE_CHAIN (pack))
          {
*************** instantiate_decl (tree d, int defer_ok,
*** 17181,17186 ****
--- 17234,17241 ----
      d = DECL_CLONED_FUNCTION (d);
  
    if (DECL_TEMPLATE_INSTANTIATED (d)
+       || (TREE_CODE (d) == FUNCTION_DECL
+ 	  && DECL_DEFAULTED_FN (d) && DECL_INITIAL (d))
        || DECL_TEMPLATE_SPECIALIZATION (d))
      /* D has already been instantiated or explicitly specialized, so
         there's nothing for us to do here.
*************** instantiate_decl (tree d, int defer_ok,
*** 17466,17486 ****
  	  spec_parm = skip_artificial_parms_for (d, spec_parm);
  	  tmpl_parm = skip_artificial_parms_for (subst_decl, tmpl_parm);
  	}
!       while (tmpl_parm && !FUNCTION_PARAMETER_PACK_P (tmpl_parm))
  	{
! 	  register_local_specialization (spec_parm, tmpl_parm);
! 	  tmpl_parm = DECL_CHAIN (tmpl_parm);
! 	  spec_parm = DECL_CHAIN (spec_parm);
  	}
-       if (tmpl_parm && FUNCTION_PARAMETER_PACK_P (tmpl_parm))
-         {
-           /* Register the (value) argument pack as a specialization of
-              TMPL_PARM, then move on.  */
- 	  tree argpack = make_fnparm_pack (spec_parm);
-           register_local_specialization (argpack, tmpl_parm);
-           tmpl_parm = DECL_CHAIN (tmpl_parm);
- 	  spec_parm = NULL_TREE;
-         }
        gcc_assert (!spec_parm);
  
        /* Substitute into the body of the function.  */
--- 17521,17541 ----
  	  spec_parm = skip_artificial_parms_for (d, spec_parm);
  	  tmpl_parm = skip_artificial_parms_for (subst_decl, tmpl_parm);
  	}
!       for (; tmpl_parm; tmpl_parm = DECL_CHAIN (tmpl_parm))
  	{
! 	  if (!FUNCTION_PARAMETER_PACK_P (tmpl_parm))
! 	    {
! 	      register_local_specialization (spec_parm, tmpl_parm);
! 	      spec_parm = DECL_CHAIN (spec_parm);
! 	    }
! 	  else
! 	    {
! 	      /* Register the (value) argument pack as a specialization of
! 		 TMPL_PARM, then move on.  */
! 	      tree argpack = extract_fnparm_pack (tmpl_parm, &spec_parm);
! 	      register_local_specialization (argpack, tmpl_parm);
! 	    }
  	}
        gcc_assert (!spec_parm);
  
        /* Substitute into the body of the function.  */
*************** build_non_dependent_expr (tree expr)
*** 18888,18893 ****
--- 18943,18952 ----
    if (TREE_CODE (expr) == THROW_EXPR)
      return expr;
  
+   /* Don't wrap an initializer list, we need to be able to look inside.  */
+   if (BRACE_ENCLOSED_INITIALIZER_P (expr))
+     return expr;
+ 
    if (TREE_CODE (expr) == COND_EXPR)
      return build3 (COND_EXPR,
  		   TREE_TYPE (expr),
diff -Nrcpad gcc-4.6.1/gcc/cp/semantics.c gcc-4.6.2/gcc/cp/semantics.c
*** gcc-4.6.1/gcc/cp/semantics.c	Tue Jun 21 20:08:01 2011
--- gcc-4.6.2/gcc/cp/semantics.c	Tue Sep 27 02:18:56 2011
*************** finish_id_expression (tree id_expression
*** 2895,2901 ****
  	  tree containing_function = current_function_decl;
  	  tree lambda_stack = NULL_TREE;
  	  tree lambda_expr = NULL_TREE;
! 	  tree initializer = decl;
  
  	  /* Core issue 696: "[At the July 2009 meeting] the CWG expressed
  	     support for an approach in which a reference to a local
--- 2895,2904 ----
  	  tree containing_function = current_function_decl;
  	  tree lambda_stack = NULL_TREE;
  	  tree lambda_expr = NULL_TREE;
! 	  tree initializer = convert_from_reference (decl);
! 
! 	  /* Mark it as used now even if the use is ill-formed.  */
! 	  mark_used (decl);
  
  	  /* Core issue 696: "[At the July 2009 meeting] the CWG expressed
  	     support for an approach in which a reference to a local
*************** finish_id_expression (tree id_expression
*** 3203,3209 ****
        if (scope)
  	{
  	  decl = (adjust_result_of_qualified_name_lookup
! 		  (decl, scope, current_class_type));
  
  	  if (TREE_CODE (decl) == FUNCTION_DECL)
  	    mark_used (decl);
--- 3206,3212 ----
        if (scope)
  	{
  	  decl = (adjust_result_of_qualified_name_lookup
! 		  (decl, scope, current_nonlambda_class_type()));
  
  	  if (TREE_CODE (decl) == FUNCTION_DECL)
  	    mark_used (decl);
*************** finish_decltype_type (tree expr, bool id
*** 4835,4840 ****
--- 4838,4846 ----
  
    expr = resolve_nondeduced_context (expr);
  
+   if (invalid_nonstatic_memfn_p (expr, complain))
+     return error_mark_node;
+ 
    /* To get the size of a static data member declared as an array of
       unknown bound, we need to instantiate it.  */
    if (TREE_CODE (expr) == VAR_DECL
*************** cxx_eval_array_reference (const constexp
*** 6300,6311 ****
    elem_type = TREE_TYPE (TREE_TYPE (ary));
    if (TREE_CODE (ary) == CONSTRUCTOR)
      len = CONSTRUCTOR_NELTS (ary);
!   else
      {
        elem_nchars = (TYPE_PRECISION (elem_type)
  		     / TYPE_PRECISION (char_type_node));
        len = (unsigned) TREE_STRING_LENGTH (ary) / elem_nchars;
      }
    if (compare_tree_int (index, len) >= 0)
      {
        if (tree_int_cst_lt (index, array_type_nelts_top (TREE_TYPE (ary))))
--- 6306,6327 ----
    elem_type = TREE_TYPE (TREE_TYPE (ary));
    if (TREE_CODE (ary) == CONSTRUCTOR)
      len = CONSTRUCTOR_NELTS (ary);
!   else if (TREE_CODE (ary) == STRING_CST)
      {
        elem_nchars = (TYPE_PRECISION (elem_type)
  		     / TYPE_PRECISION (char_type_node));
        len = (unsigned) TREE_STRING_LENGTH (ary) / elem_nchars;
      }
+   else
+     {
+       /* We can't do anything with other tree codes, so use
+ 	 VERIFY_CONSTANT to complain and fail.  */
+       VERIFY_CONSTANT (ary);
+       /* This should be unreachable, but be more fault-tolerant on the
+ 	 release branch.  */
+       *non_constant_p = true;
+       return t;
+     }
    if (compare_tree_int (index, len) >= 0)
      {
        if (tree_int_cst_lt (index, array_type_nelts_top (TREE_TYPE (ary))))
*************** cxx_eval_component_reference (const cons
*** 6375,6381 ****
        if (field == part)
          return value;
      }
!   if (TREE_CODE (TREE_TYPE (whole)) == UNION_TYPE)
      {
        /* FIXME Mike Miller wants this to be OK.  */
        if (!allow_non_constant)
--- 6391,6398 ----
        if (field == part)
          return value;
      }
!   if (TREE_CODE (TREE_TYPE (whole)) == UNION_TYPE
!       && CONSTRUCTOR_NELTS (whole) > 0)
      {
        /* FIXME Mike Miller wants this to be OK.  */
        if (!allow_non_constant)
*************** cxx_eval_component_reference (const cons
*** 6384,6391 ****
        *non_constant_p = true;
        return t;
      }
!   gcc_unreachable();
!   return error_mark_node;
  }
  
  /* Subroutine of cxx_eval_constant_expression.
--- 6401,6412 ----
        *non_constant_p = true;
        return t;
      }
! 
!   /* If there's no explicit init for this field, it's value-initialized.  */
!   value = build_value_init (TREE_TYPE (t), tf_warning_or_error);
!   return cxx_eval_constant_expression (call, value,
! 				       allow_non_constant, addr,
! 				       non_constant_p);
  }
  
  /* Subroutine of cxx_eval_constant_expression.
*************** cxx_eval_logical_expression (const const
*** 6482,6490 ****
  					   allow_non_constant, addr,
  					   non_constant_p);
    VERIFY_CONSTANT (lhs);
!   if (lhs == bailout_value)
      return lhs;
!   gcc_assert (lhs == continue_value);
    r = cxx_eval_constant_expression (call, TREE_OPERAND (t, 1),
  				    allow_non_constant, addr, non_constant_p);
    VERIFY_CONSTANT (r);
--- 6503,6511 ----
  					   allow_non_constant, addr,
  					   non_constant_p);
    VERIFY_CONSTANT (lhs);
!   if (tree_int_cst_equal (lhs, bailout_value))
      return lhs;
!   gcc_assert (tree_int_cst_equal (lhs, continue_value));
    r = cxx_eval_constant_expression (call, TREE_OPERAND (t, 1),
  				    allow_non_constant, addr, non_constant_p);
    VERIFY_CONSTANT (r);
*************** cxx_eval_vec_init_1 (const constexpr_cal
*** 6589,6594 ****
--- 6610,6616 ----
    tree elttype = TREE_TYPE (atype);
    int max = tree_low_cst (array_type_nelts (atype), 0);
    VEC(constructor_elt,gc) *n = VEC_alloc (constructor_elt, gc, max + 1);
+   bool default_init = false;
    int i;
  
    /* For the default constructor, build up a call to the default
*************** cxx_eval_vec_init_1 (const constexpr_cal
*** 6607,6612 ****
--- 6629,6635 ----
        release_tree_vector (argvec);
        init = cxx_eval_constant_expression (call, init, allow_non_constant,
  					   addr, non_constant_p);
+       default_init = true;
      }
  
    if (*non_constant_p && !allow_non_constant)
*************** cxx_eval_vec_init_1 (const constexpr_cal
*** 6634,6640 ****
  	  eltinit = cxx_eval_constant_expression
  	    (call, eltinit, allow_non_constant, addr, non_constant_p);
  	}
!       else if (TREE_CODE (init) == CONSTRUCTOR)
  	{
  	  /* Initializing an element using the call to the default
  	     constructor we just built above.  */
--- 6657,6663 ----
  	  eltinit = cxx_eval_constant_expression
  	    (call, eltinit, allow_non_constant, addr, non_constant_p);
  	}
!       else if (default_init)
  	{
  	  /* Initializing an element using the call to the default
  	     constructor we just built above.  */
*************** cxx_eval_vec_init_1 (const constexpr_cal
*** 6666,6672 ****
  
    if (!*non_constant_p)
      {
!       init = build_constructor (TREE_TYPE (atype), n);
        TREE_CONSTANT (init) = true;
        return init;
      }
--- 6689,6695 ----
  
    if (!*non_constant_p)
      {
!       init = build_constructor (atype, n);
        TREE_CONSTANT (init) = true;
        return init;
      }
*************** cxx_eval_constant_expression (const cons
*** 6932,6937 ****
--- 6955,6969 ----
        break;
  
      case TARGET_EXPR:
+       if (!literal_type_p (TREE_TYPE (t)))
+ 	{
+ 	  if (!allow_non_constant)
+ 	    error ("temporary of non-literal type %qT in a "
+ 		   "constant expression", TREE_TYPE (t));
+ 	  *non_constant_p = true;
+ 	  break;
+ 	}
+       /* else fall through.  */
      case INIT_EXPR:
        /* Pass false for 'addr' because these codes indicate
  	 initialization of a temporary.  */
*************** maybe_constant_value (tree t)
*** 7276,7281 ****
--- 7308,7314 ----
  
    if (type_dependent_expression_p (t)
        || type_unknown_p (t)
+       || BRACE_ENCLOSED_INITIALIZER_P (t)
        || !potential_constant_expression (t)
        || value_dependent_expression_p (t))
      return t;
*************** potential_constant_expression_1 (tree t,
*** 7434,7439 ****
--- 7467,7473 ----
      case IDENTIFIER_NODE:
        /* We can see a FIELD_DECL in a pointer-to-member expression.  */
      case FIELD_DECL:
+     case USING_DECL:
        return true;
  
      case PARM_DECL:
*************** potential_constant_expression_1 (tree t,
*** 7482,7488 ****
  		  {
  		    tree x = get_nth_callarg (t, 0);
  		    if (is_this_parameter (x))
! 		      /* OK.  */;
  		    else if (!potential_constant_expression_1 (x, rval, flags))
  		      {
  			if (flags & tf_error)
--- 7516,7532 ----
  		  {
  		    tree x = get_nth_callarg (t, 0);
  		    if (is_this_parameter (x))
! 		      {
! 			if (DECL_CONSTRUCTOR_P (DECL_CONTEXT (x)))
! 			  {
! 			    if (flags & tf_error)
! 			      sorry ("calling a member function of the "
! 				     "object being constructed in a constant "
! 				     "expression");
! 			    return false;
! 			  }
! 			/* Otherwise OK.  */;
! 		      }
  		    else if (!potential_constant_expression_1 (x, rval, flags))
  		      {
  			if (flags & tf_error)
*************** potential_constant_expression_1 (tree t,
*** 7745,7752 ****
        return potential_constant_expression_1 (TREE_OPERAND (t, 1),
  					      want_rval, flags);
  
-     case INIT_EXPR:
      case TARGET_EXPR:
        return potential_constant_expression_1 (TREE_OPERAND (t, 1),
  					      rval, flags);
  
--- 7789,7803 ----
        return potential_constant_expression_1 (TREE_OPERAND (t, 1),
  					      want_rval, flags);
  
      case TARGET_EXPR:
+       if (!literal_type_p (TREE_TYPE (t)))
+ 	{
+ 	  if (flags & tf_error)
+ 	    error ("temporary of non-literal type %qT in a "
+ 		   "constant expression", TREE_TYPE (t));
+ 	  return false;
+ 	}
+     case INIT_EXPR:
        return potential_constant_expression_1 (TREE_OPERAND (t, 1),
  					      rval, flags);
  
*************** lambda_return_type (tree expr)
*** 8081,8087 ****
        SET_TYPE_STRUCTURAL_EQUALITY (type);
      }
    else
!     type = type_decays_to (unlowered_expr_type (expr));
    return type;
  }
  
--- 8132,8138 ----
        SET_TYPE_STRUCTURAL_EQUALITY (type);
      }
    else
!     type = cv_unqualified (type_decays_to (unlowered_expr_type (expr)));
    return type;
  }
  
*************** add_capture (tree lambda, tree id, tree 
*** 8242,8247 ****
--- 8293,8301 ----
        if (!real_lvalue_p (initializer))
  	error ("cannot capture %qE by reference", initializer);
      }
+   else
+     /* Capture by copy requires a complete type.  */
+     type = complete_type (type);
  
    /* Make member variable.  */
    member = build_lang_decl (FIELD_DECL, id, type);
*************** maybe_add_lambda_conv_op (tree type)
*** 8457,8462 ****
--- 8511,8519 ----
    if (LAMBDA_EXPR_CAPTURE_LIST (CLASSTYPE_LAMBDA_EXPR (type)) != NULL_TREE)
      return;
  
+   if (processing_template_decl)
+     return;
+ 
    stattype = build_function_type (TREE_TYPE (TREE_TYPE (callop)),
  				  FUNCTION_ARG_CHAIN (callop));
  
diff -Nrcpad gcc-4.6.1/gcc/cp/tree.c gcc-4.6.2/gcc/cp/tree.c
*** gcc-4.6.1/gcc/cp/tree.c	Mon Jun  6 04:31:24 2011
--- gcc-4.6.2/gcc/cp/tree.c	Wed Oct 19 22:21:52 2011
*************** build_vec_init_elt (tree type, tree init
*** 495,503 ****
  	dummy = move (dummy);
        VEC_quick_push (tree, argvec, dummy);
      }
!   return build_special_member_call (NULL_TREE, complete_ctor_identifier,
  				    &argvec, inner_type, LOOKUP_NORMAL,
  				    tf_warning_or_error);
  }
  
  /* Return a TARGET_EXPR which expresses the initialization of an array to
--- 495,510 ----
  	dummy = move (dummy);
        VEC_quick_push (tree, argvec, dummy);
      }
!   init = build_special_member_call (NULL_TREE, complete_ctor_identifier,
  				    &argvec, inner_type, LOOKUP_NORMAL,
  				    tf_warning_or_error);
+ 
+   /* For a trivial constructor, build_over_call creates a TARGET_EXPR.  But
+      we don't want one here.  */
+   if (TREE_CODE (init) == TARGET_EXPR)
+     init = TARGET_EXPR_INITIAL (init);
+ 
+   return init;
  }
  
  /* Return a TARGET_EXPR which expresses the initialization of an array to
*************** build_vec_init_expr (tree type, tree ini
*** 526,534 ****
      VEC_INIT_EXPR_IS_CONSTEXPR (init) = true;
    VEC_INIT_EXPR_VALUE_INIT (init) = value_init;
  
-   init = build_target_expr (slot, init);
-   TARGET_EXPR_IMPLICIT_P (init) = 1;
- 
    return init;
  }
  
--- 533,538 ----
*************** bot_manip (tree* tp, int* walk_subtrees,
*** 1836,1842 ****
        tree u;
  
        if (TREE_CODE (TREE_OPERAND (t, 1)) == AGGR_INIT_EXPR)
! 	u = build_cplus_new (TREE_TYPE (t), TREE_OPERAND (t, 1));
        else
  	u = build_target_expr_with_type (TREE_OPERAND (t, 1), TREE_TYPE (t));
  
--- 1840,1850 ----
        tree u;
  
        if (TREE_CODE (TREE_OPERAND (t, 1)) == AGGR_INIT_EXPR)
! 	{
! 	  u = build_cplus_new (TREE_TYPE (t), TREE_OPERAND (t, 1));
! 	  if (AGGR_INIT_ZERO_FIRST (TREE_OPERAND (t, 1)))
! 	    AGGR_INIT_ZERO_FIRST (TREE_OPERAND (u, 1)) = true;
! 	}
        else
  	u = build_target_expr_with_type (TREE_OPERAND (t, 1), TREE_TYPE (t));
  
*************** bot_manip (tree* tp, int* walk_subtrees,
*** 1857,1863 ****
      }
  
    /* Make a copy of this node.  */
!   return copy_tree_r (tp, walk_subtrees, NULL);
  }
  
  /* Replace all remapped VAR_DECLs in T with their new equivalents.
--- 1865,1875 ----
      }
  
    /* Make a copy of this node.  */
!   t = copy_tree_r (tp, walk_subtrees, NULL);
!   if (TREE_CODE (*tp) == CALL_EXPR && !TREE_NOTHROW (*tp)
!       && cfun && cp_function_chain)
!     cp_function_chain->can_throw = 1;
!   return t;
  }
  
  /* Replace all remapped VAR_DECLs in T with their new equivalents.
diff -Nrcpad gcc-4.6.1/gcc/cp/typeck.c gcc-4.6.2/gcc/cp/typeck.c
*** gcc-4.6.1/gcc/cp/typeck.c	Tue Jun  7 15:12:15 2011
--- gcc-4.6.2/gcc/cp/typeck.c	Tue Sep 27 02:19:05 2011
*************** structural_comptypes (tree t1, tree t2, 
*** 1298,1304 ****
        if (!cp_tree_equal (TYPENAME_TYPE_FULLNAME (t1),
  			  TYPENAME_TYPE_FULLNAME (t2)))
  	return false;
!       if (!same_type_p (TYPE_CONTEXT (t1), TYPE_CONTEXT (t2)))
  	return false;
        break;
  
--- 1298,1306 ----
        if (!cp_tree_equal (TYPENAME_TYPE_FULLNAME (t1),
  			  TYPENAME_TYPE_FULLNAME (t2)))
  	return false;
!       /* Qualifiers don't matter on scopes.  */
!       if (!same_type_ignoring_top_level_qualifiers_p (TYPE_CONTEXT (t1),
! 						      TYPE_CONTEXT (t2)))
  	return false;
        break;
  
*************** cp_build_binary_op (location_t location,
*** 4331,4336 ****
--- 4333,4339 ----
  		{
  		case MULT_EXPR:
  		case TRUNC_DIV_EXPR:
+ 		  op1 = save_expr (op1);
  		  imag = build2 (resultcode, real_type, imag, op1);
  		  /* Fall through.  */
  		case PLUS_EXPR:
*************** cp_build_binary_op (location_t location,
*** 4349,4354 ****
--- 4352,4358 ----
  	      switch (code)
  		{
  		case MULT_EXPR:
+ 		  op0 = save_expr (op0);
  		  imag = build2 (resultcode, real_type, op0, imag);
  		  /* Fall through.  */
  		case PLUS_EXPR:
diff -Nrcpad gcc-4.6.1/gcc/cp/typeck2.c gcc-4.6.2/gcc/cp/typeck2.c
*** gcc-4.6.1/gcc/cp/typeck2.c	Fri May 20 21:29:14 2011
--- gcc-4.6.2/gcc/cp/typeck2.c	Tue Aug 16 23:35:59 2011
*************** cxx_incomplete_type_diagnostic (const_tr
*** 442,447 ****
--- 442,453 ----
        break;
  
      case LANG_TYPE:
+       if (type == init_list_type_node)
+ 	{
+ 	  emit_diagnostic (diag_kind, input_location, 0,
+ 			   "invalid use of brace-enclosed initializer list");
+ 	  break;
+ 	}
        gcc_assert (type == unknown_type_node);
        if (value && TREE_CODE (value) == COMPONENT_REF)
  	goto bad_member;
*************** digest_init_r (tree type, tree init, boo
*** 900,906 ****
  	{
  	  /* Allow the result of build_array_copy and of
  	     build_value_init_noctor.  */
! 	  if ((TREE_CODE (init) == TARGET_EXPR
  	       || TREE_CODE (init) == CONSTRUCTOR)
  	      && (same_type_ignoring_top_level_qualifiers_p
  		  (type, TREE_TYPE (init))))
--- 906,912 ----
  	{
  	  /* Allow the result of build_array_copy and of
  	     build_value_init_noctor.  */
! 	  if ((TREE_CODE (init) == VEC_INIT_EXPR
  	       || TREE_CODE (init) == CONSTRUCTOR)
  	      && (same_type_ignoring_top_level_qualifiers_p
  		  (type, TREE_TYPE (init))))
diff -Nrcpad gcc-4.6.1/libstdc++-v3/ChangeLog gcc-4.6.2/libstdc++-v3/ChangeLog
*** gcc-4.6.1/libstdc++-v3/ChangeLog	Mon Jun 27 10:04:10 2011
--- gcc-4.6.2/libstdc++-v3/ChangeLog	Wed Oct 26 09:07:01 2011
***************
*** 1,3 ****
--- 1,105 ----
+ 2011-10-26  Release Manager
+ 
+ 	* GCC 4.6.2 released.
+ 
+ 2011-10-05  Benjamin Kosnik  <bkoz@redhat.com
+             Jonathan Wakely  <jwakely.gcc@gmail.com>
+ 
+         PR libstdc++/48698
+         * acinclude.m4 (GLIBCXX_ENABLE_SYMVERS): Set libtool_VERSION here.
+         * configure.ac: Move AC_SUBST of libtool_VERSION past call to
+         GLIBCXX_ENABLE_SYMVERS.
+         * configure: Regenerate.
+         * include/bits/c++config: Use __7 as versioned namespace name.
+         * config/abi/pre/gnu-versioned-namespace.ver: Change mangling as
+         per above.
+         * include/c_global/cwchar: Adjust nested namespaces.
+         * testsuite/20_util/bind/48698.cc: Add test case.
+         * testsuite/ext/profile/mutex_extensions_neg.cc: Change line number.
+ 
+ 2011-09-30  Fran��ois Dumont  <fdumont@gcc.gnu.org>
+ 
+ 	* include/debug/vector (vector<>::erase(iterator, iterator)): Check
+ 	iterators equality using normal iterators.
+ 	* include/debug/deque (deque<>::erase(iterator, iterator)): Likewise.
+ 
+ 2011-09-30  Paolo Carlini  <paolo.carlini@oracle.com>
+ 
+ 	PR libstdc++/50529
+ 	* include/bits/vector.tcc (vector<>::erase(iterator, iterator)):
+ 	Fix to do nothing if the range is empty.
+ 	* include/bits/stl_bvector.h: Likewise.
+ 	* include/bits/deque.tcc: Likewise.
+ 	* include/debug/vector: Adjust.
+ 	* include/debug/deque: Likewise.
+ 	* testsuite/23_containers/vector/modifiers/erase/50529.cc: New.
+ 	* testsuite/23_containers/deque/modifiers/erase/50529.cc: Likewise.
+ 	* testsuite/23_containers/deque/modifiers/erase/3.cc: Adjust.
+ 
+ 2011-09-27  Paolo Carlini  <paolo.carlini@oracle.com>
+ 
+ 	PR libstdc++/49559
+ 	* include/bits/stl_algo.h (__move_merge_backward): Remove.
+ 	(__move_merge_adaptive, __move_merge_adaptive_backward): New.
+ 	(__merge_adaptive): Use the latter two.
+ 	(__rotate_adaptive): Avoid self move-assignment.
+ 	* include/bits/stl_algobase.h (move_backward): Fix comment.
+ 	* testsuite/25_algorithms/stable_sort/49559.cc: New.
+ 	* testsuite/25_algorithms/inplace_merge/49559.cc: Likewise.
+ 	* testsuite/25_algorithms/inplace_merge/moveable.cc: Extend.
+ 	* testsuite/25_algorithms/inplace_merge/moveable2.cc: Likewise.
+ 	* testsuite/util/testsuite_rvalref.h (rvalstruct::operator=
+ 	(rvalstruct&&)): Check for self move-assignment.
+ 
+ 2011-09-24  John Salmon  <john.salmon@deshaw.com>
+ 
+ 	PR libstdc++/50510
+ 	* include/bits/random.tcc (seed_seq::generate): Fix computation.
+ 
+ 2011-09-24  John Salmon  <john.salmon@deshaw.com>
+ 
+ 	PR libstdc++/50509
+ 	* include/bits/random.tcc (seed_seq::generate): Fix computation.
+ 
+ 2011-09-02  Paolo Carlini  <paolo.carlini@oracle.com>
+ 
+ 	* include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)):
+ 	rearrange to consistently update __ht._M_rehash_policy before using
+ 	_M_next_bkt on it.
+ 
+ 2011-09-02  Paolo Carlini  <paolo.carlini@oracle.com>
+ 	    Marc Glisse  <marc.glisse@normalesup.org>
+ 
+ 	PR libstdc++/50268
+ 	* include/std/bitset (struct _Sanitize_val): Add.
+ 	(bitset<>::bitset(unsigned long long)): Fix.
+ 	* testsuite/23_containers/bitset/cons/50268.cc: New.
+ 
+ 2011-07-31  Paolo Carlini  <paolo.carlini@oracle.com>
+ 
+ 	* include/parallel/algo.h: Trivial uglification fixes.
+ 
+ 2011-07-31  Paolo Carlini  <paolo.carlini@oracle.com>
+ 
+ 	PR libstdc++/49925
+ 	* include/bits/shared_ptr.h (make_shared): Qualify allocate_shared
+ 	with std::.
+ 	* include/bits/shared_ptr_base.h (__make_shared): Likewise.
+ 
+ 2011-07-27  Jeffrey Yasskin  <jyasskin@google.com>
+ 
+ 	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Updated.
+ 
+ 2011-07-22  Uros Bizjak  <ubizjak@gmail.com>
+ 
+ 	Backport from mainline
+ 	2011-06-07  Paolo Carlini  <paolo.carlini@oracle.com>
+ 
+ 	PR libstdc++/49293
+ 	* testsuite/22_locale/time_get/get_weekday/char/38081-1.cc: Tweak
+ 	for glibc 2.14.
+ 	* testsuite/22_locale/time_get/get_weekday/char/38081-2.cc: Likewise.
+ 
  2011-06-27  Release Manager
  
  	* GCC 4.6.1 released.
diff -Nrcpad gcc-4.6.1/libstdc++-v3/acinclude.m4 gcc-4.6.2/libstdc++-v3/acinclude.m4
*** gcc-4.6.1/libstdc++-v3/acinclude.m4	Tue Mar  8 00:04:05 2011
--- gcc-4.6.2/libstdc++-v3/acinclude.m4	Wed Oct  5 23:09:51 2011
*************** dnl
*** 2861,2870 ****
--- 2861,2875 ----
  dnl Add version tags to symbols in shared library (or not), additionally
  dnl marking other symbols as private/local (or not).
  dnl
+ dnl Sets libtool_VERSION, and determines shared library SONAME.
+ dnl
+ dnl  This depends on GLIBCXX CHECK_LINKER_FEATURES, but without it assumes no.
+ dnl
  dnl --enable-symvers=style adds a version script to the linker call when
  dnl       creating the shared library.  The choice of version script is
  dnl       controlled by 'style'.
  dnl --disable-symvers does not.
+ dnl
  dnl  +  Usage:  GLIBCXX_ENABLE_SYMVERS[(DEFAULT)]
  dnl       Where DEFAULT is either 'yes' or 'no'.  Passing `yes' tries to
  dnl       choose a default style based on linker characteristics.  Passing
*************** changequote([,])dnl
*** 3001,3007 ****
    fi
  fi
  
! # Everything parsed; figure out what file to use.
  case $enable_symvers in
    no)
      SYMVER_FILE=config/abi/pre/none.ver
--- 3006,3015 ----
    fi
  fi
  
! # For libtool versioning info, format is CURRENT:REVISION:AGE
! libtool_VERSION=6:16:0
! 
! # Everything parsed; figure out what files and settings to use.
  case $enable_symvers in
    no)
      SYMVER_FILE=config/abi/pre/none.ver
*************** case $enable_symvers in
*** 3012,3017 ****
--- 3020,3026 ----
  	      [Define to use GNU versioning in the shared library.])
      ;;
    gnu-versioned-namespace)
+     libtool_VERSION=7:0:0
      SYMVER_FILE=config/abi/pre/gnu-versioned-namespace.ver
      AC_DEFINE(_GLIBCXX_SYMVER_GNU_NAMESPACE, 1,
  	      [Define to use GNU namespace versioning in the shared library.])
diff -Nrcpad gcc-4.6.1/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver gcc-4.6.2/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
*** gcc-4.6.1/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver	Sun Jan 30 22:39:36 2011
--- gcc-4.6.2/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver	Wed Oct  5 23:09:51 2011
***************
*** 20,42 ****
  ## with this library; see the file COPYING3.  If not see
  ## <http://www.gnu.org/licenses/>.
  
! GLIBCXX_5.0 {
  
    global:
  
      # Names inside the 'extern' block are demangled names.
      extern "C++"
      {
!       std::_6::*;
        std::*
      };
  
      # locale
!     _ZNSt2_69has_facetINS_*;
  
      # hash 
!     _ZNSt8__detail2_612__prime_listE;
!     _ZNSt3tr18__detail2_612__prime_listE;
  
      # thread/mutex/condition_variable/future
      __once_proxy;
--- 20,42 ----
  ## with this library; see the file COPYING3.  If not see
  ## <http://www.gnu.org/licenses/>.
  
! GLIBCXX_7.0 {
  
    global:
  
      # Names inside the 'extern' block are demangled names.
      extern "C++"
      {
!       std::__7::*;
        std::*
      };
  
      # locale
!     _ZNSt3__79has_facetINS_*;
  
      # hash 
!     _ZNSt8__detail3__712__prime_listE;
!     _ZNSt3tr18__detail3__712__prime_listE;
  
      # thread/mutex/condition_variable/future
      __once_proxy;
*************** GLIBCXX_5.0 {
*** 73,113 ****
      _ZTv0_n*;
  
      # std::__detail::_List_node_base
!     _ZNSt8__detail2_615_List_node_base7_M_hook*;
!     _ZNSt8__detail2_615_List_node_base9_M_unhookEv;
!     _ZNSt8__detail2_615_List_node_base10_M_reverseEv;
!     _ZNSt8__detail2_615_List_node_base11_M_transfer*;
!     _ZNSt8__detail2_615_List_node_base4swapER*;
  
      # std::__convert_to_v
!     _ZNSt2_614__convert_to_v*;
  
      # std::__copy_streambufs
!     _ZNSt2_617__copy_streambufsI*;
!     _ZNSt2_621__copy_streambufs_eofI*;
  
      # __gnu_cxx::__atomic_add
      # __gnu_cxx::__exchange_and_add
!     _ZN9__gnu_cxx2_612__atomic_addEPV[il][il];
!     _ZN9__gnu_cxx2_618__exchange_and_addEPV[li][il];
  
      # __gnu_cxx::__pool
!     _ZN9__gnu_cxx2_66__poolILb[01]EE13_M_initializeEv;
!     _ZN9__gnu_cxx2_66__poolILb[01]EE16_M_reserve_blockE[jm][jm];
!     _ZN9__gnu_cxx2_66__poolILb[01]EE16_M_reclaim_blockEPc[jm];
!     _ZN9__gnu_cxx2_66__poolILb[01]EE10_M_destroyEv;
!     _ZN9__gnu_cxx2_66__poolILb1EE16_M_get_thread_idEv;
  
!     _ZN9__gnu_cxx2_617__pool_alloc_base9_M_refillE[jm];    
!     _ZN9__gnu_cxx2_617__pool_alloc_base16_M_get_free_listE[jm];
!     _ZN9__gnu_cxx2_617__pool_alloc_base12_M_get_mutexEv;
  
!     _ZN9__gnu_cxx2_69free_list6_M_getE[jm];
!     _ZN9__gnu_cxx2_69free_list8_M_clearEv;
  
      # __gnu_cxx::stdio_sync_filebuf
!     _ZTVN9__gnu_cxx2_618stdio_sync_filebufI[cw]St2_611char_traitsI[cw]EEE;
!     _ZN9__gnu_cxx2_618stdio_sync_filebufI[cw]NSt2_611char_traitsI[cw]EEE[5-9]*;
  
      # debug mode
      _ZN11__gnu_debug19_Safe_sequence_base12_M_get_mutexEv;
--- 73,113 ----
      _ZTv0_n*;
  
      # std::__detail::_List_node_base
!     _ZNSt8__detail3__715_List_node_base7_M_hook*;
!     _ZNSt8__detail3__715_List_node_base9_M_unhookEv;
!     _ZNSt8__detail3__715_List_node_base10_M_reverseEv;
!     _ZNSt8__detail3__715_List_node_base11_M_transfer*;
!     _ZNSt8__detail3__715_List_node_base4swapER*;
  
      # std::__convert_to_v
!     _ZNSt3__714__convert_to_v*;
  
      # std::__copy_streambufs
!     _ZNSt3__717__copy_streambufsI*;
!     _ZNSt3__721__copy_streambufs_eofI*;
  
      # __gnu_cxx::__atomic_add
      # __gnu_cxx::__exchange_and_add
!     _ZN9__gnu_cxx3__712__atomic_addEPV[il][il];
!     _ZN9__gnu_cxx3__718__exchange_and_addEPV[li][il];
  
      # __gnu_cxx::__pool
!     _ZN9__gnu_cxx3__76__poolILb[01]EE13_M_initializeEv;
!     _ZN9__gnu_cxx3__76__poolILb[01]EE16_M_reserve_blockE[jm][jm];
!     _ZN9__gnu_cxx3__76__poolILb[01]EE16_M_reclaim_blockEPc[jm];
!     _ZN9__gnu_cxx3__76__poolILb[01]EE10_M_destroyEv;
!     _ZN9__gnu_cxx3__76__poolILb1EE16_M_get_thread_idEv;
  
!     _ZN9__gnu_cxx3__717__pool_alloc_base9_M_refillE[jm];    
!     _ZN9__gnu_cxx3__717__pool_alloc_base16_M_get_free_listE[jm];
!     _ZN9__gnu_cxx3__717__pool_alloc_base12_M_get_mutexEv;
  
!     _ZN9__gnu_cxx3__79free_list6_M_getE[jm];
!     _ZN9__gnu_cxx3__79free_list8_M_clearEv;
  
      # __gnu_cxx::stdio_sync_filebuf
!     _ZTVN9__gnu_cxx3__718stdio_sync_filebufI[cw]St3__711char_traitsI[cw]EEE;
!     _ZN9__gnu_cxx3__718stdio_sync_filebufI[cw]NSt3__711char_traitsI[cw]EEE[5-9]*;
  
      # debug mode
      _ZN11__gnu_debug19_Safe_sequence_base12_M_get_mutexEv;
*************** CXXABI_2.0 {
*** 212,218 ****
      _ZSt15_Fnv_hash_bytesPKv*;
  
      # __gnu_cxx::_verbose_terminate_handler()
!     _ZN9__gnu_cxx2_627__verbose_terminate_handlerEv;
  
      # *_type_info classes, ctor and dtor
      _ZN10__cxxabiv117__array_type_info*;
--- 212,218 ----
      _ZSt15_Fnv_hash_bytesPKv*;
  
      # __gnu_cxx::_verbose_terminate_handler()
!     _ZN9__gnu_cxx3__727__verbose_terminate_handlerEv;
  
      # *_type_info classes, ctor and dtor
      _ZN10__cxxabiv117__array_type_info*;
diff -Nrcpad gcc-4.6.1/libstdc++-v3/configure gcc-4.6.2/libstdc++-v3/configure
*** gcc-4.6.1/libstdc++-v3/configure	Thu May 26 00:15:58 2011
--- gcc-4.6.2/libstdc++-v3/configure	Wed Oct  5 23:09:51 2011
*************** GLIBCXX_LDBL_COMPAT_FALSE
*** 644,649 ****
--- 644,650 ----
  GLIBCXX_LDBL_COMPAT_TRUE
  ENABLE_VISIBILITY_FALSE
  ENABLE_VISIBILITY_TRUE
+ libtool_VERSION
  ENABLE_SYMVERS_SOL2_FALSE
  ENABLE_SYMVERS_SOL2_TRUE
  ENABLE_SYMVERS_SUN_FALSE
*************** build_vendor
*** 787,793 ****
  build_cpu
  build
  multi_basedir
- libtool_VERSION
  target_alias
  host_alias
  build_alias
--- 788,793 ----
*************** ac_config_headers="$ac_config_headers co
*** 2824,2833 ****
  # exported.  Only used at the end of this file.
  ### am handles this now?  ORIGINAL_LD_FOR_MULTILIBS=$LD
  
- # For libtool versioning info, format is CURRENT:REVISION:AGE
- libtool_VERSION=6:16:0
- 
- 
  # Find the rest of the source tree framework.
  # Default to --enable-multilib
  # Check whether --enable-multilib was given.
--- 2824,2829 ----
*************** else
*** 11488,11494 ****
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
    lt_status=$lt_dlunknown
    cat > conftest.$ac_ext <<_LT_EOF
! #line 11491 "configure"
  #include "confdefs.h"
  
  #if HAVE_DLFCN_H
--- 11484,11490 ----
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
    lt_status=$lt_dlunknown
    cat > conftest.$ac_ext <<_LT_EOF
! #line 11487 "configure"
  #include "confdefs.h"
  
  #if HAVE_DLFCN_H
*************** else
*** 11594,11600 ****
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
    lt_status=$lt_dlunknown
    cat > conftest.$ac_ext <<_LT_EOF
! #line 11597 "configure"
  #include "confdefs.h"
  
  #if HAVE_DLFCN_H
--- 11590,11596 ----
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
    lt_status=$lt_dlunknown
    cat > conftest.$ac_ext <<_LT_EOF
! #line 11593 "configure"
  #include "confdefs.h"
  
  #if HAVE_DLFCN_H
*************** fi
*** 14952,14958 ****
      #
      # Fake what AC_TRY_COMPILE does.  XXX Look at redoing this new-style.
      cat > conftest.$ac_ext << EOF
! #line 14955 "configure"
  struct S { ~S(); };
  void bar();
  void foo()
--- 14948,14954 ----
      #
      # Fake what AC_TRY_COMPILE does.  XXX Look at redoing this new-style.
      cat > conftest.$ac_ext << EOF
! #line 14951 "configure"
  struct S { ~S(); };
  void bar();
  void foo()
*************** $as_echo "$glibcxx_cv_atomic_long_long" 
*** 15320,15326 ****
    # Fake what AC_TRY_COMPILE does.
  
      cat > conftest.$ac_ext << EOF
! #line 15323 "configure"
  int main()
  {
    typedef bool atomic_type;
--- 15316,15322 ----
    # Fake what AC_TRY_COMPILE does.
  
      cat > conftest.$ac_ext << EOF
! #line 15319 "configure"
  int main()
  {
    typedef bool atomic_type;
*************** $as_echo "$glibcxx_cv_atomic_bool" >&6; 
*** 15357,15363 ****
      rm -f conftest*
  
      cat > conftest.$ac_ext << EOF
! #line 15360 "configure"
  int main()
  {
    typedef short atomic_type;
--- 15353,15359 ----
      rm -f conftest*
  
      cat > conftest.$ac_ext << EOF
! #line 15356 "configure"
  int main()
  {
    typedef short atomic_type;
*************** $as_echo "$glibcxx_cv_atomic_short" >&6;
*** 15394,15400 ****
      rm -f conftest*
  
      cat > conftest.$ac_ext << EOF
! #line 15397 "configure"
  int main()
  {
    // NB: _Atomic_word not necessarily int.
--- 15390,15396 ----
      rm -f conftest*
  
      cat > conftest.$ac_ext << EOF
! #line 15393 "configure"
  int main()
  {
    // NB: _Atomic_word not necessarily int.
*************** $as_echo "$glibcxx_cv_atomic_int" >&6; }
*** 15432,15438 ****
      rm -f conftest*
  
      cat > conftest.$ac_ext << EOF
! #line 15435 "configure"
  int main()
  {
    typedef long long atomic_type;
--- 15428,15434 ----
      rm -f conftest*
  
      cat > conftest.$ac_ext << EOF
! #line 15431 "configure"
  int main()
  {
    typedef long long atomic_type;
*************** $as_echo "$as_me: WARNING: Performance o
*** 15508,15514 ****
    # unnecessary for this test.
  
      cat > conftest.$ac_ext << EOF
! #line 15511 "configure"
  int main()
  {
    _Decimal32 d1;
--- 15504,15510 ----
    # unnecessary for this test.
  
      cat > conftest.$ac_ext << EOF
! #line 15507 "configure"
  int main()
  {
    _Decimal32 d1;
*************** $as_echo "$as_me: WARNING: === Symbol ve
*** 64267,64273 ****
    fi
  fi
  
! # Everything parsed; figure out what file to use.
  case $enable_symvers in
    no)
      SYMVER_FILE=config/abi/pre/none.ver
--- 64263,64272 ----
    fi
  fi
  
! # For libtool versioning info, format is CURRENT:REVISION:AGE
! libtool_VERSION=6:16:0
! 
! # Everything parsed; figure out what files and settings to use.
  case $enable_symvers in
    no)
      SYMVER_FILE=config/abi/pre/none.ver
*************** $as_echo "#define _GLIBCXX_SYMVER_GNU 1"
*** 64279,64284 ****
--- 64278,64284 ----
  
      ;;
    gnu-versioned-namespace)
+     libtool_VERSION=7:0:0
      SYMVER_FILE=config/abi/pre/gnu-versioned-namespace.ver
  
  $as_echo "#define _GLIBCXX_SYMVER_GNU_NAMESPACE 1" >>confdefs.h
*************** fi
*** 64429,64434 ****
--- 64429,64436 ----
  $as_echo "$glibcxx_ptrdiff_t_is_i" >&6; }
  
  
+ 
+ 
   # Check whether --enable-visibility was given.
  if test "${enable_visibility+set}" = set; then :
    enableval=$enable_visibility;
diff -Nrcpad gcc-4.6.1/libstdc++-v3/configure.ac gcc-4.6.2/libstdc++-v3/configure.ac
*** gcc-4.6.1/libstdc++-v3/configure.ac	Thu May 26 00:15:58 2011
--- gcc-4.6.2/libstdc++-v3/configure.ac	Wed Oct  5 23:09:51 2011
*************** AC_CONFIG_HEADER(config.h)
*** 11,20 ****
  # exported.  Only used at the end of this file.
  ### am handles this now?  ORIGINAL_LD_FOR_MULTILIBS=$LD
  
- # For libtool versioning info, format is CURRENT:REVISION:AGE
- libtool_VERSION=6:16:0
- AC_SUBST(libtool_VERSION)
- 
  # Find the rest of the source tree framework.
  AM_ENABLE_MULTILIB(, ..)
  
--- 11,16 ----
*************** GCC_HEADER_STDINT(include/gstdint.h)
*** 303,308 ****
--- 299,306 ----
  
  # This depends on GLIBCXX CHECK_LINKER_FEATURES, but without it assumes no.
  GLIBCXX_ENABLE_SYMVERS([yes])
+ AC_SUBST(libtool_VERSION)
+ 
  GLIBCXX_ENABLE_VISIBILITY([yes])
  
  ac_ldbl_compat=no
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/bits/c++config gcc-4.6.2/libstdc++-v3/include/bits/c++config
*** gcc-4.6.1/libstdc++-v3/include/bits/c++config	Wed Mar 16 16:59:24 2011
--- gcc-4.6.2/libstdc++-v3/include/bits/c++config	Wed Oct  5 23:09:51 2011
*************** namespace std
*** 162,202 ****
  
  
  // Defined if inline namespaces are used for versioning.
! #define _GLIBCXX_INLINE_VERSION
  
  // Inline namespace for symbol versioning.
  #if _GLIBCXX_INLINE_VERSION
  namespace std
  {
!   inline namespace _6 { }
  
!   namespace rel_ops { inline namespace _6 { } }
  
    namespace tr1
    {
!     inline namespace _6 { }
!     namespace placeholders { inline namespace _6 { } }
!     namespace regex_constants { inline namespace _6 { } }
!     namespace __detail { inline namespace _6 { } }
    }
  
!   namespace decimal { inline namespace _6 { } }
  
!   namespace chrono { inline namespace _6 { } }
!   namespace placeholders { inline namespace _6 { } }
!   namespace regex_constants { inline namespace _6 { } }
!   namespace this_thread { inline namespace _6 { } }
  
!   namespace __detail { inline namespace _6 { } }
!   namespace __regex { inline namespace _6 { } }
  }
  
  namespace __gnu_cxx
  {
!   inline namespace _6 { }
!   namespace __detail { inline namespace _6 { } }
  }
! # define _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace _6 {
  # define _GLIBCXX_END_NAMESPACE_VERSION }
  #else
  # define _GLIBCXX_BEGIN_NAMESPACE_VERSION
--- 162,203 ----
  
  
  // Defined if inline namespaces are used for versioning.
! #define _GLIBCXX_INLINE_VERSION 
  
  // Inline namespace for symbol versioning.
  #if _GLIBCXX_INLINE_VERSION
+ 
  namespace std
  {
!   inline namespace __7 { }
  
!   namespace rel_ops { inline namespace __7 { } }
  
    namespace tr1
    {
!     inline namespace __7 { }
!     namespace placeholders { inline namespace __7 { } }
!     namespace regex_constants { inline namespace __7 { } }
!     namespace __detail { inline namespace __7 { } }
    }
  
!   namespace decimal { inline namespace __7 { } }
  
!   namespace chrono { inline namespace __7 { } }
!   namespace placeholders { inline namespace __7 { } }
!   namespace regex_constants { inline namespace __7 { } }
!   namespace this_thread { inline namespace __7 { } }
  
!   namespace __detail { inline namespace __7 { } }
!   namespace __regex { inline namespace __7 { } }
  }
  
  namespace __gnu_cxx
  {
!   inline namespace __7 { }
!   namespace __detail { inline namespace __7 { } }
  }
! # define _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace __7 {
  # define _GLIBCXX_END_NAMESPACE_VERSION }
  #else
  # define _GLIBCXX_BEGIN_NAMESPACE_VERSION
*************** namespace std
*** 213,219 ****
    namespace __cxx1998
    {
  #if _GLIBCXX_INLINE_VERSION
!  inline namespace _6 { }
  #endif
    }
  
--- 214,220 ----
    namespace __cxx1998
    {
  #if _GLIBCXX_INLINE_VERSION
!  inline namespace __7 { }
  #endif
    }
  
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/bits/deque.tcc gcc-4.6.2/libstdc++-v3/include/bits/deque.tcc
*** gcc-4.6.1/libstdc++-v3/include/bits/deque.tcc	Sun Jan 30 22:39:36 2011
--- gcc-4.6.2/libstdc++-v3/include/bits/deque.tcc	Fri Sep 30 20:47:12 2011
*************** _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
*** 218,224 ****
      deque<_Tp, _Alloc>::
      erase(iterator __first, iterator __last)
      {
!       if (__first == begin() && __last == end())
  	{
  	  clear();
  	  return end();
--- 218,226 ----
      deque<_Tp, _Alloc>::
      erase(iterator __first, iterator __last)
      {
!       if (__first == __last)
! 	return __first;
!       else if (__first == begin() && __last == end())
  	{
  	  clear();
  	  return end();
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/bits/hashtable.h gcc-4.6.2/libstdc++-v3/include/bits/hashtable.h
*** gcc-4.6.1/libstdc++-v3/include/bits/hashtable.h	Tue Feb  1 01:31:42 2011
--- gcc-4.6.2/libstdc++-v3/include/bits/hashtable.h	Fri Sep  2 15:37:06 2011
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
*** 683,694 ****
        _M_element_count(__ht._M_element_count),
        _M_rehash_policy(__ht._M_rehash_policy)
      {
!       size_type __n_bkt = __ht._M_rehash_policy._M_next_bkt(0);
!       __ht._M_buckets = __ht._M_allocate_buckets(__n_bkt);
!       __ht._M_bucket_count = __n_bkt;
        __ht._M_begin_bucket_index = __ht._M_bucket_count;
        __ht._M_element_count = 0;
-       __ht._M_rehash_policy = _RehashPolicy();
      }
  
    template<typename _Key, typename _Value,
--- 683,693 ----
        _M_element_count(__ht._M_element_count),
        _M_rehash_policy(__ht._M_rehash_policy)
      {
!       __ht._M_rehash_policy = _RehashPolicy();
!       __ht._M_bucket_count = __ht._M_rehash_policy._M_next_bkt(0);
!       __ht._M_buckets = __ht._M_allocate_buckets(__ht._M_bucket_count);
        __ht._M_begin_bucket_index = __ht._M_bucket_count;
        __ht._M_element_count = 0;
      }
  
    template<typename _Key, typename _Value,
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/bits/random.tcc gcc-4.6.2/libstdc++-v3/include/bits/random.tcc
*** gcc-4.6.1/libstdc++-v3/include/bits/random.tcc	Sat Mar 26 10:02:34 2011
--- gcc-4.6.2/libstdc++-v3/include/bits/random.tcc	Sat Sep 24 22:35:02 2011
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
*** 2768,2774 ****
  	  _Type __arg = (__begin[__k % __n]
  			 ^ __begin[(__k + __p) % __n]
  			 ^ __begin[(__k - 1) % __n]);
! 	  _Type __r1 = __arg ^ (__arg << 27);
  	  __r1 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value,
  	                         1664525u, 0u>(__r1);
  	  _Type __r2 = __r1;
--- 2768,2774 ----
  	  _Type __arg = (__begin[__k % __n]
  			 ^ __begin[(__k + __p) % __n]
  			 ^ __begin[(__k - 1) % __n]);
! 	  _Type __r1 = __arg ^ (__arg >> 27);
  	  __r1 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value,
  	                         1664525u, 0u>(__r1);
  	  _Type __r2 = __r1;
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
*** 2790,2803 ****
  	  _Type __arg = (__begin[__k % __n]
  			 + __begin[(__k + __p) % __n]
  			 + __begin[(__k - 1) % __n]);
! 	  _Type __r3 = __arg ^ (__arg << 27);
  	  __r3 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value,
  	                         1566083941u, 0u>(__r3);
  	  _Type __r4 = __r3 - __k % __n;
  	  __r4 = __detail::__mod<_Type,
  	           __detail::_Shift<_Type, 32>::__value>(__r4);
! 	  __begin[(__k + __p) % __n] ^= __r4;
! 	  __begin[(__k + __q) % __n] ^= __r3;
  	  __begin[__k % __n] = __r4;
  	}
      }
--- 2790,2803 ----
  	  _Type __arg = (__begin[__k % __n]
  			 + __begin[(__k + __p) % __n]
  			 + __begin[(__k - 1) % __n]);
! 	  _Type __r3 = __arg ^ (__arg >> 27);
  	  __r3 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value,
  	                         1566083941u, 0u>(__r3);
  	  _Type __r4 = __r3 - __k % __n;
  	  __r4 = __detail::__mod<_Type,
  	           __detail::_Shift<_Type, 32>::__value>(__r4);
! 	  __begin[(__k + __p) % __n] ^= __r3;
! 	  __begin[(__k + __q) % __n] ^= __r4;
  	  __begin[__k % __n] = __r4;
  	}
      }
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/bits/shared_ptr.h gcc-4.6.2/libstdc++-v3/include/bits/shared_ptr.h
*** gcc-4.6.1/libstdc++-v3/include/bits/shared_ptr.h	Mon Jan 31 20:46:43 2011
--- gcc-4.6.2/libstdc++-v3/include/bits/shared_ptr.h	Sun Jul 31 20:28:58 2011
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
*** 543,550 ****
      make_shared(_Args&&... __args)
      {
        typedef typename std::remove_const<_Tp>::type _Tp_nc;
!       return allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
! 				  std::forward<_Args>(__args)...);
      }
  
    /// std::hash specialization for shared_ptr.
--- 543,550 ----
      make_shared(_Args&&... __args)
      {
        typedef typename std::remove_const<_Tp>::type _Tp_nc;
!       return std::allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
! 				       std::forward<_Args>(__args)...);
      }
  
    /// std::hash specialization for shared_ptr.
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/bits/shared_ptr_base.h gcc-4.6.2/libstdc++-v3/include/bits/shared_ptr_base.h
*** gcc-4.6.1/libstdc++-v3/include/bits/shared_ptr_base.h	Wed Mar 16 16:59:24 2011
--- gcc-4.6.2/libstdc++-v3/include/bits/shared_ptr_base.h	Sun Jul 31 20:28:58 2011
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
*** 1365,1372 ****
      __make_shared(_Args&&... __args)
      {
        typedef typename std::remove_const<_Tp>::type _Tp_nc;
!       return __allocate_shared<_Tp, _Lp>(std::allocator<_Tp_nc>(),
! 					 std::forward<_Args>(__args)...);
      }
  
    /// std::hash specialization for __shared_ptr.
--- 1365,1372 ----
      __make_shared(_Args&&... __args)
      {
        typedef typename std::remove_const<_Tp>::type _Tp_nc;
!       return std::__allocate_shared<_Tp, _Lp>(std::allocator<_Tp_nc>(),
! 					      std::forward<_Args>(__args)...);
      }
  
    /// std::hash specialization for __shared_ptr.
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/bits/stl_algo.h gcc-4.6.2/libstdc++-v3/include/bits/stl_algo.h
*** gcc-4.6.1/libstdc++-v3/include/bits/stl_algo.h	Wed Mar  9 18:30:11 2011
--- gcc-4.6.2/libstdc++-v3/include/bits/stl_algo.h	Tue Sep 27 08:22:07 2011
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
*** 2716,2735 ****
  
    // merge
  
!   /// This is a helper function for the merge routines.
    template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
  	   typename _BidirectionalIterator3>
!     _BidirectionalIterator3
!     __move_merge_backward(_BidirectionalIterator1 __first1,
! 			  _BidirectionalIterator1 __last1,
! 			  _BidirectionalIterator2 __first2,
! 			  _BidirectionalIterator2 __last2,
! 			  _BidirectionalIterator3 __result)
      {
        if (__first1 == __last1)
! 	return _GLIBCXX_MOVE_BACKWARD3(__first2, __last2, __result);
!       if (__first2 == __last2)
! 	return _GLIBCXX_MOVE_BACKWARD3(__first1, __last1, __result);
        --__last1;
        --__last2;
        while (true)
--- 2716,2791 ----
  
    // merge
  
!   /// This is a helper function for the __merge_adaptive routines.
!   template<typename _InputIterator1, typename _InputIterator2,
! 	   typename _OutputIterator>
!     void
!     __move_merge_adaptive(_InputIterator1 __first1, _InputIterator1 __last1,
! 			  _InputIterator2 __first2, _InputIterator2 __last2,
! 			  _OutputIterator __result)
!     {
!       while (__first1 != __last1 && __first2 != __last2)
! 	{
! 	  if (*__first2 < *__first1)
! 	    {
! 	      *__result = _GLIBCXX_MOVE(*__first2);
! 	      ++__first2;
! 	    }
! 	  else
! 	    {
! 	      *__result = _GLIBCXX_MOVE(*__first1);
! 	      ++__first1;
! 	    }
! 	  ++__result;
! 	}
!       if (__first1 != __last1)
! 	_GLIBCXX_MOVE3(__first1, __last1, __result);
!     }
! 
!   /// This is a helper function for the __merge_adaptive routines.
!   template<typename _InputIterator1, typename _InputIterator2,
! 	   typename _OutputIterator, typename _Compare>
!     void
!     __move_merge_adaptive(_InputIterator1 __first1, _InputIterator1 __last1,
! 			  _InputIterator2 __first2, _InputIterator2 __last2,
! 			  _OutputIterator __result, _Compare __comp)
!     {
!       while (__first1 != __last1 && __first2 != __last2)
! 	{
! 	  if (__comp(*__first2, *__first1))
! 	    {
! 	      *__result = _GLIBCXX_MOVE(*__first2);
! 	      ++__first2;
! 	    }
! 	  else
! 	    {
! 	      *__result = _GLIBCXX_MOVE(*__first1);
! 	      ++__first1;
! 	    }
! 	  ++__result;
! 	}
!       if (__first1 != __last1)
! 	_GLIBCXX_MOVE3(__first1, __last1, __result);
!     }
! 
!   /// This is a helper function for the __merge_adaptive routines.
    template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
  	   typename _BidirectionalIterator3>
!     void
!     __move_merge_adaptive_backward(_BidirectionalIterator1 __first1,
! 				   _BidirectionalIterator1 __last1,
! 				   _BidirectionalIterator2 __first2,
! 				   _BidirectionalIterator2 __last2,
! 				   _BidirectionalIterator3 __result)
      {
        if (__first1 == __last1)
! 	{
! 	  _GLIBCXX_MOVE_BACKWARD3(__first2, __last2, __result);
! 	  return;
! 	}
!       else if (__first2 == __last2)
! 	return;
! 
        --__last1;
        --__last2;
        while (true)
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
*** 2738,2771 ****
  	    {
  	      *--__result = _GLIBCXX_MOVE(*__last1);
  	      if (__first1 == __last1)
! 		return _GLIBCXX_MOVE_BACKWARD3(__first2, ++__last2, __result);
  	      --__last1;
  	    }
  	  else
  	    {
  	      *--__result = _GLIBCXX_MOVE(*__last2);
  	      if (__first2 == __last2)
! 		return _GLIBCXX_MOVE_BACKWARD3(__first1, ++__last1, __result);
  	      --__last2;
  	    }
  	}
      }
  
!   /// This is a helper function for the merge routines.
    template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
  	   typename _BidirectionalIterator3, typename _Compare>
!     _BidirectionalIterator3
!     __move_merge_backward(_BidirectionalIterator1 __first1,
! 			  _BidirectionalIterator1 __last1,
! 			  _BidirectionalIterator2 __first2,
! 			  _BidirectionalIterator2 __last2,
! 			  _BidirectionalIterator3 __result,
! 			  _Compare __comp)
      {
        if (__first1 == __last1)
! 	return _GLIBCXX_MOVE_BACKWARD3(__first2, __last2, __result);
!       if (__first2 == __last2)
! 	return _GLIBCXX_MOVE_BACKWARD3(__first1, __last1, __result);
        --__last1;
        --__last2;
        while (true)
--- 2794,2834 ----
  	    {
  	      *--__result = _GLIBCXX_MOVE(*__last1);
  	      if (__first1 == __last1)
! 		{
! 		  _GLIBCXX_MOVE_BACKWARD3(__first2, ++__last2, __result);
! 		  return;
! 		}
  	      --__last1;
  	    }
  	  else
  	    {
  	      *--__result = _GLIBCXX_MOVE(*__last2);
  	      if (__first2 == __last2)
! 		return;
  	      --__last2;
  	    }
  	}
      }
  
!   /// This is a helper function for the __merge_adaptive routines.
    template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
  	   typename _BidirectionalIterator3, typename _Compare>
!     void
!     __move_merge_adaptive_backward(_BidirectionalIterator1 __first1,
! 				   _BidirectionalIterator1 __last1,
! 				   _BidirectionalIterator2 __first2,
! 				   _BidirectionalIterator2 __last2,
! 				   _BidirectionalIterator3 __result,
! 				   _Compare __comp)
      {
        if (__first1 == __last1)
! 	{
! 	  _GLIBCXX_MOVE_BACKWARD3(__first2, __last2, __result);
! 	  return;
! 	}
!       else if (__first2 == __last2)
! 	return;
! 
        --__last1;
        --__last2;
        while (true)
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
*** 2774,2848 ****
  	    {
  	      *--__result = _GLIBCXX_MOVE(*__last1);
  	      if (__first1 == __last1)
! 		return _GLIBCXX_MOVE_BACKWARD3(__first2, ++__last2, __result);
  	      --__last1;
  	    }
  	  else
  	    {
  	      *--__result = _GLIBCXX_MOVE(*__last2);
  	      if (__first2 == __last2)
! 		return _GLIBCXX_MOVE_BACKWARD3(__first1, ++__last1, __result);
  	      --__last2;
  	    }
  	}
      }
  
    /// This is a helper function for the merge routines.
-   template<typename _InputIterator1, typename _InputIterator2,
- 	   typename _OutputIterator>
-     _OutputIterator
-     __move_merge(_InputIterator1 __first1, _InputIterator1 __last1,
- 		 _InputIterator2 __first2, _InputIterator2 __last2,
- 		 _OutputIterator __result)
-     {
-       while (__first1 != __last1 && __first2 != __last2)
- 	{
- 	  if (*__first2 < *__first1)
- 	    {
- 	      *__result = _GLIBCXX_MOVE(*__first2);
- 	      ++__first2;
- 	    }
- 	  else
- 	    {
- 	      *__result = _GLIBCXX_MOVE(*__first1);
- 	      ++__first1;
- 	    }
- 	  ++__result;
- 	}
-       return _GLIBCXX_MOVE3(__first2, __last2,
- 			    _GLIBCXX_MOVE3(__first1, __last1,
- 					   __result));
-     }
- 
-   /// This is a helper function for the merge routines.
-   template<typename _InputIterator1, typename _InputIterator2,
- 	   typename _OutputIterator, typename _Compare>
-     _OutputIterator
-     __move_merge(_InputIterator1 __first1, _InputIterator1 __last1,
- 		 _InputIterator2 __first2, _InputIterator2 __last2,
- 		 _OutputIterator __result, _Compare __comp)
-     {
-       while (__first1 != __last1 && __first2 != __last2)
- 	{
- 	  if (__comp(*__first2, *__first1))
- 	    {
- 	      *__result = _GLIBCXX_MOVE(*__first2);
- 	      ++__first2;
- 	    }
- 	  else
- 	    {
- 	      *__result = _GLIBCXX_MOVE(*__first1);
- 	      ++__first1;
- 	    }
- 	  ++__result;
- 	}
-       return _GLIBCXX_MOVE3(__first2, __last2,
- 			    _GLIBCXX_MOVE3(__first1, __last1,
- 					   __result));
-     }
- 
- 
-   /// This is a helper function for the merge routines.
    template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
  	   typename _Distance>
      _BidirectionalIterator1
--- 2837,2859 ----
  	    {
  	      *--__result = _GLIBCXX_MOVE(*__last1);
  	      if (__first1 == __last1)
! 		{
! 		  _GLIBCXX_MOVE_BACKWARD3(__first2, ++__last2, __result);
! 		  return;
! 		}
  	      --__last1;
  	    }
  	  else
  	    {
  	      *--__result = _GLIBCXX_MOVE(*__last2);
  	      if (__first2 == __last2)
! 		return;
  	      --__last2;
  	    }
  	}
      }
  
    /// This is a helper function for the merge routines.
    template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
  	   typename _Distance>
      _BidirectionalIterator1
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
*** 2856,2870 ****
        _BidirectionalIterator2 __buffer_end;
        if (__len1 > __len2 && __len2 <= __buffer_size)
  	{
! 	  __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer);
! 	  _GLIBCXX_MOVE_BACKWARD3(__first, __middle, __last);
! 	  return _GLIBCXX_MOVE3(__buffer, __buffer_end, __first);
  	}
        else if (__len1 <= __buffer_size)
  	{
! 	  __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer);
! 	  _GLIBCXX_MOVE3(__middle, __last, __first);
! 	  return _GLIBCXX_MOVE_BACKWARD3(__buffer, __buffer_end, __last);
  	}
        else
  	{
--- 2867,2891 ----
        _BidirectionalIterator2 __buffer_end;
        if (__len1 > __len2 && __len2 <= __buffer_size)
  	{
! 	  if (__len2)
! 	    {
! 	      __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer);
! 	      _GLIBCXX_MOVE_BACKWARD3(__first, __middle, __last);
! 	      return _GLIBCXX_MOVE3(__buffer, __buffer_end, __first);
! 	    }
! 	  else
! 	    return __first;
  	}
        else if (__len1 <= __buffer_size)
  	{
! 	  if (__len1)
! 	    {
! 	      __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer);
! 	      _GLIBCXX_MOVE3(__middle, __last, __first);
! 	      return _GLIBCXX_MOVE_BACKWARD3(__buffer, __buffer_end, __last);
! 	    }
! 	  else
! 	    return __last;
  	}
        else
  	{
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
*** 2887,2899 ****
        if (__len1 <= __len2 && __len1 <= __buffer_size)
  	{
  	  _Pointer __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer);
! 	  std::__move_merge(__buffer, __buffer_end, __middle, __last, __first);
  	}
        else if (__len2 <= __buffer_size)
  	{
  	  _Pointer __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer);
! 	  std::__move_merge_backward(__first, __middle, __buffer,
! 				    __buffer_end, __last);
  	}
        else
  	{
--- 2908,2921 ----
        if (__len1 <= __len2 && __len1 <= __buffer_size)
  	{
  	  _Pointer __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer);
! 	  std::__move_merge_adaptive(__buffer, __buffer_end, __middle, __last,
! 				     __first);
  	}
        else if (__len2 <= __buffer_size)
  	{
  	  _Pointer __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer);
! 	  std::__move_merge_adaptive_backward(__first, __middle, __buffer,
! 					      __buffer_end, __last);
  	}
        else
  	{
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
*** 2943,2956 ****
        if (__len1 <= __len2 && __len1 <= __buffer_size)
  	{
  	  _Pointer __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer);
! 	  std::__move_merge(__buffer, __buffer_end, __middle, __last,
! 			    __first, __comp);
  	}
        else if (__len2 <= __buffer_size)
  	{
  	  _Pointer __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer);
! 	  std::__move_merge_backward(__first, __middle, __buffer, __buffer_end,
! 				     __last, __comp);
  	}
        else
  	{
--- 2965,2978 ----
        if (__len1 <= __len2 && __len1 <= __buffer_size)
  	{
  	  _Pointer __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer);
! 	  std::__move_merge_adaptive(__buffer, __buffer_end, __middle, __last,
! 				     __first, __comp);
  	}
        else if (__len2 <= __buffer_size)
  	{
  	  _Pointer __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer);
! 	  std::__move_merge_adaptive_backward(__first, __middle, __buffer,
! 					      __buffer_end, __last, __comp);
  	}
        else
  	{
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
*** 3187,3192 ****
--- 3209,3269 ----
  			      __comp);
      }
  
+ 
+   /// This is a helper function for the __merge_sort_loop routines.
+   template<typename _InputIterator1, typename _InputIterator2,
+ 	   typename _OutputIterator>
+     _OutputIterator
+     __move_merge(_InputIterator1 __first1, _InputIterator1 __last1,
+ 		 _InputIterator2 __first2, _InputIterator2 __last2,
+ 		 _OutputIterator __result)
+     {
+       while (__first1 != __last1 && __first2 != __last2)
+ 	{
+ 	  if (*__first2 < *__first1)
+ 	    {
+ 	      *__result = _GLIBCXX_MOVE(*__first2);
+ 	      ++__first2;
+ 	    }
+ 	  else
+ 	    {
+ 	      *__result = _GLIBCXX_MOVE(*__first1);
+ 	      ++__first1;
+ 	    }
+ 	  ++__result;
+ 	}
+       return _GLIBCXX_MOVE3(__first2, __last2,
+ 			    _GLIBCXX_MOVE3(__first1, __last1,
+ 					   __result));
+     }
+ 
+   /// This is a helper function for the __merge_sort_loop routines.
+   template<typename _InputIterator1, typename _InputIterator2,
+ 	   typename _OutputIterator, typename _Compare>
+     _OutputIterator
+     __move_merge(_InputIterator1 __first1, _InputIterator1 __last1,
+ 		 _InputIterator2 __first2, _InputIterator2 __last2,
+ 		 _OutputIterator __result, _Compare __comp)
+     {
+       while (__first1 != __last1 && __first2 != __last2)
+ 	{
+ 	  if (__comp(*__first2, *__first1))
+ 	    {
+ 	      *__result = _GLIBCXX_MOVE(*__first2);
+ 	      ++__first2;
+ 	    }
+ 	  else
+ 	    {
+ 	      *__result = _GLIBCXX_MOVE(*__first1);
+ 	      ++__first1;
+ 	    }
+ 	  ++__result;
+ 	}
+       return _GLIBCXX_MOVE3(__first2, __last2,
+ 			    _GLIBCXX_MOVE3(__first1, __last1,
+ 					   __result));
+     }
+ 
    template<typename _RandomAccessIterator1, typename _RandomAccessIterator2,
  	   typename _Distance>
      void
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/bits/stl_algobase.h gcc-4.6.2/libstdc++-v3/include/bits/stl_algobase.h
*** gcc-4.6.1/libstdc++-v3/include/bits/stl_algobase.h	Sun Jan 30 22:39:36 2011
--- gcc-4.6.2/libstdc++-v3/include/bits/stl_algobase.h	Tue Sep 27 08:22:07 2011
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
*** 641,647 ****
     *  loop count will be known (and therefore a candidate for compiler
     *  optimizations such as unrolling).
     *
!    *  Result may not be in the range [first,last).  Use move instead.  Note
     *  that the start of the output range may overlap [first,last).
    */
    template<typename _BI1, typename _BI2>
--- 641,647 ----
     *  loop count will be known (and therefore a candidate for compiler
     *  optimizations such as unrolling).
     *
!    *  Result may not be in the range (first,last].  Use move instead.  Note
     *  that the start of the output range may overlap [first,last).
    */
    template<typename _BI1, typename _BI2>
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/bits/stl_bvector.h gcc-4.6.2/libstdc++-v3/include/bits/stl_bvector.h
*** gcc-4.6.1/libstdc++-v3/include/bits/stl_bvector.h	Sun Jan 30 22:39:36 2011
--- gcc-4.6.2/libstdc++-v3/include/bits/stl_bvector.h	Fri Sep 30 20:47:12 2011
*************** template<typename _Alloc>
*** 821,827 ****
      iterator
      erase(iterator __first, iterator __last)
      {
!       _M_erase_at_end(std::copy(__last, end(), __first));
        return __first;
      }
  
--- 821,828 ----
      iterator
      erase(iterator __first, iterator __last)
      {
!       if (__first != __last)
! 	_M_erase_at_end(std::copy(__last, end(), __first));
        return __first;
      }
  
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/bits/vector.tcc gcc-4.6.2/libstdc++-v3/include/bits/vector.tcc
*** gcc-4.6.1/libstdc++-v3/include/bits/vector.tcc	Sun Jan 30 22:39:36 2011
--- gcc-4.6.2/libstdc++-v3/include/bits/vector.tcc	Fri Sep 30 20:47:12 2011
*************** _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
*** 147,155 ****
      vector<_Tp, _Alloc>::
      erase(iterator __first, iterator __last)
      {
!       if (__last != end())
! 	_GLIBCXX_MOVE3(__last, end(), __first);
!       _M_erase_at_end(__first.base() + (end() - __last));
        return __first;
      }
  
--- 147,158 ----
      vector<_Tp, _Alloc>::
      erase(iterator __first, iterator __last)
      {
!       if (__first != __last)
! 	{
! 	  if (__last != end())
! 	    _GLIBCXX_MOVE3(__last, end(), __first);
! 	  _M_erase_at_end(__first.base() + (end() - __last));
! 	}
        return __first;
      }
  
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/c_global/cwchar gcc-4.6.2/libstdc++-v3/include/c_global/cwchar
*** gcc-4.6.1/libstdc++-v3/include/c_global/cwchar	Sun Jan 30 22:39:36 2011
--- gcc-4.6.2/libstdc++-v3/include/c_global/cwchar	Wed Oct  5 23:09:51 2011
*************** namespace std
*** 136,141 ****
--- 136,143 ----
  
  namespace std _GLIBCXX_VISIBILITY(default)
  {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ 
    using ::wint_t;
  
    using ::btowc;
*************** namespace std _GLIBCXX_VISIBILITY(defaul
*** 207,214 ****
    using ::wcsstr;
    using ::wmemchr;
  
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
- 
  #ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO
    inline wchar_t*
    wcschr(wchar_t* __p, wchar_t __c)
--- 209,214 ----
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/debug/deque gcc-4.6.2/libstdc++-v3/include/debug/deque
*** gcc-4.6.1/libstdc++-v3/include/debug/deque	Sun Jan 30 22:39:36 2011
--- gcc-4.6.2/libstdc++-v3/include/debug/deque	Fri Sep 30 20:47:12 2011
*************** namespace __debug
*** 460,466 ****
  	// _GLIBCXX_RESOLVE_LIB_DEFECTS
  	// 151. can't currently clear() empty container
  	__glibcxx_check_erase_range(__first, __last);
!         if (__first.base() == _Base::begin() || __last.base() == _Base::end())
  	  {
  	    this->_M_detach_singular();
  	    for (_Base_iterator __position = __first.base();
--- 460,470 ----
  	// _GLIBCXX_RESOLVE_LIB_DEFECTS
  	// 151. can't currently clear() empty container
  	__glibcxx_check_erase_range(__first, __last);
! 
! 	if (__first.base() == __last.base())
! 	  return __first;
!         else if (__first.base() == _Base::begin()
! 		 || __last.base() == _Base::end())
  	  {
  	    this->_M_detach_singular();
  	    for (_Base_iterator __position = __first.base();
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/debug/vector gcc-4.6.2/libstdc++-v3/include/debug/vector
*** gcc-4.6.1/libstdc++-v3/include/debug/vector	Sun Jan 30 22:39:36 2011
--- gcc-4.6.2/libstdc++-v3/include/debug/vector	Fri Sep 30 20:47:12 2011
*************** namespace __debug
*** 492,502 ****
  	// 151. can't currently clear() empty container
  	__glibcxx_check_erase_range(__first, __last);
  
! 	difference_type __offset = __first.base() - _Base::begin();
! 	_Base_iterator __res = _Base::erase(__first.base(),
! 						      __last.base());
! 	this->_M_invalidate_after_nth(__offset);
! 	return iterator(__res, this);
        }
  
        void
--- 492,507 ----
  	// 151. can't currently clear() empty container
  	__glibcxx_check_erase_range(__first, __last);
  
! 	if (__first.base() != __last.base())
! 	  {
! 	    difference_type __offset = __first.base() - _Base::begin();
! 	    _Base_iterator __res = _Base::erase(__first.base(),
! 						__last.base());
! 	    this->_M_invalidate_after_nth(__offset);
! 	    return iterator(__res, this);
! 	  }
! 	else
! 	  return __first;
        }
  
        void
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/parallel/algo.h gcc-4.6.2/libstdc++-v3/include/parallel/algo.h
*** gcc-4.6.1/libstdc++-v3/include/parallel/algo.h	Sun Jan 30 22:39:36 2011
--- gcc-4.6.2/libstdc++-v3/include/parallel/algo.h	Sun Jul 31 20:28:58 2011
***************
*** 1,6 ****
  // -*- C++ -*-
  
! // Copyright (C) 2007, 2008, 2009, 2010 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
--- 1,6 ----
  // -*- C++ -*-
  
! // Copyright (C) 2007, 2008, 2009, 2010, 2011 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
*************** namespace __parallel
*** 273,284 ****
                    _BinaryPredicate __comp)
      {
        typedef std::iterator_traits<_IIter> _IIterTraits;
!       typedef std::iterator_traits<_FIterator> iteratorf_traits;
        typedef typename _IIterTraits::iterator_category _IIteratorCategory;
!       typedef typename iteratorf_traits::iterator_category iteratorf_category;
  
        return __find_first_of_switch(__begin1, __end1, __begin2, __end2, __comp,
!                                   _IIteratorCategory(), iteratorf_category());
      }
  
    // Public interface, insert default comparator
--- 273,284 ----
                    _BinaryPredicate __comp)
      {
        typedef std::iterator_traits<_IIter> _IIterTraits;
!       typedef std::iterator_traits<_FIterator> _FIterTraits;
        typedef typename _IIterTraits::iterator_category _IIteratorCategory;
!       typedef typename _FIterTraits::iterator_category _FIteratorCategory;
  
        return __find_first_of_switch(__begin1, __end1, __begin2, __end2, __comp,
!                                   _IIteratorCategory(), _FIteratorCategory());
      }
  
    // Public interface, insert default comparator
*************** namespace __parallel
*** 288,296 ****
                    _FIterator __begin2, _FIterator __end2)
      {
        typedef std::iterator_traits<_IIter> _IIterTraits;
!       typedef std::iterator_traits<_FIterator> iteratorf_traits;
        typedef typename _IIterTraits::value_type _IValueType;
!       typedef typename iteratorf_traits::value_type _FValueType;
  
        return __gnu_parallel::find_first_of(__begin1, __end1, __begin2, __end2,
                           __gnu_parallel::_EqualTo<_IValueType, _FValueType>());
--- 288,296 ----
                    _FIterator __begin2, _FIterator __end2)
      {
        typedef std::iterator_traits<_IIter> _IIterTraits;
!       typedef std::iterator_traits<_FIterator> _FIterTraits;
        typedef typename _IIterTraits::value_type _IValueType;
!       typedef typename _FIterTraits::value_type _FValueType;
  
        return __gnu_parallel::find_first_of(__begin1, __end1, __begin2, __end2,
                           __gnu_parallel::_EqualTo<_IValueType, _FValueType>());
diff -Nrcpad gcc-4.6.1/libstdc++-v3/include/std/bitset gcc-4.6.2/libstdc++-v3/include/std/bitset
*** gcc-4.6.1/libstdc++-v3/include/std/bitset	Sun Jan 30 22:39:36 2011
--- gcc-4.6.2/libstdc++-v3/include/std/bitset	Fri Sep  2 13:39:22 2011
***************
*** 52,62 ****
  #include <iosfwd>
  #include <bits/cxxabi_forced.h>
  
! #define _GLIBCXX_BITSET_BITS_PER_WORD  (__CHAR_BIT__ * sizeof(unsigned long))
  #define _GLIBCXX_BITSET_WORDS(__n) \
    ((__n) / _GLIBCXX_BITSET_BITS_PER_WORD + \
     ((__n) % _GLIBCXX_BITSET_BITS_PER_WORD == 0 ? 0 : 1))
  
  namespace std _GLIBCXX_VISIBILITY(default)
  {
  _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
--- 52,64 ----
  #include <iosfwd>
  #include <bits/cxxabi_forced.h>
  
! #define _GLIBCXX_BITSET_BITS_PER_WORD  (__CHAR_BIT__ * __SIZEOF_LONG__)
  #define _GLIBCXX_BITSET_WORDS(__n) \
    ((__n) / _GLIBCXX_BITSET_BITS_PER_WORD + \
     ((__n) % _GLIBCXX_BITSET_BITS_PER_WORD == 0 ? 0 : 1))
  
+ #define _GLIBCXX_BITSET_BITS_PER_ULL (__CHAR_BIT__ * __SIZEOF_LONG_LONG__)
+ 
  namespace std _GLIBCXX_VISIBILITY(default)
  {
  _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
*************** _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
*** 654,659 ****
--- 656,679 ----
        _S_do_sanitize(_WordT) { } 
      };
  
+ #ifdef __GXX_EXPERIMENTAL_CXX0X__
+   template<size_t _Nb, bool = _Nb < _GLIBCXX_BITSET_BITS_PER_ULL>
+     struct _Sanitize_val
+     {
+       static constexpr unsigned long long
+       _S_do_sanitize_val(unsigned long long __val)
+       { return __val; }
+     };
+ 
+   template<size_t _Nb>
+     struct _Sanitize_val<_Nb, true>
+     {
+       static constexpr unsigned long long
+       _S_do_sanitize_val(unsigned long long __val)
+       { return __val & ~((~static_cast<unsigned long long>(0)) << _Nb); }
+     };
+ #endif
+ 
    /**
     *  @brief  The %bitset class represents a @e fixed-size sequence of bits.
     *
*************** _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
*** 819,825 ****
        /// Initial bits bitwise-copied from a single word (others set to zero).
  #ifdef __GXX_EXPERIMENTAL_CXX0X__
        constexpr bitset(unsigned long long __val)
!       : _Base(__val) { }
  #else
        bitset(unsigned long __val)
        : _Base(__val)
--- 839,845 ----
        /// Initial bits bitwise-copied from a single word (others set to zero).
  #ifdef __GXX_EXPERIMENTAL_CXX0X__
        constexpr bitset(unsigned long long __val)
!       : _Base(_Sanitize_val<_Nb>::_S_do_sanitize_val(__val)) { }
  #else
        bitset(unsigned long __val)
        : _Base(__val)
*************** _GLIBCXX_END_NAMESPACE_CONTAINER
*** 1509,1514 ****
--- 1529,1535 ----
  
  #undef _GLIBCXX_BITSET_WORDS
  #undef _GLIBCXX_BITSET_BITS_PER_WORD
+ #undef _GLIBCXX_BITSET_BITS_PER_ULL
  
  #ifdef __GXX_EXPERIMENTAL_CXX0X__
  
diff -Nrcpad gcc-4.6.1/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc gcc-4.6.2/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc
*** gcc-4.6.1/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc	Sat Apr 16 02:04:56 2011
--- gcc-4.6.2/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc	Wed Jul 27 22:13:18 2011
*************** main()
*** 43,53 ****
  }
  
  // { dg-warning "note" "" { target *-*-* } 354 }
! // { dg-warning "note" "" { target *-*-* } 1086 }
! // { dg-warning "note" "" { target *-*-* } 469 }
! // { dg-warning "note" "" { target *-*-* } 587 }
! // { dg-warning "note" "" { target *-*-* } 1050 }
! // { dg-warning "note" "" { target *-*-* } 1056 }
! // { dg-warning "note" "" { target *-*-* } 342 }
! // { dg-warning "note" "" { target *-*-* } 292 }
  // { dg-warning "note" "" { target *-*-* } 207 }
--- 43,53 ----
  }
  
  // { dg-warning "note" "" { target *-*-* } 354 }
! // { dg-warning "note" "" { target *-*-* } 1085 }
! // { dg-warning "note" "" { target *-*-* } 468 }
! // { dg-warning "note" "" { target *-*-* } 586 }
! // { dg-warning "note" "" { target *-*-* } 1049 }
! // { dg-warning "note" "" { target *-*-* } 1055 }
! // { dg-warning "note" "" { target *-*-* } 341 }
! // { dg-warning "note" "" { target *-*-* } 291 }
  // { dg-warning "note" "" { target *-*-* } 207 }
diff -Nrcpad gcc-4.6.1/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc gcc-4.6.2/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc
*** gcc-4.6.1/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc	Wed Sep 15 10:46:39 2010
--- gcc-4.6.2/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc	Fri Jul 22 16:47:20 2011
***************
*** 1,6 ****
  // { dg-require-namedlocale "ru_RU.ISO-8859-5" }
  
! // Copyright (C) 2010 Free Software Foundation
  //
  // 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
--- 1,6 ----
  // { dg-require-namedlocale "ru_RU.ISO-8859-5" }
  
! // Copyright (C) 2010, 2011 Free Software Foundation
  //
  // 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
*************** void test01()
*** 49,55 ****
--- 49,59 ----
    // get_weekday(iter_type, iter_type, ios_base&, 
    //             ios_base::iostate&, tm*) const
  
+ #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 14)
+   iss.str("\xbf\xdd\x2e");
+ #else
    iss.str("\xbf\xdd\xd4");
+ #endif
    iterator_type is_it01(iss);
    tm time01;
    memset(&time01, -1, sizeof(tm));
*************** void test01()
*** 67,73 ****
--- 71,81 ----
    VERIFY( time02.tm_wday == 1 );
    VERIFY( errorstate == ios_base::eofbit );
  
+ #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 14)
+   iss.str("\xbf\xdd\x2e\xd5\xd4\xd5\xdb\xec\xdd\xd8\xda");
+ #else
    iss.str("\xbf\xdd\xd4\xd5\xd4\xd5\xdb\xec\xdd\xd8\xda");
+ #endif
    iterator_type is_it03(iss);
    tm time03;
    memset(&time03, -1, sizeof(tm));
diff -Nrcpad gcc-4.6.1/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc gcc-4.6.2/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc
*** gcc-4.6.1/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc	Wed Sep 15 10:46:39 2010
--- gcc-4.6.2/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc	Fri Jul 22 16:47:20 2011
***************
*** 2,8 ****
  
  // 2010-01-05  Paolo Carlini  <paolo.carlini@oracle.com>
  
! // Copyright (C) 2010 Free Software Foundation
  //
  // 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
--- 2,8 ----
  
  // 2010-01-05  Paolo Carlini  <paolo.carlini@oracle.com>
  
! // Copyright (C) 2010, 2011 Free Software Foundation
  //
  // 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
*************** void test01()
*** 50,55 ****
--- 50,64 ----
    // get_weekday(iter_type, iter_type, ios_base&, 
    //             ios_base::iostate&, tm*) const
  
+ #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 14)
+   const char* awdays[7] = { "\u0412\u0441\u002E",
+ 			    "\u041F\u043D\u002E",
+ 			    "\u0412\u0442\u002E",
+ 			    "\u0421\u0440\u002E",
+ 			    "\u0427\u0442\u002E",
+ 			    "\u041F\u0442\u002E",
+ 			    "\u0421\u0431\u002E" };
+ #else
    const char* awdays[7] = { "\u0412\u0441\u043A",
  			    "\u041F\u043D\u0434",
  			    "\u0412\u0442\u0440",
*************** void test01()
*** 57,62 ****
--- 66,72 ----
  			    "\u0427\u0442\u0432",
  			    "\u041F\u0442\u043D",
  			    "\u0421\u0431\u0442" };
+ #endif
  
    for (int i = 0; i < 7; ++i)
      {
diff -Nrcpad gcc-4.6.1/libstdc++-v3/testsuite/23_containers/bitset/cons/50268.cc gcc-4.6.2/libstdc++-v3/testsuite/23_containers/bitset/cons/50268.cc
*** gcc-4.6.1/libstdc++-v3/testsuite/23_containers/bitset/cons/50268.cc	Thu Jan  1 00:00:00 1970
--- gcc-4.6.2/libstdc++-v3/testsuite/23_containers/bitset/cons/50268.cc	Fri Sep  2 13:39:22 2011
***************
*** 0 ****
--- 1,84 ----
+ // { dg-options "-std=gnu++0x" }
+ 
+ // Copyright (C) 2011 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 <bitset>
+ #include <testsuite_hooks.h>
+ 
+ // libstdc++/50268
+ void test01()
+ {
+   bool test __attribute__((unused)) = true;
+ 
+   std::bitset<1> b1(3ULL);
+   VERIFY( b1.count() == 1ULL );
+ 
+   std::bitset<3> b2(30ULL);
+   VERIFY( b2.count() == 2ULL );
+ 
+   std::bitset<6> b3(300ULL);
+   VERIFY( b3.count() == 3ULL );
+ 
+   std::bitset<9> b4(3000ULL);
+   VERIFY( b4.count() == 5ULL );
+ 
+   std::bitset<16> b5(300000ULL);
+   VERIFY( b5.count() == 7ULL );
+ 
+   std::bitset<24> b6(30000000ULL);
+   VERIFY( b6.count() == 9ULL );
+ 
+   std::bitset<32> b7(30000000000ULL);
+   VERIFY( b7.count() == 13ULL );
+ 
+   std::bitset<37> b8(3000000000000ULL);
+   VERIFY( b8.count() == 18ULL );
+ 
+   std::bitset<40> b9(30000000000000ULL);
+   VERIFY( b9.count() == 16ULL );
+ 
+   std::bitset<45> b10(30000000000000ULL);
+   VERIFY( b10.count() == 20ULL );
+ 
+   std::bitset<64> b11(30000000000000ULL);
+   VERIFY( b11.count() == 20ULL );
+ 
+   std::bitset<100> b12(30000000000000ULL);
+   VERIFY( b12.count() == 20ULL );
+ 
+   std::bitset<200> b13(30000000000000ULL);
+   VERIFY( b13.count() == 20ULL );
+ 
+   std::bitset<45> b14(18446744073709551615ULL);
+   VERIFY( b14.count() == 45ULL );
+ 
+   std::bitset<64> b15(18446744073709551615ULL);
+   VERIFY( b15.count() == 64ULL );
+ 
+   std::bitset<100> b16(18446744073709551615ULL);
+   VERIFY( b16.count() == 64ULL );
+ 
+   std::bitset<200> b17(18446744073709551615ULL);
+   VERIFY( b17.count() == 64ULL );  
+ }
+ 
+ int main()
+ {
+   test01();
+   return 0;
+ }
diff -Nrcpad gcc-4.6.1/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/3.cc gcc-4.6.2/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/3.cc
*** gcc-4.6.1/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/3.cc	Thu Apr  9 15:00:19 2009
--- gcc-4.6.2/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/3.cc	Fri Sep 30 20:47:12 2011
***************
*** 1,4 ****
! // Copyright (C) 2007, 2009 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
--- 1,4 ----
! // Copyright (C) 2007, 2009, 2010, 2011 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
*************** void erase(size_t num_elm, size_t elm_st
*** 31,37 ****
    
    x.erase(x.begin() + elm_strt, x.begin() + elm_end);
    
!   const size_t min_num_cpy = std::min(elm_strt, num_elm - elm_end);
    VERIFY( assignment_operator::count() == min_num_cpy );
  }
  
--- 31,39 ----
    
    x.erase(x.begin() + elm_strt, x.begin() + elm_end);
    
!   const size_t min_num_cpy
!     = elm_strt == elm_end ? 0 : std::min(elm_strt, num_elm - elm_end);
! 
    VERIFY( assignment_operator::count() == min_num_cpy );
  }
  
diff -Nrcpad gcc-4.6.1/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/50529.cc gcc-4.6.2/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/50529.cc
*** gcc-4.6.1/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/50529.cc	Thu Jan  1 00:00:00 1970
--- gcc-4.6.2/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/50529.cc	Fri Sep 30 20:47:12 2011
***************
*** 0 ****
--- 1,38 ----
+ // { dg-options "-std=gnu++0x" }
+ 
+ // 2011-09-26  Paolo Carlini  <paolo.carlini@oracle.com>
+ 
+ // Copyright (C) 2011 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 <deque>
+ #include <testsuite_rvalref.h>
+ 
+ // libstdc++/50529
+ void test01()
+ {
+   std::deque<__gnu_test::rvalstruct> d(10);
+ 
+   for (auto it = d.begin(); it != d.end(); ++it)
+     d.erase(it, it);
+ }
+ 
+ int main()
+ {
+   test01();
+   return 0;
+ }
diff -Nrcpad gcc-4.6.1/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/50529.cc gcc-4.6.2/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/50529.cc
*** gcc-4.6.1/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/50529.cc	Thu Jan  1 00:00:00 1970
--- gcc-4.6.2/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/50529.cc	Fri Sep 30 20:47:12 2011
***************
*** 0 ****
--- 1,38 ----
+ // { dg-options "-std=gnu++0x" }
+ 
+ // 2011-09-26  Paolo Carlini  <paolo.carlini@oracle.com>
+ 
+ // Copyright (C) 2011 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 <vector>
+ #include <testsuite_rvalref.h>
+ 
+ // libstdc++/50529
+ void test01()
+ {
+   std::vector<__gnu_test::rvalstruct> v(10);
+ 
+   for (auto it = v.begin(); it != v.end(); ++it)
+     v.erase(it, it);
+ }
+ 
+ int main()
+ {
+   test01();
+   return 0;
+ }
diff -Nrcpad gcc-4.6.1/libstdc++-v3/testsuite/25_algorithms/inplace_merge/49559.cc gcc-4.6.2/libstdc++-v3/testsuite/25_algorithms/inplace_merge/49559.cc
*** gcc-4.6.1/libstdc++-v3/testsuite/25_algorithms/inplace_merge/49559.cc	Thu Jan  1 00:00:00 1970
--- gcc-4.6.2/libstdc++-v3/testsuite/25_algorithms/inplace_merge/49559.cc	Tue Sep 27 08:22:07 2011
***************
*** 0 ****
--- 1,72 ----
+ // { dg-options "-std=gnu++0x" }
+ 
+ // Copyright (C) 2011 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/>.
+ 
+ #undef _GLIBCXX_CONCEPT_CHECKS
+ 
+ // XXX FIXME:  parallel-mode should deal correctly with moveable-only types
+ // per C++0x, at minimum smoothly fall back to serial.
+ #undef _GLIBCXX_PARALLEL
+ 
+ #include <algorithm>
+ #include <testsuite_hooks.h>
+ #include <testsuite_iterators.h>
+ #include <testsuite_rvalref.h>
+ 
+ using __gnu_test::test_container;
+ using __gnu_test::bidirectional_iterator_wrapper;
+ using __gnu_test::rvalstruct;
+ 
+ typedef test_container<rvalstruct, bidirectional_iterator_wrapper> Container;
+ 
+ const int A[] = { 0, 1, 2, 3, 4, 5 };
+ const int N = 6;
+ 
+ bool are_ordered(const rvalstruct& lhs, const rvalstruct& rhs)
+ { return lhs < rhs; }
+ 
+ // libstdc++/49559
+ void test01()
+ {
+   bool test __attribute__((unused)) = true;
+ 
+   rvalstruct s1[6];
+   std::copy(A, A + N, s1);
+   Container con1(s1, s1 + N);
+   std::inplace_merge(con1.begin(), con1.it(4), con1.end());
+   VERIFY( s1[0] == 0 && s1[1] == 1 && s1[2] == 2
+ 	  && s1[3] == 3 && s1[4] == 4 && s1[5] == 5 );
+   VERIFY( s1[0].valid && s1[1].valid && s1[2].valid
+ 	  && s1[3].valid && s1[4].valid && s1[5].valid );
+ 
+   rvalstruct s2[6];
+   std::copy(A, A + N, s2);
+   Container con2(s2, s2 + N);
+   std::inplace_merge(con2.begin(), con2.it(4), con2.end(), are_ordered);
+   VERIFY( s2[0] == 0 && s2[1] == 1 && s2[2] == 2
+ 	  && s2[3] == 3 && s2[4] == 4 && s2[5] == 5 );
+   VERIFY( s2[0].valid && s2[1].valid && s2[2].valid
+ 	  && s2[3].valid && s2[4].valid && s2[5].valid );
+ }
+ 
+ int
+ main()
+ {
+   test01();
+   return 0;
+ }
diff -Nrcpad gcc-4.6.1/libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable.cc gcc-4.6.2/libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable.cc
*** gcc-4.6.1/libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable.cc	Tue Jan 12 17:16:25 2010
--- gcc-4.6.2/libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable.cc	Tue Sep 27 08:22:07 2011
*************** test01()
*** 39,51 ****
  {
    bool test __attribute__((unused)) = true;
  
!   int array[]={0,2,4,1,3,5};
!   rvalstruct rv_array[6];
!   std::copy(array, array + 6, rv_array);
!   container con(rv_array, rv_array + 6);
!   std::inplace_merge(con.begin(), con.it(3), con.end());
!   VERIFY( rv_array[0] == 0 && rv_array[1] == 1 && rv_array[2] == 2
! 	  && rv_array[3] == 3 && rv_array[4] == 4 && rv_array[5] == 5 );
  }
  
  int 
--- 39,97 ----
  {
    bool test __attribute__((unused)) = true;
  
!   int array1[]={0,2,4,1,3,5};
!   rvalstruct rv_array1[6];
!   std::copy(array1, array1 + 6, rv_array1);
!   container con1(rv_array1, rv_array1 + 6);
!   std::inplace_merge(con1.begin(), con1.it(3), con1.end());
!   VERIFY( rv_array1[0] == 0 && rv_array1[1] == 1 && rv_array1[2] == 2
! 	  && rv_array1[3] == 3 && rv_array1[4] == 4 && rv_array1[5] == 5 );
! 
!   int array2[]={0,2,4,5,1,3};
!   rvalstruct rv_array2[6];
!   std::copy(array2, array2 + 6, rv_array2);
!   container con2(rv_array2, rv_array2 + 6);
!   std::inplace_merge(con2.begin(), con2.it(4), con2.end());
!   VERIFY( rv_array2[0] == 0 && rv_array2[1] == 1 && rv_array2[2] == 2
! 	  && rv_array2[3] == 3 && rv_array2[4] == 4 && rv_array2[5] == 5 );
! 
!   int array3[]={1,1,1,2,2,2};
!   rvalstruct rv_array3[6];
!   std::copy(array3, array3 + 6, rv_array3);
!   container con3(rv_array3, rv_array3 + 6);
!   std::inplace_merge(con3.begin(), con3.it(3), con3.end());
!   VERIFY( rv_array3[0] == 1 && rv_array3[1] == 1 && rv_array3[2] == 1
! 	  && rv_array3[3] == 2 && rv_array3[4] == 2 && rv_array3[5] == 2 );
! 
!   int array4[]={1,1,1,1,2,2};
!   rvalstruct rv_array4[6];
!   std::copy(array4, array4 + 6, rv_array4);
!   container con4(rv_array4, rv_array4 + 6);
!   std::inplace_merge(con4.begin(), con4.it(4), con4.end());
!   VERIFY( rv_array4[0] == 1 && rv_array4[1] == 1 && rv_array4[2] == 1
! 	  && rv_array4[3] == 1 && rv_array4[4] == 2 && rv_array4[5] == 2 );
! 
!   int array5[]={3,3,3,3};
!   rvalstruct rv_array5[4];
!   std::copy(array5, array5 + 4, rv_array5);
!   container con5(rv_array5, rv_array5 + 4);
!   std::inplace_merge(con5.begin(), con5.it(2), con5.end());
!   VERIFY( rv_array5[0] == 3 && rv_array5[1] == 3 && rv_array5[2] == 3
! 	  && rv_array5[3] == 3 );
! 
!   int array6[]={3,3,3};
!   rvalstruct rv_array6[3];
!   std::copy(array6, array6 + 3, rv_array6);
!   container con6(rv_array6, rv_array6 + 3);
!   std::inplace_merge(con6.begin(), con6.it(0), con6.end());
!   VERIFY( rv_array6[0] == 3 && rv_array6[1] == 3 && rv_array6[2] == 3 );
! 
!   int array7[]={3,3};
!   rvalstruct rv_array7[2];
!   std::copy(array7, array7 + 2, rv_array7);
!   container con7(rv_array7, rv_array7 + 2);
!   std::inplace_merge(con7.begin(), con7.it(2), con7.end());
!   VERIFY( rv_array7[0] == 3 && rv_array7[1] == 3 );
  }
  
  int 
diff -Nrcpad gcc-4.6.1/libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable2.cc gcc-4.6.2/libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable2.cc
*** gcc-4.6.1/libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable2.cc	Mon Oct  5 14:11:11 2009
--- gcc-4.6.2/libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable2.cc	Tue Sep 27 08:22:07 2011
***************
*** 1,6 ****
  // { dg-options "-std=gnu++0x" }
  
! // Copyright (C) 2009 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
--- 1,6 ----
  // { dg-options "-std=gnu++0x" }
  
! // Copyright (C) 2009, 2010, 2011 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
*************** test01()
*** 39,51 ****
  {
    bool test __attribute__((unused)) = true;
  
!   int array[]={0,2,4,1,3,5};
!   rvalstruct rv_array[6];
!   std::copy(array, array + 6, rv_array);
!   container con(rv_array, rv_array + 6);
!   std::inplace_merge(con.begin(), con.it(3), con.end(), are_ordered);
!   VERIFY( rv_array[0] == 0 && rv_array[1] == 1 && rv_array[2] == 2
! 	  && rv_array[3] == 3 && rv_array[4] == 4 && rv_array[5] == 5 );
  }
  
  int 
--- 39,97 ----
  {
    bool test __attribute__((unused)) = true;
  
!   int array1[]={0,2,4,1,3,5};
!   rvalstruct rv_array1[6];
!   std::copy(array1, array1 + 6, rv_array1);
!   container con1(rv_array1, rv_array1 + 6);
!   std::inplace_merge(con1.begin(), con1.it(3), con1.end(), are_ordered);
!   VERIFY( rv_array1[0] == 0 && rv_array1[1] == 1 && rv_array1[2] == 2
! 	  && rv_array1[3] == 3 && rv_array1[4] == 4 && rv_array1[5] == 5 );
! 
!   int array2[]={0,2,4,5,1,3};
!   rvalstruct rv_array2[6];
!   std::copy(array2, array2 + 6, rv_array2);
!   container con2(rv_array2, rv_array2 + 6);
!   std::inplace_merge(con2.begin(), con2.it(4), con2.end(), are_ordered);
!   VERIFY( rv_array2[0] == 0 && rv_array2[1] == 1 && rv_array2[2] == 2
! 	  && rv_array2[3] == 3 && rv_array2[4] == 4 && rv_array2[5] == 5 );
! 
!   int array3[]={1,1,1,2,2,2};
!   rvalstruct rv_array3[6];
!   std::copy(array3, array3 + 6, rv_array3);
!   container con3(rv_array3, rv_array3 + 6);
!   std::inplace_merge(con3.begin(), con3.it(3), con3.end(), are_ordered);
!   VERIFY( rv_array3[0] == 1 && rv_array3[1] == 1 && rv_array3[2] == 1
! 	  && rv_array3[3] == 2 && rv_array3[4] == 2 && rv_array3[5] == 2 );
! 
!   int array4[]={1,1,1,1,2,2};
!   rvalstruct rv_array4[6];
!   std::copy(array4, array4 + 6, rv_array4);
!   container con4(rv_array4, rv_array4 + 6);
!   std::inplace_merge(con4.begin(), con4.it(4), con4.end(), are_ordered);
!   VERIFY( rv_array4[0] == 1 && rv_array4[1] == 1 && rv_array4[2] == 1
! 	  && rv_array4[3] == 1 && rv_array4[4] == 2 && rv_array4[5] == 2 );
! 
!   int array5[]={3,3,3,3};
!   rvalstruct rv_array5[4];
!   std::copy(array5, array5 + 4, rv_array5);
!   container con5(rv_array5, rv_array5 + 4);
!   std::inplace_merge(con5.begin(), con5.it(2), con5.end(), are_ordered);
!   VERIFY( rv_array5[0] == 3 && rv_array5[1] == 3 && rv_array5[2] == 3
! 	  && rv_array5[3] == 3 );
! 
!   int array6[]={3,3,3};
!   rvalstruct rv_array6[3];
!   std::copy(array6, array6 + 3, rv_array6);
!   container con6(rv_array6, rv_array6 + 3);
!   std::inplace_merge(con6.begin(), con6.it(0), con6.end(), are_ordered);
!   VERIFY( rv_array6[0] == 3 && rv_array6[1] == 3 && rv_array6[2] == 3 );
! 
!   int array7[]={3,3};
!   rvalstruct rv_array7[2];
!   std::copy(array7, array7 + 2, rv_array7);
!   container con7(rv_array7, rv_array7 + 2);
!   std::inplace_merge(con7.begin(), con7.it(2), con7.end(), are_ordered);
!   VERIFY( rv_array7[0] == 3 && rv_array7[1] == 3 );
  }
  
  int 
diff -Nrcpad gcc-4.6.1/libstdc++-v3/testsuite/25_algorithms/stable_sort/49559.cc gcc-4.6.2/libstdc++-v3/testsuite/25_algorithms/stable_sort/49559.cc
*** gcc-4.6.1/libstdc++-v3/testsuite/25_algorithms/stable_sort/49559.cc	Thu Jan  1 00:00:00 1970
--- gcc-4.6.2/libstdc++-v3/testsuite/25_algorithms/stable_sort/49559.cc	Tue Sep 27 08:22:07 2011
***************
*** 0 ****
--- 1,68 ----
+ // { dg-options "-std=gnu++0x" }
+ 
+ // Copyright (C) 2011 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/>.
+ 
+ #undef _GLIBCXX_CONCEPT_CHECKS
+ 
+ // XXX FIXME:  parallel-mode should deal correctly with moveable-only types
+ // per C++0x, at minimum smoothly fall back to serial.
+ #undef _GLIBCXX_PARALLEL
+ 
+ #include <algorithm>
+ #include <testsuite_hooks.h>
+ #include <testsuite_iterators.h>
+ #include <testsuite_rvalref.h>
+ 
+ using __gnu_test::test_container;
+ using __gnu_test::random_access_iterator_wrapper;
+ using __gnu_test::rvalstruct;
+ 
+ typedef test_container<rvalstruct, random_access_iterator_wrapper> Container;
+ 
+ const int A[] = { 10 };
+ const int N = 1;
+ 
+ bool order(const rvalstruct& lhs, const rvalstruct& rhs)
+ { return lhs < rhs; }
+ 
+ // libstdc++/49559
+ void test01()
+ {
+   bool test __attribute__((unused)) = true;
+ 
+   rvalstruct s1[1];
+   std::copy(A, A + 1, s1);
+   Container con1(s1, s1 + 1);
+   std::stable_sort(con1.begin(), con1.end());
+   VERIFY( s1[0] == 10 );
+   VERIFY( s1[0].valid );
+ 
+   rvalstruct s2[1];
+   std::copy(A, A + 1, s2);
+   Container con2(s2, s2 + 1);
+   std::stable_sort(con2.begin(), con2.end(), order);
+   VERIFY( s2[0] == 10 );
+   VERIFY( s2[0].valid );
+ }
+ 
+ int
+ main()
+ {
+   test01();
+   return 0;
+ }
diff -Nrcpad gcc-4.6.1/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc gcc-4.6.2/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
*** gcc-4.6.1/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc	Tue May  3 17:54:35 2011
--- gcc-4.6.2/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc	Wed Oct  5 23:09:51 2011
***************
*** 25,28 ****
  
  #include <vector>
  
! // { dg-error "multiple inlined namespaces" "" { target *-*-* } 241 }
--- 25,28 ----
  
  #include <vector>
  
! // { dg-error "multiple inlined namespaces" "" { target *-*-* } 242 }
diff -Nrcpad gcc-4.6.1/libstdc++-v3/testsuite/util/testsuite_rvalref.h gcc-4.6.2/libstdc++-v3/testsuite/util/testsuite_rvalref.h
*** gcc-4.6.1/libstdc++-v3/testsuite/util/testsuite_rvalref.h	Wed Mar  9 18:30:11 2011
--- gcc-4.6.2/libstdc++-v3/testsuite/util/testsuite_rvalref.h	Tue Sep 27 08:22:07 2011
*************** namespace __gnu_test
*** 68,73 ****
--- 68,74 ----
      operator=(rvalstruct&& in)
      {
        bool test __attribute__((unused)) = true;
+       VERIFY( this != &in );
        VERIFY( in.valid == true );
        val = in.val;
        in.valid = false;