DR 1170 PR c++/51213
[gcc.git] / gcc / cp / cp-tree.h
index d0e874bc370a8586fc8251a0cfb5bfc155d4818b..f1a4b32603ce80aba3c8f66cc75e81b9d8441528 100644 (file)
@@ -1,6 +1,7 @@
 /* Definitions for C++ parsing and type checking.
    Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+   2012
    Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com)
 
@@ -73,6 +74,11 @@ c-common.h, not after.
       VEC_INIT_EXPR_IS_CONSTEXPR (in VEC_INIT_EXPR)
       DECL_OVERRIDE_P (in FUNCTION_DECL)
       IMPLICIT_CONV_EXPR_DIRECT_INIT (in IMPLICIT_CONV_EXPR)
+      TRANSACTION_EXPR_IS_STMT (in TRANSACTION_EXPR)
+      CONVERT_EXPR_VBASE_PATH (in CONVERT_EXPR)
+      OVL_ARG_DEPENDENT (in OVERLOAD)
+      PACK_EXPANSION_LOCAL_P (in *_PACK_EXPANSION)
+      TINFO_RECHECK_ACCESS_P (in TEMPLATE_INFO)
    1: IDENTIFIER_VIRTUAL_P (in IDENTIFIER_NODE)
       TI_PENDING_TEMPLATE_FLAG.
       TEMPLATE_PARMS_FOR_INLINE.
@@ -91,8 +97,8 @@ c-common.h, not after.
       DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (in VAR_DECL)
       STATEMENT_LIST_TRY_BLOCK (in STATEMENT_LIST)
       TYPENAME_IS_RESOLVING_P (in TYPE_NAME_TYPE)
-      LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P (in LAMBDA_EXPR)
       TARGET_EXPR_DIRECT_INIT_P (in TARGET_EXPR)
+      FNDECL_USED_AUTO (in FUNCTION_DECL)
    3: (TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out).
       ICS_BAD_FLAG (in _CONV)
       FN_TRY_BLOCK_P (in TRY_BLOCK)
@@ -129,6 +135,7 @@ c-common.h, not after.
       DECL_TEMPLATE_INSTANTIATED (in a VAR_DECL or a FUNCTION_DECL)
       DECL_MEMBER_TEMPLATE_P (in TEMPLATE_DECL)
       FUNCTION_PARAMETER_PACK_P (in PARM_DECL)
+      USING_DECL_TYPENAME_P (in USING_DECL)
    2: DECL_THIS_EXTERN (in VAR_DECL or FUNCTION_DECL).
       DECL_IMPLICIT_TYPEDEF_P (in a TYPE_DECL)
    3: DECL_IN_AGGR_P.
@@ -139,6 +146,7 @@ c-common.h, not after.
    5: DECL_INTERFACE_KNOWN.
    6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL).
       DECL_FIELD_IS_BASE (in FIELD_DECL)
+      TYPE_DECL_ALIAS_P (in TYPE_DECL)
    7: DECL_DEAD_FOR_LOCAL (in VAR_DECL).
       DECL_THUNK_P (in a member FUNCTION_DECL)
       DECL_NORMAL_CAPTURE_P (in FIELD_DECL)
@@ -242,7 +250,6 @@ struct GTY(()) template_parm_index_s {
   int index;
   int level;
   int orig_level;
-  int num_siblings;
   tree decl;
 };
 typedef struct template_parm_index_s template_parm_index;
@@ -400,7 +407,11 @@ typedef enum cpp0x_warn_str
   /* override controls, override/final */
   CPP0X_OVERRIDE_CONTROLS,
   /* non-static data member initializers */
-  CPP0X_NSDMI
+  CPP0X_NSDMI,
+  /* user defined literals */
+  CPP0X_USER_DEFINED_LITERALS,
+  /* delegating constructors */
+  CPP0X_DELEGATING_CTORS
 } cpp0x_warn_str;
   
 /* The various kinds of operation used by composite_pointer_type. */
@@ -580,6 +591,7 @@ typedef enum cp_trait_kind
   CPTK_IS_CONVERTIBLE_TO,
   CPTK_IS_EMPTY,
   CPTK_IS_ENUM,
+  CPTK_IS_FINAL,
   CPTK_IS_LITERAL_TYPE,
   CPTK_IS_POD,
   CPTK_IS_POLYMORPHIC,
@@ -648,11 +660,6 @@ enum cp_lambda_default_capture_mode_type {
 #define LAMBDA_EXPR_MUTABLE_P(NODE) \
   TREE_LANG_FLAG_1 (LAMBDA_EXPR_CHECK (NODE))
 
-/* True iff we should try to deduce the lambda return type from any return
-   statement.  */
-#define LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P(NODE) \
-  TREE_LANG_FLAG_2 (LAMBDA_EXPR_CHECK (NODE))
-
 /* The return type in the expression.
  * NULL_TREE indicates that none was specified.  */
 #define LAMBDA_EXPR_RETURN_TYPE(NODE) \
@@ -719,6 +726,14 @@ typedef struct qualified_typedef_usage_s qualified_typedef_usage_t;
 DEF_VEC_O (qualified_typedef_usage_t);
 DEF_VEC_ALLOC_O (qualified_typedef_usage_t,gc);
 
+/* Non-zero if this template specialization has access violations that
+   should be rechecked when the function is instantiated outside argument
+   deduction.  */
+#define TINFO_RECHECK_ACCESS_P(NODE) \
+  (TREE_LANG_FLAG_0 (TEMPLATE_INFO_CHECK (NODE)))
+#define FNDECL_RECHECK_ACCESS_P(NODE) \
+  (TINFO_RECHECK_ACCESS_P (DECL_TEMPLATE_INFO (NODE)))
+
 struct GTY(()) tree_template_info {
   struct tree_common common;
   VEC(qualified_typedef_usage_t,gc) *typedefs_needing_access_checking;
@@ -740,6 +755,7 @@ enum cp_tree_node_structure_enum {
   TS_CP_TRAIT_EXPR,
   TS_CP_LAMBDA_EXPR,
   TS_CP_TEMPLATE_INFO,
+  TS_CP_USERDEF_LITERAL,
   LAST_TS_CP_ENUM
 };
 
@@ -765,6 +781,8 @@ union GTY((desc ("cp_tree_node_structure (&%h)"),
     lambda_expression;
   struct tree_template_info GTY ((tag ("TS_CP_TEMPLATE_INFO")))
     template_info;
+  struct tree_userdef_literal GTY ((tag ("TS_CP_USERDEF_LITERAL")))
+    userdef_literal;
 };
 
 \f
@@ -789,7 +807,6 @@ enum cp_tree_index
     CPTI_CLASS_TYPE,
     CPTI_UNKNOWN_TYPE,
     CPTI_INIT_LIST_TYPE,
-    CPTI_DEPENDENT_LAMBDA_RETURN_TYPE,
     CPTI_VTBL_TYPE,
     CPTI_VTBL_PTR_TYPE,
     CPTI_STD,
@@ -861,7 +878,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
 #define class_type_node                        cp_global_trees[CPTI_CLASS_TYPE]
 #define unknown_type_node              cp_global_trees[CPTI_UNKNOWN_TYPE]
 #define init_list_type_node            cp_global_trees[CPTI_INIT_LIST_TYPE]
-#define dependent_lambda_return_type_node cp_global_trees[CPTI_DEPENDENT_LAMBDA_RETURN_TYPE]
 #define vtbl_type_node                 cp_global_trees[CPTI_VTBL_TYPE]
 #define vtbl_ptr_type_node             cp_global_trees[CPTI_VTBL_PTR_TYPE]
 #define std_node                       cp_global_trees[CPTI_STD]
@@ -1061,6 +1077,7 @@ struct GTY(()) language_function {
   tree x_in_charge_parm;
   tree x_vtt_parm;
   tree x_return_value;
+  tree x_auto_return_pattern;
 
   BOOL_BITFIELD returns_value : 1;
   BOOL_BITFIELD returns_null : 1;
@@ -1143,6 +1160,11 @@ struct GTY(()) language_function {
 #define current_function_return_value \
   (cp_function_chain->x_return_value)
 
+/* A type involving 'auto' to be used for return type deduction.  */
+
+#define current_function_auto_return_pattern \
+  (cp_function_chain->x_auto_return_pattern)
+
 /* True if NAME is the IDENTIFIER_NODE for an overloaded "operator
    new" or "operator delete".  */
 #define NEW_DELETE_OPNAME_P(NAME)              \
@@ -1644,6 +1666,10 @@ struct GTY((variable_size)) lang_type {
 #define CLASSTYPE_PURE_VIRTUALS(NODE) \
   (LANG_TYPE_CLASS_CHECK (NODE)->pure_virtuals)
 
+/* Nonzero means that this type is an abstract class type.  */
+#define ABSTRACT_CLASS_TYPE_P(NODE) \
+  (CLASS_TYPE_P (NODE) && CLASSTYPE_PURE_VIRTUALS(NODE))
+
 /* Nonzero means that this type has an X() constructor.  */
 #define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) \
   (LANG_TYPE_CLASS_CHECK (NODE)->h.has_default_ctor)
@@ -1923,7 +1949,7 @@ struct GTY(()) lang_decl_fn {
   unsigned thunk_p : 1;
   unsigned this_thunk_p : 1;
   unsigned hidden_friend_p : 1;
-  /* 1 spare bit.  */
+  unsigned suppress_implicit_decl : 1;
 
   /* For a non-thunk function decl, this is a tree list of
      friendly classes. For a thunk function decl, it is the
@@ -2512,6 +2538,9 @@ extern void decl_shadowed_for_var_insert (tree, tree);
 /* The decls named by a using decl.  */
 #define USING_DECL_DECLS(NODE) DECL_INITIAL (USING_DECL_CHECK (NODE))
 
+/* Non zero if the using decl refers to a dependent type.  */
+#define USING_DECL_TYPENAME_P(NODE) DECL_LANG_FLAG_1 (USING_DECL_CHECK (NODE))
+
 /* In a VAR_DECL, true if we have a shadowed local variable
    in the shadowed var table for this VAR_DECL.  */
 #define DECL_HAS_SHADOWED_FOR_VAR_P(NODE) \
@@ -2536,6 +2565,19 @@ extern void decl_shadowed_for_var_insert (tree, tree);
 #define DECL_PENDING_INLINE_INFO(NODE) \
   (LANG_DECL_FN_CHECK (NODE)->u.pending_inline_info)
 
+/* Nonzero for TYPE_DECL means that it was written 'using name = type'.  */
+#define TYPE_DECL_ALIAS_P(NODE) \
+  DECL_LANG_FLAG_6 (TYPE_DECL_CHECK (NODE))
+
+/* Nonzero for a type which is an alias for another type; i.e, a type
+   which declaration was written 'using name-of-type =
+   another-type'.  */
+#define TYPE_ALIAS_P(NODE)                     \
+  (TYPE_P (NODE)                               \
+   && TYPE_NAME (NODE)                         \
+   && TREE_CODE (TYPE_NAME (NODE)) == TYPE_DECL        \
+   && TYPE_DECL_ALIAS_P (TYPE_NAME (NODE)))
+
 /* For a class type: if this structure has many fields, we'll sort them
    and put them into a TREE_VEC.  */
 #define CLASSTYPE_SORTED_FIELDS(NODE) \
@@ -2586,22 +2628,33 @@ extern void decl_shadowed_for_var_insert (tree, tree);
   (LANG_TYPE_CLASS_CHECK (BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK (NODE)) \
    ->template_info)
 
-/* Template information for an ENUMERAL_, RECORD_, or UNION_TYPE.  */
-#define TYPE_TEMPLATE_INFO(NODE)                       \
-  (TREE_CODE (NODE) == ENUMERAL_TYPE                   \
-   ? ENUM_TEMPLATE_INFO (NODE) :                       \
-   (TREE_CODE (NODE) == BOUND_TEMPLATE_TEMPLATE_PARM   \
-    ? TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (NODE) :    \
-    (TYPE_LANG_SPECIFIC (NODE)                         \
-     ? CLASSTYPE_TEMPLATE_INFO (NODE)                  \
-     : NULL_TREE)))
+/* Template information for an ENUMERAL_, RECORD_, UNION_TYPE, or
+   BOUND_TEMPLATE_TEMPLATE_PARM type.  Note that if NODE is a
+   specialization of an alias template, this accessor returns the
+   template info for the alias template, not the one (if any) for the
+   template of the underlying type.  */
+#define TYPE_TEMPLATE_INFO(NODE)                                       \
+  (TYPE_ALIAS_P (NODE)                                                 \
+   ? ((TYPE_NAME (NODE) && DECL_LANG_SPECIFIC (TYPE_NAME (NODE)))      \
+      ? DECL_TEMPLATE_INFO (TYPE_NAME (NODE))                          \
+      : NULL_TREE)                                                     \
+   : ((TREE_CODE (NODE) == ENUMERAL_TYPE)                              \
+      ? ENUM_TEMPLATE_INFO (NODE)                                      \
+      : ((TREE_CODE (NODE) == BOUND_TEMPLATE_TEMPLATE_PARM)            \
+        ? TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (NODE)                  \
+        : (CLASS_TYPE_P (NODE)                                         \
+           ? CLASSTYPE_TEMPLATE_INFO (NODE)                            \
+           : NULL_TREE))))
+
 
 /* Set the template information for an ENUMERAL_, RECORD_, or
    UNION_TYPE to VAL.  */
-#define SET_TYPE_TEMPLATE_INFO(NODE, VAL)      \
-  (TREE_CODE (NODE) == ENUMERAL_TYPE           \
-   ? (ENUM_TEMPLATE_INFO (NODE) = (VAL))       \
-   : (CLASSTYPE_TEMPLATE_INFO (NODE) = (VAL)))
+#define SET_TYPE_TEMPLATE_INFO(NODE, VAL)                              \
+  (TREE_CODE (NODE) == ENUMERAL_TYPE                                   \
+   ? (ENUM_TEMPLATE_INFO (NODE) = (VAL))                               \
+   : ((CLASS_TYPE_P (NODE) && !TYPE_ALIAS_P (NODE))                    \
+      ? (CLASSTYPE_TEMPLATE_INFO (NODE) = (VAL))                       \
+      : (DECL_TEMPLATE_INFO (TYPE_NAME (NODE)) = (VAL))))
 
 #define TI_TEMPLATE(NODE) TREE_TYPE (TEMPLATE_INFO_CHECK (NODE))
 #define TI_ARGS(NODE) TREE_CHAIN (TEMPLATE_INFO_CHECK (NODE))
@@ -2790,7 +2843,17 @@ extern void decl_shadowed_for_var_insert (tree, tree);
 #define PACK_EXPANSION_PARAMETER_PACKS(NODE)           \
   *(TREE_CODE (NODE) == EXPR_PACK_EXPANSION            \
     ? &TREE_OPERAND (NODE, 1)                          \
-    : &TREE_CHAIN (TYPE_PACK_EXPANSION_CHECK (NODE)))
+    : &TYPE_MINVAL (TYPE_PACK_EXPANSION_CHECK (NODE)))
+
+/* Any additional template args to be applied when substituting into
+   the pattern, set by tsubst_pack_expansion for partial instantiations.  */
+#define PACK_EXPANSION_EXTRA_ARGS(NODE)                \
+  *(TREE_CODE (NODE) == TYPE_PACK_EXPANSION    \
+    ? &TYPE_MAXVAL (NODE)                      \
+    : &TREE_OPERAND ((NODE), 2))
+
+/* True iff this pack expansion is within a function context.  */
+#define PACK_EXPANSION_LOCAL_P(NODE) TREE_LANG_FLAG_0 (NODE)
 
 /* Determine if this is an argument pack.  */
 #define ARGUMENT_PACK_P(NODE)                          \
@@ -2976,6 +3039,11 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
 #define VEC_INIT_EXPR_VALUE_INIT(NODE) \
   TREE_LANG_FLAG_1 (VEC_INIT_EXPR_CHECK (NODE))
 
+/* The condition under which this MUST_NOT_THROW_EXPR actually blocks
+   exceptions.  NULL_TREE means 'true'.  */
+#define MUST_NOT_THROW_COND(NODE) \
+  TREE_OPERAND (MUST_NOT_THROW_EXPR_CHECK (NODE), 1)
+
 /* The TYPE_MAIN_DECL for a class template type is a TYPE_DECL, not a
    TEMPLATE_DECL.  This macro determines whether or not a given class
    type is really a template type, as opposed to an instantiation or
@@ -3028,6 +3096,13 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
 #define DECL_LOCAL_FUNCTION_P(NODE) \
   DECL_LANG_FLAG_0 (FUNCTION_DECL_CHECK (NODE))
 
+/* True if NODE was declared with auto in its return type, but it has
+   started compilation and so the return type might have been changed by
+   return type deduction; its declared return type should be found in
+   DECL_STRUCT_FUNCTION(NODE)->language->x_auto_return_pattern.  */
+#define FNDECL_USED_AUTO(NODE) \
+  TREE_LANG_FLAG_2 (FUNCTION_DECL_CHECK (NODE))
+
 /* Nonzero if NODE is a DECL which we know about but which has not
    been explicitly declared, such as a built-in function or a friend
    declared inside a class.  In the latter case DECL_HIDDEN_FRIEND_P
@@ -3041,6 +3116,12 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
 #define DECL_HIDDEN_FRIEND_P(NODE) \
   (LANG_DECL_FN_CHECK (DECL_COMMON_CHECK (NODE))->hidden_friend_p)
 
+/* Nonzero if NODE is a FUNCTION_DECL generated by implicitly_declare_fn
+   that we shouldn't actually declare implicitly; it is only used for
+   comparing to an =default declaration.  */
+#define FNDECL_SUPPRESS_IMPLICIT_DECL(NODE) \
+  (LANG_DECL_FN_CHECK (DECL_COMMON_CHECK (NODE))->suppress_implicit_decl)
+
 /* Nonzero if DECL has been declared threadprivate by
    #pragma omp threadprivate.  */
 #define CP_DECL_THREADPRIVATE_P(DECL) \
@@ -3128,7 +3209,7 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
    
    Keep these checks in ascending code order.  */
 #define SCALAR_TYPE_P(TYPE)                    \
-  (TYPE_PTRMEM_P (TYPE)                                \
+  (TYPE_PTRDATAMEM_P (TYPE)                    \
    || TREE_CODE (TYPE) == ENUMERAL_TYPE                \
    || ARITHMETIC_TYPE_P (TYPE)                 \
    || TYPE_PTR_P (TYPE)                                \
@@ -3200,8 +3281,9 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
 
 /* [dcl.init.aggr]
 
-   An aggregate is an array or a class with no user-declared
-   constructors, no private or protected non-static data members, no
+   An aggregate is an array or a class with no user-provided
+   constructors, no brace-or-equal-initializers for non-static data
+   members, no private or protected non-static data members, no
    base classes, and no virtual functions.
 
    As an extension, we also treat vectors as aggregates.  Keep these
@@ -3312,7 +3394,7 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
   (TYPE_HAS_COPY_ASSIGN (NODE) && ! TYPE_HAS_COMPLEX_COPY_ASSIGN (NODE))
 
 /* Returns true if NODE is a pointer-to-data-member.  */
-#define TYPE_PTRMEM_P(NODE)                    \
+#define TYPE_PTRDATAMEM_P(NODE)                        \
   (TREE_CODE (NODE) == OFFSET_TYPE)
 /* Returns true if NODE is a pointer.  */
 #define TYPE_PTR_P(NODE)                       \
@@ -3370,8 +3452,12 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
   (LANG_TYPE_CLASS_CHECK (NODE)->ptrmemfunc_flag)
 
 /* Returns true if NODE is a pointer-to-member.  */
-#define TYPE_PTR_TO_MEMBER_P(NODE) \
-  (TYPE_PTRMEM_P (NODE) || TYPE_PTRMEMFUNC_P (NODE))
+#define TYPE_PTRMEM_P(NODE) \
+  (TYPE_PTRDATAMEM_P (NODE) || TYPE_PTRMEMFUNC_P (NODE))
+
+/* Returns true if NODE is a pointer or a pointer-to-member.  */
+#define TYPE_PTR_OR_PTRMEM_P(NODE) \
+  (TYPE_PTR_P (NODE) || TYPE_PTRMEM_P (NODE))
 
 /* Indicates when overload resolution may resolve to a pointer to
    member function. [expr.unary.op]/3 */
@@ -3409,13 +3495,13 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
    TYPE_PTRMEM_POINTED_TO_TYPE; there, the first parameter will have
    type `const X*'.  */
 #define TYPE_PTRMEM_CLASS_TYPE(NODE)                   \
-  (TYPE_PTRMEM_P (NODE)                                        \
+  (TYPE_PTRDATAMEM_P (NODE)                                    \
    ? TYPE_OFFSET_BASETYPE (NODE)               \
    : TYPE_PTRMEMFUNC_OBJECT_TYPE (NODE))
 
 /* For a pointer-to-member type of the form `T X::*', this is `T'.  */
 #define TYPE_PTRMEM_POINTED_TO_TYPE(NODE)              \
-   (TYPE_PTRMEM_P (NODE)                               \
+   (TYPE_PTRDATAMEM_P (NODE)                           \
     ? TREE_TYPE (NODE)                                 \
     : TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE)))
 
@@ -3614,15 +3700,26 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
    && !DECL_UNBOUND_CLASS_TEMPLATE_P (NODE) \
    && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == FUNCTION_DECL)
 
-/* Nonzero for a DECL that represents a template class.  */
-#define DECL_CLASS_TEMPLATE_P(NODE)                            \
+/* Nonzero for a DECL that represents a class template or alias
+   template.  */
+#define DECL_TYPE_TEMPLATE_P(NODE)                             \
   (TREE_CODE (NODE) == TEMPLATE_DECL                           \
    && DECL_TEMPLATE_RESULT (NODE) != NULL_TREE                 \
+   && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == TYPE_DECL)
+
+/* Nonzero for a DECL that represents a class template.  */
+#define DECL_CLASS_TEMPLATE_P(NODE)                            \
+  (DECL_TYPE_TEMPLATE_P (NODE)                                 \
    && DECL_IMPLICIT_TYPEDEF_P (DECL_TEMPLATE_RESULT (NODE)))
 
-/* Nonzero if NODE which declares a type.  */
+/* Nonzero for a TEMPLATE_DECL that represents an alias template.  */
+#define DECL_ALIAS_TEMPLATE_P(NODE)                    \
+  (DECL_TYPE_TEMPLATE_P (NODE)                         \
+   && !DECL_ARTIFICIAL (DECL_TEMPLATE_RESULT (NODE)))
+
+/* Nonzero for a NODE which declares a type.  */
 #define DECL_DECLARES_TYPE_P(NODE) \
-  (TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE))
+  (TREE_CODE (NODE) == TYPE_DECL || DECL_TYPE_TEMPLATE_P (NODE))
 
 /* Nonzero if NODE declares a function.  */
 #define DECL_DECLARES_FUNCTION_P(NODE) \
@@ -3857,6 +3954,10 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
   TREE_TYPE (OMP_CLAUSE_RANGE_CHECK (NODE, OMP_CLAUSE_PRIVATE, \
                                     OMP_CLAUSE_COPYPRIVATE))
 
+/* Nonzero if this transaction expression's body contains statements.  */
+#define TRANSACTION_EXPR_IS_STMT(NODE) \
+   TREE_LANG_FLAG_0 (TRANSACTION_EXPR_CHECK (NODE))
+
 /* These macros provide convenient access to the various _STMT nodes
    created when parsing template declarations.  */
 #define TRY_STMTS(NODE)                TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 0)
@@ -3945,6 +4046,11 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
   (TREE_CODE (EXPR) == TARGET_EXPR && TREE_LANG_FLAG_2 (EXPR)          \
    && same_type_ignoring_top_level_qualifiers_p (TYPE, TREE_TYPE (EXPR)))
 
+/* True if this CONVERT_EXPR is for a conversion to virtual base in
+   an NSDMI, and should be re-evaluated when used in a constructor.  */
+#define CONVERT_EXPR_VBASE_PATH(NODE) \
+  TREE_LANG_FLAG_0 (CONVERT_EXPR_CHECK (NODE))
+
 /* An enumeration of the kind of tags that C++ accepts.  */
 enum tag_types {
   none_type = 0, /* Not a tag type.  */
@@ -3959,8 +4065,8 @@ enum tag_types {
 enum cp_lvalue_kind_flags {
   clk_none = 0,     /* Things that are not an lvalue.  */
   clk_ordinary = 1, /* An ordinary lvalue.  */
-  clk_rvalueref = 2,/* An rvalue formed using an rvalue reference */
-  clk_class = 4,    /* Arvalue of class-type.  */
+  clk_rvalueref = 2,/* An xvalue (rvalue formed using an rvalue reference) */
+  clk_class = 4,    /* A prvalue of class-type.  */
   clk_bitfield = 8, /* An lvalue for a bit-field.  */
   clk_packed = 16   /* An lvalue for a packed field.  */
 };
@@ -4066,6 +4172,8 @@ enum tsubst_flags {
                                    conversion.  */
   tf_no_access_control = 1 << 7, /* Do not perform access checks, even
                                    when issuing other errors.   */
+  tf_partial = 1 << 8,          /* Doing initial explicit argument
+                                   substitution in fn_type_unification.  */
   /* Convenient substitution flags combinations.  */
   tf_warning_or_error = tf_warning | tf_error
 };
@@ -4228,6 +4336,17 @@ extern GTY(()) VEC(tree,gc) *local_classes;
              LAMBDANAME_PREFIX, \
             sizeof (LAMBDANAME_PREFIX) - 1))
 
+#define UDLIT_OP_ANSI_PREFIX "operator\"\" "
+#define UDLIT_OP_ANSI_FORMAT UDLIT_OP_ANSI_PREFIX "%s"
+#define UDLIT_OP_MANGLED_PREFIX "li"
+#define UDLIT_OP_MANGLED_FORMAT UDLIT_OP_MANGLED_PREFIX "%s"
+#define UDLIT_OPER_P(ID_NODE) \
+  (!strncmp (IDENTIFIER_POINTER (ID_NODE), \
+             UDLIT_OP_ANSI_PREFIX, \
+            sizeof (UDLIT_OP_ANSI_PREFIX) - 1))
+#define UDLIT_OP_SUFFIX(ID_NODE) \
+  (IDENTIFIER_POINTER (ID_NODE) + sizeof (UDLIT_OP_ANSI_PREFIX) - 1)
+
 #if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL)
 
 #define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
@@ -4266,16 +4385,13 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, TYPENAME_FLAG };
    behaviors relevant to them.  */
 /* Check for access violations.  */
 #define LOOKUP_PROTECT (1 << 0)
-/* Complain if no suitable member function matching the arguments is
-   found.  */
-#define LOOKUP_COMPLAIN (1 << 1)
-#define LOOKUP_NORMAL (LOOKUP_PROTECT | LOOKUP_COMPLAIN)
+#define LOOKUP_NORMAL (LOOKUP_PROTECT)
 /* Even if the function found by lookup is a virtual function, it
    should be called directly.  */
-#define LOOKUP_NONVIRTUAL (1 << 2)
+#define LOOKUP_NONVIRTUAL (1 << 1)
 /* Non-converting (i.e., "explicit") constructors are not tried.  This flag
    indicates that we are not performing direct-initialization.  */
-#define LOOKUP_ONLYCONVERTING (1 << 3)
+#define LOOKUP_ONLYCONVERTING (1 << 2)
 #define LOOKUP_IMPLICIT (LOOKUP_NORMAL | LOOKUP_ONLYCONVERTING)
 /* If a temporary is created, it should be created so that it lives
    as long as the current variable bindings; otherwise it only lives
@@ -4283,20 +4399,20 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, TYPENAME_FLAG };
    direct-initialization in cases where other parts of the compiler
    have already generated a temporary, such as reference
    initialization and the catch parameter.  */
-#define DIRECT_BIND (1 << 4)
+#define DIRECT_BIND (1 << 3)
 /* We're performing a user-defined conversion, so more user-defined
    conversions are not permitted (only built-in conversions).  */
-#define LOOKUP_NO_CONVERSION (1 << 5)
+#define LOOKUP_NO_CONVERSION (1 << 4)
 /* The user has explicitly called a destructor.  (Therefore, we do
    not need to check that the object is non-NULL before calling the
    destructor.)  */
-#define LOOKUP_DESTRUCTOR (1 << 6)
+#define LOOKUP_DESTRUCTOR (1 << 5)
 /* Do not permit references to bind to temporaries.  */
-#define LOOKUP_NO_TEMP_BIND (1 << 7)
+#define LOOKUP_NO_TEMP_BIND (1 << 6)
 /* Do not accept objects, and possibly namespaces.  */
-#define LOOKUP_PREFER_TYPES (1 << 8)
+#define LOOKUP_PREFER_TYPES (1 << 7)
 /* Do not accept objects, and possibly types.   */
-#define LOOKUP_PREFER_NAMESPACES (1 << 9)
+#define LOOKUP_PREFER_NAMESPACES (1 << 8)
 /* Accept types or namespaces.  */
 #define LOOKUP_PREFER_BOTH (LOOKUP_PREFER_TYPES | LOOKUP_PREFER_NAMESPACES)
 /* Return friend declarations and un-declared builtin functions.
@@ -4307,20 +4423,17 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, TYPENAME_FLAG };
 #define LOOKUP_PREFER_RVALUE (LOOKUP_HIDDEN << 1)
 /* We're inside an init-list, so narrowing conversions are ill-formed.  */
 #define LOOKUP_NO_NARROWING (LOOKUP_PREFER_RVALUE << 1)
-/* Avoid user-defined conversions for the first parameter of a copy
-   constructor (or move constructor).  */
-#define LOOKUP_NO_COPY_CTOR_CONVERSION (LOOKUP_NO_NARROWING << 1)
+/* We're looking up a constructor for list-initialization.  */
+#define LOOKUP_LIST_INIT_CTOR (LOOKUP_NO_NARROWING << 1)
 /* This is the first parameter of a copy constructor.  */
-#define LOOKUP_COPY_PARM (LOOKUP_NO_COPY_CTOR_CONVERSION << 1)
+#define LOOKUP_COPY_PARM (LOOKUP_LIST_INIT_CTOR << 1)
 /* We only want to consider list constructors.  */
 #define LOOKUP_LIST_ONLY (LOOKUP_COPY_PARM << 1)
 /* Return after determining which function to call and checking access.
    Used by sythesized_method_walk to determine which functions will
    be called to initialize subobjects, in order to determine exception
    specification and possible implicit delete.
-   This is kind of a hack, but since access control doesn't respect SFINAE
-   we can't just use tf_none to avoid access control errors, we need
-   another mechanism.  Exiting early also avoids problems with trying
+   This is kind of a hack, but exiting early avoids problems with trying
    to perform argument conversions when the class isn't complete yet.  */
 #define LOOKUP_SPECULATIVE (LOOKUP_LIST_ONLY << 1)
 /* Used by calls from defaulted functions to limit the overload set to avoid
@@ -4422,9 +4535,6 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, TYPENAME_FLAG };
        ((template_parm_index*)TEMPLATE_PARM_INDEX_CHECK (NODE))
 #define TEMPLATE_PARM_IDX(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->index)
 #define TEMPLATE_PARM_LEVEL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->level)
-/* The Number of sibling parms this template parm has.  */
-#define TEMPLATE_PARM_NUM_SIBLINGS(NODE) \
-  (TEMPLATE_PARM_INDEX_CAST (NODE)->num_siblings)
 #define TEMPLATE_PARM_DESCENDANTS(NODE) (TREE_CHAIN (NODE))
 #define TEMPLATE_PARM_ORIG_LEVEL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->orig_level)
 #define TEMPLATE_PARM_DECL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->decl)
@@ -4547,7 +4657,9 @@ typedef enum cp_storage_class {
   sc_mutable
 } cp_storage_class;
 
-/* An individual decl-specifier.  */
+/* An individual decl-specifier.  This is used to index the array of
+   locations for the declspecs in struct cp_decl_specifier_seq
+   below.  */
 
 typedef enum cp_decl_spec {
   ds_first,
@@ -4563,20 +4675,24 @@ typedef enum cp_decl_spec {
   ds_explicit,
   ds_friend,
   ds_typedef,
+  ds_alias,
   ds_constexpr,
   ds_complex,
   ds_thread,
-  ds_last
+  ds_type_spec,
+  ds_redefined_builtin_type_spec,
+  ds_attribute,
+  ds_storage_class,
+  ds_long_long,
+  ds_last /* This enumerator must always be the last one.  */
 } cp_decl_spec;
 
 /* A decl-specifier-seq.  */
 
 typedef struct cp_decl_specifier_seq {
-  /* The number of times each of the keywords has been seen.  */
-  unsigned specs[(int) ds_last];
-  /* The location of the primary type. Mainly used for error
-     reporting.  */
-  location_t type_location;
+  /* An array of locations for the declaration sepecifiers, indexed by
+     enum cp_decl_spec_word.  */
+  source_location locations[ds_last];
   /* The primary type, if any, given by the decl-specifier-seq.
      Modifiers, like "short", "const", and "unsigned" are not
      reflected here.  This field will be a TYPE, unless a typedef-name
@@ -4726,6 +4842,8 @@ struct GTY((chain_next ("%h.next"))) tinst_level {
   bool in_system_header_p;
 };
 
+bool decl_spec_seq_has_spec_p (const cp_decl_specifier_seq *, cp_decl_spec);
+
 /* Return the type of the `this' parameter of FNTYPE.  */
 
 static inline tree
@@ -4757,7 +4875,7 @@ extern bool check_dtor_name                       (tree, tree);
 
 extern tree build_conditional_expr             (tree, tree, tree, 
                                                  tsubst_flags_t);
-extern tree build_addr_func                    (tree);
+extern tree build_addr_func                    (tree, tsubst_flags_t);
 extern void set_flags_from_callee              (tree);
 extern tree build_call_a                       (tree, int, tree*);
 extern tree build_call_n                       (tree, int, ...);
@@ -4765,38 +4883,46 @@ extern bool null_ptr_cst_p                      (tree);
 extern bool null_member_pointer_value_p                (tree);
 extern bool sufficient_parms_p                 (const_tree);
 extern tree type_decays_to                     (tree);
-extern tree build_user_type_conversion         (tree, tree, int);
+extern tree build_user_type_conversion         (tree, tree, int,
+                                                tsubst_flags_t);
 extern tree build_new_function_call            (tree, VEC(tree,gc) **, bool, 
                                                 tsubst_flags_t);
 extern tree build_operator_new_call            (tree, VEC(tree,gc) **, tree *,
-                                                tree *, tree *);
+                                                tree *, tree *,
+                                                tsubst_flags_t);
 extern tree build_new_method_call              (tree, tree, VEC(tree,gc) **,
                                                 tree, int, tree *,
                                                 tsubst_flags_t);
 extern tree build_special_member_call          (tree, tree, VEC(tree,gc) **,
                                                 tree, int, tsubst_flags_t);
-extern tree build_new_op                       (enum tree_code, int, tree, 
-                                                tree, tree, tree *,
+extern tree build_new_op                       (location_t, enum tree_code,
+                                                int, tree, tree, tree, tree *,
                                                 tsubst_flags_t);
 extern tree build_op_call                      (tree, VEC(tree,gc) **,
                                                 tsubst_flags_t);
-extern tree build_op_delete_call               (enum tree_code, tree, tree, bool, tree, tree);
-extern bool can_convert                                (tree, tree);
-extern bool can_convert_arg                    (tree, tree, tree, int);
-extern bool can_convert_arg_bad                        (tree, tree, tree, int);
-extern bool enforce_access                     (tree, tree, tree);
+extern tree build_op_delete_call               (enum tree_code, tree, tree,
+                                                bool, tree, tree,
+                                                tsubst_flags_t);
+extern bool can_convert                                (tree, tree, tsubst_flags_t);
+extern bool can_convert_arg                    (tree, tree, tree, int,
+                                                tsubst_flags_t);
+extern bool can_convert_arg_bad                        (tree, tree, tree, int,
+                                                tsubst_flags_t);
+extern bool enforce_access                     (tree, tree, tree,
+                                                tsubst_flags_t);
 extern void push_defarg_context                        (tree);
 extern void pop_defarg_context                 (void);
-extern tree convert_default_arg                        (tree, tree, tree, int);
-extern tree convert_arg_to_ellipsis            (tree);
-extern tree build_x_va_arg                     (tree, tree);
+extern tree convert_default_arg                        (tree, tree, tree, int,
+                                                tsubst_flags_t);
+extern tree convert_arg_to_ellipsis            (tree, tsubst_flags_t);
+extern tree build_x_va_arg                     (source_location, tree, tree);
 extern tree cxx_type_promotes_to               (tree);
 extern tree type_passed_as                     (tree);
-extern tree convert_for_arg_passing            (tree, tree);
+extern tree convert_for_arg_passing            (tree, tree, tsubst_flags_t);
 extern bool is_properly_derived_from           (tree, tree);
-extern tree set_up_extended_ref_temp           (tree, tree, tree *, tree *);
-extern tree initialize_reference               (tree, tree, tree, tree *, int,
+extern tree initialize_reference               (tree, tree, int,
                                                 tsubst_flags_t);
+extern tree extend_ref_init_temps              (tree, tree, VEC(tree,gc)**);
 extern tree make_temporary_var_for_ref_to_temp (tree, tree);
 extern tree strip_top_quals                    (tree);
 extern bool reference_related_p                        (tree, tree);
@@ -4881,18 +5007,23 @@ extern void fixup_attribute_variants            (tree);
 extern tree* decl_cloned_function_p            (const_tree, bool);
 extern void clone_function_decl                        (tree, int);
 extern void adjust_clone_args                  (tree);
+extern void deduce_noexcept_on_destructor       (tree);
+extern void insert_late_enum_def_into_classtype_sorted_fields (tree, tree);
 
 /* in cvt.c */
-extern tree convert_to_reference               (tree, tree, int, int, tree);
+extern tree convert_to_reference               (tree, tree, int, int, tree,
+                                                tsubst_flags_t);
 extern tree convert_from_reference             (tree);
 extern tree force_rvalue                       (tree, tsubst_flags_t);
-extern tree ocp_convert                                (tree, tree, int, int);
-extern tree cp_convert                         (tree, tree);
-extern tree cp_convert_and_check                (tree, tree);
+extern tree ocp_convert                                (tree, tree, int, int,
+                                                tsubst_flags_t);
+extern tree cp_convert                         (tree, tree, tsubst_flags_t);
+extern tree cp_convert_and_check                (tree, tree, tsubst_flags_t);
 extern tree cp_fold_convert                    (tree, tree);
 extern tree convert_to_void                    (tree, impl_conv_void,
                                                 tsubst_flags_t);
-extern tree convert_force                      (tree, tree, int);
+extern tree convert_force                      (tree, tree, int,
+                                                tsubst_flags_t);
 extern tree build_expr_type_conversion         (int, tree, bool);
 extern tree type_promotes_to                   (tree);
 extern tree perform_qualification_conversions  (tree, tree);
@@ -5009,7 +5140,7 @@ extern void maybe_make_one_only                   (tree);
 extern bool vague_linkage_p                    (tree);
 extern void grokclassfn                                (tree, tree,
                                                 enum overload_flags);
-extern tree grok_array_decl                    (tree, tree);
+extern tree grok_array_decl                    (location_t, tree, tree);
 extern tree delete_sanity                      (tree, tree, bool, int, tsubst_flags_t);
 extern tree check_classfn                      (tree, tree, tree);
 extern void check_member_template              (tree);
@@ -5032,13 +5163,12 @@ extern tree build_offset_ref_call_from_tree     (tree, VEC(tree,gc) **);
 extern bool decl_constant_var_p                        (tree);
 extern bool decl_maybe_constant_var_p          (tree);
 extern void check_default_args                 (tree);
-extern void mark_used                          (tree);
+extern bool mark_used                          (tree);
 extern void finish_static_data_member_decl     (tree, tree, bool, tree, int);
 extern tree cp_build_parm_decl                 (tree, tree);
 extern tree get_guard                          (tree);
 extern tree get_guard_cond                     (tree);
 extern tree set_guard                          (tree);
-extern tree cxx_callgraph_analyze_expr         (tree *, int *);
 extern void mark_needed                                (tree);
 extern bool decl_needed_p                      (tree);
 extern void note_vague_linkage_fn              (tree);
@@ -5052,8 +5182,10 @@ extern const char *type_as_string                (tree, int);
 extern const char *type_as_string_translate    (tree, int);
 extern const char *decl_as_string              (tree, int);
 extern const char *decl_as_string_translate    (tree, int);
+extern const char *decl_as_dwarf_string                (tree, int);
 extern const char *expr_as_string              (tree, int);
 extern const char *lang_decl_name              (tree, int, bool);
+extern const char *lang_decl_dwarf_name                (tree, int, bool);
 extern const char *language_to_string          (enum languages);
 extern const char *class_key_or_enum_as_string (tree);
 extern void print_instantiation_context                (void);
@@ -5080,6 +5212,7 @@ extern bool type_noexcept_p                       (const_tree);
 extern bool type_throw_all_p                   (const_tree);
 extern tree build_noexcept_spec                        (tree, int);
 extern void choose_personality_routine         (enum languages);
+extern tree build_must_not_throw_expr          (tree,tree);
 extern tree eh_type_info                       (tree);
 extern tree begin_eh_spec_block                        (void);
 extern void finish_eh_spec_block               (tree, tree);
@@ -5166,6 +5299,8 @@ extern tree get_copy_assign                       (tree);
 extern tree get_default_ctor                   (tree);
 extern tree get_dtor                           (tree, tsubst_flags_t);
 extern tree locate_ctor                                (tree);
+extern tree implicitly_declare_fn               (special_function_kind, tree,
+                                                bool);
 
 /* In optimize.c */
 extern bool maybe_clone_body                   (tree);
@@ -5191,9 +5326,8 @@ extern void append_type_to_template_for_access_check (tree, tree, tree,
 extern tree splice_late_return_type            (tree, tree);
 extern bool is_auto                            (const_tree);
 extern tree process_template_parm              (tree, location_t, tree, 
-                                                bool, bool, unsigned);
+                                                bool, bool);
 extern tree end_template_parm_list             (tree);
-void fixup_template_parms (void);
 extern void end_template_decl                  (void);
 extern tree maybe_update_decl_type             (tree, tree);
 extern bool check_default_tmpl_args             (tree, tree, int, int, int);
@@ -5205,6 +5339,7 @@ extern tree lookup_template_class         (tree, tree, tree, tree,
 extern tree lookup_template_function           (tree, tree);
 extern int uses_template_parms                 (tree);
 extern int uses_template_parms_level           (tree, int);
+extern bool in_template_function               (void);
 extern tree instantiate_class_template         (tree);
 extern tree instantiate_template               (tree, tree, tsubst_flags_t);
 extern int fn_type_unification                 (tree, tree, tree,
@@ -5266,14 +5401,16 @@ extern tree build_non_dependent_expr            (tree);
 extern void make_args_non_dependent            (VEC(tree,gc) *);
 extern bool reregister_specialization          (tree, tree, tree);
 extern tree fold_non_dependent_expr            (tree);
+extern bool alias_type_or_template_p            (tree);
+extern bool alias_template_specialization_p     (tree);
 extern bool explicit_class_specialization_p     (tree);
 extern int push_tinst_level                     (tree);
 extern void pop_tinst_level                     (void);
 extern struct tinst_level *outermost_tinst_level(void);
-extern bool parameter_of_template_p            (tree, tree);
 extern void init_template_processing           (void);
 extern void print_template_statistics          (void);
 bool template_template_parameter_p             (const_tree);
+bool template_type_parameter_p                  (const_tree);
 extern bool primary_template_instantiation_p    (const_tree);
 extern tree get_primary_template_innermost_parameters  (const_tree);
 extern tree get_template_parms_at_level (tree, int);
@@ -5312,9 +5449,11 @@ extern tree lookup_field_1                       (tree, tree, bool);
 extern tree lookup_field                       (tree, tree, int, bool);
 extern int lookup_fnfields_1                   (tree, tree);
 extern tree lookup_fnfields_slot               (tree, tree);
+extern tree lookup_fnfields_slot_nolazy                (tree, tree);
 extern int class_method_index_for_fn           (tree, tree);
 extern tree lookup_fnfields                    (tree, tree, int);
-extern tree lookup_member                      (tree, tree, int, bool);
+extern tree lookup_member                      (tree, tree, int, bool,
+                                                tsubst_flags_t);
 extern int look_for_overrides                  (tree, tree);
 extern void get_pure_virtuals                  (tree);
 extern void maybe_suppress_debug_info          (tree);
@@ -5353,6 +5492,8 @@ typedef struct GTY(()) deferred_access_check {
   tree decl;
   /* The declaration that should be used in the error message.  */
   tree diag_decl;
+  /* The location of this access.  */
+  location_t loc;
 } deferred_access_check;
 DEF_VEC_O(deferred_access_check);
 DEF_VEC_ALLOC_O(deferred_access_check,gc);
@@ -5364,14 +5505,16 @@ extern void stop_deferring_access_checks        (void);
 extern void pop_deferring_access_checks                (void);
 extern VEC (deferred_access_check,gc)* get_deferred_access_checks              (void);
 extern void pop_to_parent_deferring_access_checks (void);
-extern void perform_access_checks              (VEC (deferred_access_check,gc)*);
-extern void perform_deferred_access_checks     (void);
-extern void perform_or_defer_access_check      (tree, tree, tree);
-extern bool speculative_access_check           (tree, tree, tree, bool);
+extern bool perform_access_checks (VEC (deferred_access_check,gc)*,
+                                  tsubst_flags_t);
+extern bool perform_deferred_access_checks     (tsubst_flags_t);
+extern bool perform_or_defer_access_check      (tree, tree, tree,
+                                                tsubst_flags_t);
 extern int stmts_are_full_exprs_p              (void);
 extern void init_cp_semantics                  (void);
 extern tree do_poplevel                                (tree);
 extern void add_decl_expr                      (tree);
+extern tree maybe_cleanup_point_expr_void      (tree);
 extern tree finish_expr_stmt                   (tree);
 extern tree begin_if_stmt                      (void);
 extern void finish_if_stmt_cond                        (tree, tree);
@@ -5454,13 +5597,13 @@ extern tree finish_call_expr                    (tree, VEC(tree,gc) **, bool,
 extern tree finish_increment_expr              (tree, enum tree_code);
 extern tree finish_this_expr                   (void);
 extern tree finish_pseudo_destructor_expr       (tree, tree, tree);
-extern tree finish_unary_op_expr               (enum tree_code, tree);
+extern tree finish_unary_op_expr               (location_t, enum tree_code, tree);
 extern tree finish_compound_literal            (tree, tree, tsubst_flags_t);
 extern tree finish_fname                       (tree);
 extern void finish_translation_unit            (void);
 extern tree finish_template_type_parm          (tree, tree);
 extern tree finish_template_template_parm       (tree, tree);
-extern tree begin_class_definition             (tree, tree);
+extern tree begin_class_definition             (tree);
 extern void finish_template_decl               (tree);
 extern tree finish_template_type               (tree, tree, int);
 extern tree finish_base_specifier              (tree, tree, bool);
@@ -5507,6 +5650,9 @@ extern void finish_omp_atomic                     (enum tree_code, enum tree_code,
 extern void finish_omp_barrier                 (void);
 extern void finish_omp_flush                   (void);
 extern void finish_omp_taskwait                        (void);
+extern tree begin_transaction_stmt             (location_t, tree *, int);
+extern void finish_transaction_stmt            (tree, tree, int, tree);
+extern tree build_transaction_expr             (location_t, tree, int, tree);
 extern void finish_omp_taskyield               (void);
 extern bool cxx_omp_create_clause_info         (tree, tree, bool, bool, bool);
 extern tree baselink_for_fns                    (tree);
@@ -5521,10 +5667,11 @@ extern tree lambda_capture_field_type           (tree);
 extern tree lambda_return_type                 (tree);
 extern tree lambda_proxy_type                  (tree);
 extern tree lambda_function                    (tree);
-extern void apply_lambda_return_type            (tree, tree);
+extern void apply_deduced_return_type           (tree, tree);
 extern tree add_capture                         (tree, tree, tree, bool, bool);
 extern tree add_default_capture                 (tree, tree, tree);
 extern tree build_capture_proxy                        (tree);
+extern void insert_capture_proxy               (tree);
 extern void insert_pending_capture_proxies     (void);
 extern bool is_capture_proxy                   (tree);
 extern bool is_normal_capture_proxy             (tree);
@@ -5557,15 +5704,18 @@ extern bool type_has_nontrivial_copy_init       (const_tree);
 extern bool class_tmpl_impl_spec_p             (const_tree);
 extern int zero_init_p                         (const_tree);
 extern tree strip_typedefs                     (tree);
+extern tree strip_typedefs_expr                        (tree);
 extern tree copy_binfo                         (tree, tree, tree,
                                                 tree *, int);
 extern int member_p                            (const_tree);
 extern cp_lvalue_kind real_lvalue_p            (const_tree);
 extern cp_lvalue_kind lvalue_kind              (const_tree);
 extern bool lvalue_or_rvalue_with_address_p    (const_tree);
+extern bool xvalue_p                           (const_tree);
 extern bool builtin_valid_in_constant_expr_p    (const_tree);
 extern tree build_min                          (enum tree_code, tree, ...);
-extern tree build_min_nt                       (enum tree_code, ...);
+extern tree build_min_nt_loc                   (location_t, enum tree_code,
+                                                ...);
 extern tree build_min_non_dep                  (enum tree_code, tree, ...);
 extern tree build_min_non_dep_call_vec         (tree, tree, VEC(tree,gc) *);
 extern tree build_cplus_new                    (tree, tree, tsubst_flags_t);
@@ -5581,10 +5731,12 @@ extern tree hash_tree_cons                      (tree, tree, tree);
 extern tree hash_tree_chain                    (tree, tree);
 extern tree build_qualified_name               (tree, tree, tree, bool);
 extern int is_overloaded_fn                    (tree);
+extern tree dependent_name                     (tree);
 extern tree get_fns                            (tree);
 extern tree get_first_fn                       (tree);
 extern tree ovl_cons                           (tree, tree);
 extern tree build_overload                     (tree, tree);
+extern tree ovl_scope                          (tree);
 extern bool non_static_member_function_p        (tree);
 extern const char *cxx_printable_name          (tree, int);
 extern const char *cxx_printable_name_translate        (tree, int);
@@ -5669,42 +5821,46 @@ extern tree cxx_sizeof_or_alignof_type          (tree, enum tree_code, bool);
 extern tree cxx_sizeof_nowarn                   (tree);
 extern tree is_bitfield_expr_with_lowered_type  (const_tree);
 extern tree unlowered_expr_type                 (const_tree);
-extern tree decay_conversion                   (tree);
+extern tree decay_conversion                   (tree, tsubst_flags_t);
 extern tree build_class_member_access_expr      (tree, tree, tree, bool,
                                                 tsubst_flags_t);
 extern tree finish_class_member_access_expr     (tree, tree, bool, 
                                                 tsubst_flags_t);
-extern tree build_x_indirect_ref               (tree, ref_operator, 
-                                                 tsubst_flags_t);
+extern tree build_x_indirect_ref               (location_t, tree,
+                                                ref_operator, tsubst_flags_t);
 extern tree cp_build_indirect_ref              (tree, ref_operator,
                                                  tsubst_flags_t);
 extern tree build_array_ref                    (location_t, tree, tree);
 extern tree cp_build_array_ref                 (location_t, tree, tree,
                                                 tsubst_flags_t);
-extern tree get_member_function_from_ptrfunc   (tree *, tree);
+extern tree get_member_function_from_ptrfunc   (tree *, tree, tsubst_flags_t);
 extern tree cp_build_function_call              (tree, tree, tsubst_flags_t);
 extern tree cp_build_function_call_nary         (tree, tsubst_flags_t, ...)
                                                ATTRIBUTE_SENTINEL;
 extern tree cp_build_function_call_vec         (tree, VEC(tree,gc) **,
                                                 tsubst_flags_t);
-extern tree build_x_binary_op                  (enum tree_code, tree,
+extern tree build_x_binary_op                  (location_t,
+                                                enum tree_code, tree,
                                                 enum tree_code, tree,
                                                 enum tree_code, tree *,
                                                 tsubst_flags_t);
-extern tree build_x_array_ref                  (tree, tree, tsubst_flags_t);
-extern tree build_x_unary_op                   (enum tree_code, tree,
+extern tree build_x_array_ref                  (location_t, tree, tree,
+                                                tsubst_flags_t);
+extern tree build_x_unary_op                   (location_t,
+                                                enum tree_code, tree,
                                                  tsubst_flags_t);
 extern tree cp_build_addr_expr                 (tree, tsubst_flags_t);
 extern tree cp_build_addr_expr_strict          (tree, tsubst_flags_t);
 extern tree cp_build_unary_op                   (enum tree_code, tree, int, 
                                                  tsubst_flags_t);
 extern tree unary_complex_lvalue               (enum tree_code, tree);
-extern tree build_x_conditional_expr           (tree, tree, tree, 
+extern tree build_x_conditional_expr           (location_t, tree, tree, tree, 
                                                  tsubst_flags_t);
 extern tree build_x_compound_expr_from_list    (tree, expr_list_kind,
                                                 tsubst_flags_t);
 extern tree build_x_compound_expr_from_vec     (VEC(tree,gc) *, const char *);
-extern tree build_x_compound_expr              (tree, tree, tsubst_flags_t);
+extern tree build_x_compound_expr              (location_t, tree, tree,
+                                                tsubst_flags_t);
 extern tree build_compound_expr                 (location_t, tree, tree);
 extern tree cp_build_compound_expr             (tree, tree, tsubst_flags_t);
 extern tree build_static_cast                  (tree, tree, tsubst_flags_t);
@@ -5712,7 +5868,8 @@ extern tree build_reinterpret_cast                (tree, tree, tsubst_flags_t);
 extern tree build_const_cast                   (tree, tree, tsubst_flags_t);
 extern tree build_c_cast                       (location_t, tree, tree);
 extern tree cp_build_c_cast                    (tree, tree, tsubst_flags_t);
-extern tree build_x_modify_expr                        (tree, enum tree_code, tree,
+extern tree build_x_modify_expr                        (location_t, tree,
+                                                enum tree_code, tree,
                                                 tsubst_flags_t);
 extern tree cp_build_modify_expr               (tree, enum tree_code, tree,
                                                 tsubst_flags_t);
@@ -5752,12 +5909,16 @@ extern tree build_nop                           (tree, tree);
 extern tree non_reference                      (tree);
 extern tree lookup_anon_field                  (tree, tree);
 extern bool invalid_nonstatic_memfn_p          (const_tree, tsubst_flags_t);
-extern tree convert_member_func_to_ptr         (tree, tree);
+extern tree convert_member_func_to_ptr         (tree, tree, tsubst_flags_t);
 extern tree convert_ptrmem                     (tree, tree, bool, bool,
                                                 tsubst_flags_t);
 extern int lvalue_or_else                      (tree, enum lvalue_use,
                                                  tsubst_flags_t);
 extern void check_template_keyword             (tree);
+extern bool check_raw_literal_operator         (const_tree decl);
+extern bool check_literal_operator_args                (const_tree, bool *, bool *);
+extern void maybe_warn_about_useless_cast       (tree, tree, tsubst_flags_t);
+extern tree cp_perform_integral_promotions      (tree, tsubst_flags_t);
 
 /* in typeck2.c */
 extern void require_complete_eh_spec_types     (tree, tree);
@@ -5773,13 +5934,14 @@ extern void complete_type_check_abstract        (tree);
 extern int abstract_virtuals_error             (tree, tree);
 extern int abstract_virtuals_error_sfinae      (tree, tree, tsubst_flags_t);
 
-extern tree store_init_value                   (tree, tree, int);
+extern tree store_init_value                   (tree, tree, VEC(tree,gc)**, int);
 extern void check_narrowing                    (tree, tree);
 extern tree digest_init                                (tree, tree, tsubst_flags_t);
 extern tree digest_init_flags                  (tree, tree, int);
 extern tree build_scoped_ref                   (tree, tree, tree *);
-extern tree build_x_arrow                      (tree);
-extern tree build_m_component_ref              (tree, tree);
+extern tree build_x_arrow                      (location_t, tree,
+                                                tsubst_flags_t);
+extern tree build_m_component_ref              (tree, tree, tsubst_flags_t);
 extern tree build_functional_cast              (tree, tree, tsubst_flags_t);
 extern tree add_exception_specifier            (tree, tree, int);
 extern tree merge_exception_specifiers         (tree, tree, tree);
@@ -5825,7 +5987,8 @@ extern void cxx_omp_finish_clause         (tree);
 extern bool cxx_omp_privatize_by_reference     (const_tree);
 
 /* in name-lookup.c */
-extern void suggest_alternatives_for (location_t, tree);
+extern void suggest_alternatives_for            (location_t, tree);
+extern tree strip_using_decl                    (tree);
 
 /* -- end of C++ */