diff options
Diffstat (limited to 'gcc/cp')
37 files changed, 2788 insertions, 2772 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 789815f..28b08ad 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -6378,7 +6378,7 @@ (cp_parser_direct_declarator): Likewise. * pt.c (tsubst): Likewise. (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand - for COMPONENT_REF. + for COMPONENT_REF. * semantics.c (finish_non_static_data_member): Add new operand for COMPONENT_REF. * typeck.c (build_class_member_access_expr): Likewise. diff --git a/gcc/cp/ChangeLog-1999 b/gcc/cp/ChangeLog-1999 index 2342d11..4b17345 100644 --- a/gcc/cp/ChangeLog-1999 +++ b/gcc/cp/ChangeLog-1999 @@ -454,8 +454,8 @@ Greg McGary <gkm@gnu.org> * decl.c (duplicate_decls): Merge - DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, - DECL_NO_CHECK_MEMORY_USAGE, DECL_NO_LIMIT_STACK. + DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, + DECL_NO_CHECK_MEMORY_USAGE, DECL_NO_LIMIT_STACK. 1999-12-02 Mike Stump <mrs@wrs.com> @@ -860,7 +860,7 @@ Thu Nov 11 12:42:11 MST 1999 Diego Novillo <dnovillo@cygnus.com> * pt.c (tsubst_enum): Adjust according to build_enumerator changes. Wed Nov 10 12:43:21 1999 Philippe De Muyter <phdm@macqel.be> - Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'. @@ -2183,8 +2183,8 @@ Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * g++spec.c: Include gcc.h. (lang_specific_driver): Constify a char*. Call xcalloc, not - xmalloc/bzero. All calls to the function pointer parameter now - explicitly call `fatal'. + xmalloc/bzero. All calls to the function pointer parameter now + explicitly call `fatal'. 1999-09-12 Mark Mitchell <mark@codesourcery.com> @@ -4791,7 +4791,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva <oliva@dcc.unicamp.br> (pt.c): Or CP_TYPE_QUALS for an ERROR_MARK. (typeck.c): Or TYPE_MAIN_VARIANT for a type. - * pt.c (for_each_template_parm): Rework to match documentation. + * pt.c (for_each_template_parm): Rework to match documentation. Don't be fooled by a COMPONENT_REF with no TREE_TYPE. 1999-05-20 Jason Merrill <jason@yorick.cygnus.com> diff --git a/gcc/cp/ChangeLog-2003 b/gcc/cp/ChangeLog-2003 index 07ed1ed..1cd19fa 100644 --- a/gcc/cp/ChangeLog-2003 +++ b/gcc/cp/ChangeLog-2003 @@ -85,12 +85,12 @@ 2003-12-22 Andrew Pinski <pinskia@physics.uc.edu> PR c++/5050 - * tree.c (cp_start_inlining): Remove. - (cp_end_inlining): Remove. - * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Do not define. - (LANG_HOOKS_TREE_INLINING_END_INLINING): Do not define. - * cp-tree.h (cp_start_inlining): Do not declare. - (cp_end_inlining): Do not declare. + * tree.c (cp_start_inlining): Remove. + (cp_end_inlining): Remove. + * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Do not define. + (LANG_HOOKS_TREE_INLINING_END_INLINING): Do not define. + * cp-tree.h (cp_start_inlining): Do not declare. + (cp_end_inlining): Do not declare. 2003-12-22 Mark Mitchell <mark@codesourcery.com> @@ -304,7 +304,7 @@ * decl.c (xref_basetypes): Check java class inheritance. * decl2.c (check_java_method): Skip artificial params. - PR c++/13241 + PR c++/13241 C++ ABI change. Mangling of symbols in expressions. * mangle.c (write_mangled_name): Add top_level flag. Rework for nested and unnested mangling. Deal with abi version 1 and version @@ -514,8 +514,8 @@ 2003-12-02 Richard Henderson <rth@redhat.com> * name-lookup.h (struct cp_binding_level): Use ENUM_BITFIELD. - * parser.c (struct cp_token): Likewise. - (struct cp_parser_token_tree_map_node): Likewise. + * parser.c (struct cp_token): Likewise. + (struct cp_parser_token_tree_map_node): Likewise. * lex.c (struct resword): Move const after ENUM_BITFIELD. 2003-11-30 Mark Mitchell <mark@codesourcery.com> @@ -630,11 +630,11 @@ 2003-11-14 Giovanni Bajo <giovannibajo@libero.it> - PR c++/2294 - * name-lookup.c (push_overloaded_decl): Always construct an OVERLOAD - unless the declaration is a built-in. - (set_namespace_binding): While binding OVERLOADs with only one - declaration, we still need to call supplement_binding. + PR c++/2294 + * name-lookup.c (push_overloaded_decl): Always construct an OVERLOAD + unless the declaration is a built-in. + (set_namespace_binding): While binding OVERLOADs with only one + declaration, we still need to call supplement_binding. 2003-11-14 Mark Mitchell <mark@codesourcery.com> @@ -647,9 +647,9 @@ 2003-11-14 Giovanni Bajo <giovannibajo@libero.it> - PR c++/2094 - * pt.c (unify): Add support for PTRMEM_CST and - FIELD_DECL unification. + PR c++/2094 + * pt.c (unify): Add support for PTRMEM_CST and + FIELD_DECL unification. 2003-11-13 Richard Earnshaw <rearnsha@arm.com> @@ -801,7 +801,7 @@ 2003-10-21 Robert Bowdidge <bowdidge@apple.com> * decl.c (cp_finish_decl): Remove clause intended for asm directives - in struct or class fields: this code is never executed. + in struct or class fields: this code is never executed. 2003-10-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> @@ -1194,7 +1194,7 @@ 2003-09-27 Gabriel Dos Reis <gdr@integrable-solutions.net> * cp-tree.h, name-lookup.h, decl.c, decl2.c: Remove reference to - macros BINDING_SCOPE, BINDING_VALUE and BINDING_TYPE. + macros BINDING_SCOPE, BINDING_VALUE and BINDING_TYPE. 2003-09-26 Gabriel Dos Reis <gdr@integrable-solutions.net> @@ -1344,7 +1344,7 @@ 2003-09-17 Richard Henderson <rth@redhat.com> PR c++/12316 - * semantics.c (expand_or_defer_fn): Inc/dec function_depth. + * semantics.c (expand_or_defer_fn): Inc/dec function_depth. 2003-09-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> diff --git a/gcc/cp/ChangeLog-2004 b/gcc/cp/ChangeLog-2004 index 7dd4e26..dc4636b 100644 --- a/gcc/cp/ChangeLog-2004 +++ b/gcc/cp/ChangeLog-2004 @@ -4631,7 +4631,7 @@ (cp_parser_direct_declarator): Likewise. * pt.c (tsubst): Likewise. (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand - for COMPONENT_REF. + for COMPONENT_REF. * semantics.c (finish_non_static_data_member): Add new operand for COMPONENT_REF. * typeck.c (build_class_member_access_expr): Likewise. diff --git a/gcc/cp/ChangeLog.tree-ssa b/gcc/cp/ChangeLog.tree-ssa index a85593c..e02c765 100644 --- a/gcc/cp/ChangeLog.tree-ssa +++ b/gcc/cp/ChangeLog.tree-ssa @@ -261,8 +261,8 @@ 2003-09-03 Richard Henderson <rth@redhat.com> - * decl.c (finish_function): Fix misapplied patch. Don't - free_after_parsing or free_after_compilation. For real this time. + * decl.c (finish_function): Fix misapplied patch. Don't + free_after_parsing or free_after_compilation. For real this time. 2003-08-22 Jason Merrill <jason@redhat.com> @@ -314,7 +314,7 @@ 2003-06-05 Frank Ch. Eigler <fche@redhat.com> - * cp-mudflap.c (mx_flag): Remove. Update callers to use mf_mark. + * cp-mudflap.c (mx_flag): Remove. Update callers to use mf_mark. 2003-05-24 Diego Novillo <dnovillo@redhat.com> diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index abd39d4..26ce8ac 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -164,7 +164,7 @@ c++.install-common: installdirs $(INSTALL_PROGRAM) g++-cross$(exeext) $(DESTDIR)$(gcc_tooldir)/bin/g++$(exeext); \ rm -f $(DESTDIR)$(gcc_tooldir)/bin/c++$(exeext); \ ( cd $(DESTDIR)$(gcc_tooldir)/bin && \ - $(LN) g++$(exeext) c++$(exeext) ); \ + $(LN) g++$(exeext) c++$(exeext) ); \ else true; fi; \ else \ rm -f $(DESTDIR)$(bindir)/$(GXX_TARGET_INSTALL_NAME)$(exeext); \ diff --git a/gcc/cp/NEWS b/gcc/cp/NEWS index 29b7611..6825b9e 100644 --- a/gcc/cp/NEWS +++ b/gcc/cp/NEWS @@ -250,7 +250,7 @@ but not all, the compiler will tell you where you need to add 'typename'. For more information, see - http://www.cygnus.com/misc/wp/dec96pub/template.html#temp.res + http://www.cygnus.com/misc/wp/dec96pub/template.html#temp.res + Guiding declarations are no longer supported. Function declarations, including friend declarations, do not refer to template instantiations. @@ -269,7 +269,7 @@ + Explicit instantiation of template constructors and destructors is now supported. For instance: - template A<int>::A(const A&); + template A<int>::A(const A&); Still not supported: @@ -324,9 +324,9 @@ signatures are overridden) as it did before. + -Wall no longer implies -W. The new warning flag, -Wsign-compare, - included in -Wall, warns about dangerous comparisons of signed and - unsigned values. Only the flag is new; it was previously part of - -W. + included in -Wall, warns about dangerous comparisons of signed and + unsigned values. Only the flag is new; it was previously part of + -W. + The new flag, -fno-weak, disables the use of weak symbols. @@ -377,12 +377,12 @@ supported. For instance: struct A { - struct B; - B* bp; + struct B; + B* bp; }; struct A::B { - int member; + int member; }; * On the HPPA, some classes that do not define a copy constructor diff --git a/gcc/cp/call.c b/gcc/cp/call.c index f6873cc..d245171 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -134,11 +134,11 @@ static tree build_java_interface_fn_ref (tree, tree); #define convert_like_with_context(CONV, EXPR, FN, ARGNO) \ convert_like_real ((CONV), (EXPR), (FN), (ARGNO), 0, \ /*issue_conversion_warnings=*/true, \ - /*c_cast_p=*/false) + /*c_cast_p=*/false) static tree convert_like_real (conversion *, tree, tree, int, int, bool, bool); static void op_error (enum tree_code, enum tree_code, tree, tree, - tree, const char *); + tree, const char *); static tree build_object_call (tree, tree); static tree resolve_args (tree); static struct z_candidate *build_user_type_conversion_1 (tree, tree, int); @@ -148,23 +148,23 @@ static tree build_this (tree); static struct z_candidate *splice_viable (struct z_candidate *, bool, bool *); static bool any_strictly_viable (struct z_candidate *); static struct z_candidate *add_template_candidate - (struct z_candidate **, tree, tree, tree, tree, tree, - tree, tree, int, unification_kind_t); + (struct z_candidate **, tree, tree, tree, tree, tree, + tree, tree, int, unification_kind_t); static struct z_candidate *add_template_candidate_real (struct z_candidate **, tree, tree, tree, tree, tree, - tree, tree, int, tree, unification_kind_t); + tree, tree, int, tree, unification_kind_t); static struct z_candidate *add_template_conv_candidate - (struct z_candidate **, tree, tree, tree, tree, tree, tree); + (struct z_candidate **, tree, tree, tree, tree, tree, tree); static void add_builtin_candidates (struct z_candidate **, enum tree_code, enum tree_code, - tree, tree *, int); + tree, tree *, int); static void add_builtin_candidate (struct z_candidate **, enum tree_code, enum tree_code, - tree, tree, tree, tree *, tree *, int); + tree, tree, tree, tree *, tree *, int); static bool is_complete (tree); static void build_builtin_candidate (struct z_candidate **, tree, tree, tree, tree *, tree *, - int); + int); static struct z_candidate *add_conv_candidate (struct z_candidate **, tree, tree, tree, tree, tree); static struct z_candidate *add_function_candidate @@ -177,7 +177,7 @@ static bool is_subseq (conversion *, conversion *); static tree maybe_handle_ref_bind (conversion **); static void maybe_handle_implicit_object (conversion **); static struct z_candidate *add_candidate - (struct z_candidate **, tree, tree, size_t, + (struct z_candidate **, tree, tree, size_t, conversion **, tree, tree, int); static tree source_type (conversion *); static void add_warning (struct z_candidate *, struct z_candidate *); @@ -227,11 +227,11 @@ check_dtor_name (tree basetype, tree name) { /* In the case of: - template <class T> struct S { ~S(); }; - int i; - i.~S(); + template <class T> struct S { ~S(); }; + int i; + i.~S(); - NAME will be a class template. */ + NAME will be a class template. */ gcc_assert (DECL_CLASS_TEMPLATE_P (name)); return false; } @@ -628,18 +628,18 @@ standard_conversion (tree to, tree from, tree expr, int flags) if (tcode == COMPLEX_TYPE && fcode == COMPLEX_TYPE) { /* The standard conversion sequence to convert FROM to TO is - the standard conversion sequence to perform componentwise - conversion. */ + the standard conversion sequence to perform componentwise + conversion. */ conversion *part_conv = standard_conversion - (TREE_TYPE (to), TREE_TYPE (from), NULL_TREE, flags); + (TREE_TYPE (to), TREE_TYPE (from), NULL_TREE, flags); if (part_conv) - { + { conv = build_conv (part_conv->kind, to, conv); conv->rank = part_conv->rank; - } + } else - conv = NULL; + conv = NULL; return conv; } @@ -705,15 +705,15 @@ standard_conversion (tree to, tree from, tree expr, int flags) && IS_AGGR_TYPE (TREE_TYPE (to)) /* [conv.ptr] - An rvalue of type "pointer to cv D," where D is a + An rvalue of type "pointer to cv D," where D is a class type, can be converted to an rvalue of type "pointer to cv B," where B is a base class (clause _class.derived_) of D. If B is an inaccessible (clause _class.access_) or ambiguous (_class.member.lookup_) base class of D, a program that necessitates this conversion is ill-formed. - Therefore, we use DERIVED_FROM_P, and do not check - access or uniqueness. */ + Therefore, we use DERIVED_FROM_P, and do not check + access or uniqueness. */ && DERIVED_FROM_P (TREE_TYPE (to), TREE_TYPE (from))) { from = @@ -778,7 +778,7 @@ standard_conversion (tree to, tree from, tree expr, int flags) { /* [conv.bool] - An rvalue of arithmetic, enumeration, pointer, or pointer to + An rvalue of arithmetic, enumeration, pointer, or pointer to member type can be converted to an rvalue of type bool. */ if (ARITHMETIC_TYPE_P (from) || fcode == ENUMERAL_TYPE @@ -921,7 +921,7 @@ convert_class_to_reference (tree t, tree s, tree expr) cand = NULL; /* If this is a template function, try to get an exact - match. */ + match. */ if (TREE_CODE (f) == TEMPLATE_DECL) { cand = add_template_candidate (&candidates, @@ -1133,7 +1133,7 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) conversion functions (_over.match.ref_) and choosing the best one through overload resolution. (_over.match_). - the reference is bound to the lvalue result of the conversion + the reference is bound to the lvalue result of the conversion in the second case. */ conv = convert_class_to_reference (to, from, expr); if (conv) @@ -1169,7 +1169,7 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) is bound in one of the following ways: -- The reference is bound to the object represented by the rvalue - or to a sub-object within that object. + or to a sub-object within that object. -- ... @@ -1427,7 +1427,7 @@ add_function_candidate (struct z_candidate **candidates, static struct z_candidate * add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj, - tree arglist, tree access_path, tree conversion_path) + tree arglist, tree access_path, tree conversion_path) { tree totype = TREE_TYPE (TREE_TYPE (fn)); int i, len, viable, flags; @@ -1494,8 +1494,8 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj, static void build_builtin_candidate (struct z_candidate **candidates, tree fnname, - tree type1, tree type2, tree *args, tree *argtypes, - int flags) + tree type1, tree type2, tree *args, tree *argtypes, + int flags) { conversion *t; conversion **convs; @@ -1580,8 +1580,8 @@ promoted_arithmetic_type_p (tree type) static void add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, - enum tree_code code2, tree fnname, tree type1, - tree type2, tree *args, tree *argtypes, int flags) + enum tree_code code2, tree fnname, tree type1, + tree type2, tree *args, tree *argtypes, int flags) { switch (code) { @@ -1769,11 +1769,11 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, case MAX_EXPR: case MIN_EXPR: if (ARITHMETIC_TYPE_P (type1) && ARITHMETIC_TYPE_P (type2)) - break; + break; if (TYPE_PTR_P (type1) && TYPE_PTR_P (type2)) break; if (TREE_CODE (type1) == ENUMERAL_TYPE && TREE_CODE (type2) == ENUMERAL_TYPE) - break; + break; if (TYPE_PTR_P (type1) && null_ptr_cst_p (args[1])) { type2 = type1; @@ -1988,8 +1988,8 @@ type_decays_to (tree type) static void add_builtin_candidates (struct z_candidate **candidates, enum tree_code code, - enum tree_code code2, tree fnname, tree *args, - int flags) + enum tree_code code2, tree fnname, tree *args, + int flags) { int ref1, i; int enum_p = 0; @@ -2104,8 +2104,8 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code, if (i != 0 || ! ref1) { type = TYPE_MAIN_VARIANT (type_decays_to (type)); - if (enum_p && TREE_CODE (type) == ENUMERAL_TYPE) - types[i] = tree_cons (NULL_TREE, type, types[i]); + if (enum_p && TREE_CODE (type) == ENUMERAL_TYPE) + types[i] = tree_cons (NULL_TREE, type, types[i]); if (INTEGRAL_TYPE_P (type)) type = type_promotes_to (type); } @@ -2124,7 +2124,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code, { type = TYPE_MAIN_VARIANT (type_decays_to (type)); if (enum_p && TREE_CODE (type) == ENUMERAL_TYPE) - types[i] = tree_cons (NULL_TREE, type, types[i]); + types[i] = tree_cons (NULL_TREE, type, types[i]); if (INTEGRAL_TYPE_P (type)) type = type_promotes_to (type); } @@ -2163,10 +2163,10 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code, static struct z_candidate* add_template_candidate_real (struct z_candidate **candidates, tree tmpl, - tree ctype, tree explicit_targs, tree arglist, - tree return_type, tree access_path, + tree ctype, tree explicit_targs, tree arglist, + tree return_type, tree access_path, tree conversion_path, int flags, tree obj, - unification_kind_t strict) + unification_kind_t strict) { int ntparms = DECL_NTPARMS (tmpl); tree targs = make_tree_vec (ntparms); @@ -2206,7 +2206,7 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl, in: struct A { - A(A&); + A(A&); template <class T> A(const T&); }; const A f (); @@ -2262,9 +2262,9 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl, static struct z_candidate * add_template_candidate (struct z_candidate **candidates, tree tmpl, tree ctype, - tree explicit_targs, tree arglist, tree return_type, - tree access_path, tree conversion_path, int flags, - unification_kind_t strict) + tree explicit_targs, tree arglist, tree return_type, + tree access_path, tree conversion_path, int flags, + unification_kind_t strict) { return add_template_candidate_real (candidates, tmpl, ctype, @@ -2276,7 +2276,7 @@ add_template_candidate (struct z_candidate **candidates, tree tmpl, tree ctype, static struct z_candidate * add_template_conv_candidate (struct z_candidate **candidates, tree tmpl, - tree obj, tree arglist, tree return_type, + tree obj, tree arglist, tree return_type, tree access_path, tree conversion_path) { return @@ -2997,7 +2997,7 @@ build_object_call (tree obj, tree args) static void op_error (enum tree_code code, enum tree_code code2, - tree arg1, tree arg2, tree arg3, const char *problem) + tree arg1, tree arg2, tree arg3, const char *problem) { const char *opname; @@ -3010,7 +3010,7 @@ op_error (enum tree_code code, enum tree_code code2, { case COND_EXPR: error ("%s for ternary %<operator?:%> in %<%E ? %E : %E%>", - problem, arg1, arg2, arg3); + problem, arg1, arg2, arg3); break; case POSTINCREMENT_EXPR: @@ -3030,10 +3030,10 @@ op_error (enum tree_code code, enum tree_code code2, default: if (arg2) error ("%s for %<operator%s%> in %<%E %s %E%>", - problem, opname, arg1, opname, arg2); + problem, opname, arg1, opname, arg2); else error ("%s for %<operator%s%> in %<%s%E%>", - problem, opname, opname, arg1); + problem, opname, opname, arg1); break; } } @@ -3176,7 +3176,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) --Both the second and the third operands have type void; the result is of type void and is an rvalue. - We must avoid calling force_rvalue for expressions of type + We must avoid calling force_rvalue for expressions of type "void" because it will complain that their value is being used. */ if (TREE_CODE (arg2) == THROW_EXPR @@ -3401,15 +3401,15 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) arg3_type); if (TREE_CODE (arg2_type) == ENUMERAL_TYPE - && TREE_CODE (arg3_type) == ENUMERAL_TYPE) - warning (0, "enumeral mismatch in conditional expression: %qT vs %qT", - arg2_type, arg3_type); + && TREE_CODE (arg3_type) == ENUMERAL_TYPE) + warning (0, "enumeral mismatch in conditional expression: %qT vs %qT", + arg2_type, arg3_type); else if (extra_warnings - && ((TREE_CODE (arg2_type) == ENUMERAL_TYPE - && !same_type_p (arg3_type, type_promotes_to (arg2_type))) - || (TREE_CODE (arg3_type) == ENUMERAL_TYPE - && !same_type_p (arg2_type, type_promotes_to (arg3_type))))) - warning (0, "enumeral and non-enumeral type in conditional expression"); + && ((TREE_CODE (arg2_type) == ENUMERAL_TYPE + && !same_type_p (arg3_type, type_promotes_to (arg2_type))) + || (TREE_CODE (arg3_type) == ENUMERAL_TYPE + && !same_type_p (arg2_type, type_promotes_to (arg3_type))))) + warning (0, "enumeral and non-enumeral type in conditional expression"); arg2 = perform_implicit_conversion (result_type, arg2); arg3 = perform_implicit_conversion (result_type, arg3); @@ -3704,9 +3704,9 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, one, then we fall back to the old way of doing things. */ if (flags & LOOKUP_COMPLAIN) pedwarn ("no %<%D(int)%> declared for postfix %qs, " - "trying prefix operator instead", - fnname, - operator_name_info[code].name); + "trying prefix operator instead", + fnname, + operator_name_info[code].name); if (code == POSTINCREMENT_EXPR) code = PREINCREMENT_EXPR; else @@ -3777,7 +3777,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, != TYPE_MAIN_VARIANT (TREE_TYPE (arg2)))) { warning (0, "comparison between %q#T and %q#T", - TREE_TYPE (arg1), TREE_TYPE (arg2)); + TREE_TYPE (arg1), TREE_TYPE (arg2)); } break; default: @@ -4444,7 +4444,7 @@ convert_arg_to_ellipsis (tree arg) evaluated. We keep the builtin_trap just as a safety check. */ if (!skip_evaluation) warning (0, "cannot pass objects of non-POD type %q#T through %<...%>; " - "call will abort at runtime", TREE_TYPE (arg)); + "call will abort at runtime", TREE_TYPE (arg)); arg = call_builtin_trap (); arg = build2 (COMPOUND_EXPR, integer_type_node, arg, integer_zero_node); @@ -4470,7 +4470,7 @@ build_x_va_arg (tree expr, tree type) { /* Undefined behavior [expr.call] 5.2.2/7. */ warning (0, "cannot receive objects of non-POD type %q#T through %<...%>; " - "call will abort at runtime", type); + "call will abort at runtime", type); expr = convert (build_pointer_type (type), null_node); expr = build2 (COMPOUND_EXPR, TREE_TYPE (expr), call_builtin_trap (), expr); @@ -4718,13 +4718,13 @@ build_over_call (struct z_candidate *cand, int flags) if (convs[i]->bad_p) pedwarn ("passing %qT as %<this%> argument of %q#D discards qualifiers", - TREE_TYPE (argtype), fn); + TREE_TYPE (argtype), fn); /* [class.mfct.nonstatic]: If a nonstatic member function of a class X is called for an object that is not of type X, or of a type derived from X, the behavior is undefined. - So we can assume that anything passed as 'this' is non-null, and + So we can assume that anything passed as 'this' is non-null, and optimize accordingly. */ gcc_assert (TREE_CODE (parmtype) == POINTER_TYPE); /* Convert to the base in which the function was declared. */ @@ -4740,8 +4740,8 @@ build_over_call (struct z_candidate *cand, int flags) BINFO_TYPE (cand->conversion_path), TREE_TYPE (argtype)); /* If fn was found by a using declaration, the conversion path - will be to the derived class, not the base declaring fn. We - must convert from derived to base. */ + will be to the derived class, not the base declaring fn. We + must convert from derived to base. */ base_binfo = lookup_base (TREE_TYPE (TREE_TYPE (converted_arg)), TREE_TYPE (parmtype), ba_unique, NULL); converted_arg = build_base_path (PLUS_EXPR, converted_arg, @@ -4830,10 +4830,10 @@ build_over_call (struct z_candidate *cand, int flags) mark_used (fn); /* If we're creating a temp and we already have one, don't create a - new one. If we're not creating a temp but we get one, use - INIT_EXPR to collapse the temp into our target. Otherwise, if the - ctor is trivial, do a bitwise copy with a simple TARGET_EXPR for a - temp or an INIT_EXPR otherwise. */ + new one. If we're not creating a temp but we get one, use + INIT_EXPR to collapse the temp into our target. Otherwise, if the + ctor is trivial, do a bitwise copy with a simple TARGET_EXPR for a + temp or an INIT_EXPR otherwise. */ if (integer_zerop (TREE_VALUE (args))) { if (TREE_CODE (arg) == TARGET_EXPR) @@ -4998,9 +4998,9 @@ build_java_interface_fn_ref (tree fn, tree instance) for (method = TYPE_METHODS (iface); method; method = TREE_CHAIN (method)) { if (!DECL_VIRTUAL_P (method)) - continue; + continue; if (fn == method) - break; + break; i++; } idx = build_int_cst (NULL_TREE, i); @@ -5272,7 +5272,7 @@ build_new_method_call (tree instance, tree fns, tree args, { if ((flags & LOOKUP_COMPLAIN) && basetype != error_mark_node) error ("request for member %qD in %qE, which is of non-aggregate " - "type %qT", + "type %qT", fns, instance, basetype); return error_mark_node; @@ -6085,9 +6085,9 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) if (cand1->template_decl && cand2->template_decl) { winner = more_specialized_fn - (TI_TEMPLATE (cand1->template_decl), - TI_TEMPLATE (cand2->template_decl), - /* Tell the deduction code how many real function arguments + (TI_TEMPLATE (cand1->template_decl), + TI_TEMPLATE (cand2->template_decl), + /* Tell the deduction code how many real function arguments we saw, not counting the implicit 'this' argument. But, add_function_candidate() suppresses the "this" argument for constructors. @@ -6099,7 +6099,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) - (DECL_NONSTATIC_MEMBER_FUNCTION_P (cand1->fn) - DECL_CONSTRUCTOR_P (cand1->fn))); if (winner) - return winner; + return winner; } /* or, if not that, @@ -6114,7 +6114,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) { winner = compare_ics (cand1->second_conv, cand2->second_conv); if (winner) - return winner; + return winner; } /* Check whether we can discard a builtin candidate, either because we @@ -6176,7 +6176,7 @@ tweak: if (rank1 > rank2) winner = -1, w = cand2, l = cand1; if (winner) - { + { if (warn) { pedwarn ("\ @@ -6188,8 +6188,8 @@ the worst conversion for the second:"); } else add_warning (w, l); - return winner; - } + return winner; + } } gcc_assert (!winner); @@ -6450,12 +6450,12 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup) if (!conv || conv->bad_p) { if (!(TYPE_QUALS (TREE_TYPE (type)) & TYPE_QUAL_CONST) - && !real_lvalue_p (expr)) - error ("invalid initialization of non-const reference of " - "type %qT from a temporary of type %qT", - type, TREE_TYPE (expr)); + && !real_lvalue_p (expr)) + error ("invalid initialization of non-const reference of " + "type %qT from a temporary of type %qT", + type, TREE_TYPE (expr)); else - error ("invalid initialization of reference of type " + error ("invalid initialization of reference of type " "%qT from expression of type %qT", type, TREE_TYPE (expr)); return error_mark_node; @@ -6508,7 +6508,7 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup) if (conv->kind == ck_base) { if (conv->check_copy_constructor_p) - check_constructor_callable (TREE_TYPE (expr), expr); + check_constructor_callable (TREE_TYPE (expr), expr); base_conv_type = conv->type; conv = conv->u.next; } diff --git a/gcc/cp/class.c b/gcc/cp/class.c index a53cbbc..520442f 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -227,9 +227,9 @@ int n_inner_fields_searched = 0; tree build_base_path (enum tree_code code, - tree expr, - tree binfo, - int nonnull) + tree expr, + tree binfo, + int nonnull) { tree v_binfo = NULL_TREE; tree d_binfo = NULL_TREE; @@ -318,8 +318,8 @@ build_base_path (enum tree_code code, if (virtual_access) { /* Going via virtual base V_BINFO. We need the static offset - from V_BINFO to BINFO, and the dynamic offset from D_BINFO to - V_BINFO. That offset is an entry in D_BINFO's vtable. */ + from V_BINFO to BINFO, and the dynamic offset from D_BINFO to + V_BINFO. That offset is an entry in D_BINFO's vtable. */ tree v_offset; if (fixed_type_p < 0 && in_base_initializer) @@ -414,9 +414,9 @@ build_simple_base_path (tree expr, tree binfo) gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (expr)) == type); /* Transform `(a, b).x' into `(*(a, &b)).x', `(a ? b : c).x' - into `(*(a ? &b : &c)).x', and so on. A COND_EXPR is only - an lvalue in the frontend; only _DECLs and _REFs are lvalues - in the backend. */ + into `(*(a ? &b : &c)).x', and so on. A COND_EXPR is only + an lvalue in the frontend; only _DECLs and _REFs are lvalues + in the backend. */ temp = unary_complex_lvalue (ADDR_EXPR, expr); if (temp) expr = build_indirect_ref (temp, NULL); @@ -847,10 +847,10 @@ make_new_vtable (tree t, tree binfo) static void modify_vtable_entry (tree t, - tree binfo, - tree fndecl, - tree delta, - tree *virtuals) + tree binfo, + tree fndecl, + tree delta, + tree *virtuals) { tree v; @@ -1093,7 +1093,7 @@ alter_access (tree t, tree fdecl, tree access) { if (TREE_CODE (TREE_TYPE (fdecl)) == FUNCTION_DECL) cp_error_at ("conflicting access specifications for method" - " %qD, ignored", TREE_TYPE (fdecl)); + " %qD, ignored", TREE_TYPE (fdecl)); else error ("conflicting access specifications for field %qE, ignored", DECL_NAME (fdecl)); @@ -1186,8 +1186,8 @@ handle_using_decl (tree using_decl, tree t) static void check_bases (tree t, - int* cant_have_const_ctor_p, - int* no_const_asn_ref_p) + int* cant_have_const_ctor_p, + int* no_const_asn_ref_p) { int i; int seen_non_virtual_nearly_empty_base_p; @@ -1301,8 +1301,8 @@ determine_primary_bases (tree t) BINFO_INHERITANCE_CHAIN (this_primary) = base_binfo; /* A virtual binfo might have been copied from within - another hierarchy. As we're about to use it as a - primary base, make sure the offsets match. */ + another hierarchy. As we're about to use it as a + primary base, make sure the offsets match. */ delta = size_diffop (convert (ssizetype, BINFO_OFFSET (base_binfo)), convert (ssizetype, @@ -1364,8 +1364,8 @@ determine_primary_bases (tree t) BINFO_INHERITANCE_CHAIN (primary) = type_binfo; /* A virtual binfo might have been copied from within - another hierarchy. As we're about to use it as a primary - base, make sure the offsets match. */ + another hierarchy. As we're about to use it as a primary + base, make sure the offsets match. */ delta = size_diffop (ssize_int (0), convert (ssizetype, BINFO_OFFSET (primary))); @@ -1573,7 +1573,7 @@ maybe_warn_about_overly_private_class (tree t) if (nonprivate_ctor == 0) { warning (0, "%q#T only defines private constructors and has no friends", - t); + t); return; } } @@ -1632,9 +1632,9 @@ resort_method_name_cmp (const void* m1_p, const void* m2_p) void resort_type_method_vec (void* obj, - void* orig_obj ATTRIBUTE_UNUSED , - gt_pointer_operator new_value, - void* cookie) + void* orig_obj ATTRIBUTE_UNUSED , + gt_pointer_operator new_value, + void* cookie) { VEC(tree,gc) *method_vec = (VEC(tree,gc) *) obj; int len = VEC_length (tree, method_vec); @@ -1981,9 +1981,9 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, && CLASS_TYPE_P (TREE_TYPE (base_return))) { /* If FN is a covariant thunk, we must figure out the adjustment - to the final base FN was converting to. As OVERRIDER_TARGET might - also be converting to the return type of FN, we have to - combine the two conversions here. */ + to the final base FN was converting to. As OVERRIDER_TARGET might + also be converting to the return type of FN, we have to + combine the two conversions here. */ tree fixed_offset, virtual_offset; over_return = TREE_TYPE (over_return); @@ -2099,19 +2099,19 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, if (overrider_fn != overrider_target && !virtual_base) { /* The ABI specifies that a covariant thunk includes a mangling - for a this pointer adjustment. This-adjusting thunks that - override a function from a virtual base have a vcall - adjustment. When the virtual base in question is a primary - virtual base, we know the adjustments are zero, (and in the - non-covariant case, we would not use the thunk). - Unfortunately we didn't notice this could happen, when - designing the ABI and so never mandated that such a covariant - thunk should be emitted. Because we must use the ABI mandated - name, we must continue searching from the binfo where we - found the most recent definition of the function, towards the - primary binfo which first introduced the function into the - vtable. If that enters a virtual base, we must use a vcall - this-adjusting thunk. Bleah! */ + for a this pointer adjustment. This-adjusting thunks that + override a function from a virtual base have a vcall + adjustment. When the virtual base in question is a primary + virtual base, we know the adjustments are zero, (and in the + non-covariant case, we would not use the thunk). + Unfortunately we didn't notice this could happen, when + designing the ABI and so never mandated that such a covariant + thunk should be emitted. Because we must use the ABI mandated + name, we must continue searching from the binfo where we + found the most recent definition of the function, towards the + primary binfo which first introduced the function into the + vtable. If that enters a virtual base, we must use a vcall + this-adjusting thunk. Bleah! */ tree probe = first_defn; while ((probe = get_primary_binfo (probe)) @@ -2296,8 +2296,8 @@ check_for_override (tree decl, tree ctype) if (TREE_CODE (decl) == TEMPLATE_DECL) /* In [temp.mem] we have: - A specialization of a member function template does not - override a virtual function from a base class. */ + A specialization of a member function template does not + override a virtual function from a base class. */ return; if ((DECL_DESTRUCTOR_P (decl) || IDENTIFIER_VIRTUAL_P (DECL_NAME (decl)) @@ -2426,7 +2426,7 @@ finish_struct_anon (tree t) if (TREE_CODE (elt) != FIELD_DECL) { cp_pedwarn_at ("%q#D invalid; an anonymous union can " - "only have non-static data members", + "only have non-static data members", elt); continue; } @@ -2672,9 +2672,9 @@ check_bitfield_decl (tree field) static void check_field_decl (tree field, - tree t, - int* cant_have_const_ctor, - int* no_const_asn_ref, + tree t, + int* cant_have_const_ctor, + int* no_const_asn_ref, int* any_default_members) { tree type = strip_array_types (TREE_TYPE (field)); @@ -2861,7 +2861,7 @@ check_field_decls (tree t, tree *access_decls, if (TREE_CODE (type) == REFERENCE_TYPE) { cp_error_at ("%qD may not have reference type %qT because" - " it is a member of a union", + " it is a member of a union", x, type); continue; } @@ -2900,7 +2900,7 @@ check_field_decls (tree t, tree *access_decls, /* If this is of reference type, check if it needs an init. Also do a little ANSI jig if necessary. */ if (TREE_CODE (type) == REFERENCE_TYPE) - { + { CLASSTYPE_NON_POD_P (t) = 1; if (DECL_INITIAL (x) == NULL_TREE) SET_CLASSTYPE_REF_FIELDS_NEED_INIT (t, 1); @@ -2913,7 +2913,7 @@ check_field_decls (tree t, tree *access_decls, if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t) && extra_warnings) - cp_warning_at ("non-static reference %q#D in class without a constructor", x); + cp_warning_at ("non-static reference %q#D in class without a constructor", x); } type = strip_array_types (type); @@ -2938,8 +2938,8 @@ check_field_decls (tree t, tree *access_decls, CLASSTYPE_HAS_MUTABLE (t) = 1; if (! pod_type_p (type)) - /* DR 148 now allows pointers to members (which are POD themselves), - to be allowed in POD structs. */ + /* DR 148 now allows pointers to members (which are POD themselves), + to be allowed in POD structs. */ CLASSTYPE_NON_POD_P (t) = 1; if (! zero_init_p (type)) @@ -2960,7 +2960,7 @@ check_field_decls (tree t, tree *access_decls, if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t) && extra_warnings) - cp_warning_at ("non-static const member %q#D in class without a constructor", x); + cp_warning_at ("non-static const member %q#D in class without a constructor", x); } /* A field that is pseudo-const makes the structure likewise. */ else if (CLASS_TYPE_P (type)) @@ -3091,11 +3091,11 @@ check_subobject_offset (tree type, tree offset, splay_tree offsets) static int walk_subobject_offsets (tree type, - subobject_offset_fn f, - tree offset, - splay_tree offsets, - tree max_offset, - int vbases_p) + subobject_offset_fn f, + tree offset, + splay_tree offsets, + tree max_offset, + int vbases_p) { int r = 0; tree type_binfo = NULL_TREE; @@ -3285,9 +3285,9 @@ walk_subobject_offsets (tree type, static void record_subobject_offsets (tree type, - tree offset, - splay_tree offsets, - int vbases_p) + tree offset, + splay_tree offsets, + int vbases_p) { walk_subobject_offsets (type, record_subobject_offset, offset, offsets, /*max_offset=*/NULL_TREE, vbases_p); @@ -3299,9 +3299,9 @@ record_subobject_offsets (tree type, static int layout_conflict_p (tree type, - tree offset, - splay_tree offsets, - int vbases_p) + tree offset, + splay_tree offsets, + int vbases_p) { splay_tree_node max_node; @@ -3817,7 +3817,7 @@ clone_function_decl (tree fn, int update_method_vec_p) corresponds to the correct layout order in the virtual function table. - For a non-virtual destructor, we do not build a deleting + For a non-virtual destructor, we do not build a deleting destructor. */ if (DECL_VIRTUAL_P (fn)) { @@ -4126,7 +4126,7 @@ create_vtable_ptr (tree t, tree* virtuals_p) class constructor was inlined, we could generate bad code for setting up the vtable pointer. - Therefore, we use one type for all vtable pointers. We still + Therefore, we use one type for all vtable pointers. We still use a type-correct type; it's just doesn't indicate the array bounds. That's better than using `void*' or some such; it's cleaner, and it let's the alias analysis code know that these @@ -4308,7 +4308,7 @@ layout_virtual_bases (record_layout_info rli, splay_tree offsets) bitsize_unit_node), BINFO_OFFSET (vbase)))) warning (0, "offset of virtual base %qT is not ABI-compliant and " - "may change in a future version of GCC", + "may change in a future version of GCC", basetype); first_vbase = false; @@ -4542,7 +4542,7 @@ layout_class_type (tree t, tree *virtuals_p) struct S1; struct S2 { static S1 s1; }; - At this point, finish_record_layout will be called, but + At this point, finish_record_layout will be called, but S1 is still incomplete.) */ if (TREE_CODE (field) == VAR_DECL) { @@ -4663,7 +4663,7 @@ layout_class_type (tree t, tree *virtuals_p) DECL_FIELD_BIT_OFFSET (field), bitsize_unit_node))) cp_warning_at ("offset of %qD is not ABI-compliant and may " - "change in a future version of GCC", + "change in a future version of GCC", field); /* G++ used to use DECL_FIELD_OFFSET as if it were the byte @@ -4989,8 +4989,8 @@ finish_struct_1 (tree t) if (n_fields > 7) { struct sorted_fields_type *field_vec = GGC_NEWVAR - (struct sorted_fields_type, - sizeof (struct sorted_fields_type) + n_fields * sizeof (tree)); + (struct sorted_fields_type, + sizeof (struct sorted_fields_type) + n_fields * sizeof (tree)); field_vec->len = n_fields; add_fields_to_record_type (TYPE_FIELDS (t), field_vec, 0); qsort (field_vec->elts, n_fields, sizeof (tree), @@ -5198,7 +5198,7 @@ fixed_type_or_null (tree instance, int* nonnull, int* cdtorp) /* If this component is really a base class reference, then the field itself isn't definitive. */ if (DECL_FIELD_IS_BASE (TREE_OPERAND (instance, 1))) - return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull, cdtorp); + return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull, cdtorp); return fixed_type_or_null (TREE_OPERAND (instance, 1), nonnull, cdtorp); case VAR_DECL: @@ -5221,24 +5221,24 @@ fixed_type_or_null (tree instance, int* nonnull, int* cdtorp) return TREE_TYPE (instance); } else if (instance == current_class_ptr) - { - if (nonnull) - *nonnull = 1; - - /* if we're in a ctor or dtor, we know our type. */ - if (DECL_LANG_SPECIFIC (current_function_decl) - && (DECL_CONSTRUCTOR_P (current_function_decl) - || DECL_DESTRUCTOR_P (current_function_decl))) - { - if (cdtorp) - *cdtorp = 1; - return TREE_TYPE (TREE_TYPE (instance)); - } - } + { + if (nonnull) + *nonnull = 1; + + /* if we're in a ctor or dtor, we know our type. */ + if (DECL_LANG_SPECIFIC (current_function_decl) + && (DECL_CONSTRUCTOR_P (current_function_decl) + || DECL_DESTRUCTOR_P (current_function_decl))) + { + if (cdtorp) + *cdtorp = 1; + return TREE_TYPE (TREE_TYPE (instance)); + } + } else if (TREE_CODE (TREE_TYPE (instance)) == REFERENCE_TYPE) - { - /* Reference variables should be references to objects. */ - if (nonnull) + { + /* Reference variables should be references to objects. */ + if (nonnull) *nonnull = 1; /* DECL_VAR_MARKED_P is used to prevent recursion; a @@ -5623,8 +5623,8 @@ resolve_address_of_overloaded_function (tree target_type, { if (flags & tf_error) error ("cannot resolve overloaded function %qD based on" - " conversion to type %qT", - DECL_NAME (OVL_FUNCTION (overload)), target_type); + " conversion to type %qT", + DECL_NAME (OVL_FUNCTION (overload)), target_type); return error_mark_node; } @@ -5747,15 +5747,15 @@ resolve_address_of_overloaded_function (tree target_type, /* There were *no* matches. */ if (flags & tf_error) { - error ("no matches converting function %qD to type %q#T", - DECL_NAME (OVL_FUNCTION (overload)), - target_type); + error ("no matches converting function %qD to type %q#T", + DECL_NAME (OVL_FUNCTION (overload)), + target_type); /* print_candidates expects a chain with the functions in - TREE_VALUE slots, so we cons one up here (we're losing anyway, - so why be clever?). */ - for (; overload; overload = OVL_NEXT (overload)) - matches = tree_cons (NULL_TREE, OVL_CURRENT (overload), + TREE_VALUE slots, so we cons one up here (we're losing anyway, + so why be clever?). */ + for (; overload; overload = OVL_NEXT (overload)) + matches = tree_cons (NULL_TREE, OVL_CURRENT (overload), matches); print_candidates (matches); @@ -5770,7 +5770,7 @@ resolve_address_of_overloaded_function (tree target_type, { tree match; - error ("converting overloaded function %qD to type %q#T is ambiguous", + error ("converting overloaded function %qD to type %q#T is ambiguous", DECL_NAME (OVL_FUNCTION (overload)), target_type); @@ -5794,14 +5794,14 @@ resolve_address_of_overloaded_function (tree target_type, static int explained; if (!(flags & tf_error)) - return error_mark_node; + return error_mark_node; pedwarn ("assuming pointer to member %qD", fn); if (!explained) - { - pedwarn ("(a pointer to member can only be formed with %<&%E%>)", fn); - explained = 1; - } + { + pedwarn ("(a pointer to member can only be formed with %<&%E%>)", fn); + explained = 1; + } } /* If we're doing overload resolution purely for the purpose of @@ -6061,7 +6061,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) case ADDR_EXPR: { if (PTRMEM_OK_P (rhs)) - flags |= tf_ptrmem_ok; + flags |= tf_ptrmem_ok; return instantiate_type (lhstype, TREE_OPERAND (rhs, 0), flags); } @@ -6123,7 +6123,7 @@ print_class_statistics (void) /* Build a dummy reference to ourselves so Derived::Base (and A::A) works, according to [class]: - The class-name is also inserted + The class-name is also inserted into the scope of the class itself. For purposes of access checking, the inserted class name is treated as if it were a public member name. */ @@ -6313,10 +6313,10 @@ maybe_indent_hierarchy (FILE * stream, int indent, int indented_p) static tree dump_class_hierarchy_r (FILE *stream, - int flags, - tree binfo, - tree igo, - int indent) + int flags, + tree binfo, + tree igo, + int indent) { int indented = 0; tree base_binfo; @@ -6808,10 +6808,10 @@ dfs_build_secondary_vptr_vtt_inits (tree binfo, void *data_) if (BINFO_VIRTUAL_P (binfo)) { - /* It's a primary virtual base, and this is not a - construction vtable. Find the base this is primary of in - the inheritance graph, and use that base's vtable - now. */ + /* It's a primary virtual base, and this is not a + construction vtable. Find the base this is primary of in + the inheritance graph, and use that base's vtable + now. */ while (BINFO_PRIMARY_P (binfo)) binfo = BINFO_INHERITANCE_CHAIN (binfo); } @@ -6922,10 +6922,10 @@ build_ctor_vtbl_group (tree binfo, tree t) static void accumulate_vtbl_inits (tree binfo, - tree orig_binfo, - tree rtti_binfo, - tree t, - tree inits) + tree orig_binfo, + tree rtti_binfo, + tree t, + tree inits) { int i; tree base_binfo; @@ -6972,10 +6972,10 @@ accumulate_vtbl_inits (tree binfo, static tree dfs_accumulate_vtbl_inits (tree binfo, - tree orig_binfo, - tree rtti_binfo, - tree t, - tree l) + tree orig_binfo, + tree rtti_binfo, + tree t, + tree l) { tree inits = NULL_TREE; tree vtbl = NULL_TREE; @@ -7097,10 +7097,10 @@ static GTY(()) tree abort_fndecl_addr; static tree build_vtbl_initializer (tree binfo, - tree orig_binfo, - tree t, - tree rtti_binfo, - int* non_fn_entries_p) + tree orig_binfo, + tree t, + tree rtti_binfo, + int* non_fn_entries_p) { tree v, b; tree vfun_inits; @@ -7261,7 +7261,7 @@ build_vtbl_initializer (tree binfo, } } else - vfun_inits = tree_cons (NULL_TREE, init, vfun_inits); + vfun_inits = tree_cons (NULL_TREE, init, vfun_inits); } /* The initializers for virtual functions were built up in reverse @@ -7638,7 +7638,7 @@ build_rtti_vtbl_entries (tree binfo, vtbl_init_data* vid) primary base, and then add the offset in the vtbl to that value. */ b = binfo; while (CLASSTYPE_HAS_PRIMARY_BASE_P (BINFO_TYPE (b)) - && !BINFO_LOST_PRIMARY_P (b)) + && !BINFO_LOST_PRIMARY_P (b)) { tree primary_base; diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index 4af7843..785498b 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -409,7 +409,7 @@ cp_gimplify_init_expr (tree *expr_p, tree *pre_p, tree *post_p) *expr_p = from; /* The initialization is now a side-effect, so the container can - become void. */ + become void. */ if (from != sub) TREE_TYPE (from) = void_type_node; } diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c index a8b807b..3bbe56b 100644 --- a/gcc/cp/cp-objcp-common.c +++ b/gcc/cp/cp-objcp-common.c @@ -89,15 +89,15 @@ cp_expr_size (tree exp) /* And, the gimplifier will sometimes make a copy of an aggregate. In particular, for a case like: - struct S { S(); }; - struct X { int a; S s; }; - X x = { 0 }; - - the gimplifier will create a temporary with - static storage duration, perform static - initialization of the temporary, and then copy - the result. Since the "s" subobject is never - constructed, this is a valid transformation. */ + struct S { S(); }; + struct X { int a; S s; }; + X x = { 0 }; + + the gimplifier will create a temporary with + static storage duration, perform static + initialization of the temporary, and then copy + the result. Since the "s" subobject is never + constructed, this is a valid transformation. */ || CP_AGGREGATE_TYPE_P (type)); /* This would be wrong for a type with virtual bases, but they are @@ -118,9 +118,9 @@ cp_tree_size (enum tree_code code) switch (code) { case TINST_LEVEL: return sizeof (struct tinst_level_s); - case PTRMEM_CST: return sizeof (struct ptrmem_cst); + case PTRMEM_CST: return sizeof (struct ptrmem_cst); case BASELINK: return sizeof (struct tree_baselink); - case TEMPLATE_PARM_INDEX: return sizeof (template_parm_index); + case TEMPLATE_PARM_INDEX: return sizeof (template_parm_index); case DEFAULT_ARG: return sizeof (struct tree_default_arg); case OVERLOAD: return sizeof (struct tree_overload); default: diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def index 833ad33..82e3939 100644 --- a/gcc/cp/cp-tree.def +++ b/gcc/cp/cp-tree.def @@ -108,17 +108,17 @@ DEFTREECODE (BASELINK, "baselink", tcc_exceptional, 0) /* Template definition. The following fields have the specified uses, although there are other macros in cp-tree.h that should be used for accessing this data. - DECL_ARGUMENTS template parm vector - DECL_TEMPLATE_INFO template text &c + DECL_ARGUMENTS template parm vector + DECL_TEMPLATE_INFO template text &c DECL_VINDEX list of instantiations already produced; only done for functions so far For class template: - DECL_INITIAL associated templates (methods &c) - DECL_TEMPLATE_RESULT null + DECL_INITIAL associated templates (methods &c) + DECL_TEMPLATE_RESULT null For non-class templates: TREE_TYPE type of object to be constructed - DECL_TEMPLATE_RESULT decl for object to be created - (e.g., FUNCTION_DECL with tmpl parms used) + DECL_TEMPLATE_RESULT decl for object to be created + (e.g., FUNCTION_DECL with tmpl parms used) */ DEFTREECODE (TEMPLATE_DECL, "template_decl", tcc_declaration, 0) @@ -132,7 +132,7 @@ DEFTREECODE (TEMPLATE_DECL, "template_decl", tcc_declaration, 0) struct S { template <class U, // Index 0, Level 2. - class V> // Index 1, Level 2. + class V> // Index 1, Level 2. void f(); }; @@ -148,7 +148,7 @@ DEFTREECODE (TEMPLATE_DECL, "template_decl", tcc_declaration, 0) struct S<int> { template <class U, // Index 0, Level 1, Orig Level 2 - class V> // Index 1, Level 1, Orig Level 2 + class V> // Index 1, Level 1, Orig Level 2 void f(); }; diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index ef90c3d..29baa7c 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -70,7 +70,7 @@ struct diagnostic_context; IDENTIFIER_CTOR_OR_DTOR_P (in IDENTIFIER_NODE) BIND_EXPR_BODY_BLOCK (in BIND_EXPR) 4: TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR, - or FIELD_DECL). + or FIELD_DECL). IDENTIFIER_TYPENAME_P (in IDENTIFIER_NODE) DECL_TINFO_P (in VAR_DECL) 5: C_IS_RESERVED_WORD (in IDENTIFIER_NODE) @@ -174,7 +174,7 @@ struct diagnostic_context; #define NON_THUNK_FUNCTION_CHECK(NODE) __extension__ \ ({ const tree __t = (NODE); \ if (TREE_CODE (__t) != FUNCTION_DECL && \ - TREE_CODE (__t) != TEMPLATE_DECL && __t->decl.lang_specific \ + TREE_CODE (__t) != TEMPLATE_DECL && __t->decl.lang_specific \ && __t->decl.lang_specific->decl_flags.thunk_p) \ tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, 0); \ __t; }) @@ -182,7 +182,7 @@ struct diagnostic_context; ({ const tree __t = (NODE); \ if (TREE_CODE (__t) != FUNCTION_DECL || !__t->decl.lang_specific \ || !__t->decl.lang_specific->decl_flags.thunk_p) \ - tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, 0); \ + tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, 0); \ __t; }) #else #define NON_THUNK_FUNCTION_CHECK(NODE) (NODE) @@ -247,7 +247,7 @@ typedef struct ptrmem_cst * ptrmem_cst_t; #define SET_IDENTIFIER_NAMESPACE_VALUE(NODE, VAL) \ set_namespace_binding ((NODE), current_namespace, (VAL)) -#define CLEANUP_P(NODE) TREE_LANG_FLAG_0 (TRY_BLOCK_CHECK (NODE)) +#define CLEANUP_P(NODE) TREE_LANG_FLAG_0 (TRY_BLOCK_CHECK (NODE)) #define BIND_EXPR_TRY_BLOCK(NODE) \ TREE_LANG_FLAG_0 (BIND_EXPR_CHECK (NODE)) @@ -291,7 +291,7 @@ typedef struct ptrmem_cst * ptrmem_cst_t; /* Returns nonzero iff NODE is a declaration for the global function `main'. */ #define DECL_MAIN_P(NODE) \ - (DECL_EXTERN_C_FUNCTION_P (NODE) \ + (DECL_EXTERN_C_FUNCTION_P (NODE) \ && DECL_NAME (NODE) != NULL_TREE \ && MAIN_NAME_P (DECL_NAME (NODE))) @@ -300,14 +300,14 @@ typedef struct ptrmem_cst * ptrmem_cst_t; (((struct tree_overload*)OVERLOAD_CHECK (NODE))->function) #define OVL_CHAIN(NODE) TREE_CHAIN (NODE) /* Polymorphic access to FUNCTION and CHAIN. */ -#define OVL_CURRENT(NODE) \ +#define OVL_CURRENT(NODE) \ ((TREE_CODE (NODE) == OVERLOAD) ? OVL_FUNCTION (NODE) : (NODE)) -#define OVL_NEXT(NODE) \ +#define OVL_NEXT(NODE) \ ((TREE_CODE (NODE) == OVERLOAD) ? TREE_CHAIN (NODE) : NULL_TREE) /* If set, this was imported in a using declaration. This is not to confuse with being used somewhere, which is not important for this node. */ -#define OVL_USED(NODE) TREE_USED (NODE) +#define OVL_USED(NODE) TREE_USED (NODE) struct tree_overload GTY(()) { @@ -557,7 +557,7 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; pointer in pointer-to-member types. */ #define delta_type_node cp_global_trees[CPTI_DELTA_TYPE] /* The type used to represent an index into the vtable. */ -#define vtable_index_type cp_global_trees[CPTI_VTABLE_INDEX_TYPE] +#define vtable_index_type cp_global_trees[CPTI_VTABLE_INDEX_TYPE] #define ti_desc_type_node cp_global_trees[CPTI_TI_DESC_TYPE] #define bltn_desc_type_node cp_global_trees[CPTI_BLTN_DESC_TYPE] @@ -576,7 +576,7 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; #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] -#define abi_node cp_global_trees[CPTI_ABI] +#define abi_node cp_global_trees[CPTI_ABI] #define const_type_info_type_node cp_global_trees[CPTI_CONST_TYPE_INFO_TYPE] #define type_info_ptr_type cp_global_trees[CPTI_TYPE_INFO_PTR_TYPE] #define abort_fndecl cp_global_trees[CPTI_ABORT_FNDECL] @@ -588,70 +588,70 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; /* The name of a constructor that takes an in-charge parameter to decide whether or not to construct virtual base classes. */ -#define ctor_identifier cp_global_trees[CPTI_CTOR_IDENTIFIER] +#define ctor_identifier cp_global_trees[CPTI_CTOR_IDENTIFIER] /* The name of a constructor that constructs virtual base classes. */ -#define complete_ctor_identifier cp_global_trees[CPTI_COMPLETE_CTOR_IDENTIFIER] +#define complete_ctor_identifier cp_global_trees[CPTI_COMPLETE_CTOR_IDENTIFIER] /* The name of a constructor that does not construct virtual base classes. */ -#define base_ctor_identifier cp_global_trees[CPTI_BASE_CTOR_IDENTIFIER] +#define base_ctor_identifier cp_global_trees[CPTI_BASE_CTOR_IDENTIFIER] /* The name of a destructor that takes an in-charge parameter to decide whether or not to destroy virtual base classes and whether or not to delete the object. */ -#define dtor_identifier cp_global_trees[CPTI_DTOR_IDENTIFIER] +#define dtor_identifier cp_global_trees[CPTI_DTOR_IDENTIFIER] /* The name of a destructor that destroys virtual base classes. */ -#define complete_dtor_identifier cp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER] +#define complete_dtor_identifier cp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER] /* The name of a destructor that does not destroy virtual base classes. */ -#define base_dtor_identifier cp_global_trees[CPTI_BASE_DTOR_IDENTIFIER] +#define base_dtor_identifier cp_global_trees[CPTI_BASE_DTOR_IDENTIFIER] /* The name of a destructor that destroys virtual base classes, and then deletes the entire object. */ -#define deleting_dtor_identifier cp_global_trees[CPTI_DELETING_DTOR_IDENTIFIER] -#define delta_identifier cp_global_trees[CPTI_DELTA_IDENTIFIER] -#define in_charge_identifier cp_global_trees[CPTI_IN_CHARGE_IDENTIFIER] +#define deleting_dtor_identifier cp_global_trees[CPTI_DELETING_DTOR_IDENTIFIER] +#define delta_identifier cp_global_trees[CPTI_DELTA_IDENTIFIER] +#define in_charge_identifier cp_global_trees[CPTI_IN_CHARGE_IDENTIFIER] /* The name of the parameter that contains a pointer to the VTT to use for this subobject constructor or destructor. */ -#define vtt_parm_identifier cp_global_trees[CPTI_VTT_PARM_IDENTIFIER] -#define nelts_identifier cp_global_trees[CPTI_NELTS_IDENTIFIER] -#define this_identifier cp_global_trees[CPTI_THIS_IDENTIFIER] -#define pfn_identifier cp_global_trees[CPTI_PFN_IDENTIFIER] -#define vptr_identifier cp_global_trees[CPTI_VPTR_IDENTIFIER] +#define vtt_parm_identifier cp_global_trees[CPTI_VTT_PARM_IDENTIFIER] +#define nelts_identifier cp_global_trees[CPTI_NELTS_IDENTIFIER] +#define this_identifier cp_global_trees[CPTI_THIS_IDENTIFIER] +#define pfn_identifier cp_global_trees[CPTI_PFN_IDENTIFIER] +#define vptr_identifier cp_global_trees[CPTI_VPTR_IDENTIFIER] /* The name of the std namespace. */ -#define std_identifier cp_global_trees[CPTI_STD_IDENTIFIER] -#define lang_name_c cp_global_trees[CPTI_LANG_NAME_C] -#define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS] -#define lang_name_java cp_global_trees[CPTI_LANG_NAME_JAVA] +#define std_identifier cp_global_trees[CPTI_STD_IDENTIFIER] +#define lang_name_c cp_global_trees[CPTI_LANG_NAME_C] +#define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS] +#define lang_name_java cp_global_trees[CPTI_LANG_NAME_JAVA] /* Exception specifier used for throw(). */ -#define empty_except_spec cp_global_trees[CPTI_EMPTY_EXCEPT_SPEC] +#define empty_except_spec cp_global_trees[CPTI_EMPTY_EXCEPT_SPEC] /* If non-NULL, a POINTER_TYPE equivalent to (java::lang::Class*). */ -#define jclass_node cp_global_trees[CPTI_JCLASS] +#define jclass_node cp_global_trees[CPTI_JCLASS] /* The declaration for `std::terminate'. */ -#define terminate_node cp_global_trees[CPTI_TERMINATE] +#define terminate_node cp_global_trees[CPTI_TERMINATE] /* The declaration for "__cxa_call_unexpected". */ -#define call_unexpected_node cp_global_trees[CPTI_CALL_UNEXPECTED] +#define call_unexpected_node cp_global_trees[CPTI_CALL_UNEXPECTED] /* A pointer to `std::atexit'. */ -#define atexit_node cp_global_trees[CPTI_ATEXIT] +#define atexit_node cp_global_trees[CPTI_ATEXIT] /* A pointer to `__dso_handle'. */ -#define dso_handle_node cp_global_trees[CPTI_DSO_HANDLE] +#define dso_handle_node cp_global_trees[CPTI_DSO_HANDLE] /* The declaration of the dynamic_cast runtime. */ -#define dynamic_cast_node cp_global_trees[CPTI_DCAST] +#define dynamic_cast_node cp_global_trees[CPTI_DCAST] /* The type of a destructor. */ -#define cleanup_type cp_global_trees[CPTI_CLEANUP_TYPE] +#define cleanup_type cp_global_trees[CPTI_CLEANUP_TYPE] /* The type of the vtt parameter passed to subobject constructors and destructors. */ -#define vtt_parm_type cp_global_trees[CPTI_VTT_PARM_TYPE] +#define vtt_parm_type cp_global_trees[CPTI_VTT_PARM_TYPE] /* A TREE_LIST of the dynamic classes whose vtables may have to be emitted in this translation unit. */ -#define keyed_classes cp_global_trees[CPTI_KEYED_CLASSES] +#define keyed_classes cp_global_trees[CPTI_KEYED_CLASSES] /* Node to indicate default access. This must be distinct from the access nodes in tree.h. */ @@ -828,9 +828,9 @@ struct language_function GTY(()) /* True if NAME is the IDENTIFIER_NODE for an overloaded "operator new" or "operator delete". */ #define NEW_DELETE_OPNAME_P(NAME) \ - ((NAME) == ansi_opname (NEW_EXPR) \ - || (NAME) == ansi_opname (VEC_NEW_EXPR) \ - || (NAME) == ansi_opname (DELETE_EXPR) \ + ((NAME) == ansi_opname (NEW_EXPR) \ + || (NAME) == ansi_opname (VEC_NEW_EXPR) \ + || (NAME) == ansi_opname (DELETE_EXPR) \ || (NAME) == ansi_opname (VEC_DELETE_EXPR)) #define ansi_opname(CODE) \ @@ -841,7 +841,7 @@ struct language_function GTY(()) /* True if NODE is an erroneous expression. */ #define error_operand_p(NODE) \ - ((NODE) == error_mark_node \ + ((NODE) == error_mark_node \ || ((NODE) && TREE_TYPE ((NODE)) == error_mark_node)) /* C++ language-specific tree codes. */ @@ -963,7 +963,7 @@ enum languages { lang_c, lang_cplusplus, lang_java }; /* Nonzero iff TYPE is publicly & uniquely derived from PARENT. */ #define PUBLICLY_UNIQUELY_DERIVED_P(PARENT, TYPE) \ (lookup_base ((TYPE), (PARENT), ba_ignore_scope | ba_check | ba_quiet, \ - NULL) != NULL_TREE) + NULL) != NULL_TREE) /* Gives the visibility specification for a class type. */ #define CLASSTYPE_VISIBILITY(TYPE) \ @@ -1580,8 +1580,8 @@ struct lang_decl GTY(()) unsigned spare : 22; /* For a non-thunk function decl, this is a tree list of - friendly classes. For a thunk function decl, it is the - thunked to function decl. */ + friendly classes. For a thunk function decl, it is the + thunked to function decl. */ tree befriending_classes; /* For a non-virtual FUNCTION_DECL, this is @@ -1607,7 +1607,7 @@ struct lang_decl GTY(()) { struct sorted_fields_type * GTY ((tag ("0"), reorder ("resort_sorted_fields"))) sorted_fields; - struct cp_token_cache * GTY ((tag ("2"))) pending_inline_info; + struct cp_token_cache * GTY ((tag ("2"))) pending_inline_info; struct language_function * GTY ((tag ("1"))) saved_language_function; } GTY ((desc ("%1.u3sel + %1.pending_inline_p"))) u; @@ -1639,8 +1639,8 @@ struct lang_decl GTY(()) created by language-independent code, and has C linkage. Most VAR_DECLs have C++ linkage, and do not have DECL_LANG_SPECIFIC, but we do create DECL_LANG_SPECIFIC for variables with non-C++ linkage. */ -#define DECL_LANGUAGE(NODE) \ - (DECL_LANG_SPECIFIC (NODE) \ +#define DECL_LANGUAGE(NODE) \ + (DECL_LANG_SPECIFIC (NODE) \ ? DECL_LANG_SPECIFIC (NODE)->decl_flags.language \ : (TREE_CODE (NODE) == FUNCTION_DECL \ ? lang_c : lang_cplusplus)) @@ -1721,7 +1721,7 @@ struct lang_decl GTY(()) clones. This macro should be used like: FOR_EACH_CLONE (clone, fn) - { ... } + { ... } */ #define FOR_EACH_CLONE(CLONE, FN) \ @@ -2136,7 +2136,7 @@ struct lang_decl GTY(()) /* Nonzero if the template arguments is actually a vector of vectors, rather than just a vector. */ -#define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \ +#define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \ (NODE && TREE_VEC_ELT (NODE, 0) \ && TREE_CODE (TREE_VEC_ELT (NODE, 0)) == TREE_VEC) @@ -2201,7 +2201,7 @@ struct lang_decl GTY(()) DECL_TI_TEMPLATE, the DECL_TI_ARGS will be {int, double}. These are always the full set of arguments required to instantiate this declaration from the most general template specialized here. */ -#define DECL_TI_ARGS(NODE) TI_ARGS (DECL_TEMPLATE_INFO (NODE)) +#define DECL_TI_ARGS(NODE) TI_ARGS (DECL_TEMPLATE_INFO (NODE)) #define CLASSTYPE_TI_TEMPLATE(NODE) TI_TEMPLATE (CLASSTYPE_TEMPLATE_INFO (NODE)) #define CLASSTYPE_TI_ARGS(NODE) TI_ARGS (CLASSTYPE_TEMPLATE_INFO (NODE)) @@ -2339,7 +2339,7 @@ struct lang_decl GTY(()) /* Keep these codes in ascending code order. CHAR_TYPE is used here to completely fill the range. */ -#define INTEGRAL_CODE_P(CODE) \ +#define INTEGRAL_CODE_P(CODE) \ ((CODE) == ENUMERAL_TYPE || (CODE) == BOOLEAN_TYPE \ || (CODE) == CHAR_TYPE || (CODE) == INTEGER_TYPE) @@ -2439,10 +2439,10 @@ struct lang_decl GTY(()) destructor and if: - all of the direct base classes of its class have trivial - destructors, + destructors, - for all of the non-static data members of its class that are - of class type (or array thereof), each such class has a + of class type (or array thereof), each such class has a trivial destructor. */ #define TYPE_HAS_TRIVIAL_DESTRUCTOR(NODE) \ (!TYPE_HAS_NONTRIVIAL_DESTRUCTOR (NODE)) @@ -2473,23 +2473,23 @@ struct lang_decl GTY(()) /* Returns true if NODE is a pointer to an object. Keep these checks in ascending tree code order. */ #define TYPE_PTROB_P(NODE) \ - (TYPE_PTR_P (NODE) \ + (TYPE_PTR_P (NODE) \ && !(TREE_CODE (TREE_TYPE (NODE)) == VOID_TYPE \ - || TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE \ - || TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE)) + || TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE \ + || TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE)) /* Returns true if NODE is a reference to an object. Keep these checks in ascending tree code order. */ #define TYPE_REF_OBJ_P(NODE) \ (TREE_CODE (NODE) == REFERENCE_TYPE \ && !(TREE_CODE (TREE_TYPE (NODE)) == VOID_TYPE \ - || TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE \ - || TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE)) + || TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE \ + || TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE)) /* Returns true if NODE is a pointer to an object, or a pointer to void. Keep these checks in ascending tree code order. */ #define TYPE_PTROBV_P(NODE) \ - (TYPE_PTR_P (NODE) \ + (TYPE_PTR_P (NODE) \ && !(TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE \ - || TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE)) + || TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE)) /* Returns true if NODE is a pointer to function. */ #define TYPE_PTRFN_P(NODE) \ (TREE_CODE (NODE) == POINTER_TYPE \ @@ -2536,8 +2536,8 @@ struct lang_decl GTY(()) do { \ if (TYPE_LANG_SPECIFIC (NODE) == NULL) \ { \ - TYPE_LANG_SPECIFIC (NODE) = GGC_CNEWVAR \ - (struct lang_type, sizeof (struct lang_type_ptrmem)); \ + TYPE_LANG_SPECIFIC (NODE) = GGC_CNEWVAR \ + (struct lang_type, sizeof (struct lang_type_ptrmem)); \ TYPE_LANG_SPECIFIC (NODE)->u.ptrmem.h.is_lang_type_class = 0; \ } \ TYPE_LANG_SPECIFIC (NODE)->u.ptrmem.record = (VALUE); \ @@ -2668,7 +2668,7 @@ struct lang_decl GTY(()) arguments are always complete. For example, given: template <class T> struct S1 { - template <class U> struct S2 {}; + template <class U> struct S2 {}; template <class U> struct S2<U*> {}; }; @@ -2687,7 +2687,7 @@ struct lang_decl GTY(()) partial instantiation. For example, given: template <class T> struct S { - template <class U> void f(U); + template <class U> void f(U); template <> void f(T); }; @@ -2917,18 +2917,18 @@ struct lang_decl GTY(()) /* 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) -#define TRY_HANDLERS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 1) +#define TRY_STMTS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 0) +#define TRY_HANDLERS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 1) -#define EH_SPEC_STMTS(NODE) TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 0) -#define EH_SPEC_RAISES(NODE) TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 1) +#define EH_SPEC_STMTS(NODE) TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 0) +#define EH_SPEC_RAISES(NODE) TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 1) #define USING_STMT_NAMESPACE(NODE) TREE_OPERAND (USING_STMT_CHECK (NODE), 0) /* Nonzero if this try block is a function try block. */ -#define FN_TRY_BLOCK_P(NODE) TREE_LANG_FLAG_3 (TRY_BLOCK_CHECK (NODE)) -#define HANDLER_PARMS(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 0) -#define HANDLER_BODY(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 1) +#define FN_TRY_BLOCK_P(NODE) TREE_LANG_FLAG_3 (TRY_BLOCK_CHECK (NODE)) +#define HANDLER_PARMS(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 0) +#define HANDLER_BODY(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 1) #define HANDLER_TYPE(NODE) TREE_TYPE (HANDLER_CHECK (NODE)) /* CLEANUP_STMT accessors. The statement(s) covered, the cleanup to run @@ -2940,38 +2940,38 @@ struct lang_decl GTY(()) /* IF_STMT accessors. These give access to the condition of the if statement, the then block of the if statement, and the else block of the if statement if it exists. */ -#define IF_COND(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 0) -#define THEN_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 1) -#define ELSE_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 2) +#define IF_COND(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 0) +#define THEN_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 1) +#define ELSE_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 2) /* WHILE_STMT accessors. These give access to the condition of the while statement and the body of the while statement, respectively. */ -#define WHILE_COND(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0) -#define WHILE_BODY(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 1) +#define WHILE_COND(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0) +#define WHILE_BODY(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 1) /* DO_STMT accessors. These give access to the condition of the do statement and the body of the do statement, respectively. */ -#define DO_COND(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 0) -#define DO_BODY(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 1) +#define DO_COND(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 0) +#define DO_BODY(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 1) /* FOR_STMT accessors. These give access to the init statement, condition, update expression, and body of the for statement, respectively. */ -#define FOR_INIT_STMT(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 0) -#define FOR_COND(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 1) -#define FOR_EXPR(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 2) -#define FOR_BODY(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 3) +#define FOR_INIT_STMT(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 0) +#define FOR_COND(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 1) +#define FOR_EXPR(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 2) +#define FOR_BODY(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 3) #define SWITCH_STMT_COND(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 0) #define SWITCH_STMT_BODY(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 1) #define SWITCH_STMT_TYPE(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 2) /* STMT_EXPR accessor. */ -#define STMT_EXPR_STMT(NODE) TREE_OPERAND (STMT_EXPR_CHECK (NODE), 0) +#define STMT_EXPR_STMT(NODE) TREE_OPERAND (STMT_EXPR_CHECK (NODE), 0) /* EXPR_STMT accessor. This gives the expression associated with an expression statement. */ -#define EXPR_STMT_EXPR(NODE) TREE_OPERAND (EXPR_STMT_CHECK (NODE), 0) +#define EXPR_STMT_EXPR(NODE) TREE_OPERAND (EXPR_STMT_CHECK (NODE), 0) /* An enumeration of the kind of tags that C++ accepts. */ enum tag_types { @@ -2994,20 +2994,20 @@ typedef enum cp_lvalue_kind { /* Various kinds of template specialization, instantiation, etc. */ typedef enum tmpl_spec_kind { - tsk_none, /* Not a template at all. */ + tsk_none, /* Not a template at all. */ tsk_invalid_member_spec, /* An explicit member template specialization, but the enclosing classes have not all been explicitly specialized. */ tsk_invalid_expl_inst, /* An explicit instantiation containing template parameter lists. */ - tsk_excessive_parms, /* A template declaration with too many + tsk_excessive_parms, /* A template declaration with too many template parameter lists. */ tsk_insufficient_parms, /* A template declaration with too few parameter lists. */ - tsk_template, /* A template declaration. */ - tsk_expl_spec, /* An explicit specialization. */ - tsk_expl_inst /* An explicit instantiation. */ + tsk_template, /* A template declaration. */ + tsk_expl_spec, /* An explicit specialization. */ + tsk_expl_inst /* An explicit instantiation. */ } tmpl_spec_kind; /* The various kinds of access. BINFO_ACCESS depends on these being @@ -3015,28 +3015,28 @@ typedef enum tmpl_spec_kind { used to initialize RTTI data structures, so changing them changes the ABI. */ typedef enum access_kind { - ak_none = 0, /* Inaccessible. */ - ak_public = 1, /* Accessible, as a `public' thing. */ - ak_protected = 2, /* Accessible, as a `protected' thing. */ - ak_private = 3 /* Accessible, as a `private' thing. */ + ak_none = 0, /* Inaccessible. */ + ak_public = 1, /* Accessible, as a `public' thing. */ + ak_protected = 2, /* Accessible, as a `protected' thing. */ + ak_private = 3 /* Accessible, as a `private' thing. */ } access_kind; /* The various kinds of special functions. If you add to this list, you should update special_function_p as well. */ typedef enum special_function_kind { - sfk_none = 0, /* Not a special function. This enumeral + sfk_none = 0, /* Not a special function. This enumeral must have value zero; see special_function_p. */ - sfk_constructor, /* A constructor. */ + sfk_constructor, /* A constructor. */ sfk_copy_constructor, /* A copy constructor. */ sfk_assignment_operator, /* An assignment operator. */ - sfk_destructor, /* A destructor. */ + sfk_destructor, /* A destructor. */ sfk_complete_destructor, /* A destructor for complete objects. */ sfk_base_destructor, /* A destructor for base subobjects. */ sfk_deleting_destructor, /* A destructor for complete objects that deletes the object after it has been destroyed. */ - sfk_conversion /* A conversion operator. */ + sfk_conversion /* A conversion operator. */ } special_function_kind; /* The various kinds of linkage. From [basic.link], @@ -3046,35 +3046,35 @@ typedef enum special_function_kind { as a name introduced in another scope: -- When a name has external linkage, the entity it denotes can - be referred to from scopes of other translation units or from + be referred to from scopes of other translation units or from other scopes of the same translation unit. -- When a name has internal linkage, the entity it denotes can - be referred to by names from other scopes in the same + be referred to by names from other scopes in the same translation unit. -- When a name has no linkage, the entity it denotes cannot be - referred to by names from other scopes. */ + referred to by names from other scopes. */ typedef enum linkage_kind { - lk_none, /* No linkage. */ - lk_internal, /* Internal linkage. */ - lk_external /* External linkage. */ + lk_none, /* No linkage. */ + lk_internal, /* Internal linkage. */ + lk_external /* External linkage. */ } linkage_kind; /* Bitmask flags to control type substitution. */ typedef enum tsubst_flags_t { - tf_none = 0, /* nothing special */ - tf_error = 1 << 0, /* give error messages */ - tf_warning = 1 << 1, /* give warnings too */ - tf_ignore_bad_quals = 1 << 2, /* ignore bad cvr qualifiers */ + tf_none = 0, /* nothing special */ + tf_error = 1 << 0, /* give error messages */ + tf_warning = 1 << 1, /* give warnings too */ + tf_ignore_bad_quals = 1 << 2, /* ignore bad cvr qualifiers */ tf_keep_type_decl = 1 << 3, /* retain typedef type decls (make_typename_type use) */ - tf_ptrmem_ok = 1 << 4, /* pointers to member ok (internal + tf_ptrmem_ok = 1 << 4, /* pointers to member ok (internal instantiate_type use) */ tf_user = 1 << 5, /* found template must be a user template (lookup_template_class use) */ - tf_conv = 1 << 6 /* We are determining what kind of + tf_conv = 1 << 6 /* We are determining what kind of conversion might be permissible, not actually performing the conversion. */ @@ -3102,11 +3102,11 @@ typedef enum deferring_kind { Values <0 indicate we failed. */ typedef enum base_kind { bk_inaccessible = -3, /* The base is inaccessible */ - bk_ambig = -2, /* The base is ambiguous */ - bk_not_base = -1, /* It is not a base */ - bk_same_type = 0, /* It is the same type */ - bk_proper_base = 1, /* It is a proper base */ - bk_via_virtual = 2 /* It is a proper base, but via a virtual + bk_ambig = -2, /* The base is ambiguous */ + bk_not_base = -1, /* It is not a base */ + bk_same_type = 0, /* It is the same type */ + bk_proper_base = 1, /* It is a proper base */ + bk_via_virtual = 2 /* It is a proper base, but via a virtual path. This might not be the canonical binfo. */ } base_kind; @@ -3249,7 +3249,7 @@ extern GTY(()) VEC(tree,gc) *local_classes; /* Returns nonzero iff NODE is a declaration for the global function `main'. */ #define DECL_MAIN_P(NODE) \ - (DECL_EXTERN_C_FUNCTION_P (NODE) \ + (DECL_EXTERN_C_FUNCTION_P (NODE) \ && DECL_NAME (NODE) != NULL_TREE \ && MAIN_NAME_P (DECL_NAME (NODE))) @@ -3353,27 +3353,27 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; /* Used with comptypes, and related functions, to guide type comparison. */ -#define COMPARE_STRICT 0 /* Just check if the types are the +#define COMPARE_STRICT 0 /* Just check if the types are the same. */ -#define COMPARE_BASE 1 /* Check to see if the second type is +#define COMPARE_BASE 1 /* Check to see if the second type is derived from the first. */ -#define COMPARE_DERIVED 2 /* Like COMPARE_BASE, but in +#define COMPARE_DERIVED 2 /* Like COMPARE_BASE, but in reverse. */ #define COMPARE_REDECLARATION 4 /* The comparison is being done when another declaration of an existing entity is seen. */ /* Used with push_overloaded_decl. */ -#define PUSH_GLOBAL 0 /* Push the DECL into namespace scope, +#define PUSH_GLOBAL 0 /* Push the DECL into namespace scope, regardless of the current scope. */ -#define PUSH_LOCAL 1 /* Push the DECL into the current +#define PUSH_LOCAL 1 /* Push the DECL into the current scope. */ -#define PUSH_USING 2 /* We are pushing this DECL as the +#define PUSH_USING 2 /* We are pushing this DECL as the result of a using declaration. */ /* Used with start function. */ -#define SF_DEFAULT 0 /* No flags. */ -#define SF_PRE_PARSED 1 /* The function declaration has +#define SF_DEFAULT 0 /* No flags. */ +#define SF_PRE_PARSED 1 /* The function declaration has already been parsed. */ #define SF_INCLASS_INLINE 2 /* The function is an inline, defined in the class body. */ @@ -3424,18 +3424,18 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; TFF_EXPR_IN_PARENS: parenthesize expressions. TFF_NO_FUNCTION_ARGUMENTS: don't show function arguments. */ -#define TFF_PLAIN_IDENTIFIER (0) -#define TFF_SCOPE (1) -#define TFF_CHASE_TYPEDEF (1 << 1) -#define TFF_DECL_SPECIFIERS (1 << 2) -#define TFF_CLASS_KEY_OR_ENUM (1 << 3) -#define TFF_RETURN_TYPE (1 << 4) -#define TFF_FUNCTION_DEFAULT_ARGUMENTS (1 << 5) -#define TFF_EXCEPTION_SPECIFICATION (1 << 6) -#define TFF_TEMPLATE_HEADER (1 << 7) -#define TFF_TEMPLATE_NAME (1 << 8) -#define TFF_EXPR_IN_PARENS (1 << 9) -#define TFF_NO_FUNCTION_ARGUMENTS (1 << 10) +#define TFF_PLAIN_IDENTIFIER (0) +#define TFF_SCOPE (1) +#define TFF_CHASE_TYPEDEF (1 << 1) +#define TFF_DECL_SPECIFIERS (1 << 2) +#define TFF_CLASS_KEY_OR_ENUM (1 << 3) +#define TFF_RETURN_TYPE (1 << 4) +#define TFF_FUNCTION_DEFAULT_ARGUMENTS (1 << 5) +#define TFF_EXCEPTION_SPECIFICATION (1 << 6) +#define TFF_TEMPLATE_HEADER (1 << 7) +#define TFF_TEMPLATE_NAME (1 << 8) +#define TFF_EXPR_IN_PARENS (1 << 9) +#define TFF_NO_FUNCTION_ARGUMENTS (1 << 10) /* Returns the TEMPLATE_DECL associated to a TEMPLATE_TEMPLATE_PARM node. */ @@ -3592,7 +3592,7 @@ struct cp_declarator { /* For identifiers. */ struct { /* If non-NULL, the qualifying scope (a NAMESPACE_DECL or - *_TYPE) for this identifier. */ + *_TYPE) for this identifier. */ tree qualifying_scope; /* The unqualified name of the entity -- an IDENTIFIER_NODE, BIT_NOT_EXPR, or TEMPLATE_ID_EXPR. */ @@ -3633,53 +3633,54 @@ extern cp_declarator *cp_error_declarator; extern cp_parameter_declarator *no_parameters; /* in call.c */ -extern bool check_dtor_name (tree, tree); +extern bool check_dtor_name (tree, tree); extern tree build_vfield_ref (tree, tree); extern tree build_conditional_expr (tree, tree, tree); -extern tree build_addr_func (tree); -extern tree build_call (tree, tree); -extern bool null_ptr_cst_p (tree); -extern bool sufficient_parms_p (tree); -extern tree type_decays_to (tree); -extern tree build_user_type_conversion (tree, tree, int); -extern tree build_new_function_call (tree, tree); -extern tree build_operator_new_call (tree, tree, tree *, tree *); -extern tree build_new_method_call (tree, tree, tree, tree, int); -extern tree build_special_member_call (tree, tree, tree, tree, int); -extern tree build_new_op (enum tree_code, int, tree, tree, tree, bool *); -extern tree build_op_delete_call (enum tree_code, tree, tree, bool, tree); -extern bool can_convert (tree, tree); -extern bool can_convert_arg (tree, tree, tree); -extern bool can_convert_arg_bad (tree, tree, tree); -extern bool enforce_access (tree, tree); -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 cxx_type_promotes_to (tree); -extern tree type_passed_as (tree); -extern tree convert_for_arg_passing (tree, tree); -extern bool is_properly_derived_from (tree, tree); -extern tree initialize_reference (tree, tree, tree, tree *); -extern tree make_temporary_var_for_ref_to_temp (tree, tree); -extern tree strip_top_quals (tree); -extern tree perform_implicit_conversion (tree, tree); +extern tree build_addr_func (tree); +extern tree build_call (tree, tree); +extern bool null_ptr_cst_p (tree); +extern bool sufficient_parms_p (tree); +extern tree type_decays_to (tree); +extern tree build_user_type_conversion (tree, tree, int); +extern tree build_new_function_call (tree, tree); +extern tree build_operator_new_call (tree, tree, tree *, tree *); +extern tree build_new_method_call (tree, tree, tree, tree, int); +extern tree build_special_member_call (tree, tree, tree, tree, int); +extern tree build_new_op (enum tree_code, int, tree, tree, tree, bool *); +extern tree build_op_delete_call (enum tree_code, tree, tree, bool, tree); +extern bool can_convert (tree, tree); +extern bool can_convert_arg (tree, tree, tree); +extern bool can_convert_arg_bad (tree, tree, tree); +extern bool enforce_access (tree, tree); +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 cxx_type_promotes_to (tree); +extern tree type_passed_as (tree); +extern tree convert_for_arg_passing (tree, tree); +extern bool is_properly_derived_from (tree, tree); +extern tree initialize_reference (tree, tree, tree, tree *); +extern tree make_temporary_var_for_ref_to_temp (tree, tree); +extern tree strip_top_quals (tree); +extern tree perform_implicit_conversion (tree, tree); extern tree perform_direct_initialization_if_possible (tree, tree, bool); -extern tree in_charge_arg_for_name (tree); -extern tree build_cxx_call (tree, tree); +extern tree in_charge_arg_for_name (tree); +extern tree build_cxx_call (tree, tree); #ifdef ENABLE_CHECKING -extern void validate_conversion_obstack (void); +extern void validate_conversion_obstack (void); #endif /* ENABLE_CHECKING */ /* in class.c */ -extern tree build_base_path (enum tree_code, tree, tree, int); -extern tree convert_to_base (tree, tree, bool, bool); -extern tree convert_to_base_statically (tree, tree); +extern tree build_base_path (enum tree_code, tree, + tree, int); +extern tree convert_to_base (tree, tree, bool, bool); +extern tree convert_to_base_statically (tree, tree); extern tree build_vtbl_ref (tree, tree); extern tree build_vfn_ref (tree, tree); -extern tree get_vtable_decl (tree, int); -extern void resort_type_method_vec - (void *, void *, gt_pointer_operator, void *); +extern tree get_vtable_decl (tree, int); +extern void resort_type_method_vec (void *, void *, + gt_pointer_operator, void *); extern void add_method (tree, tree, tree); extern int currently_open_class (tree); extern tree currently_open_derived_class (tree); @@ -3696,45 +3697,45 @@ extern int current_lang_depth (void); extern void push_lang_context (tree); extern void pop_lang_context (void); extern tree instantiate_type (tree, tree, tsubst_flags_t); -extern void print_class_statistics (void); +extern void print_class_statistics (void); extern void cxx_print_statistics (void); -extern void cxx_print_xnode (FILE *, tree, int); -extern void cxx_print_decl (FILE *, tree, int); -extern void cxx_print_type (FILE *, tree, int); -extern void cxx_print_identifier (FILE *, tree, int); +extern void cxx_print_xnode (FILE *, tree, int); +extern void cxx_print_decl (FILE *, tree, int); +extern void cxx_print_type (FILE *, tree, int); +extern void cxx_print_identifier (FILE *, tree, int); extern void cxx_print_error_function (struct diagnostic_context *, const char *); extern void build_self_reference (void); extern int same_signature_p (tree, tree); extern void warn_hidden (tree); extern void maybe_add_class_template_decl_list (tree, tree, int); -extern void unreverse_member_declarations (tree); -extern void invalidate_class_lookup_cache (void); -extern void maybe_note_name_used_in_class (tree, tree); -extern void note_name_declared_in_class (tree, tree); -extern tree get_vtbl_decl_for_binfo (tree); -extern tree get_vtt_name (tree); -extern tree get_primary_binfo (tree); +extern void unreverse_member_declarations (tree); +extern void invalidate_class_lookup_cache (void); +extern void maybe_note_name_used_in_class (tree, tree); +extern void note_name_declared_in_class (tree, tree); +extern tree get_vtbl_decl_for_binfo (tree); +extern tree get_vtt_name (tree); +extern tree get_primary_binfo (tree); extern void debug_class (tree); -extern void debug_thunks (tree); +extern void debug_thunks (tree); extern tree cp_fold_obj_type_ref (tree, tree); -extern void set_linkage_according_to_type (tree, tree); -extern void determine_key_method (tree); -extern void check_for_override (tree, tree); +extern void set_linkage_according_to_type (tree, tree); +extern void determine_key_method (tree); +extern void check_for_override (tree, tree); /* in cvt.c */ -extern tree convert_to_reference (tree, tree, int, int, tree); -extern tree convert_from_reference (tree); -extern tree force_rvalue (tree); -extern tree ocp_convert (tree, tree, int, int); -extern tree cp_convert (tree, tree); -extern tree convert_to_void (tree, const char */*implicit context*/); -extern tree convert_force (tree, tree, int); -extern tree build_type_conversion (tree, tree); -extern tree build_expr_type_conversion (int, tree, bool); -extern tree type_promotes_to (tree); -extern tree perform_qualification_conversions (tree, tree); -extern void clone_function_decl (tree, int); +extern tree convert_to_reference (tree, tree, int, int, tree); +extern tree convert_from_reference (tree); +extern tree force_rvalue (tree); +extern tree ocp_convert (tree, tree, int, int); +extern tree cp_convert (tree, tree); +extern tree convert_to_void (tree, const char */*implicit context*/); +extern tree convert_force (tree, tree, int); +extern tree build_type_conversion (tree, tree); +extern tree build_expr_type_conversion (int, tree, bool); +extern tree type_promotes_to (tree); +extern tree perform_qualification_conversions (tree, tree); +extern void clone_function_decl (tree, int); extern void adjust_clone_args (tree); /* decl.c */ @@ -3743,12 +3744,12 @@ extern void insert_block (tree); extern tree pushdecl (tree); extern void cxx_init_decl_processing (void); enum cp_tree_node_structure_enum cp_tree_node_structure - (union lang_tree_node *); + (union lang_tree_node *); extern bool cxx_mark_addressable (tree); extern void cxx_push_function_context (struct function *); extern void cxx_pop_function_context (struct function *); -extern void maybe_push_cleanup_level (tree); -extern void finish_scope (void); +extern void maybe_push_cleanup_level (tree); +extern void finish_scope (void); extern void push_switch (tree); extern void pop_switch (void); extern tree pushtag (tree, tree, tag_scope); @@ -3756,14 +3757,14 @@ extern tree make_anon_name (void); extern int decls_match (tree, tree); extern tree duplicate_decls (tree, tree); extern tree pushdecl_top_level (tree); -extern tree pushdecl_top_level_and_finish (tree, tree); -extern tree push_using_decl (tree, tree); -extern tree declare_local_label (tree); +extern tree pushdecl_top_level_and_finish (tree, tree); +extern tree push_using_decl (tree, tree); +extern tree declare_local_label (tree); extern tree define_label (location_t, tree); extern void check_goto (tree); extern tree make_typename_type (tree, tree, enum tag_types, tsubst_flags_t); extern tree make_unbound_class_template (tree, tree, tree, tsubst_flags_t); -extern tree check_for_out_of_scope_variable (tree); +extern tree check_for_out_of_scope_variable (tree); extern tree build_library_fn (tree, tree); extern tree build_library_fn_ptr (const char *, tree); extern tree build_cp_library_fn_ptr (const char *, tree); @@ -3779,10 +3780,10 @@ extern void cp_finish_decl (tree, tree, tree, int); extern void finish_decl (tree, tree, tree); extern int cp_complete_array_type (tree *, tree, bool); extern tree build_ptrmemfunc_type (tree); -extern tree build_ptrmem_type (tree, tree); +extern tree build_ptrmem_type (tree, tree); /* the grokdeclarator prototype is in decl.h */ extern int copy_fn_p (tree); -extern tree get_scope_of_declarator (const cp_declarator *); +extern tree get_scope_of_declarator (const cp_declarator *); extern void grok_special_member_properties (tree); extern int grok_ctor_properties (tree, tree); extern void grok_op_properties (tree, bool); @@ -3792,82 +3793,87 @@ extern void xref_basetypes (tree, tree); extern tree start_enum (tree); extern void finish_enum (tree); extern void build_enumerator (tree, tree, tree); -extern void start_preparsed_function (tree, tree, int); +extern void start_preparsed_function (tree, tree, int); extern int start_function (cp_decl_specifier_seq *, const cp_declarator *, tree); extern tree begin_function_body (void); extern void finish_function_body (tree); extern tree finish_function (int); extern tree start_method (cp_decl_specifier_seq *, const cp_declarator *, tree); extern tree finish_method (tree); -extern void maybe_register_incomplete_var (tree); +extern void maybe_register_incomplete_var (tree); extern void complete_vars (tree); extern void finish_stmt (void); extern void print_other_binding_stack (struct cp_binding_level *); -extern void revert_static_member_fn (tree); -extern void fixup_anonymous_aggr (tree); -extern int check_static_variable_definition (tree, tree); +extern void revert_static_member_fn (tree); +extern void fixup_anonymous_aggr (tree); +extern int check_static_variable_definition (tree, tree); extern tree compute_array_index_type (tree, tree); -extern tree check_default_argument (tree, tree); -typedef int (*walk_namespaces_fn) (tree, void *); -extern int walk_namespaces (walk_namespaces_fn, - void *); -extern int wrapup_globals_for_namespace (tree, void *); -extern tree create_implicit_typedef (tree, tree); -extern tree maybe_push_decl (tree); +extern tree check_default_argument (tree, tree); +typedef int (*walk_namespaces_fn) (tree, void *); +extern int walk_namespaces (walk_namespaces_fn, + void *); +extern int wrapup_globals_for_namespace (tree, void *); +extern tree create_implicit_typedef (tree, tree); +extern tree maybe_push_decl (tree); extern tree force_target_expr (tree, tree); -extern tree build_target_expr_with_type (tree, tree); -extern int local_variable_p (tree); -extern int nonstatic_local_decl_p (tree); -extern tree declare_global_var (tree, tree); -extern tree register_dtor_fn (tree); -extern tmpl_spec_kind current_tmpl_spec_kind (int); +extern tree build_target_expr_with_type (tree, tree); +extern int local_variable_p (tree); +extern int nonstatic_local_decl_p (tree); +extern tree declare_global_var (tree, tree); +extern tree register_dtor_fn (tree); +extern tmpl_spec_kind current_tmpl_spec_kind (int); extern tree cp_fname_init (const char *, tree *); -extern tree builtin_function (const char *name, tree type, - int code, - enum built_in_class cl, - const char *libname, tree attrs); -extern tree check_elaborated_type_specifier (enum tag_types, tree, bool); -extern void warn_extern_redeclared_static (tree, tree); -extern const char *cxx_comdat_group (tree); +extern tree builtin_function (const char *name, tree type, + int code, + enum built_in_class cl, + const char *libname, + tree attrs); +extern tree check_elaborated_type_specifier (enum tag_types, tree, bool); +extern void warn_extern_redeclared_static (tree, tree); +extern const char *cxx_comdat_group (tree); extern bool cp_missing_noreturn_ok_p (tree); -extern void initialize_artificial_var (tree, tree); -extern tree check_var_type (tree, tree); +extern void initialize_artificial_var (tree, tree); +extern tree check_var_type (tree, tree); extern bool have_extern_spec; /* in decl2.c */ -extern bool check_java_method (tree); -extern cp_cv_quals grok_method_quals (tree, tree, cp_cv_quals); -extern void maybe_retrofit_in_chrg (tree); -extern void maybe_make_one_only (tree); -extern void grokclassfn (tree, tree, enum overload_flags, cp_cv_quals); -extern tree grok_array_decl (tree, tree); -extern tree delete_sanity (tree, tree, bool, int); -extern tree check_classfn (tree, tree, tree); -extern void check_member_template (tree); -extern tree grokfield (const cp_declarator *, cp_decl_specifier_seq *, tree, tree, tree); -extern tree grokbitfield (const cp_declarator *, cp_decl_specifier_seq *, tree); -extern void cplus_decl_attributes (tree *, tree, int); -extern void finish_anon_union (tree); -extern void cp_finish_file (void); -extern tree coerce_new_type (tree); -extern tree coerce_delete_type (tree); -extern void comdat_linkage (tree); -extern void determine_visibility (tree); -extern void import_export_decl (tree); +extern bool check_java_method (tree); +extern cp_cv_quals grok_method_quals (tree, tree, cp_cv_quals); +extern void maybe_retrofit_in_chrg (tree); +extern void maybe_make_one_only (tree); +extern void grokclassfn (tree, tree, + enum overload_flags, + cp_cv_quals); +extern tree grok_array_decl (tree, tree); +extern tree delete_sanity (tree, tree, bool, int); +extern tree check_classfn (tree, tree, tree); +extern void check_member_template (tree); +extern tree grokfield (const cp_declarator *, cp_decl_specifier_seq *, + tree, tree, tree); +extern tree grokbitfield (const cp_declarator *, cp_decl_specifier_seq *, + tree); +extern void cplus_decl_attributes (tree *, tree, int); +extern void finish_anon_union (tree); +extern void cp_finish_file (void); +extern tree coerce_new_type (tree); +extern tree coerce_delete_type (tree); +extern void comdat_linkage (tree); +extern void determine_visibility (tree); +extern void import_export_decl (tree); extern tree build_cleanup (tree); -extern tree build_offset_ref_call_from_tree (tree, tree); -extern void check_default_args (tree); -extern void mark_used (tree); -extern void finish_static_data_member_decl (tree, tree, 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 *, tree); -extern void mark_needed (tree); -extern bool decl_needed_p (tree); -extern void note_vague_linkage_fn (tree); +extern tree build_offset_ref_call_from_tree (tree, tree); +extern void check_default_args (tree); +extern void mark_used (tree); +extern void finish_static_data_member_decl (tree, tree, 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 *, tree); +extern void mark_needed (tree); +extern bool decl_needed_p (tree); +extern void note_vague_linkage_fn (tree); /* in error.c */ extern void init_error (void); @@ -3875,9 +3881,9 @@ extern const char *type_as_string (tree, int); extern const char *decl_as_string (tree, int); extern const char *expr_as_string (tree, int); extern const char *lang_decl_name (tree, int); -extern const char *language_to_string (enum languages); -extern const char *class_key_or_enum_as_string (tree); -extern void print_instantiation_context (void); +extern const char *language_to_string (enum languages); +extern const char *class_key_or_enum_as_string (tree); +extern void print_instantiation_context (void); /* in except.c */ extern void init_exception_processing (void); @@ -3894,12 +3900,12 @@ extern tree eh_type_info (tree); extern rtx cxx_expand_expr (tree, rtx, enum machine_mode, int, rtx *); -extern tree cplus_expand_constant (tree); +extern tree cplus_expand_constant (tree); /* friend.c */ extern int is_friend (tree, tree); extern void make_friend_class (tree, tree, bool); -extern void add_friend (tree, tree, bool); +extern void add_friend (tree, tree, bool); extern tree do_friend (tree, tree, tree, tree, enum overload_flags, cp_cv_quals, int); /* in init.c */ @@ -3909,77 +3915,84 @@ extern tree build_aggr_init (tree, tree, int); extern tree build_init (tree, tree, int); extern int is_aggr_type (tree, int); extern tree get_type_value (tree); -extern tree build_zero_init (tree, tree, bool); +extern tree build_zero_init (tree, tree, bool); extern tree build_offset_ref (tree, tree, bool); extern tree build_new (tree, tree, tree, tree, int); extern tree build_vec_init (tree, tree, tree, int); extern tree build_x_delete (tree, int, tree); -extern tree build_delete (tree, tree, special_function_kind, int, int); +extern tree build_delete (tree, tree, + special_function_kind, + int, int); extern void push_base_cleanups (void); -extern tree build_vec_delete (tree, tree, special_function_kind, int); -extern tree create_temporary_var (tree); -extern void initialize_vtbl_ptrs (tree); -extern tree build_java_class_ref (tree); -extern tree integral_constant_value (tree); +extern tree build_vec_delete (tree, tree, + special_function_kind, int); +extern tree create_temporary_var (tree); +extern void initialize_vtbl_ptrs (tree); +extern tree build_java_class_ref (tree); +extern tree integral_constant_value (tree); /* in lex.c */ extern void cxx_dup_lang_specific_decl (tree); extern void yyungetc (int, int); -extern tree unqualified_name_lookup_error (tree); -extern tree unqualified_fn_lookup_error (tree); +extern tree unqualified_name_lookup_error (tree); +extern tree unqualified_fn_lookup_error (tree); extern tree build_lang_decl (enum tree_code, tree, tree); extern void retrofit_lang_decl (tree); -extern tree copy_decl (tree); -extern tree copy_type (tree); +extern tree copy_decl (tree); +extern tree copy_type (tree); extern tree cxx_make_type (enum tree_code); extern tree make_aggr_type (enum tree_code); extern void yyerror (const char *); extern void yyhook (int); extern bool cxx_init (void); -extern void cxx_finish (void); +extern void cxx_finish (void); /* in method.c */ -extern void init_method (void); -extern tree make_thunk (tree, bool, tree, tree); -extern void finish_thunk (tree); -extern void use_thunk (tree, bool); -extern void synthesize_method (tree); -extern tree implicitly_declare_fn (special_function_kind, tree, bool); -extern tree lazily_declare_fn (special_function_kind, tree); -extern tree skip_artificial_parms_for (tree, tree); -extern tree make_alias_for (tree, tree); +extern void init_method (void); +extern tree make_thunk (tree, bool, tree, tree); +extern void finish_thunk (tree); +extern void use_thunk (tree, bool); +extern void synthesize_method (tree); +extern tree implicitly_declare_fn (special_function_kind, + tree, bool); +extern tree lazily_declare_fn (special_function_kind, + tree); +extern tree skip_artificial_parms_for (tree, tree); +extern tree make_alias_for (tree, tree); /* In optimize.c */ -extern bool maybe_clone_body (tree); +extern bool maybe_clone_body (tree); /* in pt.c */ extern void check_template_shadow (tree); -extern tree get_innermost_template_args (tree, int); +extern tree get_innermost_template_args (tree, int); extern void maybe_begin_member_template_processing (tree); extern void maybe_end_member_template_processing (void); -extern tree finish_member_template_decl (tree); +extern tree finish_member_template_decl (tree); extern void begin_template_parm_list (void); -extern void begin_specialization (void); -extern void reset_specialization (void); -extern void end_specialization (void); -extern void begin_explicit_instantiation (void); -extern void end_explicit_instantiation (void); -extern tree check_explicit_specialization (tree, tree, int, int); +extern void begin_specialization (void); +extern void reset_specialization (void); +extern void end_specialization (void); +extern void begin_explicit_instantiation (void); +extern void end_explicit_instantiation (void); +extern tree check_explicit_specialization (tree, tree, int, int); extern tree process_template_parm (tree, tree, bool); extern tree end_template_parm_list (tree); extern void end_template_decl (void); extern tree current_template_args (void); extern tree push_template_decl (tree); -extern tree push_template_decl_real (tree, int); -extern void redeclare_class_template (tree, tree); -extern tree lookup_template_class (tree, tree, tree, tree, int, tsubst_flags_t); -extern tree lookup_template_function (tree, tree); +extern tree push_template_decl_real (tree, int); +extern void redeclare_class_template (tree, tree); +extern tree lookup_template_class (tree, tree, tree, tree, + int, tsubst_flags_t); +extern tree lookup_template_function (tree, tree); extern int uses_template_parms (tree); extern int uses_template_parms_level (tree, int); extern tree instantiate_class_template (tree); extern tree instantiate_template (tree, tree, tsubst_flags_t); -extern int fn_type_unification (tree, tree, tree, tree, tree, unification_kind_t); +extern int fn_type_unification (tree, tree, tree, tree, + tree, unification_kind_t); extern void mark_decl_instantiated (tree, int); extern int more_specialized_fn (tree, tree, int); extern void mark_class_instantiated (tree, int); @@ -3989,78 +4002,80 @@ extern tree instantiate_decl (tree, int, int); extern int push_tinst_level (tree); extern void pop_tinst_level (void); extern int more_specialized_class (tree, tree, tree); -extern int comp_template_parms (tree, tree); -extern int template_class_depth (tree); -extern int is_specialization_of (tree, tree); -extern bool is_specialization_of_friend (tree, tree); -extern int comp_template_args (tree, tree); +extern int comp_template_parms (tree, tree); +extern int template_class_depth (tree); +extern int is_specialization_of (tree, tree); +extern bool is_specialization_of_friend (tree, tree); +extern int comp_template_args (tree, tree); extern void maybe_process_partial_specialization (tree); -extern tree most_specialized_instantiation (tree); -extern void print_candidates (tree); -extern void instantiate_pending_templates (int); -extern tree tsubst_default_argument (tree, tree, tree); -extern tree tsubst_copy_and_build (tree, tree, tsubst_flags_t, tree, bool); +extern tree most_specialized_instantiation (tree); +extern void print_candidates (tree); +extern void instantiate_pending_templates (int); +extern tree tsubst_default_argument (tree, tree, tree); +extern tree tsubst_copy_and_build (tree, tree, tsubst_flags_t, + tree, bool); extern tree most_general_template (tree); extern tree get_mostly_instantiated_function_type (tree); -extern int problematic_instantiation_changed (void); +extern int problematic_instantiation_changed (void); extern void record_last_problematic_instantiation (void); -extern tree current_instantiation (void); +extern tree current_instantiation (void); extern tree maybe_get_template_decl_from_type_decl (tree); extern int processing_template_parmlist; -extern bool dependent_type_p (tree); +extern bool dependent_type_p (tree); extern bool any_dependent_template_arguments_p (tree); -extern bool dependent_template_p (tree); -extern bool dependent_template_id_p (tree, tree); -extern bool type_dependent_expression_p (tree); +extern bool dependent_template_p (tree); +extern bool dependent_template_id_p (tree, tree); +extern bool type_dependent_expression_p (tree); extern bool any_type_dependent_arguments_p (tree); -extern bool value_dependent_expression_p (tree); -extern tree resolve_typename_type (tree, bool); -extern tree template_for_substitution (tree); -extern tree build_non_dependent_expr (tree); -extern tree build_non_dependent_args (tree); -extern bool reregister_specialization (tree, tree, tree); -extern tree fold_non_dependent_expr (tree); -extern tree fold_decl_constant_value (tree); +extern bool value_dependent_expression_p (tree); +extern tree resolve_typename_type (tree, bool); +extern tree template_for_substitution (tree); +extern tree build_non_dependent_expr (tree); +extern tree build_non_dependent_args (tree); +extern bool reregister_specialization (tree, tree, tree); +extern tree fold_non_dependent_expr (tree); +extern tree fold_decl_constant_value (tree); /* in repo.c */ -extern void init_repo (void); -extern int repo_emit_p (tree); -extern bool repo_export_class_p (tree); -extern void finish_repo (void); +extern void init_repo (void); +extern int repo_emit_p (tree); +extern bool repo_export_class_p (tree); +extern void finish_repo (void); /* in rtti.c */ /* A vector of all tinfo decls that haven't been emitted yet. */ extern GTY(()) VEC(tree,gc) *unemitted_tinfo_decls; -extern void init_rtti_processing (void); -extern tree build_typeid (tree); -extern tree get_tinfo_decl (tree); -extern tree get_typeid (tree); -extern tree build_dynamic_cast (tree, tree); -extern void emit_support_tinfos (void); -extern bool emit_tinfo_decl (tree); +extern void init_rtti_processing (void); +extern tree build_typeid (tree); +extern tree get_tinfo_decl (tree); +extern tree get_typeid (tree); +extern tree build_dynamic_cast (tree, tree); +extern void emit_support_tinfos (void); +extern bool emit_tinfo_decl (tree); /* in search.c */ -extern bool accessible_base_p (tree, tree, bool); -extern tree lookup_base (tree, tree, base_access, base_kind *); -extern tree dcast_base_hint (tree, tree); -extern int accessible_p (tree, tree, bool); -extern tree lookup_field_1 (tree, tree, bool); +extern bool accessible_base_p (tree, tree, bool); +extern tree lookup_base (tree, tree, base_access, + base_kind *); +extern tree dcast_base_hint (tree, tree); +extern int accessible_p (tree, tree, bool); +extern tree lookup_field_1 (tree, tree, bool); extern tree lookup_field (tree, tree, int, bool); -extern int lookup_fnfields_1 (tree, tree); -extern int class_method_index_for_fn (tree, tree); +extern int lookup_fnfields_1 (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 int look_for_overrides (tree, tree); -extern void get_pure_virtuals (tree); +extern void get_pure_virtuals (tree); extern void maybe_suppress_debug_info (tree); extern void note_debug_info_needed (tree); extern void print_search_statistics (void); extern void reinit_search_statistics (void); extern tree current_scope (void); -extern int at_function_scope_p (void); -extern bool at_class_scope_p (void); -extern bool at_namespace_scope_p (void); +extern int at_function_scope_p (void); +extern bool at_class_scope_p (void); +extern bool at_namespace_scope_p (void); extern tree context_for_name_lookup (tree); extern tree lookup_conversions (tree); extern tree binfo_from_vbase (tree); @@ -4071,13 +4086,13 @@ extern tree dfs_walk_all (tree, tree (*) (tree, void *), tree (*) (tree, void *), void *); extern tree dfs_walk_once (tree, tree (*) (tree, void *), tree (*) (tree, void *), void *); -extern tree binfo_via_virtual (tree, tree); -extern tree build_baselink (tree, tree, tree, tree); +extern tree binfo_via_virtual (tree, tree); +extern tree build_baselink (tree, tree, tree, tree); extern tree adjust_result_of_qualified_name_lookup - (tree, tree, tree); + (tree, tree, tree); extern tree copied_binfo (tree, tree); extern tree original_binfo (tree, tree); -extern int shared_member_p (tree); +extern int shared_member_p (tree); /* in semantics.c */ extern void push_deferring_access_checks (deferring_kind); @@ -4085,119 +4100,119 @@ extern void resume_deferring_access_checks (void); extern void stop_deferring_access_checks (void); extern void pop_deferring_access_checks (void); extern tree get_deferred_access_checks (void); -extern void pop_to_parent_deferring_access_checks (void); +extern void pop_to_parent_deferring_access_checks (void); extern void perform_deferred_access_checks (void); extern void perform_or_defer_access_check (tree, tree); extern int stmts_are_full_exprs_p (void); -extern void init_cp_semantics (void); +extern void init_cp_semantics (void); extern tree do_poplevel (tree); extern void add_decl_expr (tree); -extern tree finish_expr_stmt (tree); -extern tree begin_if_stmt (void); -extern void finish_if_stmt_cond (tree, tree); -extern tree finish_then_clause (tree); +extern tree finish_expr_stmt (tree); +extern tree begin_if_stmt (void); +extern void finish_if_stmt_cond (tree, tree); +extern tree finish_then_clause (tree); extern void begin_else_clause (tree); -extern void finish_else_clause (tree); -extern void finish_if_stmt (tree); -extern tree begin_while_stmt (void); -extern void finish_while_stmt_cond (tree, tree); -extern void finish_while_stmt (tree); -extern tree begin_do_stmt (void); -extern void finish_do_body (tree); -extern void finish_do_stmt (tree, tree); -extern tree finish_return_stmt (tree); -extern tree begin_for_stmt (void); -extern void finish_for_init_stmt (tree); -extern void finish_for_cond (tree, tree); -extern void finish_for_expr (tree, tree); -extern void finish_for_stmt (tree); -extern tree finish_break_stmt (void); -extern tree finish_continue_stmt (void); -extern tree begin_switch_stmt (void); -extern void finish_switch_cond (tree, tree); -extern void finish_switch_stmt (tree); -extern tree finish_case_label (tree, tree); -extern tree finish_goto_stmt (tree); -extern tree begin_try_block (void); -extern void finish_try_block (tree); +extern void finish_else_clause (tree); +extern void finish_if_stmt (tree); +extern tree begin_while_stmt (void); +extern void finish_while_stmt_cond (tree, tree); +extern void finish_while_stmt (tree); +extern tree begin_do_stmt (void); +extern void finish_do_body (tree); +extern void finish_do_stmt (tree, tree); +extern tree finish_return_stmt (tree); +extern tree begin_for_stmt (void); +extern void finish_for_init_stmt (tree); +extern void finish_for_cond (tree, tree); +extern void finish_for_expr (tree, tree); +extern void finish_for_stmt (tree); +extern tree finish_break_stmt (void); +extern tree finish_continue_stmt (void); +extern tree begin_switch_stmt (void); +extern void finish_switch_cond (tree, tree); +extern void finish_switch_stmt (tree); +extern tree finish_case_label (tree, tree); +extern tree finish_goto_stmt (tree); +extern tree begin_try_block (void); +extern void finish_try_block (tree); extern tree begin_eh_spec_block (void); extern void finish_eh_spec_block (tree, tree); -extern void finish_handler_sequence (tree); -extern tree begin_function_try_block (void); -extern void finish_function_try_block (tree); +extern void finish_handler_sequence (tree); +extern tree begin_function_try_block (void); +extern void finish_function_try_block (tree); extern void finish_function_handler_sequence (tree); -extern void finish_cleanup_try_block (tree); -extern tree begin_handler (void); -extern void finish_handler_parms (tree, tree); -extern void finish_handler (tree); -extern void finish_cleanup (tree, tree); +extern void finish_cleanup_try_block (tree); +extern tree begin_handler (void); +extern void finish_handler_parms (tree, tree); +extern void finish_handler (tree); +extern void finish_cleanup (tree, tree); enum { BCS_NO_SCOPE = 1, BCS_TRY_BLOCK = 2, BCS_FN_BODY = 4 }; -extern tree begin_compound_stmt (unsigned int); +extern tree begin_compound_stmt (unsigned int); -extern void finish_compound_stmt (tree); -extern tree finish_asm_stmt (int, tree, tree, tree, tree); -extern tree finish_label_stmt (tree); -extern void finish_label_decl (tree); -extern tree finish_parenthesized_expr (tree); +extern void finish_compound_stmt (tree); +extern tree finish_asm_stmt (int, tree, tree, tree, tree); +extern tree finish_label_stmt (tree); +extern void finish_label_decl (tree); +extern tree finish_parenthesized_expr (tree); extern tree finish_non_static_data_member (tree, tree, tree); -extern tree begin_stmt_expr (void); -extern tree finish_stmt_expr_expr (tree, tree); -extern tree finish_stmt_expr (tree, bool); -extern tree perform_koenig_lookup (tree, tree); -extern tree finish_call_expr (tree, tree, bool, bool); -extern tree finish_increment_expr (tree, enum tree_code); -extern tree finish_this_expr (void); +extern tree begin_stmt_expr (void); +extern tree finish_stmt_expr_expr (tree, tree); +extern tree finish_stmt_expr (tree, bool); +extern tree perform_koenig_lookup (tree, tree); +extern tree finish_call_expr (tree, tree, bool, 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_compound_literal (tree, tree); -extern tree finish_fname (tree); -extern void finish_translation_unit (void); -extern tree finish_template_type_parm (tree, tree); +extern tree finish_unary_op_expr (enum tree_code, tree); +extern tree finish_compound_literal (tree, tree); +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); -extern void finish_template_decl (tree); -extern tree finish_template_type (tree, tree, int); -extern tree finish_base_specifier (tree, tree, bool); -extern void finish_member_declaration (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); +extern void finish_member_declaration (tree); extern void qualified_name_lookup_error (tree, tree, tree); -extern tree finish_id_expression (tree, tree, tree, +extern tree finish_id_expression (tree, tree, tree, cp_id_kind *, tree *, bool, bool, bool *, const char **); extern tree finish_typeof (tree); -extern void finish_decl_cleanup (tree, tree); -extern void finish_eh_cleanup (tree); -extern void expand_body (tree); -extern void finish_mem_initializers (tree); +extern void finish_decl_cleanup (tree, tree); +extern void finish_eh_cleanup (tree); +extern void expand_body (tree); +extern void finish_mem_initializers (tree); extern tree check_template_template_default_arg (tree); extern void expand_or_defer_fn (tree); extern void check_accessibility_of_qualified_id (tree, tree, tree); -extern tree finish_qualified_id_expr (tree, tree, bool, bool); +extern tree finish_qualified_id_expr (tree, tree, bool, bool); extern void simplify_aggr_init_expr (tree *); extern void finalize_nrv (tree *, tree, tree); -extern void note_decl_for_pch (tree); +extern void note_decl_for_pch (tree); /* in tree.c */ extern void lang_check_failed (const char *, int, - const char *); + const char *); extern tree stabilize_expr (tree, tree *); extern void stabilize_call (tree, tree *); extern bool stabilize_init (tree, tree *); extern tree add_stmt_to_compound (tree, tree); extern tree cxx_maybe_build_cleanup (tree); -extern void init_tree (void); +extern void init_tree (void); extern int pod_type_p (tree); extern int zero_init_p (tree); -extern tree canonical_type_variant (tree); +extern tree canonical_type_variant (tree); extern tree copy_binfo (tree, tree, tree, tree *, int); extern int member_p (tree); -extern cp_lvalue_kind real_lvalue_p (tree); +extern cp_lvalue_kind real_lvalue_p (tree); extern bool builtin_valid_in_constant_expr_p (tree); extern tree build_min (enum tree_code, tree, ...); extern tree build_min_nt (enum tree_code, ...); @@ -4209,8 +4224,8 @@ extern tree hash_tree_cons (tree, tree, tree); extern tree hash_tree_chain (tree, tree); extern int is_overloaded_fn (tree); extern tree get_first_fn (tree); -extern tree ovl_cons (tree, tree); -extern tree build_overload (tree, tree); +extern tree ovl_cons (tree, tree); +extern tree build_overload (tree, tree); extern const char *cxx_printable_name (tree, int); extern tree build_exception_variant (tree, tree); extern tree bind_template_template_parm (tree, tree); @@ -4230,23 +4245,23 @@ extern tree build_dummy_object (tree); extern tree maybe_dummy_object (tree, tree *); extern int is_dummy_object (tree); extern const struct attribute_spec cxx_attribute_table[]; -extern tree make_ptrmem_cst (tree, tree); +extern tree make_ptrmem_cst (tree, tree); extern tree cp_build_type_attribute_variant (tree, tree); -extern tree cp_build_qualified_type_real (tree, int, tsubst_flags_t); +extern tree cp_build_qualified_type_real (tree, int, tsubst_flags_t); #define cp_build_qualified_type(TYPE, QUALS) \ cp_build_qualified_type_real ((TYPE), (QUALS), tf_error | tf_warning) extern special_function_kind special_function_p (tree); -extern int count_trees (tree); -extern int char_type_p (tree); -extern void verify_stmt_tree (tree); -extern tree find_tree (tree, tree); -extern linkage_kind decl_linkage (tree); +extern int count_trees (tree); +extern int char_type_p (tree); +extern void verify_stmt_tree (tree); +extern tree find_tree (tree, tree); +extern linkage_kind decl_linkage (tree); extern tree cp_walk_subtrees (tree*, int*, walk_tree_fn, - void*, struct pointer_set_t*); -extern int cp_cannot_inline_tree_fn (tree*); -extern tree cp_add_pending_fn_decls (void*,tree); -extern int cp_auto_var_in_fn_p (tree,tree); -extern tree fold_if_not_in_template (tree); + void*, struct pointer_set_t*); +extern int cp_cannot_inline_tree_fn (tree*); +extern tree cp_add_pending_fn_decls (void*,tree); +extern int cp_auto_var_in_fn_p (tree,tree); +extern tree fold_if_not_in_template (tree); /* in typeck.c */ extern int string_conv_p (tree, tree, int); @@ -4260,14 +4275,14 @@ extern tree original_type (tree); extern bool comp_except_specs (tree, tree, bool); extern bool comptypes (tree, tree, int); extern bool compparms (tree, tree); -extern int comp_cv_qualification (tree, tree); -extern int comp_cv_qual_signature (tree, tree); -extern tree cxx_sizeof_or_alignof_expr (tree, enum tree_code); -extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, bool); +extern int comp_cv_qualification (tree, tree); +extern int comp_cv_qual_signature (tree, tree); +extern tree cxx_sizeof_or_alignof_expr (tree, enum tree_code); +extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, bool); #define cxx_sizeof_nowarn(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, false) extern tree inline_conversion (tree); extern tree decay_conversion (tree); -extern tree default_conversion (tree); +extern tree default_conversion (tree); extern tree build_class_member_access_expr (tree, tree, tree, bool); extern tree finish_class_member_access_expr (tree, tree); extern tree build_x_indirect_ref (tree, const char *); @@ -4279,7 +4294,7 @@ extern tree build_x_binary_op (enum tree_code, tree, tree, extern tree build_x_unary_op (enum tree_code, tree); extern tree unary_complex_lvalue (enum tree_code, tree); extern tree build_x_conditional_expr (tree, tree, tree); -extern tree build_x_compound_expr_from_list (tree, const char *); +extern tree build_x_compound_expr_from_list (tree, const char *); extern tree build_x_compound_expr (tree, tree); extern tree build_compound_expr (tree, tree); extern tree build_static_cast (tree, tree); @@ -4288,35 +4303,36 @@ extern tree build_const_cast (tree, tree); extern tree build_c_cast (tree, tree); extern tree build_x_modify_expr (tree, enum tree_code, tree); extern tree build_modify_expr (tree, enum tree_code, tree); -extern tree convert_for_initialization (tree, tree, tree, int, const char *, tree, int); +extern tree convert_for_initialization (tree, tree, tree, int, + const char *, tree, int); extern int comp_ptr_ttypes (tree, tree); extern int ptr_reasonably_similar (tree, tree); extern tree build_ptrmemfunc (tree, tree, int, bool); -extern int cp_type_quals (tree); -extern bool cp_has_mutable_p (tree); -extern bool at_least_as_qualified_p (tree, tree); -extern void cp_apply_type_quals_to_decl (int, tree); -extern tree build_ptrmemfunc1 (tree, tree, tree); -extern void expand_ptrmemfunc_cst (tree, tree *, tree *); -extern tree pfn_from_ptrmemfunc (tree); +extern int cp_type_quals (tree); +extern bool cp_has_mutable_p (tree); +extern bool at_least_as_qualified_p (tree, tree); +extern void cp_apply_type_quals_to_decl (int, tree); +extern tree build_ptrmemfunc1 (tree, tree, tree); +extern void expand_ptrmemfunc_cst (tree, tree *, tree *); +extern tree pfn_from_ptrmemfunc (tree); extern tree type_after_usual_arithmetic_conversions (tree, tree); -extern tree composite_pointer_type (tree, tree, tree, tree, - const char*); +extern tree composite_pointer_type (tree, tree, tree, tree, + const char*); extern tree merge_types (tree, tree); -extern tree check_return_expr (tree); +extern tree check_return_expr (tree); #define cp_build_binary_op(code, arg1, arg2) \ build_binary_op(code, arg1, arg2, 1) #define cxx_sizeof(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, true) -extern tree build_ptrmemfunc_access_expr (tree, tree); -extern tree build_address (tree); -extern tree build_nop (tree, tree); -extern tree non_reference (tree); -extern tree lookup_anon_field (tree, tree); -extern bool invalid_nonstatic_memfn_p (tree); -extern tree convert_member_func_to_ptr (tree, tree); -extern tree convert_ptrmem (tree, tree, bool, bool); -extern int lvalue_or_else (tree, enum lvalue_use); -extern int lvalue_p (tree); +extern tree build_ptrmemfunc_access_expr (tree, tree); +extern tree build_address (tree); +extern tree build_nop (tree, tree); +extern tree non_reference (tree); +extern tree lookup_anon_field (tree, tree); +extern bool invalid_nonstatic_memfn_p (tree); +extern tree convert_member_func_to_ptr (tree, tree); +extern tree convert_ptrmem (tree, tree, bool, bool); +extern int lvalue_or_else (tree, enum lvalue_use); +extern int lvalue_p (tree); /* in typeck2.c */ extern void require_complete_eh_spec_types (tree, tree); @@ -4337,38 +4353,38 @@ 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_functional_cast (tree, tree); -extern tree add_exception_specifier (tree, tree, int); -extern tree merge_exception_specifiers (tree, tree); +extern tree add_exception_specifier (tree, tree, int); +extern tree merge_exception_specifiers (tree, tree); /* in mangle.c */ -extern void init_mangle (void); -extern void mangle_decl (tree); -extern const char *mangle_type_string (tree); -extern tree mangle_typeinfo_for_type (tree); -extern tree mangle_typeinfo_string_for_type (tree); -extern tree mangle_vtbl_for_type (tree); -extern tree mangle_vtt_for_type (tree); -extern tree mangle_ctor_vtbl_for_type (tree, tree); -extern tree mangle_thunk (tree, int, tree, tree); -extern tree mangle_conv_op_name_for_type (tree); -extern tree mangle_guard_variable (tree); -extern tree mangle_ref_init_variable (tree); +extern void init_mangle (void); +extern void mangle_decl (tree); +extern const char *mangle_type_string (tree); +extern tree mangle_typeinfo_for_type (tree); +extern tree mangle_typeinfo_string_for_type (tree); +extern tree mangle_vtbl_for_type (tree); +extern tree mangle_vtt_for_type (tree); +extern tree mangle_ctor_vtbl_for_type (tree, tree); +extern tree mangle_thunk (tree, int, tree, tree); +extern tree mangle_conv_op_name_for_type (tree); +extern tree mangle_guard_variable (tree); +extern tree mangle_ref_init_variable (tree); /* in dump.c */ -extern bool cp_dump_tree (void *, tree); +extern bool cp_dump_tree (void *, tree); /* In cp/cp-objcp-common.c. */ -extern HOST_WIDE_INT cxx_get_alias_set (tree); -extern bool cxx_warn_unused_global_decl (tree); -extern tree cp_expr_size (tree); -extern size_t cp_tree_size (enum tree_code); -extern bool cp_var_mod_type_p (tree, tree); -extern void cxx_initialize_diagnostics (struct diagnostic_context *); -extern int cxx_types_compatible_p (tree, tree); +extern HOST_WIDE_INT cxx_get_alias_set (tree); +extern bool cxx_warn_unused_global_decl (tree); +extern tree cp_expr_size (tree); +extern size_t cp_tree_size (enum tree_code); +extern bool cp_var_mod_type_p (tree, tree); +extern void cxx_initialize_diagnostics (struct diagnostic_context *); +extern int cxx_types_compatible_p (tree, tree); /* in cp-gimplify.c */ -extern int cp_gimplify_expr (tree *, tree *, tree *); +extern int cp_gimplify_expr (tree *, tree *, tree *); extern void cp_genericize (tree); /* -- end of C++ */ diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index f136d5b..c1eafe7 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -54,7 +54,7 @@ static void warn_ref_binding (tree, tree, tree); narrowing is always done with a NOP_EXPR: In convert.c, convert_to_integer. In c-typeck.c, build_binary_op_nodefault (boolean ops), - and c_common_truthvalue_conversion. + and c_common_truthvalue_conversion. In expr.c: expand_expr, for operands of a MULT_EXPR. In fold-const.c: fold. In tree.c: get_narrower and get_unwidened. @@ -88,7 +88,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force) if (!COMPLETE_TYPE_P (intype)) { error ("can't convert from incomplete type %qT to %qT", - intype, type); + intype, type); return error_mark_node; } @@ -97,7 +97,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force) { if (rval == error_mark_node) error ("conversion of %qE from %qT to %qT is ambiguous", - expr, intype, type); + expr, intype, type); return rval; } } @@ -166,7 +166,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force) if (TYPE_PTRMEMFUNC_P (type)) { error ("cannot convert %qE from type %qT to type %qT", - expr, intype, type); + expr, intype, type); return error_mark_node; } @@ -195,11 +195,11 @@ cp_convert_to_pointer (tree type, tree expr, bool force) { if (force) warning (0, "pointer to member cast from %qT to %qT is via" - " virtual base", intype, type); + " virtual base", intype, type); else { error ("pointer to member cast from %qT to %qT is" - " via virtual base", intype, type); + " via virtual base", intype, type); return error_mark_node; } /* This is a reinterpret cast, whose result is unspecified. @@ -235,7 +235,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force) } } error ("cannot convert %qE from type %qT to type %qT", - expr, intype, type); + expr, intype, type); return error_mark_node; } @@ -282,7 +282,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force) return instantiate_type (type, expr, tf_error | tf_warning); error ("cannot convert %qE from type %qT to type %qT", - expr, intype, type); + expr, intype, type); return error_mark_node; } @@ -322,8 +322,8 @@ convert_to_pointer_force (tree type, tree expr) if (binfo) { expr = build_base_path (code, expr, binfo, 0); - if (expr == error_mark_node) - return error_mark_node; + if (expr == error_mark_node) + return error_mark_node; /* Add any qualifier conversions. */ if (!same_type_p (TREE_TYPE (TREE_TYPE (expr)), TREE_TYPE (type))) @@ -414,16 +414,16 @@ warn_ref_binding (tree reftype, tree intype, tree decl) if (CP_TYPE_VOLATILE_P (ttl) && decl) msg = "initialization of volatile reference type %q#T from" - " rvalue of type %qT"; + " rvalue of type %qT"; else if (CP_TYPE_VOLATILE_P (ttl)) msg = "conversion to volatile reference type %q#T " - " from rvalue of type %qT"; + " from rvalue of type %qT"; else if (decl) msg = "initialization of non-const reference type %q#T from" - " rvalue of type %qT"; + " rvalue of type %qT"; else msg = "conversion to non-const reference type %q#T from" - " rvalue of type %qT"; + " rvalue of type %qT"; pedwarn (msg, reftype, intype); } @@ -438,7 +438,7 @@ warn_ref_binding (tree reftype, tree intype, tree decl) tree convert_to_reference (tree reftype, tree expr, int convtype, - int flags, tree decl) + int flags, tree decl) { tree type = TYPE_MAIN_VARIANT (TREE_TYPE (reftype)); tree intype; @@ -495,7 +495,7 @@ convert_to_reference (tree reftype, tree expr, int convtype, if (! (convtype & CONV_CONST) && !at_least_as_qualified_p (ttl, ttr)) pedwarn ("conversion from %qT to %qT discards qualifiers", - ttr, reftype); + ttr, reftype); } return build_up_reference (reftype, expr, flags, decl); @@ -508,7 +508,7 @@ convert_to_reference (tree reftype, tree expr, int convtype, should be done directly (jason). (int &)ri ---> *(int*)&ri */ /* B* bp; A& ar = (A&)bp; is valid, but it's probably not what they - meant. */ + meant. */ if (TREE_CODE (intype) == POINTER_TYPE && (comptypes (TREE_TYPE (intype), type, COMPARE_BASE | COMPARE_DERIVED))) @@ -627,9 +627,9 @@ ocp_convert (tree type, tree expr, int convtype, int flags) convert, which will call ocp_convert, etc. */ return e; /* For complex data types, we need to perform componentwise - conversion. */ + conversion. */ else if (TREE_CODE (type) == COMPLEX_TYPE) - return fold_if_not_in_template (convert_to_complex (type, e)); + return fold_if_not_in_template (convert_to_complex (type, e)); else if (TREE_CODE (e) == TARGET_EXPR) { /* Don't build a NOP_EXPR of class type. Instead, change the @@ -659,10 +659,10 @@ ocp_convert (tree type, tree expr, int convtype, int flags) { tree intype = TREE_TYPE (e); /* enum = enum, enum = int, enum = float, (enum)pointer are all - errors. */ + errors. */ if (TREE_CODE (type) == ENUMERAL_TYPE && (((INTEGRAL_OR_ENUMERATION_TYPE_P (intype) - || TREE_CODE (intype) == REAL_TYPE) + || TREE_CODE (intype) == REAL_TYPE) && ! (convtype & CONV_STATIC)) || TREE_CODE (intype) == POINTER_TYPE)) { @@ -696,11 +696,11 @@ ocp_convert (tree type, tree expr, int convtype, int flags) { tree ret_val; ret_val = build_type_conversion (type, e); - if (ret_val) - return ret_val; - if (flags & LOOKUP_COMPLAIN) - error ("%q#T used where a %qT was expected", in_vtype, type); - return error_mark_node; + if (ret_val) + return ret_val; + if (flags & LOOKUP_COMPLAIN) + error ("%q#T used where a %qT was expected", in_vtype, type); + return error_mark_node; } return fold_if_not_in_template (convert_to_vector (type, e)); } @@ -762,7 +762,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags) if (flags & LOOKUP_COMPLAIN) error ("conversion from %qT to non-scalar type %qT requested", - TREE_TYPE (expr), type); + TREE_TYPE (expr), type); return error_mark_node; } @@ -804,37 +804,37 @@ convert_to_void (tree expr, const char *implicit) { case COND_EXPR: { - /* The two parts of a cond expr might be separate lvalues. */ - tree op1 = TREE_OPERAND (expr,1); - tree op2 = TREE_OPERAND (expr,2); - tree new_op1 = convert_to_void + /* The two parts of a cond expr might be separate lvalues. */ + tree op1 = TREE_OPERAND (expr,1); + tree op2 = TREE_OPERAND (expr,2); + tree new_op1 = convert_to_void (op1, (implicit && !TREE_SIDE_EFFECTS (op2) ? "second operand of conditional" : NULL)); - tree new_op2 = convert_to_void + tree new_op2 = convert_to_void (op2, (implicit && !TREE_SIDE_EFFECTS (op1) ? "third operand of conditional" : NULL)); expr = build3 (COND_EXPR, TREE_TYPE (new_op1), TREE_OPERAND (expr, 0), new_op1, new_op2); - break; + break; } case COMPOUND_EXPR: { - /* The second part of a compound expr contains the value. */ - tree op1 = TREE_OPERAND (expr,1); - tree new_op1 = convert_to_void + /* The second part of a compound expr contains the value. */ + tree op1 = TREE_OPERAND (expr,1); + tree new_op1 = convert_to_void (op1, (implicit && !TREE_NO_WARNING (expr) ? "right-hand operand of comma" : NULL)); - if (new_op1 != op1) + if (new_op1 != op1) { tree t = build2 (COMPOUND_EXPR, TREE_TYPE (new_op1), TREE_OPERAND (expr, 0), new_op1); expr = t; } - break; + break; } case NON_LVALUE_EXPR: @@ -847,35 +847,35 @@ convert_to_void (tree expr, const char *implicit) case INDIRECT_REF: { - tree type = TREE_TYPE (expr); - int is_reference = TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) - == REFERENCE_TYPE; - int is_volatile = TYPE_VOLATILE (type); - int is_complete = COMPLETE_TYPE_P (complete_type (type)); - - if (is_volatile && !is_complete) - warning (0, "object of incomplete type %qT will not be accessed in %s", - type, implicit ? implicit : "void context"); - else if (is_reference && is_volatile) - warning (0, "object of type %qT will not be accessed in %s", - TREE_TYPE (TREE_OPERAND (expr, 0)), - implicit ? implicit : "void context"); - if (is_reference || !is_volatile || !is_complete) - expr = TREE_OPERAND (expr, 0); - - break; + tree type = TREE_TYPE (expr); + int is_reference = TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) + == REFERENCE_TYPE; + int is_volatile = TYPE_VOLATILE (type); + int is_complete = COMPLETE_TYPE_P (complete_type (type)); + + if (is_volatile && !is_complete) + warning (0, "object of incomplete type %qT will not be accessed in %s", + type, implicit ? implicit : "void context"); + else if (is_reference && is_volatile) + warning (0, "object of type %qT will not be accessed in %s", + TREE_TYPE (TREE_OPERAND (expr, 0)), + implicit ? implicit : "void context"); + if (is_reference || !is_volatile || !is_complete) + expr = TREE_OPERAND (expr, 0); + + break; } case VAR_DECL: { - /* External variables might be incomplete. */ - tree type = TREE_TYPE (expr); - int is_complete = COMPLETE_TYPE_P (complete_type (type)); - - if (TYPE_VOLATILE (type) && !is_complete) - warning (0, "object %qE of incomplete type %qT will not be accessed in %s", - expr, type, implicit ? implicit : "void context"); - break; + /* External variables might be incomplete. */ + tree type = TREE_TYPE (expr); + int is_complete = COMPLETE_TYPE_P (complete_type (type)); + + if (TYPE_VOLATILE (type) && !is_complete) + warning (0, "object %qE of incomplete type %qT will not be accessed in %s", + expr, type, implicit ? implicit : "void context"); + break; } default:; @@ -1074,7 +1074,7 @@ build_expr_type_conversion (int desires, tree expr, bool complain) case FUNCTION_TYPE: case ARRAY_TYPE: return (desires & WANT_POINTER) ? decay_conversion (expr) - : NULL_TREE; + : NULL_TREE; default: return NULL_TREE; } @@ -1120,9 +1120,9 @@ build_expr_type_conversion (int desires, tree expr, bool complain) if (complain) { error ("ambiguous default type conversion from %qT", - basetype); + basetype); error (" candidate conversions include %qD and %qD", - winner, cand); + winner, cand); } return error_mark_node; } diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c index 9f813a5..61adb81 100644 --- a/gcc/cp/cxx-pretty-print.c +++ b/gcc/cp/cxx-pretty-print.c @@ -162,20 +162,20 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t) case IDENTIFIER_NODE: if (t == NULL) - pp_cxx_identifier (pp, "<unnamed>"); + pp_cxx_identifier (pp, "<unnamed>"); else if (IDENTIFIER_TYPENAME_P (t)) - pp_cxx_conversion_function_id (pp, t); + pp_cxx_conversion_function_id (pp, t); else - { - if (is_destructor_name (t)) - { - pp_complement (pp); - /* FIXME: Why is this necessary? */ - if (TREE_TYPE (t)) - t = constructor_name (TREE_TYPE (t)); - } - pp_cxx_tree_identifier (pp, t); - } + { + if (is_destructor_name (t)) + { + pp_complement (pp); + /* FIXME: Why is this necessary? */ + if (TREE_TYPE (t)) + t = constructor_name (TREE_TYPE (t)); + } + pp_cxx_tree_identifier (pp, t); + } break; case TEMPLATE_ID_EXPR: @@ -195,9 +195,9 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t) case TEMPLATE_TYPE_PARM: case TEMPLATE_TEMPLATE_PARM: if (TYPE_IDENTIFIER (t)) - pp_cxx_unqualified_id (pp, TYPE_IDENTIFIER (t)); + pp_cxx_unqualified_id (pp, TYPE_IDENTIFIER (t)); else - pp_cxx_canonical_template_parameter (pp, t); + pp_cxx_canonical_template_parameter (pp, t); break; case TEMPLATE_PARM_INDEX: @@ -255,20 +255,20 @@ pp_cxx_qualified_id (cxx_pretty_printer *pp, tree t) break; /* In Standard C++, functions cannot possibly be used as - nested-name-specifiers. However, there are situations where - is "makes sense" to output the surrounding function name for the - purpose of emphasizing on the scope kind. Just printing the - function name might not be sufficient as it may be overloaded; so, - we decorate the function with its signature too. - FIXME: This is probably the wrong pretty-printing for conversion - functions and some function templates. */ + nested-name-specifiers. However, there are situations where + is "makes sense" to output the surrounding function name for the + purpose of emphasizing on the scope kind. Just printing the + function name might not be sufficient as it may be overloaded; so, + we decorate the function with its signature too. + FIXME: This is probably the wrong pretty-printing for conversion + functions and some function templates. */ case OVERLOAD: t = OVL_CURRENT (t); case FUNCTION_DECL: if (DECL_FUNCTION_MEMBER_P (t)) - pp_cxx_nested_name_specifier (pp, DECL_CONTEXT (t)); + pp_cxx_nested_name_specifier (pp, DECL_CONTEXT (t)); pp_cxx_unqualified_id - (pp, DECL_CONSTRUCTOR_P (t) ? DECL_CONTEXT (t) : t); + (pp, DECL_CONSTRUCTOR_P (t) ? DECL_CONTEXT (t) : t); pp_cxx_parameter_declaration_clause (pp, TREE_TYPE (t)); break; @@ -280,13 +280,13 @@ pp_cxx_qualified_id (cxx_pretty_printer *pp, tree t) default: { - tree scope = TYPE_P (t) ? TYPE_CONTEXT (t) : DECL_CONTEXT (t); - if (scope != pp->enclosing_scope) - { - pp_cxx_nested_name_specifier (pp, scope); - pp_cxx_template_keyword_if_needed (pp, scope, t); - } - pp_cxx_unqualified_id (pp, t); + tree scope = TYPE_P (t) ? TYPE_CONTEXT (t) : DECL_CONTEXT (t); + if (scope != pp->enclosing_scope) + { + pp_cxx_nested_name_specifier (pp, scope); + pp_cxx_template_keyword_if_needed (pp, scope, t); + } + pp_cxx_unqualified_id (pp, t); } break; } @@ -365,7 +365,7 @@ pp_cxx_primary_expression (cxx_pretty_printer *pp, tree t) simple-type-specifier ( expression-list(opt) ) typename ::(opt) nested-name-specifier identifier ( expression-list(opt) ) typename ::(opt) nested-name-specifier template(opt) - template-id ( expression-list(opt) ) + template-id ( expression-list(opt) ) postfix-expression . template(opt) ::(opt) id-expression postfix-expression -> template(opt) ::(opt) id-expression postfix-expression . pseudo-destructor-name @@ -389,54 +389,54 @@ pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t) case AGGR_INIT_EXPR: case CALL_EXPR: { - tree fun = TREE_OPERAND (t, 0); - tree args = TREE_OPERAND (t, 1); - tree saved_scope = pp->enclosing_scope; - - if (TREE_CODE (fun) == ADDR_EXPR) - fun = TREE_OPERAND (fun, 0); - - /* In templates, where there is no way to tell whether a given - call uses an actual member function. So the parser builds - FUN as a COMPONENT_REF or a plain IDENTIFIER_NODE until - instantiation time. */ - if (TREE_CODE (fun) != FUNCTION_DECL) - ; - else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fun)) - { - tree object = code == AGGR_INIT_EXPR && AGGR_INIT_VIA_CTOR_P (t) - ? TREE_OPERAND (t, 2) - : TREE_VALUE (args); - - while (TREE_CODE (object) == NOP_EXPR) - object = TREE_OPERAND (object, 0); - - if (TREE_CODE (object) == ADDR_EXPR) - object = TREE_OPERAND (object, 0); - - if (TREE_CODE (TREE_TYPE (object)) != POINTER_TYPE) - { - pp_cxx_postfix_expression (pp, object); - pp_cxx_dot (pp); - } - else - { - pp_cxx_postfix_expression (pp, object); - pp_cxx_arrow (pp); - } - args = TREE_CHAIN (args); - pp->enclosing_scope = strip_pointer_operator (TREE_TYPE (object)); - } - - pp_cxx_postfix_expression (pp, fun); - pp->enclosing_scope = saved_scope; - pp_cxx_call_argument_list (pp, args); + tree fun = TREE_OPERAND (t, 0); + tree args = TREE_OPERAND (t, 1); + tree saved_scope = pp->enclosing_scope; + + if (TREE_CODE (fun) == ADDR_EXPR) + fun = TREE_OPERAND (fun, 0); + + /* In templates, where there is no way to tell whether a given + call uses an actual member function. So the parser builds + FUN as a COMPONENT_REF or a plain IDENTIFIER_NODE until + instantiation time. */ + if (TREE_CODE (fun) != FUNCTION_DECL) + ; + else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fun)) + { + tree object = code == AGGR_INIT_EXPR && AGGR_INIT_VIA_CTOR_P (t) + ? TREE_OPERAND (t, 2) + : TREE_VALUE (args); + + while (TREE_CODE (object) == NOP_EXPR) + object = TREE_OPERAND (object, 0); + + if (TREE_CODE (object) == ADDR_EXPR) + object = TREE_OPERAND (object, 0); + + if (TREE_CODE (TREE_TYPE (object)) != POINTER_TYPE) + { + pp_cxx_postfix_expression (pp, object); + pp_cxx_dot (pp); + } + else + { + pp_cxx_postfix_expression (pp, object); + pp_cxx_arrow (pp); + } + args = TREE_CHAIN (args); + pp->enclosing_scope = strip_pointer_operator (TREE_TYPE (object)); + } + + pp_cxx_postfix_expression (pp, fun); + pp->enclosing_scope = saved_scope; + pp_cxx_call_argument_list (pp, args); } if (code == AGGR_INIT_EXPR && AGGR_INIT_VIA_CTOR_P (t)) - { - pp_cxx_separate_with (pp, ','); - pp_cxx_postfix_expression (pp, TREE_OPERAND (t, 2)); - } + { + pp_cxx_separate_with (pp, ','); + pp_cxx_postfix_expression (pp, TREE_OPERAND (t, 2)); + } break; case BASELINK: @@ -456,13 +456,13 @@ pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t) case REINTERPRET_CAST_EXPR: case CONST_CAST_EXPR: if (code == DYNAMIC_CAST_EXPR) - pp_cxx_identifier (pp, "dynamic_cast"); + pp_cxx_identifier (pp, "dynamic_cast"); else if (code == STATIC_CAST_EXPR) - pp_cxx_identifier (pp, "static_cast"); + pp_cxx_identifier (pp, "static_cast"); else if (code == REINTERPRET_CAST_EXPR) - pp_cxx_identifier (pp, "reinterpret_cast"); + pp_cxx_identifier (pp, "reinterpret_cast"); else - pp_cxx_identifier (pp, "const_cast"); + pp_cxx_identifier (pp, "const_cast"); pp_cxx_begin_template_argument_list (pp); pp_cxx_type_id (pp, TREE_TYPE (t)); pp_cxx_end_template_argument_list (pp); @@ -482,9 +482,9 @@ pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t) pp_cxx_identifier (pp, "typeid"); pp_left_paren (pp); if (TYPE_P (t)) - pp_cxx_type_id (pp, t); + pp_cxx_type_id (pp, t); else - pp_cxx_expression (pp, t); + pp_cxx_expression (pp, t); pp_right_paren (pp); break; @@ -538,27 +538,27 @@ pp_cxx_new_expression (cxx_pretty_printer *pp, tree t) case NEW_EXPR: case VEC_NEW_EXPR: if (NEW_EXPR_USE_GLOBAL (t)) - pp_cxx_colon_colon (pp); + pp_cxx_colon_colon (pp); pp_cxx_identifier (pp, "new"); if (TREE_OPERAND (t, 0)) - { - pp_cxx_call_argument_list (pp, TREE_OPERAND (t, 0)); - pp_space (pp); - } + { + pp_cxx_call_argument_list (pp, TREE_OPERAND (t, 0)); + pp_space (pp); + } /* FIXME: array-types are built with one more element. */ pp_cxx_type_id (pp, TREE_OPERAND (t, 1)); if (TREE_OPERAND (t, 2)) - { - pp_left_paren (pp); - t = TREE_OPERAND (t, 2); - if (TREE_CODE (t) == TREE_LIST) - pp_c_expression_list (pp_c_base (pp), t); - else if (t == void_zero_node) - ; /* OK, empty initializer list. */ - else - pp_cxx_expression (pp, t); - pp_right_paren (pp); - } + { + pp_left_paren (pp); + t = TREE_OPERAND (t, 2); + if (TREE_CODE (t) == TREE_LIST) + pp_c_expression_list (pp_c_base (pp), t); + else if (t == void_zero_node) + ; /* OK, empty initializer list. */ + else + pp_cxx_expression (pp, t); + pp_right_paren (pp); + } break; default: @@ -579,13 +579,13 @@ pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t) case DELETE_EXPR: case VEC_DELETE_EXPR: if (DELETE_EXPR_USE_GLOBAL (t)) - pp_cxx_colon_colon (pp); + pp_cxx_colon_colon (pp); pp_cxx_identifier (pp, "delete"); if (code == VEC_DELETE_EXPR) - { - pp_left_bracket (pp); - pp_right_bracket (pp); - } + { + pp_left_bracket (pp); + pp_right_bracket (pp); + } pp_c_cast_expression (pp_c_base (pp), TREE_OPERAND (t, 0)); break; @@ -685,10 +685,10 @@ pp_cxx_pm_expression (cxx_pretty_printer *pp, tree t) /* Handle unfortunate OFFESET_REF overloading here. */ case OFFSET_REF: if (TYPE_P (TREE_OPERAND (t, 0))) - { - pp_cxx_qualified_id (pp, t); - break; - } + { + pp_cxx_qualified_id (pp, t); + break; + } /* Else fall through. */ case MEMBER_REF: case DOTSTAR_EXPR: @@ -825,7 +825,7 @@ pp_cxx_assignment_expression (cxx_pretty_printer *pp, tree e) case THROW_EXPR: pp_cxx_identifier (pp, "throw"); if (TREE_OPERAND (e, 0)) - pp_cxx_assignment_expression (pp, TREE_OPERAND (e, 0)); + pp_cxx_assignment_expression (pp, TREE_OPERAND (e, 0)); break; case MODOP_EXPR: @@ -963,11 +963,11 @@ pp_cxx_function_specifier (cxx_pretty_printer *pp, tree t) { case FUNCTION_DECL: if (DECL_VIRTUAL_P (t)) - pp_cxx_identifier (pp, "virtual"); + pp_cxx_identifier (pp, "virtual"); else if (DECL_CONSTRUCTOR_P (t) && DECL_NONCONVERTING_P (t)) - pp_cxx_identifier (pp, "explicit"); + pp_cxx_identifier (pp, "explicit"); else - pp_c_function_specifier (pp_c_base (pp), t); + pp_c_function_specifier (pp_c_base (pp), t); default: break; @@ -1004,23 +1004,23 @@ pp_cxx_decl_specifier_seq (cxx_pretty_printer *pp, tree t) case RECORD_TYPE: if (TYPE_PTRMEMFUNC_P (t)) - { - tree pfm = TYPE_PTRMEMFUNC_FN_TYPE (t); - pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (pfm))); - pp_cxx_whitespace (pp); - pp_cxx_ptr_operator (pp, t); - } + { + tree pfm = TYPE_PTRMEMFUNC_FN_TYPE (t); + pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (pfm))); + pp_cxx_whitespace (pp); + pp_cxx_ptr_operator (pp, t); + } break; case FUNCTION_DECL: /* Constructors don't have return types. And conversion functions - do not have a type-specifier in their return types. */ + do not have a type-specifier in their return types. */ if (DECL_CONSTRUCTOR_P (t) || DECL_CONV_FN_P (t)) - pp_cxx_function_specifier (pp, t); + pp_cxx_function_specifier (pp, t); else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t)) - pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (t))); + pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (t))); else - default: + default: pp_c_declaration_specifiers (pp_c_base (pp), t); break; } @@ -1102,7 +1102,7 @@ pp_cxx_type_specifier_seq (cxx_pretty_printer *pp, tree t) default: if (!(TREE_CODE (t) == FUNCTION_DECL && DECL_CONSTRUCTOR_P (t))) - pp_c_specifier_qualifier_list (pp_c_base (pp), t); + pp_c_specifier_qualifier_list (pp_c_base (pp), t); } } @@ -1121,35 +1121,35 @@ pp_cxx_ptr_operator (cxx_pretty_printer *pp, tree t) case REFERENCE_TYPE: case POINTER_TYPE: if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE - || TYPE_PTR_TO_MEMBER_P (TREE_TYPE (t))) - pp_cxx_ptr_operator (pp, TREE_TYPE (t)); + || TYPE_PTR_TO_MEMBER_P (TREE_TYPE (t))) + pp_cxx_ptr_operator (pp, TREE_TYPE (t)); if (TREE_CODE (t) == POINTER_TYPE) - { - pp_star (pp); - pp_cxx_cv_qualifier_seq (pp, t); - } + { + pp_star (pp); + pp_cxx_cv_qualifier_seq (pp, t); + } else - pp_ampersand (pp); + pp_ampersand (pp); break; case RECORD_TYPE: if (TYPE_PTRMEMFUNC_P (t)) - { - pp_cxx_left_paren (pp); - pp_cxx_nested_name_specifier (pp, TYPE_PTRMEMFUNC_OBJECT_TYPE (t)); - pp_star (pp); - break; - } + { + pp_cxx_left_paren (pp); + pp_cxx_nested_name_specifier (pp, TYPE_PTRMEMFUNC_OBJECT_TYPE (t)); + pp_star (pp); + break; + } case OFFSET_TYPE: if (TYPE_PTR_TO_MEMBER_P (t)) - { - if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE) - pp_cxx_left_paren (pp); - pp_cxx_nested_name_specifier (pp, TYPE_PTRMEM_CLASS_TYPE (t)); - pp_star (pp); - pp_cxx_cv_qualifier_seq (pp, t); - break; - } + { + if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE) + pp_cxx_left_paren (pp); + pp_cxx_nested_name_specifier (pp, TYPE_PTRMEM_CLASS_TYPE (t)); + pp_star (pp); + pp_cxx_cv_qualifier_seq (pp, t); + break; + } /* else fall through. */ default: @@ -1207,16 +1207,16 @@ pp_cxx_parameter_declaration_clause (cxx_pretty_printer *pp, tree t) for (; args; args = TREE_CHAIN (args), types = TREE_CHAIN (types)) { if (!first) - pp_cxx_separate_with (pp, ','); + pp_cxx_separate_with (pp, ','); first = false; pp_cxx_parameter_declaration (pp, abstract ? TREE_VALUE (types) : args); if (!abstract && pp_c_base (pp)->flags & pp_cxx_flag_default_argument) - { - pp_cxx_whitespace (pp); - pp_equal (pp); - pp_cxx_whitespace (pp); - pp_cxx_assignment_expression (pp, TREE_PURPOSE (types)); - } + { + pp_cxx_whitespace (pp); + pp_equal (pp); + pp_cxx_whitespace (pp); + pp_cxx_assignment_expression (pp, TREE_PURPOSE (types)); + } } pp_cxx_right_paren (pp); } @@ -1241,7 +1241,7 @@ pp_cxx_exception_specification (cxx_pretty_printer *pp, tree t) { pp_cxx_type_id (pp, TREE_VALUE (ex_spec)); if (TREE_CHAIN (ex_spec)) - pp_cxx_separate_with (pp, ','); + pp_cxx_separate_with (pp, ','); } pp_cxx_right_paren (pp); } @@ -1249,7 +1249,7 @@ pp_cxx_exception_specification (cxx_pretty_printer *pp, tree t) /* direct-declarator: declarator-id direct-declarator ( parameter-declaration-clause ) cv-qualifier-seq(opt) - exception-specification(opt) + exception-specification(opt) direct-declaration [ constant-expression(opt) ] ( declarator ) */ @@ -1263,10 +1263,10 @@ pp_cxx_direct_declarator (cxx_pretty_printer *pp, tree t) case CONST_DECL: case FIELD_DECL: if (DECL_NAME (t)) - { - pp_cxx_space_for_pointer_operator (pp, TREE_TYPE (t)); - pp_cxx_id_expression (pp, DECL_NAME (t)); - } + { + pp_cxx_space_for_pointer_operator (pp, TREE_TYPE (t)); + pp_cxx_id_expression (pp, DECL_NAME (t)); + } pp_cxx_abstract_declarator (pp, TREE_TYPE (t)); break; @@ -1276,10 +1276,10 @@ pp_cxx_direct_declarator (cxx_pretty_printer *pp, tree t) pp_cxx_parameter_declaration_clause (pp, t); if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t)) - { - pp_base (pp)->padding = pp_before; - pp_cxx_cv_qualifier_seq (pp, pp_cxx_implicit_parameter_type (t)); - } + { + pp_base (pp)->padding = pp_before; + pp_cxx_cv_qualifier_seq (pp, pp_cxx_implicit_parameter_type (t)); + } pp_cxx_exception_specification (pp, TREE_TYPE (t)); break; @@ -1333,7 +1333,7 @@ pp_cxx_ctor_initializer (cxx_pretty_printer *pp, tree t) pp_cxx_primary_expression (pp, TREE_PURPOSE (t)); pp_cxx_call_argument_list (pp, TREE_VALUE (t)); if (TREE_CHAIN (t)) - pp_cxx_separate_with (pp, ','); + pp_cxx_separate_with (pp, ','); } } @@ -1372,8 +1372,8 @@ pp_cxx_abstract_declarator (cxx_pretty_printer *pp, tree t) else if (POINTER_TYPE_P (t)) { if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE - || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE) - pp_cxx_right_paren (pp); + || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE) + pp_cxx_right_paren (pp); t = TREE_TYPE (t); } pp_cxx_direct_abstract_declarator (pp, t); @@ -1381,7 +1381,7 @@ pp_cxx_abstract_declarator (cxx_pretty_printer *pp, tree t) /* direct-abstract-declarator: direct-abstract-declarator(opt) ( parameter-declaration-clause ) - cv-qualifier-seq(opt) exception-specification(opt) + cv-qualifier-seq(opt) exception-specification(opt) direct-abstract-declarator(opt) [ constant-expression(opt) ] ( abstract-declarator ) */ @@ -1396,7 +1396,7 @@ pp_cxx_direct_abstract_declarator (cxx_pretty_printer *pp, tree t) case RECORD_TYPE: if (TYPE_PTRMEMFUNC_P (t)) - pp_cxx_direct_abstract_declarator (pp, TYPE_PTRMEMFUNC_FN_TYPE (t)); + pp_cxx_direct_abstract_declarator (pp, TYPE_PTRMEMFUNC_FN_TYPE (t)); break; case METHOD_TYPE: @@ -1404,11 +1404,11 @@ pp_cxx_direct_abstract_declarator (cxx_pretty_printer *pp, tree t) pp_cxx_parameter_declaration_clause (pp, t); pp_cxx_direct_abstract_declarator (pp, TREE_TYPE (t)); if (TREE_CODE (t) == METHOD_TYPE) - { - pp_base (pp)->padding = pp_before; - pp_cxx_cv_qualifier_seq - (pp, TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t)))); - } + { + pp_base (pp)->padding = pp_before; + pp_cxx_cv_qualifier_seq + (pp, TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t)))); + } pp_cxx_exception_specification (pp, t); break; @@ -1479,12 +1479,12 @@ pp_cxx_template_argument_list (cxx_pretty_printer *pp, tree t) { tree arg = TREE_VEC_ELT (t, i); if (i != 0) - pp_cxx_separate_with (pp, ','); + pp_cxx_separate_with (pp, ','); if (TYPE_P (arg) || (TREE_CODE (arg) == TEMPLATE_DECL && TYPE_P (DECL_TEMPLATE_RESULT (arg)))) - pp_cxx_type_id (pp, arg); + pp_cxx_type_id (pp, arg); else - pp_cxx_expression (pp, arg); + pp_cxx_expression (pp, arg); } } @@ -1527,7 +1527,7 @@ pp_cxx_statement (cxx_pretty_printer *pp, tree t) break; /* try-block: - try compound-statement handler-seq */ + try compound-statement handler-seq */ case TRY_BLOCK: pp_maybe_newline_and_indent (pp, 0); pp_cxx_identifier (pp, "try"); @@ -1535,22 +1535,22 @@ pp_cxx_statement (cxx_pretty_printer *pp, tree t) pp_cxx_statement (pp, TRY_STMTS (t)); pp_newline_and_indent (pp, -3); if (CLEANUP_P (t)) - ; + ; else - pp_cxx_statement (pp, TRY_HANDLERS (t)); + pp_cxx_statement (pp, TRY_HANDLERS (t)); break; /* - handler-seq: - handler handler-seq(opt) + handler-seq: + handler handler-seq(opt) - handler: - catch ( exception-declaration ) compound-statement + handler: + catch ( exception-declaration ) compound-statement - exception-declaration: - type-specifier-seq declarator - type-specifier-seq abstract-declarator - ... */ + exception-declaration: + type-specifier-seq declarator + type-specifier-seq abstract-declarator + ... */ case HANDLER: pp_cxx_identifier (pp, "catch"); pp_cxx_left_paren (pp); @@ -1564,8 +1564,8 @@ pp_cxx_statement (cxx_pretty_printer *pp, tree t) break; /* selection-statement: - if ( expression ) statement - if ( expression ) statement else statement */ + if ( expression ) statement + if ( expression ) statement else statement */ case IF_STMT: pp_cxx_identifier (pp, "if"); pp_cxx_whitespace (pp); @@ -1602,10 +1602,10 @@ pp_cxx_statement (cxx_pretty_printer *pp, tree t) break; /* iteration-statement: - while ( expression ) statement - do statement while ( expression ) ; - for ( expression(opt) ; expression(opt) ; expression(opt) ) statement - for ( declaration expression(opt) ; expression(opt) ) statement */ + while ( expression ) statement + do statement while ( expression ) ; + for ( expression(opt) ; expression(opt) ; expression(opt) ) statement + for ( declaration expression(opt) ; expression(opt) ) statement */ case WHILE_STMT: pp_cxx_identifier (pp, "while"); pp_space (pp); @@ -1637,9 +1637,9 @@ pp_cxx_statement (cxx_pretty_printer *pp, tree t) pp_space (pp); pp_cxx_left_paren (pp); if (FOR_INIT_STMT (t)) - pp_cxx_statement (pp, FOR_INIT_STMT (t)); + pp_cxx_statement (pp, FOR_INIT_STMT (t)); else - pp_cxx_semicolon (pp); + pp_cxx_semicolon (pp); pp_needs_newline (pp) = false; pp_cxx_whitespace (pp); if (FOR_COND (t)) @@ -1657,9 +1657,9 @@ pp_cxx_statement (cxx_pretty_printer *pp, tree t) break; /* jump-statement: - goto identifier; - continue ; - return expression(opt) ; */ + goto identifier; + continue ; + return expression(opt) ; */ case BREAK_STMT: case CONTINUE_STMT: pp_identifier (pp, TREE_CODE (t) == BREAK_STMT ? "break" : "continue"); @@ -1668,7 +1668,7 @@ pp_cxx_statement (cxx_pretty_printer *pp, tree t) break; /* expression-statement: - expression(opt) ; */ + expression(opt) ; */ case EXPR_STMT: pp_cxx_expression (pp, EXPR_STMT_EXPR (t)); pp_cxx_semicolon (pp); @@ -1756,7 +1756,7 @@ pp_cxx_template_parameter_list (cxx_pretty_printer *pp, tree t) for (i = 0; i < n; ++i) { if (i) - pp_cxx_separate_with (pp, ','); + pp_cxx_separate_with (pp, ','); pp_cxx_template_parameter (pp, TREE_VEC_ELT (t, i)); } } @@ -1783,7 +1783,7 @@ pp_cxx_template_parameter (cxx_pretty_printer *pp, tree t) case TYPE_DECL: pp_cxx_identifier (pp, "class"); if (DECL_NAME (parameter)) - pp_cxx_tree_identifier (pp, DECL_NAME (parameter)); + pp_cxx_tree_identifier (pp, DECL_NAME (parameter)); /* FIXME: Chech if we should print also default argument. */ break; @@ -1885,19 +1885,19 @@ pp_cxx_declaration (cxx_pretty_printer *pp, tree t) switch (DECL_USE_TEMPLATE (t)) { case 1: - pp_cxx_template_declaration (pp, t); - break; + pp_cxx_template_declaration (pp, t); + break; case 2: - pp_cxx_explicit_specialization (pp, t); - break; + pp_cxx_explicit_specialization (pp, t); + break; case 3: - pp_cxx_explicit_instantiation (pp, t); - break; + pp_cxx_explicit_instantiation (pp, t); + break; default: - break; + break; } else switch (TREE_CODE (t)) { @@ -1908,16 +1908,16 @@ pp_cxx_declaration (cxx_pretty_printer *pp, tree t) case FUNCTION_DECL: if (DECL_SAVED_TREE (t)) - pp_cxx_function_definition (pp, t); + pp_cxx_function_definition (pp, t); else - pp_cxx_simple_declaration (pp, t); + pp_cxx_simple_declaration (pp, t); break; case NAMESPACE_DECL: if (DECL_NAMESPACE_ALIAS (t)) - pp_cxx_namespace_alias_definition (pp, t); + pp_cxx_namespace_alias_definition (pp, t); else - pp_cxx_original_namespace_definition (pp, t); + pp_cxx_original_namespace_definition (pp, t); break; default: diff --git a/gcc/cp/cxx-pretty-print.h b/gcc/cp/cxx-pretty-print.h index 560b094..a489279 100644 --- a/gcc/cp/cxx-pretty-print.h +++ b/gcc/cp/cxx-pretty-print.h @@ -44,21 +44,21 @@ typedef struct #define pp_cxx_cv_qualifier_seq(PP, T) \ pp_c_type_qualifier_list (pp_c_base (PP), T) -#define pp_cxx_whitespace(PP) pp_c_whitespace (pp_c_base (PP)) -#define pp_cxx_left_paren(PP) pp_c_left_paren (pp_c_base (PP)) -#define pp_cxx_right_paren(PP) pp_c_right_paren (pp_c_base (PP)) -#define pp_cxx_left_brace(PP) pp_c_left_brace (pp_c_base (PP)) -#define pp_cxx_right_brace(PP) pp_c_right_brace (pp_c_base (PP)) -#define pp_cxx_left_bracket(PP) pp_c_left_bracket (pp_c_base (PP)) -#define pp_cxx_right_bracket(PP) pp_c_right_bracket (pp_c_base (PP)) -#define pp_cxx_dot(PP) pp_c_dot (pp_c_base (PP)) -#define pp_cxx_ampersand(PP) pp_c_ampersand (pp_c_base (PP)) -#define pp_cxx_star(PP) pp_c_star (pp_c_base (PP)) -#define pp_cxx_arrow(PP) pp_c_arrow (pp_c_base (PP)) -#define pp_cxx_semicolon(PP) pp_c_semicolon (pp_c_base (PP)) -#define pp_cxx_complement(PP) pp_c_complement (pp_c_base (PP)) - -#define pp_cxx_identifier(PP, I) pp_c_identifier (pp_c_base (PP), I) +#define pp_cxx_whitespace(PP) pp_c_whitespace (pp_c_base (PP)) +#define pp_cxx_left_paren(PP) pp_c_left_paren (pp_c_base (PP)) +#define pp_cxx_right_paren(PP) pp_c_right_paren (pp_c_base (PP)) +#define pp_cxx_left_brace(PP) pp_c_left_brace (pp_c_base (PP)) +#define pp_cxx_right_brace(PP) pp_c_right_brace (pp_c_base (PP)) +#define pp_cxx_left_bracket(PP) pp_c_left_bracket (pp_c_base (PP)) +#define pp_cxx_right_bracket(PP) pp_c_right_bracket (pp_c_base (PP)) +#define pp_cxx_dot(PP) pp_c_dot (pp_c_base (PP)) +#define pp_cxx_ampersand(PP) pp_c_ampersand (pp_c_base (PP)) +#define pp_cxx_star(PP) pp_c_star (pp_c_base (PP)) +#define pp_cxx_arrow(PP) pp_c_arrow (pp_c_base (PP)) +#define pp_cxx_semicolon(PP) pp_c_semicolon (pp_c_base (PP)) +#define pp_cxx_complement(PP) pp_c_complement (pp_c_base (PP)) + +#define pp_cxx_identifier(PP, I) pp_c_identifier (pp_c_base (PP), I) #define pp_cxx_tree_identifier(PP, T) \ pp_c_tree_identifier (pp_c_base (PP), T) diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 1bf834a..44b45fc 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -66,7 +66,7 @@ static tree grokvardecl (tree, tree, const cp_decl_specifier_seq *, static void record_unknown_type (tree, const char *); static tree builtin_function_1 (const char *, tree, tree, enum built_in_function code, - enum built_in_class cl, const char *, + enum built_in_class cl, const char *, tree); static tree build_library_fn_1 (tree, enum tree_code, tree); static int member_function_or_else (tree, tree, enum overload_flags); @@ -128,7 +128,7 @@ tree error_mark_list; tree vtable_entry_type; tree delta_type_node; tree __t_desc_type_node; - tree ti_desc_type_node; + tree ti_desc_type_node; tree bltn_desc_type_node, ptr_desc_type_node; tree ary_desc_type_node, func_desc_type_node, enum_desc_type_node; tree class_desc_type_node, si_class_desc_type_node, vmi_class_desc_type_node; @@ -306,7 +306,7 @@ current_tmpl_spec_kind (int n_class_scopes) /* We've not seen enough template headers to match all the specialized classes present. For example: - template <class T> void R<T>::S<T>::f(int); + template <class T> void R<T>::S<T>::f(int); This is invalid; there needs to be one set of template parameters for each class. */ @@ -315,7 +315,7 @@ current_tmpl_spec_kind (int n_class_scopes) /* We're processing a non-template declaration (even though it may be a member of a template class.) For example: - template <class T> void S<T>::f(int); + template <class T> void S<T>::f(int); The `class T' maches the `S<T>', leaving no template headers corresponding to the `f'. */ @@ -323,14 +323,14 @@ current_tmpl_spec_kind (int n_class_scopes) else if (n_template_parm_scopes > n_class_scopes + 1) /* We've got too many template headers. For example: - template <> template <class T> void f (T); + template <> template <class T> void f (T); There need to be more enclosing classes. */ return tsk_excessive_parms; else /* This must be a template. It's of the form: - template <class T> template <class U> void S<T>::f(U); + template <class T> template <class U> void S<T>::f(U); This is a specialization if the innermost level was a specialization; otherwise it's just a definition of the @@ -362,7 +362,7 @@ pop_label (tree label, tree old_value) #ifdef USE_MAPPED_LOCATION location = input_location; /* FIXME want (input_filename, (line)0) */ #else - location.file = input_filename; + location.file = input_filename; location.line = 0; #endif /* Avoid crashing later. */ @@ -569,7 +569,7 @@ poplevel (int keep, int reverse, int functionbody) for (link = decls; link; link = TREE_CHAIN (link)) { if (leaving_for_scope && TREE_CODE (link) == VAR_DECL - && DECL_NAME (link)) + && DECL_NAME (link)) { tree name = DECL_NAME (link); cxx_binding *ob; @@ -586,8 +586,8 @@ poplevel (int keep, int reverse, int functionbody) if (ob && ob->scope == current_binding_level->level_chain) /* We have something like: - int i; - for (int i; ;); + int i; + for (int i; ;); and we are leaving the `for' scope. There's no reason to keep the binding of the inner `i' in this case. */ @@ -890,15 +890,15 @@ decls_match (tree newdecl, tree olddecl) return 0; if (TREE_CODE (f1) != TREE_CODE (f2)) - return 0; + return 0; if (same_type_p (TREE_TYPE (f1), TREE_TYPE (f2))) { if (p2 == NULL_TREE && DECL_EXTERN_C_P (olddecl) && (DECL_BUILT_IN (olddecl) #ifndef NO_IMPLICIT_EXTERN_C - || (DECL_IN_SYSTEM_HEADER (newdecl) && !DECL_CLASS_SCOPE_P (newdecl)) - || (DECL_IN_SYSTEM_HEADER (olddecl) && !DECL_CLASS_SCOPE_P (olddecl)) + || (DECL_IN_SYSTEM_HEADER (newdecl) && !DECL_CLASS_SCOPE_P (newdecl)) + || (DECL_IN_SYSTEM_HEADER (olddecl) && !DECL_CLASS_SCOPE_P (olddecl)) #endif )) { @@ -909,11 +909,11 @@ decls_match (tree newdecl, tree olddecl) #ifndef NO_IMPLICIT_EXTERN_C else if (p1 == NULL_TREE && (DECL_EXTERN_C_P (olddecl) - && DECL_IN_SYSTEM_HEADER (olddecl) - && !DECL_CLASS_SCOPE_P (olddecl)) + && DECL_IN_SYSTEM_HEADER (olddecl) + && !DECL_CLASS_SCOPE_P (olddecl)) && (DECL_EXTERN_C_P (newdecl) - && DECL_IN_SYSTEM_HEADER (newdecl) - && !DECL_CLASS_SCOPE_P (newdecl))) + && DECL_IN_SYSTEM_HEADER (newdecl) + && !DECL_CLASS_SCOPE_P (newdecl))) { types_match = self_promoting_args_p (p2); TREE_TYPE (newdecl) = TREE_TYPE (olddecl); @@ -1073,9 +1073,9 @@ duplicate_decls (tree newdecl, tree olddecl) { if (TREE_CODE (newdecl) != FUNCTION_DECL) { - /* Avoid warnings redeclaring anticipated built-ins. */ - if (DECL_ANTICIPATED (olddecl)) - return NULL_TREE; + /* Avoid warnings redeclaring anticipated built-ins. */ + if (DECL_ANTICIPATED (olddecl)) + return NULL_TREE; /* If you declare a built-in or predefined function name as static, the old definition is overridden, but optionally warn this was a @@ -1083,9 +1083,9 @@ duplicate_decls (tree newdecl, tree olddecl) if (! TREE_PUBLIC (newdecl)) { if (warn_shadow) - warning (0, "shadowing %s function %q#D", - DECL_BUILT_IN (olddecl) ? "built-in" : "library", - olddecl); + warning (0, "shadowing %s function %q#D", + DECL_BUILT_IN (olddecl) ? "built-in" : "library", + olddecl); /* Discard the old built-in function. */ return NULL_TREE; } @@ -1093,19 +1093,19 @@ duplicate_decls (tree newdecl, tree olddecl) it even globally without an error. */ else if (! DECL_BUILT_IN (olddecl)) warning (0, "library function %q#D redeclared as non-function %q#D", - olddecl, newdecl); + olddecl, newdecl); else { error ("declaration of %q#D", newdecl); error ("conflicts with built-in declaration %q#D", - olddecl); + olddecl); } return NULL_TREE; } else if (!types_match) { - /* Avoid warnings redeclaring anticipated built-ins. */ - if (DECL_ANTICIPATED (olddecl)) + /* Avoid warnings redeclaring anticipated built-ins. */ + if (DECL_ANTICIPATED (olddecl)) { /* Deal with fileptr_type_node. FILE type is not known at the time we create the builtins. */ @@ -1151,12 +1151,12 @@ duplicate_decls (tree newdecl, tree olddecl) { warning (0, "new declaration %q#D", newdecl); warning (0, "ambiguates built-in declaration %q#D", - olddecl); + olddecl); } else if (warn_shadow) warning (0, "shadowing %s function %q#D", - DECL_BUILT_IN (olddecl) ? "built-in" : "library", - olddecl); + DECL_BUILT_IN (olddecl) ? "built-in" : "library", + olddecl); } else /* Discard the old built-in function. */ @@ -1268,7 +1268,7 @@ duplicate_decls (tree newdecl, tree olddecl) if (DECL_EXTERN_C_P (newdecl) && DECL_EXTERN_C_P (olddecl)) { error ("declaration of C function %q#D conflicts with", - newdecl); + newdecl); cp_error_at ("previous declaration %q#D here", olddecl); } else if (compparms (TYPE_ARG_TYPES (TREE_TYPE (newdecl)), @@ -1284,8 +1284,8 @@ duplicate_decls (tree newdecl, tree olddecl) { error ("conflicting declaration %q#D", newdecl); cp_error_at ("%qD has a previous declaration as %q#D", - olddecl, olddecl); - return error_mark_node; + olddecl, olddecl); + return error_mark_node; } } else if (TREE_CODE (newdecl) == FUNCTION_DECL @@ -1318,7 +1318,7 @@ duplicate_decls (tree newdecl, tree olddecl) { /* In [namespace.alias] we have: - In a declarative region, a namespace-alias-definition can be + In a declarative region, a namespace-alias-definition can be used to redefine a namespace-alias declared in that declarative region to refer only to the namespace to which it already refers. @@ -1331,7 +1331,7 @@ duplicate_decls (tree newdecl, tree olddecl) return olddecl; /* [namespace.alias] - A namespace-name or namespace-alias shall not be declared as + A namespace-name or namespace-alias shall not be declared as the name of any other entity in the same declarative region. A namespace-name defined at global scope shall not be declared as the name of any other entity in any global scope @@ -1375,7 +1375,7 @@ duplicate_decls (tree newdecl, tree olddecl) cp_error_at ("previous declaration of %q#D with %qL linkage", olddecl, DECL_LANGUAGE (olddecl)); error ("conflicts with new declaration with %qL linkage", - DECL_LANGUAGE (newdecl)); + DECL_LANGUAGE (newdecl)); } } @@ -1400,12 +1400,12 @@ duplicate_decls (tree newdecl, tree olddecl) pedwarn ("default argument given for parameter %d of %q#D", i, newdecl); cp_pedwarn_at ("after previous specification in %q#D", - olddecl); + olddecl); } else { error ("default argument given for parameter %d of %q#D", - i, newdecl); + i, newdecl); cp_error_at ("after previous specification in %q#D", olddecl); } @@ -1459,8 +1459,8 @@ duplicate_decls (tree newdecl, tree olddecl) new_defines_function = DECL_INITIAL (newdecl) != NULL_TREE; /* Optionally warn about more than one declaration for the same - name, but don't warn about a function declaration followed by a - definition. */ + name, but don't warn about a function declaration followed by a + definition. */ if (warn_redundant_decls && ! DECL_ARTIFICIAL (olddecl) && !(new_defines_function && DECL_INITIAL (olddecl) == NULL_TREE) /* Don't warn about extern decl followed by definition. */ @@ -1560,10 +1560,10 @@ duplicate_decls (tree newdecl, tree olddecl) && ! DECL_IS_BUILTIN (olddecl) && flag_exceptions && !comp_except_specs (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (newdecl)), - TYPE_RAISES_EXCEPTIONS (TREE_TYPE (olddecl)), 1)) + TYPE_RAISES_EXCEPTIONS (TREE_TYPE (olddecl)), 1)) { error ("declaration of %qF throws different exceptions", - newdecl); + newdecl); cp_error_at ("than previous declaration %qF", olddecl); } } @@ -1611,7 +1611,7 @@ duplicate_decls (tree newdecl, tree olddecl) } /* Merge the section attribute. - We want to issue an error if the sections conflict but that must be + We want to issue an error if the sections conflict but that must be done later in decl_attributes since we are called before attributes are assigned. */ if (DECL_SECTION_NAME (newdecl) == NULL_TREE) @@ -1689,7 +1689,7 @@ duplicate_decls (tree newdecl, tree olddecl) DECL_REPO_AVAILABLE_P (newdecl) = DECL_REPO_AVAILABLE_P (olddecl); DECL_TEMPLATE_INFO (newdecl) = DECL_TEMPLATE_INFO (olddecl); DECL_INITIALIZED_IN_CLASS_P (newdecl) - |= DECL_INITIALIZED_IN_CLASS_P (olddecl); + |= DECL_INITIALIZED_IN_CLASS_P (olddecl); olddecl_friend = DECL_FRIEND_P (olddecl); /* Only functions have DECL_BEFRIENDING_CLASSES. */ @@ -1930,7 +1930,7 @@ redeclaration_error_message (tree newdecl, tree olddecl) return "%qD conflicts with used function"; /* We'll complain about linkage mismatches in - warn_extern_redeclared_static. */ + warn_extern_redeclared_static. */ /* Defining the same name twice is no good. */ if (DECL_INITIAL (olddecl) != NULL_TREE @@ -2127,8 +2127,8 @@ decl_jump_unsafe (tree decl) static void check_previous_goto_1 (tree decl, - struct cp_binding_level* level, - tree names, const location_t *locus) + struct cp_binding_level* level, + tree names, const location_t *locus) { int identified = 0; int saw_eh = 0; @@ -2583,7 +2583,7 @@ make_typename_type (tree context, tree name, enum tag_types tag_type, { if (complain & tf_error) error ("no class template named %q#T in %q#T", - name, context); + name, context); return error_mark_node; } @@ -2594,11 +2594,11 @@ make_typename_type (tree context, tree name, enum tag_types tag_type, TREE_OPERAND (fullname, 1), NULL_TREE, context, /*entering_scope=*/0, - tf_error | tf_warning | tf_user); + tf_error | tf_warning | tf_user); } else { - tree t; + tree t; if (!IS_AGGR_TYPE (context)) { @@ -2719,8 +2719,8 @@ make_unbound_class_template (tree context, tree name, tree parm_list, void record_builtin_type (enum rid rid_index, - const char* name, - tree type) + const char* name, + tree type) { tree rname = NULL_TREE, tname = NULL_TREE; tree tdecl = NULL_TREE; @@ -2885,7 +2885,7 @@ cxx_init_decl_processing (void) /* Enter the global namespace. */ gcc_assert (global_namespace == NULL_TREE); global_namespace = build_lang_decl (NAMESPACE_DECL, global_scope_name, - void_type_node); + void_type_node); begin_scope (sk_namespace, global_namespace); current_lang_name = NULL_TREE; @@ -3141,12 +3141,12 @@ cp_make_fname_decl (tree id, int type_dep) static tree builtin_function_1 (const char* name, - tree type, - tree context, + tree type, + tree context, enum built_in_function code, - enum built_in_class class, - const char* libname, - tree attrs) + enum built_in_class class, + const char* libname, + tree attrs) { tree decl = build_library_fn_1 (get_identifier (name), ERROR_MARK, type); DECL_BUILT_IN_CLASS (decl) = class; @@ -3193,11 +3193,11 @@ builtin_function_1 (const char* name, tree builtin_function (const char* name, - tree type, - int code, - enum built_in_class cl, - const char* libname, - tree attrs) + tree type, + int code, + enum built_in_class cl, + const char* libname, + tree attrs) { /* All builtins that don't begin with an '_' should additionally go in the 'std' namespace. */ @@ -3372,17 +3372,17 @@ fixup_anonymous_aggr (tree t) type = TREE_TYPE (field); if (CLASS_TYPE_P (type)) { - if (TYPE_NEEDS_CONSTRUCTING (type)) + if (TYPE_NEEDS_CONSTRUCTING (type)) cp_error_at ("member %q#D with constructor not allowed " - "in anonymous aggregate", + "in anonymous aggregate", field); if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)) cp_error_at ("member %q#D with destructor not allowed " - "in anonymous aggregate", + "in anonymous aggregate", field); if (TYPE_HAS_COMPLEX_ASSIGN_REF (type)) cp_error_at ("member %q#D with copy assignment operator " - "not allowed in anonymous aggregate", + "not allowed in anonymous aggregate", field); } } @@ -3431,26 +3431,26 @@ check_tag_decl (cp_decl_specifier_seq *declspecs) && TYPE_ANONYMOUS_P (declared_type)) { /* 7/3 In a simple-declaration, the optional init-declarator-list - can be omitted only when declaring a class (clause 9) or - enumeration (7.2), that is, when the decl-specifier-seq contains - either a class-specifier, an elaborated-type-specifier with - a class-key (9.1), or an enum-specifier. In these cases and - whenever a class-specifier or enum-specifier is present in the - decl-specifier-seq, the identifiers in these specifiers are among - the names being declared by the declaration (as class-name, - enum-names, or enumerators, depending on the syntax). In such - cases, and except for the declaration of an unnamed bit-field (9.6), - the decl-specifier-seq shall introduce one or more names into the - program, or shall redeclare a name introduced by a previous - declaration. [Example: - enum { }; // ill-formed - typedef class { }; // ill-formed - --end example] */ + can be omitted only when declaring a class (clause 9) or + enumeration (7.2), that is, when the decl-specifier-seq contains + either a class-specifier, an elaborated-type-specifier with + a class-key (9.1), or an enum-specifier. In these cases and + whenever a class-specifier or enum-specifier is present in the + decl-specifier-seq, the identifiers in these specifiers are among + the names being declared by the declaration (as class-name, + enum-names, or enumerators, depending on the syntax). In such + cases, and except for the declaration of an unnamed bit-field (9.6), + the decl-specifier-seq shall introduce one or more names into the + program, or shall redeclare a name introduced by a previous + declaration. [Example: + enum { }; // ill-formed + typedef class { }; // ill-formed + --end example] */ if (saw_typedef) - { - error ("missing type-name in typedef-declaration"); - return NULL_TREE; - } + { + error ("missing type-name in typedef-declaration"); + return NULL_TREE; + } /* Anonymous unions are objects, so they can have specifiers. */; SET_ANON_AGGR_TYPE_P (declared_type); @@ -3572,9 +3572,9 @@ groktypename (cp_decl_specifier_seq *type_specifiers, tree start_decl (const cp_declarator *declarator, cp_decl_specifier_seq *declspecs, - int initialized, - tree attributes, - tree prefix_attributes, + int initialized, + tree attributes, + tree prefix_attributes, tree *pushed_scope_p) { tree decl; @@ -3646,7 +3646,7 @@ start_decl (const cp_declarator *declarator, if (! toplevel_bindings_p () && DECL_EXTERNAL (decl)) warning (0, "declaration of %q#D has %<extern%> and is initialized", - decl); + decl); DECL_EXTERNAL (decl) = 0; if (toplevel_bindings_p ()) TREE_STATIC (decl) = 1; @@ -3682,7 +3682,7 @@ start_decl (const cp_declarator *declarator, { if (!same_type_p (DECL_CONTEXT (field), context)) pedwarn ("ISO C++ does not permit %<%T::%D%> " - "to be defined as %<%T::%D%>", + "to be defined as %<%T::%D%>", DECL_CONTEXT (field), DECL_NAME (decl), context, DECL_NAME (decl)); DECL_CONTEXT (decl) = DECL_CONTEXT (field); @@ -3737,7 +3737,7 @@ start_decl (const cp_declarator *declarator, if (DECL_EXTERNAL (decl) && ! DECL_TEMPLATE_SPECIALIZATION (decl)) pedwarn ("declaration of %q#D outside of class is not definition", - decl); + decl); } /* Enter this declaration into the symbol table. */ @@ -3865,7 +3865,7 @@ grok_reference_init (tree decl, tree type, tree init, tree *cleanup) if (TREE_CODE (init) == CONSTRUCTOR) { error ("ISO C++ forbids use of initializer list to " - "initialize reference %qD", decl); + "initialize reference %qD", decl); return NULL_TREE; } @@ -4052,10 +4052,10 @@ maybe_commonize_var (tree decl) TREE_PUBLIC (decl) = 0; DECL_COMMON (decl) = 0; cp_warning_at ("sorry: semantics of inline function static " - "data %q#D are wrong (you'll wind up " - "with multiple copies)", decl); + "data %q#D are wrong (you'll wind up " + "with multiple copies)", decl); warning (0, "%J you can work around this by removing " - "the initializer", + "the initializer", decl); } } @@ -4473,7 +4473,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup) if (TYPE_NON_AGGREGATE_CLASS (type)) { error ("%qD must be initialized by constructor, " - "not by %<{...}%>", + "not by %<{...}%>", decl); init = error_mark_node; } @@ -5054,7 +5054,7 @@ get_atexit_node (void) { /* The declaration for `atexit' is: - int atexit (void (*)()); + int atexit (void (*)()); We build up the argument types and then then function type itself. */ @@ -5253,16 +5253,16 @@ expand_static_init (tree decl, tree init) /* Emit code to perform this initialization but once. This code looks like: - static <type> guard; - if (!guard.first_byte) { + static <type> guard; + if (!guard.first_byte) { if (__cxa_guard_acquire (&guard)) { bool flag = false; try { - // Do initialization. - flag = true; __cxa_guard_release (&guard); - // Register variable for destruction at end of program. + // Do initialization. + flag = true; __cxa_guard_release (&guard); + // Register variable for destruction at end of program. } catch { - if (!flag) __cxa_guard_abort (&guard); + if (!flag) __cxa_guard_abort (&guard); } } @@ -5277,7 +5277,7 @@ expand_static_init (tree decl, tree init) initialization is not complete, so it will be tried again the next time control enters the declaration. - This process should be thread-safe, too; multiple threads + This process should be thread-safe, too; multiple threads should not be able to initialize the variable more than once. */ @@ -5436,12 +5436,12 @@ member_function_or_else (tree ctype, tree cur_type, enum overload_flags flags) static void bad_specifiers (tree object, - const char* type, - int virtualp, - int quals, - int inlinep, - int friendp, - int raises) + const char* type, + int virtualp, + int quals, + int inlinep, + int friendp, + int raises) { if (virtualp) error ("%qD declared as a %<virtual%> %s", object, type); @@ -5449,8 +5449,8 @@ bad_specifiers (tree object, error ("%qD declared as an %<inline%> %s", object, type); if (quals) error ("%<const%> and %<volatile%> function specifiers on " - "%qD invalid in %s declaration", - object, type); + "%qD invalid in %s declaration", + object, type); if (friendp) cp_error_at ("%qD declared as a friend", object); if (raises @@ -5481,22 +5481,22 @@ bad_specifiers (tree object, static tree grokfndecl (tree ctype, - tree type, - tree declarator, + tree type, + tree declarator, tree parms, - tree orig_declarator, - int virtualp, - enum overload_flags flags, + tree orig_declarator, + int virtualp, + enum overload_flags flags, cp_cv_quals quals, - tree raises, - int check, - int friendp, - int publicp, - int inlinep, + tree raises, + int check, + int friendp, + int publicp, + int inlinep, special_function_kind sfk, - int funcdef_flag, - int template_count, - tree in_namespace, + int funcdef_flag, + int template_count, + tree in_namespace, tree* attrlist) { tree decl; @@ -5586,8 +5586,8 @@ grokfndecl (tree ctype, decl); if (DECL_ORIGINAL_TYPE (TYPE_NAME (t))) cp_pedwarn_at ("%q#D does not refer to the unqualified " - "type, so it is not used for linkage", - TYPE_NAME (t)); + "type, so it is not used for linkage", + TYPE_NAME (t)); } } else @@ -5649,8 +5649,8 @@ grokfndecl (tree ctype, { /* Something like `template <class T> friend void f<T>()'. */ error ("invalid use of template-id %qD in declaration " - "of primary template", - orig_declarator); + "of primary template", + orig_declarator); return NULL_TREE; } @@ -5659,17 +5659,17 @@ grokfndecl (tree ctype, the information in the TEMPLATE_ID_EXPR. */ SET_DECL_IMPLICIT_INSTANTIATION (decl); - if (TREE_CODE (fns) == COMPONENT_REF) - { - /* Due to bison parser ickiness, we will have already looked - up an operator_name or PFUNCNAME within the current class - (see template_id in parse.y). If the current class contains - such a name, we'll get a COMPONENT_REF here. Undo that. */ + if (TREE_CODE (fns) == COMPONENT_REF) + { + /* Due to bison parser ickiness, we will have already looked + up an operator_name or PFUNCNAME within the current class + (see template_id in parse.y). If the current class contains + such a name, we'll get a COMPONENT_REF here. Undo that. */ - gcc_assert (TREE_TYPE (TREE_OPERAND (fns, 0)) + gcc_assert (TREE_TYPE (TREE_OPERAND (fns, 0)) == current_class_type); - fns = TREE_OPERAND (fns, 1); - } + fns = TREE_OPERAND (fns, 1); + } gcc_assert (TREE_CODE (fns) == IDENTIFIER_NODE || TREE_CODE (fns) == OVERLOAD); DECL_TEMPLATE_INFO (decl) = tree_cons (fns, args, NULL_TREE); @@ -5677,16 +5677,16 @@ grokfndecl (tree ctype, if (has_default_arg) { error ("default arguments are not allowed in declaration " - "of friend template specialization %qD", - decl); + "of friend template specialization %qD", + decl); return NULL_TREE; } if (inlinep) { error ("%<inline%> is not allowed in declaration of friend " - "template specialization %qD", - decl); + "template specialization %qD", + decl); return NULL_TREE; } } @@ -5817,11 +5817,11 @@ set_linkage_for_static_data_member (tree decl) static tree grokvardecl (tree type, - tree name, + tree name, const cp_decl_specifier_seq *declspecs, - int initialized, - int constp, - tree scope) + int initialized, + int constp, + tree scope) { tree decl; tree explicit_scope; @@ -6045,7 +6045,7 @@ check_static_variable_definition (tree decl, tree type) if (!ARITHMETIC_TYPE_P (type) && TREE_CODE (type) != ENUMERAL_TYPE) { error ("invalid in-class initialization of static data member " - "of non-integral type %qT", + "of non-integral type %qT", type); /* If we just return the declaration, crashes will sometimes occur. We therefore return void_type_node, as if this were a @@ -6055,11 +6055,11 @@ check_static_variable_definition (tree decl, tree type) } else if (!CP_TYPE_CONST_P (type)) error ("ISO C++ forbids in-class initialization of non-const " - "static member %qD", - decl); + "static member %qD", + decl); else if (pedantic && !INTEGRAL_TYPE_P (type)) pedwarn ("ISO C++ forbids initialization of member constant " - "%qD of non-integral type %qT", decl, type); + "%qD of non-integral type %qT", decl, type); return 0; } @@ -6136,7 +6136,7 @@ compute_array_index_type (tree name, tree size) /* `(int) &fn' is not a valid array bound. */ if (name) error ("size of array %qD is not an integral constant-expression", - name); + name); else error ("size of array is not an integral constant-expression"); } @@ -6156,9 +6156,9 @@ compute_array_index_type (tree name, tree size) HOST_WIDE_INT saved_processing_template_decl; /* Compute the index of the largest element in the array. It is - one less than the number of elements in the array. We save - and restore PROCESSING_TEMPLATE_DECL so that computations in - cp_build_binary_op will be appropriately folded. */ + one less than the number of elements in the array. We save + and restore PROCESSING_TEMPLATE_DECL so that computations in + cp_build_binary_op will be appropriately folded. */ saved_processing_template_decl = processing_template_decl; processing_template_decl = 0; itype = cp_build_binary_op (MINUS_EXPR, @@ -6171,8 +6171,8 @@ compute_array_index_type (tree name, tree size) /* A variable sized array. */ itype = variable_size (itype); /* Make sure that there was no overflow when creating to a signed - index type. (For example, on a 32-bit machine, an array with - size 2^32 - 1 is too big.) */ + index type. (For example, on a 32-bit machine, an array with + size 2^32 - 1 is too big.) */ else if (TREE_OVERFLOW (itype)) { error ("overflow in array dimension"); @@ -6264,11 +6264,11 @@ create_array_type_for_decl (tree name, tree type, tree size) { if (name) error ("declaration of %qD as multidimensional array must " - "have bounds for all dimensions except the first", - name); + "have bounds for all dimensions except the first", + name); else error ("multidimensional array must have bounds for all " - "dimensions except the first"); + "dimensions except the first"); return error_mark_node; } @@ -6295,8 +6295,8 @@ create_array_type_for_decl (tree name, tree type, tree size) static tree check_special_function_return_type (special_function_kind sfk, - tree type, - tree optype) + tree type, + tree optype) { switch (sfk) { @@ -6405,9 +6405,9 @@ check_var_type (tree identifier, tree type) tree grokdeclarator (const cp_declarator *declarator, const cp_decl_specifier_seq *declspecs, - enum decl_context decl_context, - int initialized, - tree* attrlist) + enum decl_context decl_context, + int initialized, + tree* attrlist) { tree type = NULL_TREE; int longlong = 0; @@ -6897,26 +6897,26 @@ grokdeclarator (const cp_declarator *declarator, type_quals |= TYPE_QUAL_RESTRICT; if (sfk == sfk_conversion && type_quals != TYPE_UNQUALIFIED) error ("qualifiers are not allowed on declaration of %<operator %T%>", - ctor_return_type); + ctor_return_type); if (TREE_CODE (type) == FUNCTION_TYPE && type_quals != TYPE_UNQUALIFIED) { /* This was an error in C++98 (cv-qualifiers cannot be added to - a function type), but DR 295 makes the code well-formed by - dropping the extra qualifiers. */ + a function type), but DR 295 makes the code well-formed by + dropping the extra qualifiers. */ if (pedantic) - { - tree bad_type = build_qualified_type (type, type_quals); - pedwarn ("ignoring %qV qualifiers added to function type %qT", - bad_type, type); - } + { + tree bad_type = build_qualified_type (type, type_quals); + pedwarn ("ignoring %qV qualifiers added to function type %qT", + bad_type, type); + } type_quals = TYPE_UNQUALIFIED; } type_quals |= cp_type_quals (type); type = cp_build_qualified_type_real (type, type_quals, ((typedef_decl && !DECL_ARTIFICIAL (typedef_decl) - ? tf_ignore_bad_quals : 0) | tf_error | tf_warning)); + ? tf_ignore_bad_quals : 0) | tf_error | tf_warning)); /* We might have ignored or rejected some of the qualifiers. */ type_quals = cp_type_quals (type); @@ -7124,7 +7124,7 @@ grokdeclarator (const cp_declarator *declarator, Make sure we have a valid type for the function to return. */ /* We now know that the TYPE_QUALS don't apply to the - decl, but to its return type. */ + decl, but to its return type. */ type_quals = TYPE_UNQUALIFIED; /* Warn about some types functions can't return. */ @@ -7186,7 +7186,7 @@ grokdeclarator (const cp_declarator *declarator, return void_type_node; } } - else /* It's a constructor. */ + else /* It's a constructor. */ { if (explicitp == 1) explicitp = 2; @@ -7234,8 +7234,8 @@ grokdeclarator (const cp_declarator *declarator, error ("friend declaration not in class definition"); if (current_function_decl && funcdef_flag) error ("can't define friend function %qs in a local " - "class definition", - name); + "class definition", + name); } arg_types = grokparms (declarator->u.function.parameters, @@ -7252,7 +7252,7 @@ grokdeclarator (const cp_declarator *declarator, } type = build_function_type (type, arg_types); - type = cp_build_qualified_type (type, quals); + type = cp_build_qualified_type (type, quals); } break; @@ -7287,11 +7287,11 @@ grokdeclarator (const cp_declarator *declarator, { tree dummy; - /* If the type is a FUNCTION_TYPE, pick up the - qualifiers from that function type. No other - qualifiers may be supplied. */ - if (TREE_CODE (type) == FUNCTION_TYPE) - quals = cp_type_quals (type); + /* If the type is a FUNCTION_TYPE, pick up the + qualifiers from that function type. No other + qualifiers may be supplied. */ + if (TREE_CODE (type) == FUNCTION_TYPE) + quals = cp_type_quals (type); dummy = build_decl (TYPE_DECL, NULL_TREE, type); grok_method_quals (declarator->u.pointer.class_type, @@ -7419,7 +7419,7 @@ grokdeclarator (const cp_declarator *declarator, else { error ("cannot declare member function %<%T::%s%> within %<%T%>", - ctype, name, current_class_type); + ctype, name, current_class_type); return error_mark_node; } } @@ -7482,7 +7482,7 @@ grokdeclarator (const cp_declarator *declarator, if (explicitp == 1 || (explicitp && friendp)) { /* [dcl.fct.spec] The explicit specifier shall only be used in - declarations of constructors within a class definition. */ + declarations of constructors within a class definition. */ error ("only declarations of constructors can be %<explicit%>"); explicitp = 0; } @@ -7490,21 +7490,21 @@ grokdeclarator (const cp_declarator *declarator, if (storage_class == sc_mutable) { if (decl_context != FIELD || friendp) - { + { error ("non-member %qs cannot be declared %<mutable%>", name); storage_class = sc_none; - } + } else if (decl_context == TYPENAME || declspecs->specs[(int)ds_typedef]) { error ("non-object member %qs cannot be declared %<mutable%>", name); storage_class = sc_none; } else if (TREE_CODE (type) == FUNCTION_TYPE - || TREE_CODE (type) == METHOD_TYPE) - { + || TREE_CODE (type) == METHOD_TYPE) + { error ("function %qs cannot be declared %<mutable%>", name); storage_class = sc_none; - } + } else if (staticp) { error ("static %qs cannot be declared %<mutable%>", name); @@ -7591,12 +7591,12 @@ grokdeclarator (const cp_declarator *declarator, { if (ctype == NULL_TREE) { - if (TREE_CODE (type) == METHOD_TYPE) + if (TREE_CODE (type) == METHOD_TYPE) ctype = TYPE_METHOD_BASETYPE (type); - /* Any qualifiers on a function type typedef have - already been dealt with. */ - else if (TREE_CODE (type) == FUNCTION_TYPE) - quals = TYPE_UNQUALIFIED; + /* Any qualifiers on a function type typedef have + already been dealt with. */ + else if (TREE_CODE (type) == FUNCTION_TYPE) + quals = TYPE_UNQUALIFIED; } if (ctype != NULL_TREE) grok_method_quals (ctype, decl, quals); @@ -7641,21 +7641,21 @@ grokdeclarator (const cp_declarator *declarator, parms = nreverse (decls); if (decl_context != TYPENAME) - { - /* A cv-qualifier-seq shall only be part of the function type - for a non-static member function. [8.3.5/4 dcl.fct] */ - if (cp_type_quals (type) != TYPE_UNQUALIFIED - && (current_class_type == NULL_TREE || staticp) ) - { - error ("qualified function types cannot be used to declare %s functions", - (staticp? "static member" : "free")); - type = TYPE_MAIN_VARIANT (type); - } - - /* The qualifiers on the function type become the qualifiers on - the non-static member function. */ - quals |= cp_type_quals (type); - } + { + /* A cv-qualifier-seq shall only be part of the function type + for a non-static member function. [8.3.5/4 dcl.fct] */ + if (cp_type_quals (type) != TYPE_UNQUALIFIED + && (current_class_type == NULL_TREE || staticp) ) + { + error ("qualified function types cannot be used to declare %s functions", + (staticp? "static member" : "free")); + type = TYPE_MAIN_VARIANT (type); + } + + /* The qualifiers on the function type become the qualifiers on + the non-static member function. */ + quals |= cp_type_quals (type); + } } /* If this is a type name (such as, in a cast or sizeof), @@ -7688,11 +7688,11 @@ grokdeclarator (const cp_declarator *declarator, if (TREE_CODE (type) == TEMPLATE_TYPE_PARM) pedwarn ("template parameters cannot be friends"); else if (TREE_CODE (type) == TYPENAME_TYPE) - pedwarn ("friend declaration requires class-key, " + pedwarn ("friend declaration requires class-key, " "i.e. %<friend class %T::%D%>", TYPE_CONTEXT (type), TYPENAME_TYPE_FULLNAME (type)); else - pedwarn ("friend declaration requires class-key, " + pedwarn ("friend declaration requires class-key, " "i.e. %<friend %#T%>", type); } @@ -7706,7 +7706,7 @@ grokdeclarator (const cp_declarator *declarator, /*complain=*/true); else error ("trying to make class %qT a friend of global scope", - type); + type); type = void_type_node; } @@ -7716,9 +7716,9 @@ grokdeclarator (const cp_declarator *declarator, if (ctype == NULL_TREE) { if (TREE_CODE (type) != METHOD_TYPE) - error ("invalid qualifiers on non-member function type"); + error ("invalid qualifiers on non-member function type"); else - ctype = TYPE_METHOD_BASETYPE (type); + ctype = TYPE_METHOD_BASETYPE (type); } if (ctype) { @@ -7839,7 +7839,7 @@ grokdeclarator (const cp_declarator *declarator, if (virtualp) { error ("%qD cannot be declared virtual, since it " - "is always static", + "is always static", unqualified_id); virtualp = 0; } @@ -7944,7 +7944,7 @@ grokdeclarator (const cp_declarator *declarator, && declspecs->type && declspecs->type == type) error (" in instantiation of template %qT", - current_class_type); + current_class_type); type = error_mark_node; decl = NULL_TREE; @@ -7954,7 +7954,7 @@ grokdeclarator (const cp_declarator *declarator, if (friendp) { error ("%qE is neither function nor member function; " - "cannot be declared friend", unqualified_id); + "cannot be declared friend", unqualified_id); friendp = 0; } decl = NULL_TREE; @@ -7965,7 +7965,7 @@ grokdeclarator (const cp_declarator *declarator, /* Friends are treated specially. */ if (ctype == current_class_type) warning (0, "member functions are implicitly friends of their class"); - else if (decl && DECL_NAME (decl)) + else if (decl && DECL_NAME (decl)) { if (template_class_depth (current_class_type) == 0) { @@ -8080,10 +8080,10 @@ grokdeclarator (const cp_declarator *declarator, { if (storage_class == sc_static) pedwarn ("%<static%> specified invalid for function %qs " - "declared out of global scope", name); + "declared out of global scope", name); else pedwarn ("%<inline%> specifier invalid for function %qs " - "declared out of global scope", name); + "declared out of global scope", name); } if (ctype == NULL_TREE) @@ -8122,7 +8122,7 @@ grokdeclarator (const cp_declarator *declarator, if (TREE_CODE (type) == METHOD_TYPE) { pedwarn ("cannot declare member function %qD to have " - "static linkage", decl); + "static linkage", decl); invalid_static = 1; } else if (current_function_decl) @@ -8157,9 +8157,9 @@ grokdeclarator (const cp_declarator *declarator, DECL_CONTEXT (decl) = ctype; if (staticp == 1) { - pedwarn ("%<static%> may not be used when defining " - "(as opposed to declaring) a static data member"); - staticp = 0; + pedwarn ("%<static%> may not be used when defining " + "(as opposed to declaring) a static data member"); + staticp = 0; storage_class = sc_none; } if (storage_class == sc_register && TREE_STATIC (decl)) @@ -8169,9 +8169,9 @@ grokdeclarator (const cp_declarator *declarator, } if (storage_class == sc_extern && pedantic) { - pedwarn ("cannot explicitly declare member %q#D to have " - "extern linkage", - decl); + pedwarn ("cannot explicitly declare member %q#D to have " + "extern linkage", + decl); storage_class = sc_none; } } @@ -8209,8 +8209,8 @@ require_complete_types_for_parms (tree parms) if (dependent_type_p (TREE_TYPE (parms))) continue; if (VOID_TYPE_P (TREE_TYPE (parms))) - /* grokparms will have already issued an error. */ - TREE_TYPE (parms) = error_mark_node; + /* grokparms will have already issued an error. */ + TREE_TYPE (parms) = error_mark_node; else if (complete_type_or_else (TREE_TYPE (parms), parms)) { layout_decl (parms, 0); @@ -8313,10 +8313,10 @@ check_default_argument (tree decl, tree arg) { if (decl) error ("default argument for %q#D has type %qT", - decl, TREE_TYPE (arg)); + decl, TREE_TYPE (arg)); else error ("default argument for parameter of type %qT has type %qT", - decl_type, TREE_TYPE (arg)); + decl_type, TREE_TYPE (arg)); return error_mark_node; } @@ -8366,32 +8366,32 @@ grokparms (cp_parameter_declarator *first_parm, tree *parms) tree decl; if (parm == no_parameters) - break; + break; attrs = parm->decl_specifiers.attributes; parm->decl_specifiers.attributes = NULL_TREE; decl = grokdeclarator (parm->declarator, &parm->decl_specifiers, PARM, init != NULL_TREE, &attrs); if (! decl || TREE_TYPE (decl) == error_mark_node) - continue; + continue; if (attrs) cplus_decl_attributes (&decl, attrs, 0); type = TREE_TYPE (decl); if (VOID_TYPE_P (type)) - { - if (same_type_p (type, void_type_node) - && !DECL_NAME (decl) && !result && !parm->next && !ellipsis) - /* this is a parmlist of `(void)', which is ok. */ - break; - cxx_incomplete_type_error (decl, type); + { + if (same_type_p (type, void_type_node) + && !DECL_NAME (decl) && !result && !parm->next && !ellipsis) + /* this is a parmlist of `(void)', which is ok. */ + break; + cxx_incomplete_type_error (decl, type); /* It's not a good idea to actually create parameters of type `void'; other parts of the compiler assume that a void type terminates the parameter list. */ type = error_mark_node; TREE_TYPE (decl) = error_mark_node; - } + } if (type != error_mark_node) { @@ -8413,20 +8413,20 @@ grokparms (cp_parameter_declarator *first_parm, tree *parms) tree t = TREE_TYPE (type); int ptr = TYPE_PTR_P (type); - while (1) - { - if (TYPE_PTR_P (t)) - ptr = 1; - else if (TREE_CODE (t) != ARRAY_TYPE) - break; - else if (!TYPE_DOMAIN (t)) - break; - t = TREE_TYPE (t); - } + while (1) + { + if (TYPE_PTR_P (t)) + ptr = 1; + else if (TREE_CODE (t) != ARRAY_TYPE) + break; + else if (!TYPE_DOMAIN (t)) + break; + t = TREE_TYPE (t); + } if (TREE_CODE (t) == ARRAY_TYPE) error ("parameter %qD includes %s to array of unknown " - "bound %qT", - decl, ptr ? "pointer" : "reference", t); + "bound %qT", + decl, ptr ? "pointer" : "reference", t); } if (!any_error && init) @@ -8527,11 +8527,11 @@ void grok_special_member_properties (tree decl) { /* [class.copy] - A non-template constructor for class X is a copy - constructor if its first parameter is of type X&, const - X&, volatile X& or const volatile X&, and either there - are no other parameters or else all other parameters have - default arguments. */ + A non-template constructor for class X is a copy + constructor if its first parameter is of type X&, const + X&, volatile X& or const volatile X&, and either there + are no other parameters or else all other parameters have + default arguments. */ TYPE_HAS_INIT_REF (DECL_CONTEXT (decl)) = 1; if (ctor > 1) TYPE_HAS_CONST_INIT_REF (DECL_CONTEXT (decl)) = 1; @@ -8543,9 +8543,9 @@ void grok_special_member_properties (tree decl) { /* [class.copy] - A non-template assignment operator for class X is a copy - assignment operator if its parameter is of type X, X&, const - X&, volatile X& or const volatile X&. */ + A non-template assignment operator for class X is a copy + assignment operator if its parameter is of type X, X&, const + X&, volatile X& or const volatile X&. */ int assop = copy_fn_p (decl); @@ -8570,19 +8570,19 @@ grok_ctor_properties (tree ctype, tree decl) { /* [class.copy] - A declaration of a constructor for a class X is ill-formed if - its first parameter is of type (optionally cv-qualified) X - and either there are no other parameters or else all other - parameters have default arguments. - - We *don't* complain about member template instantiations that - have this form, though; they can occur as we try to decide - what constructor to use during overload resolution. Since - overload resolution will never prefer such a constructor to - the non-template copy constructor (which is either explicitly - or implicitly defined), there's no need to worry about their - existence. Theoretically, they should never even be - instantiated, but that's hard to forestall. */ + A declaration of a constructor for a class X is ill-formed if + its first parameter is of type (optionally cv-qualified) X + and either there are no other parameters or else all other + parameters have default arguments. + + We *don't* complain about member template instantiations that + have this form, though; they can occur as we try to decide + what constructor to use during overload resolution. Since + overload resolution will never prefer such a constructor to + the non-template copy constructor (which is either explicitly + or implicitly defined), there's no need to worry about their + existence. Theoretically, they should never even be + instantiated, but that's hard to forestall. */ error ("invalid constructor; you probably meant %<%T (const %T&)%>", ctype, ctype); return 0; @@ -8887,7 +8887,7 @@ grok_op_properties (tree decl, bool complain) || !same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (ret)), arg)) warning (0, "prefix %qD should return %qT", decl, - build_reference_type (arg)); + build_reference_type (arg)); } else { @@ -8922,7 +8922,7 @@ grok_op_properties (tree decl, bool complain) || operator_code == TRUTH_ORIF_EXPR || operator_code == COMPOUND_EXPR)) warning (0, "user-defined %qD always evaluates both arguments", - decl); + decl); } /* Effective C++ rule 23. */ @@ -8939,19 +8939,19 @@ grok_op_properties (tree decl, bool complain) /* [over.oper]/8 */ for (; argtypes && argtypes != void_list_node; - argtypes = TREE_CHAIN (argtypes)) - if (TREE_PURPOSE (argtypes)) - { - TREE_PURPOSE (argtypes) = NULL_TREE; - if (operator_code == POSTINCREMENT_EXPR + argtypes = TREE_CHAIN (argtypes)) + if (TREE_PURPOSE (argtypes)) + { + TREE_PURPOSE (argtypes) = NULL_TREE; + if (operator_code == POSTINCREMENT_EXPR || operator_code == POSTDECREMENT_EXPR) - { - if (pedantic) - pedwarn ("%qD cannot have default arguments", decl); - } - else - error ("%qD cannot have default arguments", decl); - } + { + if (pedantic) + pedwarn ("%qD cannot have default arguments", decl); + } + else + error ("%qD cannot have default arguments", decl); + } } @@ -9274,7 +9274,7 @@ xref_tag (enum tag_types tag_code, tree name, DECL_ANTICIPATED (TYPE_TI_TEMPLATE (t)) = 0; DECL_FRIEND_P (TYPE_TI_TEMPLATE (t)) = 0; } - } + } } POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t); @@ -9763,7 +9763,7 @@ build_enumerator (tree name, tree value, tree enumtype) bool overflowed; /* The next value is the previous value plus one. We can - safely assume that the previous value is an INTEGER_CST. + safely assume that the previous value is an INTEGER_CST. add_double doesn't know the type of the target expression, so we must check with int_fits_type_p as well. */ prev_value = DECL_INITIAL (TREE_VALUE (TYPE_VALUES (enumtype))); @@ -9981,7 +9981,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) /* FIXME: Handle error_mark_node more gracefully. */ tree newdecl1 = push_template_decl (decl1); if (newdecl1 != error_mark_node) - decl1 = newdecl1; + decl1 = newdecl1; } /* We are now in the scope of the function being defined. */ @@ -10624,7 +10624,7 @@ finish_function (int flags) gcc_assert (errorcount); /* Throw away the broken statement tree and extra binding - levels. */ + levels. */ DECL_SAVED_TREE (fndecl) = alloc_stmt_list (); while (current_binding_level->kind != sk_function_parms) @@ -10772,7 +10772,7 @@ finish_function (int flags) tree start_method (cp_decl_specifier_seq *declspecs, - const cp_declarator *declarator, tree attrlist) + const cp_declarator *declarator, tree attrlist) { tree fndecl = grokdeclarator (declarator, declspecs, MEMFUNCDEF, 0, &attrlist); @@ -11075,7 +11075,7 @@ cp_tree_node_structure (union lang_tree_node * t) case TEMPLATE_PARM_INDEX: return TS_CP_TPI; case TINST_LEVEL: return TS_CP_TINST_LEVEL; case PTRMEM_CST: return TS_CP_PTRMEM; - case BASELINK: return TS_CP_BASELINK; + case BASELINK: return TS_CP_BASELINK; default: return TS_CP_GENERIC; } } diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index c8f09f9..1fe54a1 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -77,7 +77,7 @@ static tree start_static_initialization_or_destruction (tree, int); static void finish_static_initialization_or_destruction (tree); static void generate_ctor_or_dtor_function (bool, int, location_t *); static int generate_ctor_and_dtor_functions_for_priority (splay_tree_node, - void *); + void *); static tree prune_vars_needing_no_initialization (tree *); static void write_out_vars (tree); static void import_export_class (tree); @@ -370,7 +370,7 @@ grok_array_decl (tree array_expr, tree index_exp) else { error ("invalid types %<%T[%T]%> for array subscript", - type, TREE_TYPE (index_exp)); + type, TREE_TYPE (index_exp)); return error_mark_node; } @@ -419,7 +419,7 @@ delete_sanity (tree exp, tree size, bool doing_vec, int use_global_delete) if (t == NULL_TREE || t == error_mark_node) { error ("type %q#T argument given to %<delete%>, expected pointer", - TREE_TYPE (exp)); + TREE_TYPE (exp)); return error_mark_node; } @@ -431,7 +431,7 @@ delete_sanity (tree exp, tree size, bool doing_vec, int use_global_delete) if (TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE) { error ("cannot delete a function. Only pointer-to-objects are " - "valid arguments to %<delete%>"); + "valid arguments to %<delete%>"); return error_mark_node; } @@ -475,7 +475,7 @@ check_member_template (tree tmpl) A local class shall not have member templates. */ error ("invalid declaration of member template %q#D in local class", - decl); + decl); if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VIRTUAL_P (decl)) { @@ -543,7 +543,7 @@ check_java_method (tree method) if (!acceptable_java_type (ret_type)) { error ("Java method %qD has non-Java return type %qT", - method, ret_type); + method, ret_type); jerr = true; } @@ -558,8 +558,8 @@ check_java_method (tree method) tree type = TREE_VALUE (arg_types); if (!acceptable_java_type (type)) { - error ("Java method %qD has non-Java parameter type %qT", - method, type); + error ("Java method %qD has non-Java parameter type %qT", + method, type); jerr = true; } } @@ -590,8 +590,8 @@ check_classfn (tree ctype, tree function, tree template_parms) we're not going to find the declaration in the class. For example, in: - struct S { template <typename T> void f(T); }; - template <> void S::f(int); + struct S { template <typename T> void f(T); }; + template <> void S::f(int); we're not going to find `S::f(int)', but there's no reason we should, either. We let our callers know we didn't @@ -743,7 +743,7 @@ note_vague_linkage_var (tree var) void finish_static_data_member_decl (tree decl, tree init, tree asmspec_tree, - int flags) + int flags) { gcc_assert (TREE_PUBLIC (decl)); @@ -770,7 +770,7 @@ finish_static_data_member_decl (tree decl, tree init, tree asmspec_tree, error ("initializer invalid for static member with constructor"); if (!explained) - { + { error ("(an out of class initialization is required)"); explained = 1; } @@ -808,7 +808,7 @@ tree grokfield (const cp_declarator *declarator, cp_decl_specifier_seq *declspecs, tree init, tree asmspec_tree, - tree attrlist) + tree attrlist) { tree value; const char *asmspec = 0; @@ -853,7 +853,7 @@ grokfield (const cp_declarator *declarator, && IDENTIFIER_POINTER (DECL_NAME (value))[0] == '_' && ! strcmp (IDENTIFIER_POINTER (DECL_NAME (value)), "_vptr")) error ("member %qD conflicts with virtual function table field name", - value); + value); /* Stash away type declarations. */ if (TREE_CODE (value) == TYPE_DECL) @@ -904,7 +904,7 @@ grokfield (const cp_declarator *declarator, else { /* We allow initializers to become parameters to base - initializers. */ + initializers. */ if (TREE_CODE (init) == TREE_LIST) { if (TREE_CHAIN (init) == NULL_TREE) @@ -1021,7 +1021,7 @@ grokbitfield (const cp_declarator *declarator, if (DECL_IN_AGGR_P (value)) { error ("%qD is already defined in the class %qT", value, - DECL_CONTEXT (value)); + DECL_CONTEXT (value)); return void_type_node; } @@ -1086,7 +1086,7 @@ build_anon_union_vars (tree type, tree object) if (TREE_CODE (field) != FIELD_DECL) { cp_pedwarn_at ("%q#D invalid; an anonymous union can only " - "have non-static data members", + "have non-static data members", field); continue; } @@ -1200,9 +1200,9 @@ coerce_new_type (tree type) { e = 2; if (args && args != void_list_node) - args = TREE_CHAIN (args); + args = TREE_CHAIN (args); pedwarn ("%<operator new%> takes type %<size_t%> (%qT) " - "as first parameter", size_type_node); + "as first parameter", size_type_node); } switch (e) { @@ -1211,8 +1211,8 @@ coerce_new_type (tree type) /* Fall through. */ case 1: type = build_exception_variant - (build_function_type (ptr_type_node, args), - TYPE_RAISES_EXCEPTIONS (type)); + (build_function_type (ptr_type_node, args), + TYPE_RAISES_EXCEPTIONS (type)); /* Fall through. */ default:; } @@ -1238,9 +1238,9 @@ coerce_delete_type (tree type) { e = 2; if (args && args != void_list_node) - args = TREE_CHAIN (args); + args = TREE_CHAIN (args); error ("%<operator delete%> takes type %qT as first parameter", - ptr_type_node); + ptr_type_node); } switch (e) { @@ -1249,8 +1249,8 @@ coerce_delete_type (tree type) /* Fall through. */ case 1: type = build_exception_variant - (build_function_type (void_type_node, args), - TYPE_RAISES_EXCEPTIONS (type)); + (build_function_type (void_type_node, args), + TYPE_RAISES_EXCEPTIONS (type)); /* Fall through. */ default:; } @@ -1983,7 +1983,7 @@ get_guard (tree decl) DECL_COMMON (guard) = DECL_COMMON (decl); DECL_ONE_ONLY (guard) = DECL_ONE_ONLY (decl); if (TREE_PUBLIC (decl)) - DECL_WEAK (guard) = DECL_WEAK (decl); + DECL_WEAK (guard) = DECL_WEAK (decl); DECL_ARTIFICIAL (guard) = 1; DECL_IGNORED_P (guard) = 1; @@ -2813,9 +2813,9 @@ cp_finish_file (void) These include: o Template specializations that we have not yet instantiated, - but which are needed. + but which are needed. o Initialization and destruction for non-local objects with - static storage duration. (Local objects with static storage + static storage duration. (Local objects with static storage duration are initialized when their scope is first entered, and are cleaned up via atexit.) o Virtual function tables. @@ -2842,42 +2842,42 @@ cp_finish_file (void) ggc_collect (); /* Write out virtual tables as required. Note that writing out - the virtual table for a template class may cause the - instantiation of members of that class. If we write out - vtables then we remove the class from our list so we don't - have to look at it again. */ + the virtual table for a template class may cause the + instantiation of members of that class. If we write out + vtables then we remove the class from our list so we don't + have to look at it again. */ while (keyed_classes != NULL_TREE - && maybe_emit_vtables (TREE_VALUE (keyed_classes))) - { - reconsider = true; - keyed_classes = TREE_CHAIN (keyed_classes); - } + && maybe_emit_vtables (TREE_VALUE (keyed_classes))) + { + reconsider = true; + keyed_classes = TREE_CHAIN (keyed_classes); + } t = keyed_classes; if (t != NULL_TREE) - { - tree next = TREE_CHAIN (t); - - while (next) - { - if (maybe_emit_vtables (TREE_VALUE (next))) - { - reconsider = true; - TREE_CHAIN (t) = TREE_CHAIN (next); - } - else - t = next; - - next = TREE_CHAIN (t); - } - } + { + tree next = TREE_CHAIN (t); + + while (next) + { + if (maybe_emit_vtables (TREE_VALUE (next))) + { + reconsider = true; + TREE_CHAIN (t) = TREE_CHAIN (next); + } + else + t = next; + + next = TREE_CHAIN (t); + } + } /* Write out needed type info variables. We have to be careful - looping through unemitted decls, because emit_tinfo_decl may - cause other variables to be needed. New elements will be - appended, and we remove from the vector those that actually - get emitted. */ + looping through unemitted decls, because emit_tinfo_decl may + cause other variables to be needed. New elements will be + appended, and we remove from the vector those that actually + get emitted. */ for (i = VEC_length (tree, unemitted_tinfo_decls); VEC_iterate (tree, unemitted_tinfo_decls, --i, t);) if (emit_tinfo_decl (t)) @@ -2967,8 +2967,8 @@ cp_finish_file (void) up with CURRENT_FUNCTION_DECL set. */ push_to_top_level (); /* The decl's location will mark where it was first - needed. Save that so synthesize method can indicate - where it was needed from, in case of error */ + needed. Save that so synthesize method can indicate + where it was needed from, in case of error */ input_location = DECL_SOURCE_LOCATION (decl); synthesize_method (decl); pop_from_top_level (); @@ -3234,8 +3234,8 @@ mark_used (tree decl) return; /* Remember the current location for a function we will end up - synthesizing. Then we can inform the user where it was - required in the case of error. */ + synthesizing. Then we can inform the user where it was + required in the case of error. */ if (DECL_ARTIFICIAL (decl) && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl) && !DECL_THUNK_P (decl)) DECL_SOURCE_LOCATION (decl) = input_location; diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c index 8e7ac44..81b6be7 100644 --- a/gcc/cp/dump.c +++ b/gcc/cp/dump.c @@ -91,63 +91,63 @@ dump_op (dump_info_p di, tree t) break; case PLUS_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "plusassign"); + dump_string (di, "plusassign"); else - dump_string(di, "plus"); + dump_string(di, "plus"); break; case MINUS_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "minusassign"); + dump_string (di, "minusassign"); else - dump_string(di, "minus"); + dump_string(di, "minus"); break; case MULT_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "multassign"); + dump_string (di, "multassign"); else - dump_string (di, "mult"); + dump_string (di, "mult"); break; case TRUNC_DIV_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "divassign"); + dump_string (di, "divassign"); else - dump_string (di, "div"); + dump_string (di, "div"); break; case TRUNC_MOD_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "modassign"); + dump_string (di, "modassign"); else - dump_string (di, "mod"); + dump_string (di, "mod"); break; case BIT_AND_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "andassign"); + dump_string (di, "andassign"); else - dump_string (di, "and"); + dump_string (di, "and"); break; case BIT_IOR_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "orassign"); + dump_string (di, "orassign"); else - dump_string (di, "or"); + dump_string (di, "or"); break; case BIT_XOR_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "xorassign"); + dump_string (di, "xorassign"); else - dump_string (di, "xor"); + dump_string (di, "xor"); break; case LSHIFT_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "lshiftassign"); + dump_string (di, "lshiftassign"); else - dump_string (di, "lshift"); + dump_string (di, "lshift"); break; case RSHIFT_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "rshiftassign"); + dump_string (di, "rshiftassign"); else - dump_string (di, "rshift"); + dump_string (di, "rshift"); break; case EQ_EXPR: dump_string (di, "eq"); @@ -196,7 +196,7 @@ dump_op (dump_info_p di, tree t) break; case NOP_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "assign"); + dump_string (di, "assign"); break; default: break; @@ -263,7 +263,7 @@ cp_dump_tree (void* dump_info, tree t) dump_child ("vfld", TYPE_VFIELD (t)); if (CLASSTYPE_TEMPLATE_SPECIALIZATION(t)) - dump_string(di, "spec"); + dump_string(di, "spec"); if (!dump_flag (di, TDF_SLIM, t) && TYPE_BINFO (t)) { @@ -285,32 +285,32 @@ cp_dump_tree (void* dump_info, tree t) case FIELD_DECL: dump_access (di, t); if (DECL_MUTABLE_P (t)) - dump_string(di, "mutable"); + dump_string(di, "mutable"); break; case VAR_DECL: if (TREE_CODE (CP_DECL_CONTEXT (t)) == RECORD_TYPE) - dump_access (di, t); + dump_access (di, t); if (TREE_STATIC (t) && !TREE_PUBLIC (t)) - dump_string (di, "static"); + dump_string (di, "static"); break; case FUNCTION_DECL: if (!DECL_THUNK_P (t)) { - if (DECL_OVERLOADED_OPERATOR_P (t)) { + if (DECL_OVERLOADED_OPERATOR_P (t)) { dump_string (di, "operator"); - dump_op (di, t); - } + dump_op (di, t); + } if (DECL_FUNCTION_MEMBER_P (t)) { dump_string (di, "member"); dump_access (di, t); } - if (DECL_PURE_VIRTUAL_P (t)) - dump_string (di, "pure"); - if (DECL_VIRTUAL_P (t)) - dump_string (di, "virtual"); + if (DECL_PURE_VIRTUAL_P (t)) + dump_string (di, "pure"); + if (DECL_VIRTUAL_P (t)) + dump_string (di, "virtual"); if (DECL_CONSTRUCTOR_P (t)) dump_string (di, "constructor"); if (DECL_DESTRUCTOR_P (t)) diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 5ed0818..c247c97 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -81,7 +81,7 @@ static const char *function_category (tree); static void maybe_print_instantiation_context (diagnostic_context *); static void print_instantiation_full_context (diagnostic_context *); static void print_instantiation_partial_context (diagnostic_context *, - tree, location_t); + tree, location_t); static void cp_diagnostic_starter (diagnostic_context *, diagnostic_info *); static void cp_diagnostic_finalizer (diagnostic_context *, diagnostic_info *); static void cp_print_error_function (diagnostic_context *, diagnostic_info *); @@ -114,10 +114,10 @@ dump_scope (tree scope, int flags) if (TREE_CODE (scope) == NAMESPACE_DECL) { if (scope != global_namespace) - { - dump_decl (scope, f); - pp_cxx_colon_colon (cxx_pp); - } + { + dump_decl (scope, f); + pp_cxx_colon_colon (cxx_pp); + } } else if (AGGREGATE_TYPE_P (scope)) { @@ -155,7 +155,7 @@ dump_template_argument_list (tree args, int flags) for (i = 0; i< n; ++i) { if (need_comma) - pp_separate_with_comma (cxx_pp); + pp_separate_with_comma (cxx_pp); dump_template_argument (TREE_VEC_ELT (args, i), flags); need_comma = 1; } @@ -172,15 +172,15 @@ dump_template_parameter (tree parm, int flags) if (TREE_CODE (p) == TYPE_DECL) { if (flags & TFF_DECL_SPECIFIERS) - { - pp_cxx_identifier (cxx_pp, "class"); - if (DECL_NAME (p)) - pp_cxx_tree_identifier (cxx_pp, DECL_NAME (p)); - } + { + pp_cxx_identifier (cxx_pp, "class"); + if (DECL_NAME (p)) + pp_cxx_tree_identifier (cxx_pp, DECL_NAME (p)); + } else if (DECL_NAME (p)) - pp_cxx_tree_identifier (cxx_pp, DECL_NAME (p)); + pp_cxx_tree_identifier (cxx_pp, DECL_NAME (p)); else - pp_cxx_canonical_template_parameter (cxx_pp, TREE_TYPE (p)); + pp_cxx_canonical_template_parameter (cxx_pp, TREE_TYPE (p)); } else dump_decl (p, flags | TFF_DECL_SPECIFIERS); @@ -191,9 +191,9 @@ dump_template_parameter (tree parm, int flags) pp_equal (cxx_pp); pp_cxx_whitespace (cxx_pp); if (TREE_CODE (p) == TYPE_DECL || TREE_CODE (p) == TEMPLATE_DECL) - dump_type (a, flags & ~TFF_CHASE_TYPEDEF); + dump_type (a, flags & ~TFF_CHASE_TYPEDEF); else - dump_expr (a, flags | TFF_EXPR_IN_PARENS); + dump_expr (a, flags | TFF_EXPR_IN_PARENS); } } @@ -228,9 +228,9 @@ dump_template_bindings (tree parms, tree args) if (need_comma) pp_separate_with_comma (cxx_pp); dump_template_parameter (TREE_VEC_ELT (p, i), TFF_PLAIN_IDENTIFIER); - pp_cxx_whitespace (cxx_pp); - pp_equal (cxx_pp); - pp_cxx_whitespace (cxx_pp); + pp_cxx_whitespace (cxx_pp); + pp_equal (cxx_pp); + pp_cxx_whitespace (cxx_pp); if (arg) dump_template_argument (arg, TFF_PLAIN_IDENTIFIER); else @@ -283,11 +283,11 @@ dump_type (tree t, int flags) case TYPE_DECL: if (flags & TFF_CHASE_TYPEDEF) - { - dump_type (DECL_ORIGINAL_TYPE (t) - ? DECL_ORIGINAL_TYPE (t) : TREE_TYPE (t), flags); - break; - } + { + dump_type (DECL_ORIGINAL_TYPE (t) + ? DECL_ORIGINAL_TYPE (t) : TREE_TYPE (t), flags); + break; + } /* Else fall through. */ case TEMPLATE_DECL: @@ -309,7 +309,7 @@ dump_type (tree t, int flags) if (TYPE_IDENTIFIER (t)) pp_cxx_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t)); else - pp_cxx_canonical_template_parameter (cxx_pp, t); + pp_cxx_canonical_template_parameter (cxx_pp, t); break; case BOUND_TEMPLATE_TEMPLATE_PARM: @@ -318,7 +318,7 @@ dump_type (tree t, int flags) pp_cxx_cv_qualifier_seq (cxx_pp, t); pp_cxx_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t)); pp_cxx_begin_template_argument_list (cxx_pp); - dump_template_argument_list (args, flags); + dump_template_argument_list (args, flags); pp_cxx_end_template_argument_list (cxx_pp); } break; @@ -328,8 +328,8 @@ dump_type (tree t, int flags) if (TYPE_IDENTIFIER (t)) pp_cxx_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t)); else - pp_cxx_canonical_template_parameter - (cxx_pp, TEMPLATE_TYPE_PARM_INDEX (t)); + pp_cxx_canonical_template_parameter + (cxx_pp, TEMPLATE_TYPE_PARM_INDEX (t)); break; /* This is not always necessary for pointers and such, but doing this @@ -436,38 +436,38 @@ dump_aggr_type (tree t, int flags) { typdef = !DECL_ARTIFICIAL (name); tmplate = !typdef && TREE_CODE (t) != ENUMERAL_TYPE - && TYPE_LANG_SPECIFIC (t) && CLASSTYPE_TEMPLATE_INFO (t) - && (CLASSTYPE_TEMPLATE_SPECIALIZATION (t) - || TREE_CODE (CLASSTYPE_TI_TEMPLATE (t)) != TEMPLATE_DECL - || DECL_TEMPLATE_SPECIALIZATION (CLASSTYPE_TI_TEMPLATE (t)) - || PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t))); + && TYPE_LANG_SPECIFIC (t) && CLASSTYPE_TEMPLATE_INFO (t) + && (CLASSTYPE_TEMPLATE_SPECIALIZATION (t) + || TREE_CODE (CLASSTYPE_TI_TEMPLATE (t)) != TEMPLATE_DECL + || DECL_TEMPLATE_SPECIALIZATION (CLASSTYPE_TI_TEMPLATE (t)) + || PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t))); dump_scope (CP_DECL_CONTEXT (name), flags | TFF_SCOPE); if (tmplate) - { - /* Because the template names are mangled, we have to locate - the most general template, and use that name. */ - tree tpl = CLASSTYPE_TI_TEMPLATE (t); - - while (DECL_TEMPLATE_INFO (tpl)) - tpl = DECL_TI_TEMPLATE (tpl); - name = tpl; - } + { + /* Because the template names are mangled, we have to locate + the most general template, and use that name. */ + tree tpl = CLASSTYPE_TI_TEMPLATE (t); + + while (DECL_TEMPLATE_INFO (tpl)) + tpl = DECL_TI_TEMPLATE (tpl); + name = tpl; + } name = DECL_NAME (name); } if (name == 0 || ANON_AGGRNAME_P (name)) { if (flags & TFF_CLASS_KEY_OR_ENUM) - pp_identifier (cxx_pp, "<anonymous>"); + pp_identifier (cxx_pp, "<anonymous>"); else - pp_printf (pp_base (cxx_pp), "<anonymous %s>", variety); + pp_printf (pp_base (cxx_pp), "<anonymous %s>", variety); } else pp_cxx_tree_identifier (cxx_pp, name); if (tmplate) dump_template_parms (TYPE_TEMPLATE_INFO (t), - !CLASSTYPE_USE_TEMPLATE (t), - flags & ~TFF_TEMPLATE_HEADER); + !CLASSTYPE_USE_TEMPLATE (t), + flags & ~TFF_TEMPLATE_HEADER); } /* Dump into the obstack the initial part of the output for a given type. @@ -504,8 +504,8 @@ dump_type_prefix (tree t, int flags) pp_cxx_left_paren (cxx_pp); } pp_character (cxx_pp, "&*"[TREE_CODE (t) == POINTER_TYPE]); - pp_base (cxx_pp)->padding = pp_before; - pp_cxx_cv_qualifier_seq (cxx_pp, t); + pp_base (cxx_pp)->padding = pp_before; + pp_cxx_cv_qualifier_seq (cxx_pp, t); } break; @@ -514,9 +514,9 @@ dump_type_prefix (tree t, int flags) dump_type_prefix (TREE_TYPE (t), flags); if (TREE_CODE (t) == OFFSET_TYPE) /* pmfs deal with this in d_t_p */ { - pp_maybe_space (cxx_pp); - if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE) - pp_cxx_left_paren (cxx_pp); + pp_maybe_space (cxx_pp); + if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE) + pp_cxx_left_paren (cxx_pp); dump_type (TYPE_OFFSET_BASETYPE (t), flags); pp_cxx_colon_colon (cxx_pp); } @@ -526,7 +526,7 @@ dump_type_prefix (tree t, int flags) break; /* Can only be reached through function pointer -- this would not be - correct if FUNCTION_DECLs used it. */ + correct if FUNCTION_DECLs used it. */ case FUNCTION_TYPE: dump_type_prefix (TREE_TYPE (t), flags); pp_maybe_space (cxx_pp); @@ -601,7 +601,7 @@ dump_type_suffix (tree t, int flags) case METHOD_TYPE: { tree arg; - pp_cxx_right_paren (cxx_pp); + pp_cxx_right_paren (cxx_pp); arg = TYPE_ARG_TYPES (t); if (TREE_CODE (t) == METHOD_TYPE) arg = TREE_CHAIN (arg); @@ -611,10 +611,10 @@ dump_type_suffix (tree t, int flags) dump_parameters (arg, flags & ~TFF_FUNCTION_DEFAULT_ARGUMENTS); if (TREE_CODE (t) == METHOD_TYPE) - pp_cxx_cv_qualifier_seq - (cxx_pp, TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t)))); - else - pp_cxx_cv_qualifier_seq(cxx_pp, t); + pp_cxx_cv_qualifier_seq + (cxx_pp, TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t)))); + else + pp_cxx_cv_qualifier_seq(cxx_pp, t); dump_exception_spec (TYPE_RAISES_EXCEPTIONS (t), flags); dump_type_suffix (TREE_TYPE (t), flags); break; @@ -627,15 +627,15 @@ dump_type_suffix (tree t, int flags) { if (host_integerp (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0)) pp_wide_integer - (cxx_pp, tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0) + 1); + (cxx_pp, tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0) + 1); else if (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (t))) == MINUS_EXPR) dump_expr (TREE_OPERAND (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0), - flags & ~TFF_EXPR_IN_PARENS); + flags & ~TFF_EXPR_IN_PARENS); else dump_expr (fold (cp_build_binary_op (PLUS_EXPR, TYPE_MAX_VALUE (TYPE_DOMAIN (t)), integer_one_node)), - flags & ~TFF_EXPR_IN_PARENS); + flags & ~TFF_EXPR_IN_PARENS); } pp_cxx_right_bracket (cxx_pp); dump_type_suffix (TREE_TYPE (t), flags); @@ -666,7 +666,7 @@ dump_type_suffix (tree t, int flags) pp_unsupported_tree (cxx_pp, t); case ERROR_MARK: /* Don't mark it here, we should have already done in - dump_type_prefix. */ + dump_type_prefix. */ break; } } @@ -730,7 +730,7 @@ dump_decl (tree t, int flags) pp_cxx_identifier (cxx_pp, "typedef"); dump_simple_decl (t, DECL_ORIGINAL_TYPE (t) ? DECL_ORIGINAL_TYPE (t) : TREE_TYPE (t), - flags); + flags); break; case VAR_DECL: @@ -755,15 +755,15 @@ dump_decl (tree t, int flags) case NAMESPACE_DECL: if (flags & TFF_DECL_SPECIFIERS) - pp_cxx_declaration (cxx_pp, t); + pp_cxx_declaration (cxx_pp, t); else - { - dump_scope (CP_DECL_CONTEXT (t), flags); - if (DECL_NAME (t) == NULL_TREE) - pp_identifier (cxx_pp, "<unnamed>"); - else - pp_cxx_tree_identifier (cxx_pp, DECL_NAME (t)); - } + { + dump_scope (CP_DECL_CONTEXT (t), flags); + if (DECL_NAME (t) == NULL_TREE) + pp_identifier (cxx_pp, "<unnamed>"); + else + pp_cxx_tree_identifier (cxx_pp, DECL_NAME (t)); + } break; case SCOPE_REF: @@ -786,7 +786,7 @@ dump_decl (tree t, int flags) case BIT_NOT_EXPR: /* This is a pseudo destructor call which has not been folded into - a PSEUDO_DTOR_EXPR yet. */ + a PSEUDO_DTOR_EXPR yet. */ pp_cxx_complement (cxx_pp); dump_type (TREE_OPERAND (t, 0), flags); break; @@ -816,12 +816,12 @@ dump_decl (tree t, int flags) if (DECL_CLASS_SCOPE_P (t)) { dump_type (DECL_CONTEXT (t), flags); - pp_cxx_colon_colon (cxx_pp); + pp_cxx_colon_colon (cxx_pp); } else if (DECL_CONTEXT (t)) { dump_decl (DECL_CONTEXT (t), flags); - pp_cxx_colon_colon (cxx_pp); + pp_cxx_colon_colon (cxx_pp); } dump_decl (DECL_NAME (t), flags); break; @@ -838,7 +838,7 @@ dump_decl (tree t, int flags) else if (DECL_GLOBAL_CTOR_P (t) || DECL_GLOBAL_DTOR_P (t)) dump_global_iord (t); else - dump_function_decl (t, flags); + dump_function_decl (t, flags); break; case TEMPLATE_DECL: @@ -893,9 +893,9 @@ dump_decl (tree t, int flags) case TEMPLATE_TYPE_PARM: if (flags & TFF_DECL_SPECIFIERS) - pp_cxx_declaration (cxx_pp, t); + pp_cxx_declaration (cxx_pp, t); else - pp_type_id (cxx_pp, t); + pp_type_id (cxx_pp, t); break; default: @@ -921,28 +921,28 @@ dump_template_decl (tree t, int flags) if (flags & TFF_TEMPLATE_HEADER) { for (parms = orig_parms = nreverse (orig_parms); - parms; - parms = TREE_CHAIN (parms)) - { + parms; + parms = TREE_CHAIN (parms)) + { tree inner_parms = INNERMOST_TEMPLATE_PARMS (parms); - int len = TREE_VEC_LENGTH (inner_parms); + int len = TREE_VEC_LENGTH (inner_parms); - pp_cxx_identifier (cxx_pp, "template"); - pp_cxx_begin_template_argument_list (cxx_pp); + pp_cxx_identifier (cxx_pp, "template"); + pp_cxx_begin_template_argument_list (cxx_pp); /* If we've shown the template prefix, we'd better show the parameters' and decl's type too. */ flags |= TFF_DECL_SPECIFIERS; - for (i = 0; i < len; i++) - { - if (i) - pp_separate_with_comma (cxx_pp); - dump_template_parameter (TREE_VEC_ELT (inner_parms, i), flags); - } - pp_cxx_end_template_argument_list (cxx_pp); - pp_cxx_whitespace (cxx_pp); - } + for (i = 0; i < len; i++) + { + if (i) + pp_separate_with_comma (cxx_pp); + dump_template_parameter (TREE_VEC_ELT (inner_parms, i), flags); + } + pp_cxx_end_template_argument_list (cxx_pp); + pp_cxx_whitespace (cxx_pp); + } nreverse(orig_parms); if (DECL_TEMPLATE_TEMPLATE_PARM_P (t)) @@ -952,8 +952,8 @@ dump_template_decl (tree t, int flags) if (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == TYPE_DECL) dump_type (TREE_TYPE (t), - ((flags & ~TFF_CLASS_KEY_OR_ENUM) | TFF_TEMPLATE_NAME - | (flags & TFF_DECL_SPECIFIERS ? TFF_CLASS_KEY_OR_ENUM : 0))); + ((flags & ~TFF_CLASS_KEY_OR_ENUM) | TFF_TEMPLATE_NAME + | (flags & TFF_DECL_SPECIFIERS ? TFF_CLASS_KEY_OR_ENUM : 0))); else if (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == VAR_DECL) dump_decl (DECL_TEMPLATE_RESULT (t), flags | TFF_TEMPLATE_NAME); else @@ -1026,7 +1026,7 @@ dump_function_decl (tree t, int flags) /* Print the return type? */ if (show_return) show_return = !DECL_CONV_FN_P (t) && !DECL_CONSTRUCTOR_P (t) - && !DECL_DESTRUCTOR_P (t); + && !DECL_DESTRUCTOR_P (t); if (show_return) dump_type_prefix (TREE_TYPE (fntype), flags); @@ -1046,17 +1046,17 @@ dump_function_decl (tree t, int flags) dump_parameters (parmtypes, flags); if (TREE_CODE (fntype) == METHOD_TYPE) - { - pp_base (cxx_pp)->padding = pp_before; - pp_cxx_cv_qualifier_seq - (cxx_pp, TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (fntype)))); - } + { + pp_base (cxx_pp)->padding = pp_before; + pp_cxx_cv_qualifier_seq + (cxx_pp, TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (fntype)))); + } if (flags & TFF_EXCEPTION_SPECIFICATION) - { - pp_base (cxx_pp)->padding = pp_before; - dump_exception_spec (TYPE_RAISES_EXCEPTIONS (fntype), flags); - } + { + pp_base (cxx_pp)->padding = pp_before; + dump_exception_spec (TYPE_RAISES_EXCEPTIONS (fntype), flags); + } if (show_return) dump_type_suffix (TREE_TYPE (fntype), flags); @@ -1089,22 +1089,22 @@ dump_parameters (tree parmtypes, int flags) parmtypes = TREE_CHAIN (parmtypes)) { if (!first) - pp_separate_with_comma (cxx_pp); + pp_separate_with_comma (cxx_pp); first = 0; if (!parmtypes) - { - pp_cxx_identifier (cxx_pp, "..."); - break; - } + { + pp_cxx_identifier (cxx_pp, "..."); + break; + } dump_type (TREE_VALUE (parmtypes), flags); if ((flags & TFF_FUNCTION_DEFAULT_ARGUMENTS) && TREE_PURPOSE (parmtypes)) - { - pp_cxx_whitespace (cxx_pp); - pp_equal (cxx_pp); - pp_cxx_whitespace (cxx_pp); - dump_expr (TREE_PURPOSE (parmtypes), flags | TFF_EXPR_IN_PARENS); - } + { + pp_cxx_whitespace (cxx_pp); + pp_equal (cxx_pp); + pp_cxx_whitespace (cxx_pp); + dump_expr (TREE_PURPOSE (parmtypes), flags | TFF_EXPR_IN_PARENS); + } } pp_cxx_right_paren (cxx_pp); @@ -1121,14 +1121,14 @@ dump_exception_spec (tree t, int flags) pp_cxx_whitespace (cxx_pp); pp_cxx_left_paren (cxx_pp); if (TREE_VALUE (t) != NULL_TREE) - while (1) - { - dump_type (TREE_VALUE (t), flags); - t = TREE_CHAIN (t); - if (!t) - break; - pp_separate_with_comma (cxx_pp); - } + while (1) + { + dump_type (TREE_VALUE (t), flags); + t = TREE_CHAIN (t); + if (!t) + break; + pp_separate_with_comma (cxx_pp); + } pp_cxx_right_paren (cxx_pp); } } @@ -1218,17 +1218,17 @@ dump_template_parms (tree info, int primary, int flags) len = TREE_VEC_LENGTH (args); for (ix = 0; ix != len; ix++) - { - tree arg = TREE_VEC_ELT (args, ix); + { + tree arg = TREE_VEC_ELT (args, ix); - if (ix) - pp_separate_with_comma (cxx_pp); + if (ix) + pp_separate_with_comma (cxx_pp); - if (!arg) - pp_identifier (cxx_pp, "<template parameter error>"); - else - dump_template_argument (arg, flags); - } + if (!arg) + pp_identifier (cxx_pp, "<template parameter error>"); + else + dump_template_argument (arg, flags); + } } else if (primary) { @@ -1240,14 +1240,14 @@ dump_template_parms (tree info, int primary, int flags) len = parms ? TREE_VEC_LENGTH (parms) : 0; for (ix = 0; ix != len; ix++) - { - tree parm = TREE_VALUE (TREE_VEC_ELT (parms, ix)); + { + tree parm = TREE_VALUE (TREE_VEC_ELT (parms, ix)); - if (ix) - pp_separate_with_comma (cxx_pp); + if (ix) + pp_separate_with_comma (cxx_pp); - dump_decl (parm, flags & ~TFF_DECL_SPECIFIERS); - } + dump_decl (parm, flags & ~TFF_DECL_SPECIFIERS); + } } pp_cxx_end_template_argument_list (cxx_pp); } @@ -1335,11 +1335,11 @@ dump_expr (tree t, int flags) if (TREE_HAS_CONSTRUCTOR (t)) { pp_cxx_identifier (cxx_pp, "new"); - pp_cxx_whitespace (cxx_pp); + pp_cxx_whitespace (cxx_pp); dump_type (TREE_TYPE (TREE_TYPE (t)), flags); } else - dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS); + dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS); break; case AGGR_INIT_EXPR: @@ -1401,14 +1401,14 @@ dump_expr (tree t, int flags) tree type = TREE_OPERAND (t, 1); tree init = TREE_OPERAND (t, 2); if (NEW_EXPR_USE_GLOBAL (t)) - pp_cxx_colon_colon (cxx_pp); + pp_cxx_colon_colon (cxx_pp); pp_cxx_identifier (cxx_pp, "new"); if (TREE_OPERAND (t, 0)) { pp_cxx_left_paren (cxx_pp); dump_expr_list (TREE_OPERAND (t, 0), flags); - pp_cxx_right_paren (cxx_pp); - pp_cxx_whitespace (cxx_pp); + pp_cxx_right_paren (cxx_pp); + pp_cxx_whitespace (cxx_pp); } if (TREE_CODE (type) == ARRAY_REF) type = build_cplus_array_type @@ -1579,11 +1579,11 @@ dump_expr (tree t, int flags) if (TREE_CODE (next) == FUNCTION_TYPE) { if (flags & TFF_EXPR_IN_PARENS) - pp_cxx_left_paren (cxx_pp); + pp_cxx_left_paren (cxx_pp); pp_cxx_star (cxx_pp); dump_expr (TREE_OPERAND (t, 0), flags & ~TFF_EXPR_IN_PARENS); if (flags & TFF_EXPR_IN_PARENS) - pp_cxx_right_paren (cxx_pp); + pp_cxx_right_paren (cxx_pp); break; } /* Else fall through. */ @@ -1622,12 +1622,12 @@ dump_expr (tree t, int flags) if (integer_zerop (idx)) { /* A NULL pointer-to-member constant. */ - pp_cxx_left_paren (cxx_pp); - pp_cxx_left_paren (cxx_pp); + pp_cxx_left_paren (cxx_pp); + pp_cxx_left_paren (cxx_pp); dump_type (TREE_TYPE (t), flags); - pp_cxx_right_paren (cxx_pp); - pp_character (cxx_pp, '0'); - pp_cxx_right_paren (cxx_pp); + pp_cxx_right_paren (cxx_pp); + pp_character (cxx_pp, '0'); + pp_cxx_right_paren (cxx_pp); break; } else if (host_integerp (idx, 0)) @@ -1653,7 +1653,7 @@ dump_expr (tree t, int flags) if (virtuals) { dump_expr (BV_FN (virtuals), - flags | TFF_EXPR_IN_PARENS); + flags | TFF_EXPR_IN_PARENS); break; } } @@ -1661,14 +1661,14 @@ dump_expr (tree t, int flags) if (TREE_TYPE (t) && !CONSTRUCTOR_ELTS (t)) { dump_type (TREE_TYPE (t), 0); - pp_cxx_left_paren (cxx_pp); - pp_cxx_right_paren (cxx_pp); + pp_cxx_left_paren (cxx_pp); + pp_cxx_right_paren (cxx_pp); } else { - pp_cxx_left_brace (cxx_pp); + pp_cxx_left_brace (cxx_pp); dump_expr_list (CONSTRUCTOR_ELTS (t), flags); - pp_cxx_right_brace (cxx_pp); + pp_cxx_right_brace (cxx_pp); } break; @@ -1693,14 +1693,14 @@ dump_expr (tree t, int flags) if (TREE_CODE (ob) == INDIRECT_REF) { dump_expr (TREE_OPERAND (ob, 0), flags | TFF_EXPR_IN_PARENS); - pp_cxx_arrow (cxx_pp); - pp_cxx_star (cxx_pp); + pp_cxx_arrow (cxx_pp); + pp_cxx_star (cxx_pp); } else { dump_expr (ob, flags | TFF_EXPR_IN_PARENS); - pp_cxx_dot (cxx_pp); - pp_cxx_star (cxx_pp); + pp_cxx_dot (cxx_pp); + pp_cxx_star (cxx_pp); } dump_expr (TREE_OPERAND (t, 1), flags | TFF_EXPR_IN_PARENS); } @@ -1728,8 +1728,8 @@ dump_expr (tree t, int flags) { pp_cxx_left_paren (cxx_pp); dump_type (TREE_TYPE (t), flags); - pp_cxx_right_paren (cxx_pp); - pp_cxx_left_paren (cxx_pp); + pp_cxx_right_paren (cxx_pp); + pp_cxx_left_paren (cxx_pp); dump_expr_list (TREE_OPERAND (t, 0), flags); pp_cxx_right_paren (cxx_pp); } @@ -1763,7 +1763,7 @@ dump_expr (tree t, int flags) case SIZEOF_EXPR: case ALIGNOF_EXPR: if (TREE_CODE (t) == SIZEOF_EXPR) - pp_cxx_identifier (cxx_pp, "sizeof"); + pp_cxx_identifier (cxx_pp, "sizeof"); else { gcc_assert (TREE_CODE (t) == ALIGNOF_EXPR); @@ -1774,7 +1774,7 @@ dump_expr (tree t, int flags) if (TYPE_P (TREE_OPERAND (t, 0))) dump_type (TREE_OPERAND (t, 0), flags); else - dump_expr (TREE_OPERAND (t, 0), flags); + dump_expr (TREE_OPERAND (t, 0), flags); pp_cxx_right_paren (cxx_pp); break; @@ -2111,7 +2111,7 @@ cxx_print_error_function (diagnostic_context *context, const char *file) static void cp_diagnostic_starter (diagnostic_context *context, - diagnostic_info *diagnostic) + diagnostic_info *diagnostic) { diagnostic_report_current_module (context); cp_print_error_function (context, diagnostic); @@ -2121,7 +2121,7 @@ cp_diagnostic_starter (diagnostic_context *context, static void cp_diagnostic_finalizer (diagnostic_context *context, - diagnostic_info *diagnostic ATTRIBUTE_UNUSED) + diagnostic_info *diagnostic ATTRIBUTE_UNUSED) { pp_base_destroy_prefix (context->printer); } @@ -2130,7 +2130,7 @@ cp_diagnostic_finalizer (diagnostic_context *context, a diagnostic message. Called from cp_diagnostic_starter. */ static void cp_print_error_function (diagnostic_context *context, - diagnostic_info *diagnostic) + diagnostic_info *diagnostic) { if (diagnostic_last_function_changed (context)) { @@ -2141,11 +2141,11 @@ cp_print_error_function (diagnostic_context *context, pp_base_set_prefix (context->printer, new_prefix); if (current_function_decl == NULL) - pp_base_string (context->printer, "At global scope:"); + pp_base_string (context->printer, "At global scope:"); else - pp_printf (context->printer, "In %s %qs:", - function_category (current_function_decl), - cxx_printable_name (current_function_decl, 2)); + pp_printf (context->printer, "In %s %qs:", + function_category (current_function_decl), + cxx_printable_name (current_function_decl, 2)); pp_base_newline (context->printer); diagnostic_set_last_function (context); @@ -2161,15 +2161,15 @@ function_category (tree fn) if (DECL_FUNCTION_MEMBER_P (fn)) { if (DECL_STATIC_FUNCTION_P (fn)) - return "static member function"; + return "static member function"; else if (DECL_COPY_CONSTRUCTOR_P (fn)) - return "copy constructor"; + return "copy constructor"; else if (DECL_CONSTRUCTOR_P (fn)) - return "constructor"; + return "constructor"; else if (DECL_DESTRUCTOR_P (fn)) - return "destructor"; + return "destructor"; else - return "member function"; + return "member function"; } else return "function"; @@ -2197,10 +2197,10 @@ print_instantiation_full_context (diagnostic_context *context) /* Avoid redundancy with the "In function" line. */; else pp_verbatim (context->printer, - "%s: In instantiation of %qs:\n", + "%s: In instantiation of %qs:\n", LOCATION_FILE (location), - decl_as_string (TINST_DECL (p), - TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE)); + decl_as_string (TINST_DECL (p), + TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE)); location = TINST_LOCATION (p); p = TREE_CHAIN (p); @@ -2213,7 +2213,7 @@ print_instantiation_full_context (diagnostic_context *context) /* Same as above but less verbose. */ static void print_instantiation_partial_context (diagnostic_context *context, - tree t, location_t loc) + tree t, location_t loc) { expanded_location xloc; for (; ; t = TREE_CHAIN (t)) @@ -2222,13 +2222,13 @@ print_instantiation_partial_context (diagnostic_context *context, if (t == NULL_TREE) break; pp_verbatim (context->printer, "%s:%d: instantiated from %qs\n", - xloc.file, xloc.line, - decl_as_string (TINST_DECL (t), - TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE)); + xloc.file, xloc.line, + decl_as_string (TINST_DECL (t), + TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE)); loc = TINST_LOCATION (t); } pp_verbatim (context->printer, "%s:%d: instantiated from here\n", - xloc.file, xloc.line); + xloc.file, xloc.line); } /* Called from cp_thing to print the template context for an error. */ @@ -2285,14 +2285,14 @@ cp_printer (pretty_printer *pp, text_info *text) switch (*text->format_spec) { case 'A': result = args_to_string (next_tree, verbose); break; - case 'C': result = code_to_string (next_tcode); break; + case 'C': result = code_to_string (next_tcode); break; case 'D': result = decl_to_string (next_tree, verbose); break; - case 'E': result = expr_to_string (next_tree); break; + case 'E': result = expr_to_string (next_tree); break; case 'F': result = fndecl_to_string (next_tree, verbose); break; - case 'L': result = language_to_string (next_lang); break; - case 'O': result = op_to_string (next_tcode); break; - case 'P': result = parm_to_string (next_int); break; - case 'Q': result = assop_to_string (next_tcode); break; + case 'L': result = language_to_string (next_lang); break; + case 'O': result = op_to_string (next_tcode); break; + case 'P': result = parm_to_string (next_int); break; + case 'Q': result = assop_to_string (next_tcode); break; case 'T': result = type_to_string (next_tree, verbose); break; case 'V': result = cv_to_string (next_tree, verbose); break; @@ -2323,14 +2323,14 @@ locate_error (const char *gmsgid, va_list ap) plus = 0; if (*f == '%') { - if (*++f == 'q') - ++f; /* ignore quoting flag. */ + if (*++f == 'q') + ++f; /* ignore quoting flag. */ if (*f == '+') - { - ++f; - plus = 1; - } + { + ++f; + plus = 1; + } if (*f == '#') f++; @@ -2386,10 +2386,10 @@ cp_error_at (const char *gmsgid, ...) va_start (ap, gmsgid); diagnostic_set_info (&diagnostic, gmsgid, &ap, - input_location, DK_ERROR); + input_location, DK_ERROR); cp_diagnostic_starter (global_dc, &diagnostic); diagnostic_set_info (&diagnostic, gmsgid, &ap, - location_of (here), DK_ERROR); + location_of (here), DK_ERROR); report_diagnostic (&diagnostic); va_end (ap); } @@ -2407,7 +2407,7 @@ cp_warning_at (const char *gmsgid, ...) va_start (ap, gmsgid); diagnostic_set_info (&diagnostic, gmsgid, &ap, - location_of (here), DK_WARNING); + location_of (here), DK_WARNING); report_diagnostic (&diagnostic); va_end (ap); } @@ -2425,7 +2425,7 @@ cp_pedwarn_at (const char *gmsgid, ...) va_start (ap, gmsgid); diagnostic_set_info (&diagnostic, gmsgid, &ap, - location_of (here), pedantic_error_kind()); + location_of (here), pedantic_error_kind()); report_diagnostic (&diagnostic); va_end (ap); } diff --git a/gcc/cp/except.c b/gcc/cp/except.c index a90cae0..6f97312 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -260,7 +260,7 @@ decl_is_java_type (tree decl, int err) { /* Can't throw a reference. */ error ("type %qT is disallowed in Java %<throw%> or %<catch%>", - decl); + decl); } if (r) @@ -278,7 +278,7 @@ decl_is_java_type (tree decl, int err) { /* Thrown object must be a Throwable. */ error ("type %qT is not derived from %<java::lang::Throwable%>", - TREE_TYPE (decl)); + TREE_TYPE (decl)); } } } @@ -557,7 +557,7 @@ do_free_exception (tree ptr) static tree wrap_cleanups_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, - void *data ATTRIBUTE_UNUSED) + void *data ATTRIBUTE_UNUSED) { tree exp = *tp; tree cleanup; @@ -604,7 +604,7 @@ build_throw (tree exp) if (exp != NULL_TREE) { if (!is_admissible_throw_operand (exp)) - return error_mark_node; + return error_mark_node; } if (! doing_eh (1)) @@ -710,10 +710,10 @@ build_throw (tree exp) BUT: Issue 475 may do away with this inconsistency by removing the terminate() in this situation. - Note that we don't check the return value from stabilize_init - because it will only return false in cases where elided is true, - and therefore we don't need to work around the failure to - preevaluate. */ + Note that we don't check the return value from stabilize_init + because it will only return false in cases where elided is true, + and therefore we don't need to work around the failure to + preevaluate. */ temp_expr = NULL_TREE; stabilize_init (exp, &temp_expr); @@ -805,9 +805,9 @@ complete_ptr_ref_or_void_ptr_p (tree type, tree from) tree core = TREE_TYPE (type); if (is_ptr && VOID_TYPE_P (core)) - /* OK */; + /* OK */; else if (!complete_type_or_else (core, from)) - return 0; + return 0; } return 1; } @@ -822,22 +822,22 @@ is_admissible_throw_operand (tree expr) tree type = TREE_TYPE (expr); /* 15.1/4 [...] The type of the throw-expression shall not be an - incomplete type, or a pointer or a reference to an incomplete - type, other than void*, const void*, volatile void*, or - const volatile void*. Except for these restriction and the - restrictions on type matching mentioned in 15.3, the operand - of throw is treated exactly as a function argument in a call - (5.2.2) or the operand of a return statement. */ + incomplete type, or a pointer or a reference to an incomplete + type, other than void*, const void*, volatile void*, or + const volatile void*. Except for these restriction and the + restrictions on type matching mentioned in 15.3, the operand + of throw is treated exactly as a function argument in a call + (5.2.2) or the operand of a return statement. */ if (!complete_ptr_ref_or_void_ptr_p (type, expr)) return false; /* 10.4/3 An abstract class shall not be used as a parameter type, - as a function return type or as type of an explicit - conversion. */ + as a function return type or as type of an explicit + conversion. */ else if (CLASS_TYPE_P (type) && CLASSTYPE_PURE_VIRTUALS (type)) { error ("expression %qE of abstract class type %qT cannot " - "be used in throw-expression", expr, type); + "be used in throw-expression", expr, type); return false; } @@ -926,7 +926,7 @@ check_handlers_1 (tree master, tree_stmt_iterator i) warning (0, "%H by earlier handler for %qT", EXPR_LOCUS (master), type); break; - } + } } } @@ -946,7 +946,7 @@ check_handlers (tree handlers) if (!tsi_end_p (i)) while (1) { - tree handler = tsi_stmt (i); + tree handler = tsi_stmt (i); tsi_next (&i); /* No more handlers; nothing to shadow. */ diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index 346ff4c..5086f63 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -537,9 +537,9 @@ do_friend (tree ctype, tree declarator, tree decl, else { /* We can't use pushdecl, as we might be in a template - class specialization, and pushdecl will insert an - unqualified friend decl into the template parameter - scope, rather than the namespace containing it. */ + class specialization, and pushdecl will insert an + unqualified friend decl into the template parameter + scope, rather than the namespace containing it. */ tree ns = decl_namespace_context (decl); push_nested_namespace (ns); @@ -551,13 +551,13 @@ do_friend (tree ctype, tree declarator, tree decl, { static int explained; warning (0, "friend declaration %q#D declares a non-template " - "function", decl); + "function", decl); if (! explained) { warning (0, "(if this is not what you intended, make sure " - "the function template has already been declared " - "and add <> after the function name here) " - "-Wno-non-template-friend disables this warning"); + "the function template has already been declared " + "and add <> after the function name here) " + "-Wno-non-template-friend disables this warning"); explained = 1; } } diff --git a/gcc/cp/init.c b/gcc/cp/init.c index e72b4b1..1ceb9b2 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -156,16 +156,16 @@ build_zero_init (tree type, tree nelts, bool static_storage_p) To zero-initialization storage for an object of type T means: -- if T is a scalar type, the storage is set to the value of zero - converted to T. + converted to T. -- if T is a non-union class type, the storage for each nonstatic - data member and each base-class subobject is zero-initialized. + data member and each base-class subobject is zero-initialized. -- if T is a union type, the storage for its first data member is - zero-initialized. + zero-initialized. -- if T is an array type, the storage for each element is - zero-initialized. + zero-initialized. -- if T is a reference type, no initialization is performed. */ @@ -518,7 +518,7 @@ sort_mem_initializers (tree t, tree mem_inits) /* Issue a warning if the explicit initializer order does not match that which will actually occur. - ??? Are all these on the correct lines? */ + ??? Are all these on the correct lines? */ if (warn_reorder && !subobject_init) { if (TREE_CODE (TREE_PURPOSE (next_subobject)) == FIELD_DECL) @@ -1004,7 +1004,7 @@ expand_member_init (tree name) /* [class.base.init] - If a mem-initializer-id is ambiguous because it designates + If a mem-initializer-id is ambiguous because it designates both a direct non-virtual base class and an inherited virtual base class, the mem-initializer is ill-formed. */ if (direct_binfo && virtual_binfo) @@ -1372,9 +1372,9 @@ build_offset_ref (tree type, tree name, bool address_p) { tree t = lookup_namespace_name (type, name); if (t == error_mark_node) - return t; + return t; if (TREE_CODE (orig_name) == TEMPLATE_ID_EXPR) - /* Reconstruct the TEMPLATE_ID_EXPR. */ + /* Reconstruct the TEMPLATE_ID_EXPR. */ t = build2 (TEMPLATE_ID_EXPR, TREE_TYPE (t), t, TREE_OPERAND (orig_name, 1)); if (! type_unknown_p (t)) @@ -1462,11 +1462,11 @@ build_offset_ref (tree type, tree name, bool address_p) expects to encounter OVERLOADs, not raw functions. */ t = ovl_cons (t, NULL_TREE); - t = build2 (TEMPLATE_ID_EXPR, TREE_TYPE (t), t, + t = build2 (TEMPLATE_ID_EXPR, TREE_TYPE (t), t, TREE_OPERAND (orig_name, 1)); t = build2 (OFFSET_REF, unknown_type_node, decl, t); - PTRMEM_OK_P (t) = 1; + PTRMEM_OK_P (t) = 1; return t; } @@ -1588,13 +1588,13 @@ decl_constant_value (tree decl) if ((TREE_CODE (decl) == CONST_DECL || (TREE_CODE (decl) == VAR_DECL /* And so are variables with a 'const' type -- unless they - are also 'volatile'. */ + are also 'volatile'. */ && CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (decl)))) && DECL_INITIAL (decl) && DECL_INITIAL (decl) != error_mark_node /* This is invalid if initial value is not constant. If it has - either a function call, a memory reference, or a variable, - then re-evaluating it could give different results. */ + either a function call, a memory reference, or a variable, + then re-evaluating it could give different results. */ && TREE_CONSTANT (DECL_INITIAL (decl))) return DECL_INITIAL (decl); @@ -2446,7 +2446,7 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array) ++t1; } } catch (...) { - ... destroy elements that were constructed ... + ... destroy elements that were constructed ... } rval; }) diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h index 9adda3d..dfa4ce3 100644 --- a/gcc/cp/lang-specs.h +++ b/gcc/cp/lang-specs.h @@ -43,7 +43,7 @@ Boston, MA 02111-1307, USA. */ cc1plus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.ii} %{!save-temps:%g.ii}}\ %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\ %(cc1_options) %2 %{+e1*}\ - -o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}", + -o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}", CPLUSPLUS_CPP_SPEC, 0, 0}, {"@c++", "%{E|M|MM:cc1plus -E %(cpp_options) %2 %(cpp_debug_options)}\ diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 4494cf8c..92334ea 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -117,7 +117,7 @@ init_operators (void) : &operator_name_info[(int) CODE]); \ oni->identifier = identifier; \ oni->name = NAME; \ - oni->mangled_name = MANGLING; \ + oni->mangled_name = MANGLING; \ oni->arity = ARITY; #include "operators.def" @@ -184,7 +184,7 @@ static const struct resword reswords[] = { "_Complex", RID_COMPLEX, 0 }, { "__FUNCTION__", RID_FUNCTION_NAME, 0 }, { "__PRETTY_FUNCTION__", RID_PRETTY_FUNCTION_NAME, 0 }, - { "__alignof", RID_ALIGNOF, 0 }, + { "__alignof", RID_ALIGNOF, 0 }, { "__alignof__", RID_ALIGNOF, 0 }, { "__asm", RID_ASM, 0 }, { "__asm__", RID_ASM, 0 }, @@ -277,7 +277,7 @@ static const struct resword reswords[] = { "virtual", RID_VIRTUAL, 0 }, { "void", RID_VOID, 0 }, { "volatile", RID_VOLATILE, 0 }, - { "wchar_t", RID_WCHAR, 0 }, + { "wchar_t", RID_WCHAR, 0 }, { "while", RID_WHILE, 0 }, /* The remaining keywords are specific to Objective-C++. NB: @@ -553,7 +553,7 @@ handle_pragma_implementation (cpp_reader* dfile ATTRIBUTE_UNUSED ) filename = ggc_strdup (TREE_STRING_POINTER (fname)); #if 0 /* We currently cannot give this diagnostic, as we reach this point - only after cpplib has scanned the entire translation unit, so + only after cpplib has scanned the entire translation unit, so cpp_included always returns true. A plausible fix is to compare the current source-location cookie with the first source-location cookie (if any) of the filename, but this requires completing the diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 5ceeece..f6448b0 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -39,12 +39,12 @@ particular constructs when the appropriate decl for that construct is not available. These are: - mangle_typeinfo_for_type: typeinfo data - mangle_typeinfo_string_for_type: typeinfo type name - mangle_vtbl_for_type: virtual table data - mangle_vtt_for_type: VTT data - mangle_ctor_vtbl_for_type: `C-in-B' constructor virtual table data - mangle_thunk: thunk function or entry + mangle_typeinfo_for_type: typeinfo data + mangle_typeinfo_string_for_type: typeinfo type name + mangle_vtbl_for_type: virtual table data + mangle_vtt_for_type: VTT data + mangle_ctor_vtbl_for_type: `C-in-B' constructor virtual table data + mangle_thunk: thunk function or entry */ @@ -75,7 +75,7 @@ fprintf (stderr, " %-24s: %-24s\n", (FN), (INPUT)) # define MANGLE_TRACE_TREE(FN, NODE) \ fprintf (stderr, " %-24s: %-24s (%p)\n", \ - (FN), tree_code_name[TREE_CODE (NODE)], (void *) (NODE)) + (FN), tree_code_name[TREE_CODE (NODE)], (void *) (NODE)) #else # define MANGLE_TRACE(FN, INPUT) # define MANGLE_TRACE_TREE(FN, NODE) @@ -234,32 +234,32 @@ static void write_java_integer_type_codes (const tree); /* Append a single character to the end of the mangled representation. */ -#define write_char(CHAR) \ +#define write_char(CHAR) \ obstack_1grow (mangle_obstack, (CHAR)) /* Append a sized buffer to the end of the mangled representation. */ -#define write_chars(CHAR, LEN) \ +#define write_chars(CHAR, LEN) \ obstack_grow (mangle_obstack, (CHAR), (LEN)) /* Append a NUL-terminated string to the end of the mangled representation. */ -#define write_string(STRING) \ +#define write_string(STRING) \ obstack_grow (mangle_obstack, (STRING), strlen (STRING)) /* Nonzero if NODE1 and NODE2 are both TREE_LIST nodes and have the same purpose (context, which may be a type) and value (template decl). See write_template_prefix for more information on what this is used for. */ -#define NESTED_TEMPLATE_MATCH(NODE1, NODE2) \ - (TREE_CODE (NODE1) == TREE_LIST \ - && TREE_CODE (NODE2) == TREE_LIST \ - && ((TYPE_P (TREE_PURPOSE (NODE1)) \ - && same_type_p (TREE_PURPOSE (NODE1), TREE_PURPOSE (NODE2)))\ - || TREE_PURPOSE (NODE1) == TREE_PURPOSE (NODE2)) \ +#define NESTED_TEMPLATE_MATCH(NODE1, NODE2) \ + (TREE_CODE (NODE1) == TREE_LIST \ + && TREE_CODE (NODE2) == TREE_LIST \ + && ((TYPE_P (TREE_PURPOSE (NODE1)) \ + && same_type_p (TREE_PURPOSE (NODE1), TREE_PURPOSE (NODE2))) \ + || TREE_PURPOSE (NODE1) == TREE_PURPOSE (NODE2)) \ && TREE_VALUE (NODE1) == TREE_VALUE (NODE2)) /* Write out an unsigned quantity in base 10. */ -#define write_unsigned_number(NUMBER) \ +#define write_unsigned_number(NUMBER) \ write_number ((NUMBER), /*unsigned_p=*/1, 10) /* Save the current (incomplete) mangled name and release the obstack @@ -497,27 +497,27 @@ is_std_substitution_char (const tree node, First, check standard special-case substitutions. <substitution> ::= St - # ::std + # ::std - ::= Sa + ::= Sa # ::std::allocator - ::= Sb - # ::std::basic_string + ::= Sb + # ::std::basic_string - ::= Ss - # ::std::basic_string<char, + ::= Ss + # ::std::basic_string<char, ::std::char_traits<char>, ::std::allocator<char> > - ::= Si - # ::std::basic_istream<char, ::std::char_traits<char> > + ::= Si + # ::std::basic_istream<char, ::std::char_traits<char> > - ::= So - # ::std::basic_ostream<char, ::std::char_traits<char> > + ::= So + # ::std::basic_ostream<char, ::std::char_traits<char> > - ::= Sd - # ::std::basic_iostream<char, ::std::char_traits<char> > + ::= Sd + # ::std::basic_iostream<char, ::std::char_traits<char> > Then examine the stack of currently available substitution candidates for entities appearing earlier in the same mangling @@ -562,8 +562,8 @@ find_substitution (tree node) { /* If this is a type (i.e. a fully-qualified template-id), check for - std::basic_string <char, - std::char_traits<char>, + std::basic_string <char, + std::char_traits<char>, std::allocator<char> > . */ if (cp_type_quals (type) == TYPE_UNQUALIFIED && CLASSTYPE_USE_TEMPLATE (type)) @@ -679,10 +679,10 @@ write_mangled_name (const tree decl, bool top_level) else { /* The standard notes: "The <encoding> of an extern "C" - function is treated like global-scope data, i.e. as its - <source-name> without a type." We cannot write - overloaded operators that way though, because it contains - characters invalid in assembler. */ + function is treated like global-scope data, i.e. as its + <source-name> without a type." We cannot write + overloaded operators that way though, because it contains + characters invalid in assembler. */ if (abi_version_at_least (2)) write_string ("_Z"); else @@ -771,7 +771,7 @@ write_encoding (const tree decl) } /* <name> ::= <unscoped-name> - ::= <unscoped-template-name> <template-args> + ::= <unscoped-template-name> <template-args> ::= <nested-name> ::= <local-name> @@ -823,10 +823,10 @@ write_name (tree decl, const int ignore_local_scope) else { /* Handle local names, unless we asked not to (that is, invoked - under <local-name>, to handle only the part of the name under - the local scope). */ + under <local-name>, to handle only the part of the name under + the local scope). */ if (!ignore_local_scope) - { + { /* Scan up the list of scope context, looking for a function. If we find one, this entity is in local function scope. local_entity tracks context one scope @@ -861,7 +861,7 @@ write_name (tree decl, const int ignore_local_scope) } /* <unscoped-name> ::= <unqualified-name> - ::= St <unqualified-name> # ::std:: */ + ::= St <unqualified-name> # ::std:: */ static void write_unscoped_name (const tree decl) @@ -879,7 +879,7 @@ write_unscoped_name (const tree decl) else { /* If not, it should be either in the global namespace, or directly - in a local function scope. */ + in a local function scope. */ gcc_assert (context == global_namespace || context == NULL || TREE_CODE (context) == FUNCTION_DECL); @@ -889,7 +889,7 @@ write_unscoped_name (const tree decl) } /* <unscoped-template-name> ::= <unscoped-name> - ::= <substitution> */ + ::= <substitution> */ static void write_unscoped_template_name (const tree decl) @@ -905,7 +905,7 @@ write_unscoped_template_name (const tree decl) /* Write the nested name, including CV-qualifiers, of DECL. <nested-name> ::= N [<CV-qualifiers>] <prefix> <unqualified-name> E - ::= N [<CV-qualifiers>] <template-prefix> <template-args> E + ::= N [<CV-qualifiers>] <template-prefix> <template-args> E <CV-qualifiers> ::= [r] [V] [K] */ @@ -945,8 +945,8 @@ write_nested_name (const tree decl) } /* <prefix> ::= <prefix> <unqualified-name> - ::= <template-param> - ::= <template-prefix> <template-args> + ::= <template-param> + ::= <template-prefix> <template-args> ::= # empty ::= <substitution> */ @@ -1012,8 +1012,8 @@ write_prefix (const tree node) } /* <template-prefix> ::= <prefix> <template component> - ::= <template-param> - ::= <substitution> */ + ::= <template-param> + ::= <substitution> */ static void write_template_prefix (const tree node) @@ -1105,7 +1105,7 @@ write_unqualified_name (const tree decl) else if (DECL_CONV_FN_P (decl)) { /* Conversion operator. Handle it right here. - <operator> ::= cv <type> */ + <operator> ::= cv <type> */ tree type; if (decl_is_template_id (decl, NULL)) { @@ -1296,11 +1296,11 @@ write_integer_cst (const tree cst) for floating point numbers. (Spaces are for readability, not part of the encoding.) - 1.0f Lf 3f80 0000 E - -1.0f Lf bf80 0000 E - 1.17549435e-38f Lf 0080 0000 E - 1.40129846e-45f Lf 0000 0001 E - 0.0f Lf 0000 0000 E" + 1.0f Lf 3f80 0000 E + -1.0f Lf bf80 0000 E + 1.17549435e-38f Lf 0080 0000 E + 1.40129846e-45f Lf 0000 0001 E + 0.0f Lf 0000 0000 E" Caller is responsible for the Lx and the E. */ static void @@ -1319,7 +1319,7 @@ write_real_cst (const tree value) TYPE_MODE (type)); /* The value in target_real is in the target word order, - so we must write it out backward if that happens to be + so we must write it out backward if that happens to be little-endian. write_number cannot be used, it will produce uppercase. */ if (FLOAT_WORDS_BIG_ENDIAN) @@ -1363,8 +1363,8 @@ write_identifier (const char *identifier) CTOR is a constructor FUNCTION_DECL. <special-name> ::= C1 # complete object constructor - ::= C2 # base object constructor - ::= C3 # complete object allocating constructor + ::= C2 # base object constructor + ::= C3 # complete object allocating constructor Currently, allocating constructors are never used. @@ -1393,8 +1393,8 @@ write_special_name_constructor (const tree ctor) DTOR is a destructor FUNCTION_DECL. <special-name> ::= D0 # deleting (in-charge) destructor - ::= D1 # complete object (in-charge) destructor - ::= D2 # base object (not-in-charge) destructor + ::= D1 # complete object (in-charge) destructor + ::= D2 # base object (not-in-charge) destructor We also need to provide mangled names for the maybe-incharge destructor, so we treat it here too. mangle_decl_string will @@ -1411,9 +1411,9 @@ write_special_name_destructor (const tree dtor) { gcc_assert (DECL_COMPLETE_DESTRUCTOR_P (dtor) /* Even though we don't ever emit a definition of - the old-style destructor, we still have to - consider entities (like static variables) nested - inside it. */ + the old-style destructor, we still have to + consider entities (like static variables) nested + inside it. */ || DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (dtor)); write_string ("D1"); } @@ -1487,7 +1487,7 @@ write_discriminator (const int discriminator) of ENTITY. <local-name> := Z <function encoding> E <entity name> [<discriminator>] - := Z <function encoding> E s [<discriminator>] */ + := Z <function encoding> E s [<discriminator>] */ static void write_local_name (const tree function, const tree local_entity, @@ -1517,18 +1517,18 @@ write_local_name (const tree function, const tree local_entity, /* Non-terminals <type> and <CV-qualifier>. <type> ::= <builtin-type> - ::= <function-type> - ::= <class-enum-type> - ::= <array-type> - ::= <pointer-to-member-type> - ::= <template-param> - ::= <substitution> - ::= <CV-qualifier> - ::= P <type> # pointer-to - ::= R <type> # reference-to - ::= C <type> # complex pair (C 2000) - ::= G <type> # imaginary (C 2000) [not supported] - ::= U <source-name> <type> # vendor extended type qualifier + ::= <function-type> + ::= <class-enum-type> + ::= <array-type> + ::= <pointer-to-member-type> + ::= <template-param> + ::= <substitution> + ::= <CV-qualifier> + ::= P <type> # pointer-to + ::= R <type> # reference-to + ::= C <type> # complex pair (C 2000) + ::= G <type> # imaginary (C 2000) [not supported] + ::= U <source-name> <type> # vendor extended type qualifier TYPE is a type node. */ @@ -1700,26 +1700,26 @@ write_CV_qualifiers_for_type (const tree type) /* Non-terminal <builtin-type>. <builtin-type> ::= v # void - ::= b # bool - ::= w # wchar_t - ::= c # char - ::= a # signed char - ::= h # unsigned char - ::= s # short - ::= t # unsigned short - ::= i # int - ::= j # unsigned int - ::= l # long - ::= m # unsigned long - ::= x # long long, __int64 - ::= y # unsigned long long, __int64 - ::= n # __int128 - ::= o # unsigned __int128 - ::= f # float - ::= d # double - ::= e # long double, __float80 - ::= g # __float128 [not supported] - ::= u <source-name> # vendor extended type */ + ::= b # bool + ::= w # wchar_t + ::= c # char + ::= a # signed char + ::= h # unsigned char + ::= s # short + ::= t # unsigned short + ::= i # int + ::= j # unsigned int + ::= l # long + ::= m # unsigned long + ::= x # long long, __int64 + ::= y # unsigned long long, __int64 + ::= n # __int128 + ::= o # unsigned __int128 + ::= f # float + ::= d # double + ::= e # long double, __float80 + ::= g # __float128 [not supported] + ::= u <source-name> # vendor extended type */ static void write_builtin_type (tree type) @@ -1843,7 +1843,7 @@ write_function_type (const tree type) extern "C" typedef void function_t(); function_t f; // f has C++ linkage, but its type is - // `extern "C"' + // `extern "C"' typedef void function_t(); extern "C" function_t f; // Vice versa. @@ -1982,10 +1982,10 @@ write_template_args (tree args) ::= <expr-primary> <expr-primary> ::= <template-param> - ::= L <type> <value number> E # literal - ::= L <mangled-name> E # external name - ::= sr <type> <unqualified-name> - ::= sr <type> <unqualified-name> <template-args> */ + ::= L <type> <value number> E # literal + ::= L <mangled-name> E # external name + ::= sr <type> <unqualified-name> + ::= sr <type> <unqualified-name> <template-args> */ static void write_expression (tree expr) @@ -2135,9 +2135,9 @@ write_expression (tree expr) switch (code) { - case CALL_EXPR: - sorry ("call_expr cannot be mangled due to a defect in the C++ ABI"); - break; + case CALL_EXPR: + sorry ("call_expr cannot be mangled due to a defect in the C++ ABI"); + break; case CAST_EXPR: write_type (TREE_TYPE (expr)); @@ -2242,10 +2242,10 @@ write_template_arg_literal (const tree value) /* Non-terminal <template-arg>. - <template-arg> ::= <type> # type - ::= L <type> </value/ number> E # literal - ::= LZ <name> E # external name - ::= X <expression> E # expression */ + <template-arg> ::= <type> # type + ::= L <type> </value/ number> E # literal + ::= LZ <name> E # external name + ::= X <expression> E # expression */ static void write_template_arg (tree node) @@ -2335,7 +2335,7 @@ write_template_template_arg (const tree decl) /* Non-terminal <array-type>. TYPE is an ARRAY_TYPE. <array-type> ::= A [</dimension/ number>] _ </element/ type> - ::= A <expression> _ </element/ type> + ::= A <expression> _ </element/ type> "Array types encode the dimension (number of elements) and the element type. For variable length arrays, the dimension (but not @@ -2367,7 +2367,7 @@ write_array_type (const tree type) if (!abi_version_at_least (2)) { /* value_dependent_expression_p presumes nothing is - dependent when PROCESSING_TEMPLATE_DECL is zero. */ + dependent when PROCESSING_TEMPLATE_DECL is zero. */ ++processing_template_decl; if (!value_dependent_expression_p (max)) G.need_abi_warning = 1; @@ -2437,7 +2437,7 @@ write_template_param (const tree parm) } /* <template-template-param> - ::= <template-param> + ::= <template-param> ::= <substitution> */ static void @@ -2466,7 +2466,7 @@ write_template_template_param (const tree parm) /* Non-terminal <substitution>. <substitution> ::= S <seq-id> _ - ::= S_ */ + ::= S_ */ static void write_substitution (const int seq_id) @@ -2718,8 +2718,8 @@ mangle_call_offset (const tree fixed_offset, const tree virtual_offset) for the this pointer, even if there is none. <special-name> ::= T <call-offset> <base encoding> - ::= Tc <this_adjust call-offset> <result_adjust call-offset> - <base encoding> + ::= Tc <this_adjust call-offset> <result_adjust call-offset> + <base encoding> */ tree diff --git a/gcc/cp/method.c b/gcc/cp/method.c index c5d68d6..2f5e1f6 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -99,9 +99,9 @@ make_thunk (tree function, bool this_adjusting, if (this_adjusting && virtual_offset) virtual_offset = size_binop (MULT_EXPR, - virtual_offset, - convert (ssizetype, - TYPE_SIZE_UNIT (vtable_entry_type))); + virtual_offset, + convert (ssizetype, + TYPE_SIZE_UNIT (vtable_entry_type))); d = tree_low_cst (fixed_offset, 0); @@ -688,14 +688,14 @@ do_build_assign_ref (tree fndecl) if (CP_TYPE_CONST_P (expr_type)) { - error ("non-static const member %q#D, can't use default " - "assignment operator", field); + error ("non-static const member %q#D, can't use default " + "assignment operator", field); continue; } else if (TREE_CODE (expr_type) == REFERENCE_TYPE) { error ("non-static reference member %q#D, can't use " - "default assignment operator", field); + "default assignment operator", field); continue; } @@ -818,7 +818,7 @@ synthesize_method (tree fndecl) static tree synthesize_exception_spec (tree type, tree (*extractor) (tree, void*), - void *client) + void *client) { tree raises = empty_except_spec; tree fields = TYPE_FIELDS (type); @@ -830,11 +830,11 @@ synthesize_exception_spec (tree type, tree (*extractor) (tree, void*), { tree fn = (*extractor) (BINFO_TYPE (base_binfo), client); if (fn) - { - tree fn_raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)); + { + tree fn_raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)); - raises = merge_exception_specifiers (raises, fn_raises); - } + raises = merge_exception_specifiers (raises, fn_raises); + } } for (; fields; fields = TREE_CHAIN (fields)) { @@ -842,19 +842,19 @@ synthesize_exception_spec (tree type, tree (*extractor) (tree, void*), tree fn; if (TREE_CODE (fields) != FIELD_DECL || DECL_ARTIFICIAL (fields)) - continue; + continue; while (TREE_CODE (type) == ARRAY_TYPE) - type = TREE_TYPE (type); + type = TREE_TYPE (type); if (TREE_CODE (type) != RECORD_TYPE) - continue; + continue; fn = (*extractor) (type, client); if (fn) - { - tree fn_raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)); + { + tree fn_raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)); - raises = merge_exception_specifiers (raises, fn_raises); - } + raises = merge_exception_specifiers (raises, fn_raises); + } } return raises; } @@ -888,7 +888,7 @@ locate_ctor (tree type, void *client ATTRIBUTE_UNUSED) tree parms = TYPE_ARG_TYPES (TREE_TYPE (fn)); if (sufficient_parms_p (TREE_CHAIN (parms))) - return fn; + return fn; } return NULL_TREE; } @@ -939,24 +939,24 @@ locate_copy (tree type, void *client_) parms = TREE_CHAIN (parms); if (!parms) - continue; + continue; src_type = non_reference (TREE_VALUE (parms)); if (!same_type_ignoring_top_level_qualifiers_p (src_type, type)) - continue; + continue; if (!sufficient_parms_p (TREE_CHAIN (parms))) - continue; + continue; quals = cp_type_quals (src_type); if (client->quals & ~quals) - continue; + continue; excess = quals & ~client->quals; if (!best || (excess_p && !excess)) - { - best = fn; - excess_p = excess; - } + { + best = fn; + excess_p = excess; + } else - /* Ambiguous */ - return NULL_TREE; + /* Ambiguous */ + return NULL_TREE; } return best; } @@ -1026,19 +1026,19 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p) data.name = NULL; data.quals = 0; if (kind == sfk_assignment_operator) - { + { return_type = build_reference_type (type); - name = ansi_assopname (NOP_EXPR); - data.name = name; - } + name = ansi_assopname (NOP_EXPR); + data.name = name; + } else name = constructor_name (type); if (const_p) - { - data.quals = TYPE_QUAL_CONST; + { + data.quals = TYPE_QUAL_CONST; rhs_parm_type = build_qualified_type (type, TYPE_QUAL_CONST); - } + } else rhs_parm_type = type; rhs_parm_type = build_reference_type (rhs_parm_type); diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index c03b48b..b76b8af 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -46,7 +46,7 @@ static cxx_binding *binding_for_name (cxx_scope *, tree); static tree lookup_name_innermost_nonclass_level (tree); static tree push_overloaded_decl (tree, int); static bool lookup_using_namespace (tree, struct scope_binding *, tree, - tree, int); + tree, int); static bool qualified_lookup_using_namespace (tree, tree, struct scope_binding *, int); static tree lookup_type_current_level (tree); @@ -145,11 +145,11 @@ binding_table_free (binding_table table) { binding_entry temp = table->chain[i]; while (temp != NULL) - { - binding_entry entry = temp; - temp = entry->chain; - binding_entry_free (entry); - } + { + binding_entry entry = temp; + temp = entry->chain; + binding_entry_free (entry); + } table->chain[i] = NULL; } table->entry_count = 0; @@ -183,14 +183,14 @@ binding_table_expand (binding_table table) { binding_entry entry = old_chains[i]; for (; entry != NULL; entry = old_chains[i]) - { - const unsigned int hash = IDENTIFIER_HASH_VALUE (entry->name); - const size_t j = ENTRY_INDEX (hash, new_chain_count); - - old_chains[i] = entry->chain; - entry->chain = table->chain[j]; - table->chain[j] = entry; - } + { + const unsigned int hash = IDENTIFIER_HASH_VALUE (entry->name); + const size_t j = ENTRY_INDEX (hash, new_chain_count); + + old_chains[i] = entry->chain; + entry->chain = table->chain[j]; + table->chain[j] = entry; + } } table->entry_count = old_entry_count; } @@ -238,7 +238,7 @@ binding_table_foreach (binding_table table, bt_foreach_proc proc, void *data) { binding_entry entry = table->chain[i]; for (; entry != NULL; entry = entry->chain) - proc (entry, data); + proc (entry, data); } } @@ -465,7 +465,7 @@ supplement_binding (cxx_binding *binding, tree decl) /* We have two typedef-names, both naming the same type to have the same name. In general, this is OK because of: - [dcl.typedef] + [dcl.typedef] In a given scope, a typedef specifier can be used to redefine the name of any type declared in that scope to refer to the @@ -531,7 +531,7 @@ add_decl_to_level (tree decl, cxx_scope *b) else { /* We build up the list in reverse order, and reverse it later if - necessary. */ + necessary. */ TREE_CHAIN (decl) = b->names; b->names = decl; b->names_size++; @@ -576,7 +576,7 @@ pushdecl (tree x) { if (current_function_decl && x != current_function_decl /* A local declaration for a function doesn't constitute - nesting. */ + nesting. */ && TREE_CODE (x) != FUNCTION_DECL /* A local declaration for an `extern' variable is in the scope of the current namespace, not the current @@ -690,7 +690,7 @@ pushdecl (tree x) { if (pedantic && ! DECL_IN_SYSTEM_HEADER (x)) pedwarn ("redeclaration of %<wchar_t%> as %qT", - TREE_TYPE (x)); + TREE_TYPE (x)); /* Throw away the redeclaration. */ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t); @@ -766,28 +766,28 @@ pushdecl (tree x) { tree type = TREE_TYPE (x); if (DECL_IS_BUILTIN (x)) - { + { if (TYPE_NAME (type) == 0) - TYPE_NAME (type) = x; - } - else if (type != error_mark_node && TYPE_NAME (type) != x + TYPE_NAME (type) = x; + } + else if (type != error_mark_node && TYPE_NAME (type) != x /* We don't want to copy the type when all we're doing is making a TYPE_DECL for the purposes of inlining. */ && (!TYPE_NAME (type) || TYPE_NAME (type) != DECL_ABSTRACT_ORIGIN (x))) - { + { DECL_ORIGINAL_TYPE (x) = type; - type = build_variant_type_copy (type); + type = build_variant_type_copy (type); TYPE_STUB_DECL (type) = TYPE_STUB_DECL (DECL_ORIGINAL_TYPE (x)); - TYPE_NAME (type) = x; - TREE_TYPE (x) = type; - } + TYPE_NAME (type) = x; + TREE_TYPE (x) = type; + } if (type != error_mark_node && TYPE_NAME (type) && TYPE_IDENTIFIER (type)) - set_identifier_type_value (DECL_NAME (x), x); + set_identifier_type_value (DECL_NAME (x), x); } /* Multiple external decls of the same identifier ought to match. @@ -826,16 +826,16 @@ pushdecl (tree x) if (IDENTIFIER_GLOBAL_VALUE (name) == NULL_TREE && TREE_PUBLIC (x)) TREE_PUBLIC (name) = 1; - /* Bind the name for the entity. */ - if (!(TREE_CODE (x) == TYPE_DECL && DECL_ARTIFICIAL (x) - && t != NULL_TREE) - && (TREE_CODE (x) == TYPE_DECL - || TREE_CODE (x) == VAR_DECL - || TREE_CODE (x) == ALIAS_DECL - || TREE_CODE (x) == NAMESPACE_DECL - || TREE_CODE (x) == CONST_DECL - || TREE_CODE (x) == TEMPLATE_DECL)) - SET_IDENTIFIER_NAMESPACE_VALUE (name, x); + /* Bind the name for the entity. */ + if (!(TREE_CODE (x) == TYPE_DECL && DECL_ARTIFICIAL (x) + && t != NULL_TREE) + && (TREE_CODE (x) == TYPE_DECL + || TREE_CODE (x) == VAR_DECL + || TREE_CODE (x) == ALIAS_DECL + || TREE_CODE (x) == NAMESPACE_DECL + || TREE_CODE (x) == CONST_DECL + || TREE_CODE (x) == TEMPLATE_DECL)) + SET_IDENTIFIER_NAMESPACE_VALUE (name, x); /* If new decl is `static' and an `extern' was seen previously, warn about it. */ @@ -1115,7 +1115,7 @@ check_for_out_of_scope_variable (tree decl) error ("name lookup of %qD changed for new ISO %<for%> scoping", DECL_NAME (decl)); cp_error_at (" cannot use obsolete binding at %qD because " - "it has a destructor", decl); + "it has a destructor", decl); return error_mark_node; } else @@ -1176,7 +1176,7 @@ cxx_scope_debug (cxx_scope *scope, int line, const char *action) const char *desc = cxx_scope_descriptor (scope); if (scope->this_entity) verbatim ("%s %s(%E) %p %d\n", action, desc, - scope->this_entity, (void *) scope, line); + scope->this_entity, (void *) scope, line); else verbatim ("%s %s %p %d\n", action, desc, (void *) scope, line); } @@ -1302,10 +1302,10 @@ leave_scope (void) indent (--binding_depth); cxx_scope_debug (scope, input_line, "leave"); if (is_class_level != (scope == class_binding_level)) - { - indent (binding_depth); - verbatim ("XXX is_class_level != (current_scope == class_scope)\n"); - } + { + indent (binding_depth); + verbatim ("XXX is_class_level != (current_scope == class_scope)\n"); + } is_class_level = 0; } @@ -1432,7 +1432,7 @@ kept_level_p (void) { return (current_binding_level->blocks != NULL_TREE || current_binding_level->keep - || current_binding_level->kind == sk_cleanup + || current_binding_level->kind == sk_cleanup || current_binding_level->names != NULL_TREE); } @@ -1517,7 +1517,7 @@ print_binding_level (struct cp_binding_level* lvl) break; } if (i) - fprintf (stderr, "\n"); + fprintf (stderr, "\n"); } if (VEC_length (cp_class_binding, lvl->class_shadowed)) { @@ -1534,9 +1534,9 @@ print_binding_level (struct cp_binding_level* lvl) { fprintf (stderr, " type-shadowed:"); for (t = lvl->type_shadowed; t; t = TREE_CHAIN (t)) - { + { fprintf (stderr, " %s ", IDENTIFIER_POINTER (TREE_PURPOSE (t))); - } + } fprintf (stderr, "\n"); } } @@ -1560,7 +1560,7 @@ print_binding_stack (void) "\nclass_binding_level=" HOST_PTR_PRINTF "\nNAMESPACE_LEVEL (global_namespace)=" HOST_PTR_PRINTF "\n", (void *) current_binding_level, (void *) class_binding_level, - (void *) NAMESPACE_LEVEL (global_namespace)); + (void *) NAMESPACE_LEVEL (global_namespace)); if (class_binding_level) { for (b = class_binding_level; b; b = b->level_chain) @@ -1737,7 +1737,7 @@ cxx_scope_find_binding_for_name (cxx_scope *scope, tree name) { /* Fold-in case where NAME is used only once. */ if (scope == b->scope && b->previous == NULL) - return b; + return b; return find_binding (scope, b); } return NULL; @@ -1782,7 +1782,7 @@ push_using_decl (tree scope, tree name) break; if (decl) POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, - namespace_bindings_p () ? decl : NULL_TREE); + namespace_bindings_p () ? decl : NULL_TREE); decl = build_lang_decl (USING_DECL, name, NULL_TREE); USING_DECL_SCOPE (decl) = scope; TREE_CHAIN (decl) = current_binding_level->usings; @@ -1830,9 +1830,9 @@ pushdecl_with_scope (tree x, cxx_scope *level) FLAGS is a bitwise-or of the following values: PUSH_LOCAL: Bind DECL in the current scope, rather than at - namespace scope. + namespace scope. PUSH_USING: DECL is being pushed as the result of a using - declaration. + declaration. The value returned may be a previous declaration if we guessed wrong about what language DECL should belong to (C or C++). Otherwise, @@ -1864,8 +1864,8 @@ push_overloaded_decl (tree decl, int flags) old = NULL_TREE; } else if (is_overloaded_fn (old)) - { - tree tmp; + { + tree tmp; for (tmp = old; tmp; tmp = OVL_NEXT (tmp)) { @@ -1877,7 +1877,7 @@ push_overloaded_decl (tree decl, int flags) TYPE_ARG_TYPES (TREE_TYPE (decl))) && ! decls_match (fn, decl)) error ("%q#D conflicts with previous using declaration %q#D", - decl, fn); + decl, fn); if (duplicate_decls (decl, fn) == fn) POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, fn); @@ -1985,7 +1985,7 @@ validate_nonmember_using_decl (tree decl, tree scope, tree name) /* 7.3.3/5 A using-declaration shall not name a template-id. */ error ("a using-declaration cannot specify a template-id. " - "Try %<using %D%>", name); + "Try %<using %D%>", name); return NULL_TREE; } @@ -2016,7 +2016,7 @@ validate_nonmember_using_decl (tree decl, tree scope, tree name) static void do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype, - tree *newval, tree *newtype) + tree *newval, tree *newtype) { struct scope_binding decls = EMPTY_SCOPE_BINDING; @@ -2066,23 +2066,23 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype, { tree old_fn = OVL_CURRENT (tmp1); - if (new_fn == old_fn) - /* The function already exists in the current namespace. */ - break; + if (new_fn == old_fn) + /* The function already exists in the current namespace. */ + break; else if (OVL_USED (tmp1)) - continue; /* this is a using decl */ + continue; /* this is a using decl */ else if (compparms (TYPE_ARG_TYPES (TREE_TYPE (new_fn)), - TYPE_ARG_TYPES (TREE_TYPE (old_fn)))) + TYPE_ARG_TYPES (TREE_TYPE (old_fn)))) { gcc_assert (!DECL_ANTICIPATED (old_fn)); - /* There was already a non-using declaration in + /* There was already a non-using declaration in this scope with the same parameter types. If both - are the same extern "C" functions, that's ok. */ - if (decls_match (new_fn, old_fn)) + are the same extern "C" functions, that's ok. */ + if (decls_match (new_fn, old_fn)) break; else - { + { error ("%qD is already declared in this scope", name); break; } @@ -2124,7 +2124,7 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype, if (oldtype && *newtype && !same_type_p (oldtype, *newtype)) { error ("using declaration %qD introduced ambiguous type %qT", - name, oldtype); + name, oldtype); return; } } @@ -2629,9 +2629,9 @@ push_class_level_binding (tree name, tree x) if (INHERITED_VALUE_BINDING_P (binding)) { /* If the old binding was from a base class, and was for a - tag name, slide it over to make room for the new binding. - The old binding is still visible if explicitly qualified - with a class-key. */ + tag name, slide it over to make room for the new binding. + The old binding is still visible if explicitly qualified + with a class-key. */ if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval) && !(TREE_CODE (x) == TYPE_DECL && DECL_ARTIFICIAL (x))) { @@ -2818,7 +2818,7 @@ set_decl_namespace (tree decl, tree scope, bool friendp) /* It is ok for friends to be qualified in parallel space. */ if (!friendp && !is_ancestor (current_namespace, scope)) error ("declaration of %qD not in a namespace surrounding %qD", - decl, scope); + decl, scope); DECL_CONTEXT (decl) = FROB_CONTEXT (scope); /* Writing "int N::i" to declare a variable within "N" is invalid. */ @@ -2904,14 +2904,14 @@ push_namespace (tree name) if (anon) { /* The name of anonymous namespace is unique for the translation - unit. */ + unit. */ if (!anonymous_namespace_name) - anonymous_namespace_name = get_file_function_name ('N'); + anonymous_namespace_name = get_file_function_name ('N'); name = anonymous_namespace_name; d = IDENTIFIER_NAMESPACE_VALUE (name); if (d) - /* Reopening anonymous namespace. */ - need_new = 0; + /* Reopening anonymous namespace. */ + need_new = 0; implicit_use = 1; } else @@ -2919,15 +2919,15 @@ push_namespace (tree name) /* Check whether this is an extended namespace definition. */ d = IDENTIFIER_NAMESPACE_VALUE (name); if (d != NULL_TREE && TREE_CODE (d) == NAMESPACE_DECL) - { - need_new = 0; - if (DECL_NAMESPACE_ALIAS (d)) - { - error ("namespace alias %qD not allowed here, assuming %qD", - d, DECL_NAMESPACE_ALIAS (d)); - d = DECL_NAMESPACE_ALIAS (d); - } - } + { + need_new = 0; + if (DECL_NAMESPACE_ALIAS (d)) + { + error ("namespace alias %qD not allowed here, assuming %qD", + d, DECL_NAMESPACE_ALIAS (d)); + d = DECL_NAMESPACE_ALIAS (d); + } + } } if (need_new) @@ -3006,7 +3006,7 @@ push_decl_namespace (tree decl) if (TREE_CODE (decl) != NAMESPACE_DECL) decl = decl_namespace_context (decl); decl_namespace_list = tree_cons (ORIGINAL_NAMESPACE (decl), - NULL_TREE, decl_namespace_list); + NULL_TREE, decl_namespace_list); } /* [namespace.memdef]/2 */ @@ -3027,7 +3027,7 @@ namespace_ancestor (tree ns1, tree ns2) if (is_ancestor (ns1, ns2)) POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, ns1); POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, - namespace_ancestor (CP_DECL_CONTEXT (ns1), ns2)); + namespace_ancestor (CP_DECL_CONTEXT (ns1), ns2)); } /* Process a namespace-alias declaration. */ @@ -3075,28 +3075,28 @@ pushdecl_namespace_level (tree x) tree newval; tree *ptr = (tree *)0; for (; !global_scope_p (b); b = b->level_chain) - { - tree shadowed = b->type_shadowed; - for (; shadowed; shadowed = TREE_CHAIN (shadowed)) - if (TREE_PURPOSE (shadowed) == name) - { + { + tree shadowed = b->type_shadowed; + for (; shadowed; shadowed = TREE_CHAIN (shadowed)) + if (TREE_PURPOSE (shadowed) == name) + { ptr = &TREE_VALUE (shadowed); /* Can't break out of the loop here because sometimes a binding level will have duplicate bindings for PT names. It's gross, but I haven't time to fix it. */ - } - } + } + } newval = TREE_TYPE (t); if (ptr == (tree *)0) - { - /* @@ This shouldn't be needed. My test case "zstring.cc" trips - up here if this is changed to an assertion. --KR */ + { + /* @@ This shouldn't be needed. My test case "zstring.cc" trips + up here if this is changed to an assertion. --KR */ SET_IDENTIFIER_TYPE_VALUE (name, t); } else - { + { *ptr = newval; - } + } } POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t); } @@ -3344,29 +3344,29 @@ ambiguous_decl (tree name, struct scope_binding *old, cxx_binding *new, switch (TREE_CODE (val)) { case TEMPLATE_DECL: - /* If we expect types or namespaces, and not templates, - or this is not a template class. */ - if ((LOOKUP_QUALIFIERS_ONLY (flags) + /* If we expect types or namespaces, and not templates, + or this is not a template class. */ + if ((LOOKUP_QUALIFIERS_ONLY (flags) && !DECL_CLASS_TEMPLATE_P (val)) || hidden_name_p (val)) - val = NULL_TREE; - break; + val = NULL_TREE; + break; case TYPE_DECL: - if (LOOKUP_NAMESPACES_ONLY (flags) || hidden_name_p (val)) - val = NULL_TREE; - break; + if (LOOKUP_NAMESPACES_ONLY (flags) || hidden_name_p (val)) + val = NULL_TREE; + break; case NAMESPACE_DECL: - if (LOOKUP_TYPES_ONLY (flags)) - val = NULL_TREE; - break; + if (LOOKUP_TYPES_ONLY (flags)) + val = NULL_TREE; + break; case FUNCTION_DECL: - /* Ignore built-in functions that are still anticipated. */ - if (LOOKUP_QUALIFIERS_ONLY (flags) || hidden_name_p (val)) - val = NULL_TREE; - break; + /* Ignore built-in functions that are still anticipated. */ + if (LOOKUP_QUALIFIERS_ONLY (flags) || hidden_name_p (val)) + val = NULL_TREE; + break; default: - if (LOOKUP_QUALIFIERS_ONLY (flags)) - val = NULL_TREE; + if (LOOKUP_QUALIFIERS_ONLY (flags)) + val = NULL_TREE; } if (!old->value) @@ -3374,12 +3374,12 @@ ambiguous_decl (tree name, struct scope_binding *old, cxx_binding *new, else if (val && val != old->value) { if (is_overloaded_fn (old->value) && is_overloaded_fn (val)) - old->value = merge_functions (old->value, val); + old->value = merge_functions (old->value, val); else { /* Some declarations are functions, some are not. */ - if (flags & LOOKUP_COMPLAIN) - { + if (flags & LOOKUP_COMPLAIN) + { /* If we've already given this error for this lookup, old->value is error_mark_node, so let's not repeat ourselves. */ @@ -3388,8 +3388,8 @@ ambiguous_decl (tree name, struct scope_binding *old, cxx_binding *new, error ("use of %qD is ambiguous", name); cp_error_at (" first declared as %q#D here", old->value); } - cp_error_at (" also declared as %q#D here", val); - } + cp_error_at (" also declared as %q#D here", val); + } old->value = error_mark_node; } } @@ -3402,11 +3402,11 @@ ambiguous_decl (tree name, struct scope_binding *old, cxx_binding *new, else if (type && old->type != type) { if (flags & LOOKUP_COMPLAIN) - { - error ("%qD denotes an ambiguous type",name); - error ("%J first type here", TYPE_MAIN_DECL (old->type)); - error ("%J other type here", TYPE_MAIN_DECL (type)); - } + { + error ("%qD denotes an ambiguous type",name); + error ("%J first type here", TYPE_MAIN_DECL (old->type)); + error ("%J other type here", TYPE_MAIN_DECL (type)); + } } } @@ -3516,7 +3516,7 @@ lookup_namespace_name (tree namespace, tree name) /*in_decl=*/NULL_TREE, /*context=*/NULL_TREE, /*entering_scope=*/0, - tf_error | tf_warning); + tf_error | tf_warning); else if (DECL_FUNCTION_TEMPLATE_P (val) || TREE_CODE (val) == OVERLOAD) val = lookup_template_function (val, @@ -3535,7 +3535,7 @@ lookup_namespace_name (tree namespace, tree name) /* Ignore built-in functions and friends that haven't been declared yet. */ if (!val || !hidden_name_p (val)) - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, val); + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, val); } error ("%qD undeclared in namespace %qD", name, namespace); @@ -3555,7 +3555,7 @@ select_decl (const struct scope_binding *binding, int flags) { /* We are not interested in types. */ if (val && TREE_CODE (val) == NAMESPACE_DECL) - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, val); + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, val); POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE); } @@ -3589,7 +3589,7 @@ unqualified_namespace_lookup (tree name, int flags) for (; !val; scope = CP_DECL_CONTEXT (scope)) { cxx_binding *b = - cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (scope), name); + cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (scope), name); if (b) { @@ -3606,7 +3606,7 @@ unqualified_namespace_lookup (tree name, int flags) level->kind != sk_namespace; level = level->level_chain) if (!lookup_using_namespace (name, &binding, level->using_directives, - scope, flags)) + scope, flags)) /* Give up because of error. */ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); @@ -3616,7 +3616,7 @@ unqualified_namespace_lookup (tree name, int flags) while (1) { if (!lookup_using_namespace (name, &binding, - DECL_NAMESPACE_USING (siter), + DECL_NAMESPACE_USING (siter), scope, flags)) /* Give up because of error. */ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); @@ -3684,12 +3684,12 @@ lookup_using_namespace (tree name, struct scope_binding *val, for (iter = usings; iter; iter = TREE_CHAIN (iter)) if (TREE_VALUE (iter) == scope) { - tree used = ORIGINAL_NAMESPACE (TREE_PURPOSE (iter)); - cxx_binding *val1 = - cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (used), name); - /* Resolve ambiguities. */ - if (val1) - ambiguous_decl (name, val, val1, flags); + tree used = ORIGINAL_NAMESPACE (TREE_PURPOSE (iter)); + cxx_binding *val1 = + cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (used), name); + /* Resolve ambiguities. */ + if (val1) + ambiguous_decl (name, val, val1, flags); } POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, val->value != error_mark_node); } @@ -3718,7 +3718,7 @@ qualified_lookup_using_namespace (tree name, tree scope, cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (scope), name); seen = tree_cons (scope, NULL_TREE, seen); if (binding) - ambiguous_decl (name, result, binding, flags); + ambiguous_decl (name, result, binding, flags); /* Consider strong using directives always, and non-strong ones if we haven't found a binding yet. ??? Shouldn't we consider @@ -4107,7 +4107,7 @@ lookup_type_current_level (tree name) { if (purpose_member (name, b->type_shadowed)) POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, - REAL_IDENTIFIER_TYPE_VALUE (name)); + REAL_IDENTIFIER_TYPE_VALUE (name)); if (b->kind == sk_cleanup) b = b->level_chain; else @@ -4258,10 +4258,10 @@ arg_assoc_template_arg (struct arg_lookup *k, tree arg) /* It's not a member template. */ if (TREE_CODE (ctx) == NAMESPACE_DECL) - return arg_assoc_namespace (k, ctx); + return arg_assoc_namespace (k, ctx); /* Otherwise, it must be member template. */ else - return arg_assoc_class (k, ctx); + return arg_assoc_class (k, ctx); } /* It's not a template template argument, but it is a type template argument. */ @@ -4333,7 +4333,7 @@ arg_assoc_class (struct arg_lookup *k, tree type) { list = INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (type)); for (i = 0; i < TREE_VEC_LENGTH (list); ++i) - arg_assoc_template_arg (k, TREE_VEC_ELT (list, i)); + arg_assoc_template_arg (k, TREE_VEC_ELT (list, i)); } return false; @@ -4454,7 +4454,7 @@ arg_assoc (struct arg_lookup *k, tree n) int ix; if (TREE_CODE (template) == COMPONENT_REF) - template = TREE_OPERAND (template, 1); + template = TREE_OPERAND (template, 1); /* First, the template. There may actually be more than one if this is an overloaded function template. But, in that case, @@ -4566,7 +4566,7 @@ push_using_directive (tree used) static tree maybe_process_template_type_declaration (tree type, int is_friend, - cxx_scope *b) + cxx_scope *b) { tree decl = TYPE_NAME (type); @@ -4574,7 +4574,7 @@ maybe_process_template_type_declaration (tree type, int is_friend, /* You can't declare a new template type in a template parameter list. But, you can declare a non-template type: - template <class A*> struct S; + template <class A*> struct S; is a forward-declaration of `A'. */ ; @@ -4665,8 +4665,8 @@ pushtag (tree name, tree type, tag_scope scope) { /* Do C++ gratuitous typedefing. */ if (IDENTIFIER_TYPE_VALUE (name) != type) - { - tree d = NULL_TREE; + { + tree d = NULL_TREE; int in_class = 0; tree context = TYPE_CONTEXT (type); @@ -4744,7 +4744,7 @@ pushtag (tree name, tree type, tag_scope scope) if (TYPE_CONTEXT (type) && TREE_CODE (TYPE_CONTEXT (type)) == FUNCTION_DECL) VEC_safe_push (tree, gc, local_classes, type); - } + } if (b->kind == sk_class && !COMPLETE_TYPE_P (current_class_type)) { diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h index db0bfe0..7247233 100644 --- a/gcc/cp/name-lookup.h +++ b/gcc/cp/name-lookup.h @@ -40,11 +40,11 @@ struct binding_entry_s GTY(()) }; /* These macros indicate the initial chains count for binding_table. */ -#define SCOPE_DEFAULT_HT_SIZE (1 << 3) -#define CLASS_SCOPE_HT_SIZE (1 << 3) -#define NAMESPACE_ORDINARY_HT_SIZE (1 << 5) -#define NAMESPACE_STD_HT_SIZE (1 << 8) -#define GLOBAL_SCOPE_HT_SIZE (1 << 8) +#define SCOPE_DEFAULT_HT_SIZE (1 << 3) +#define CLASS_SCOPE_HT_SIZE (1 << 3) +#define NAMESPACE_ORDINARY_HT_SIZE (1 << 5) +#define NAMESPACE_STD_HT_SIZE (1 << 8) +#define GLOBAL_SCOPE_HT_SIZE (1 << 8) extern void binding_table_foreach (binding_table, bt_foreach_proc, void *); extern binding_entry binding_table_find (binding_table, tree); @@ -105,16 +105,16 @@ typedef enum scope_kind { is initialized by using "memset" to set the contents to zero, and the default scope kind is "sk_block". */ - sk_cleanup, /* A scope for (pseudo-)scope for cleanup. It is - peusdo in that it is transparent to name lookup - activities. */ + sk_cleanup, /* A scope for (pseudo-)scope for cleanup. It is + peusdo in that it is transparent to name lookup + activities. */ sk_try, /* A try-block. */ - sk_catch, /* A catch-block. */ - sk_for, /* The scope of the variable declared in a + sk_catch, /* A catch-block. */ + sk_for, /* The scope of the variable declared in a for-init-statement. */ sk_function_parms, /* The scope containing function parameters. */ - sk_class, /* The scope containing the members of a class. */ - sk_namespace, /* The scope containing the members of a + sk_class, /* The scope containing the members of a class. */ + sk_namespace, /* The scope containing the members of a namespace, including the global scope. */ sk_template_parms, /* A scope for template parameters. */ sk_template_spec /* Like sk_template_parms, but for an explicit diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index cbd705c..db3fa63 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -379,7 +379,7 @@ cp_lexer_saving_tokens (const cp_lexer* lexer) static void cp_lexer_get_preprocessor_token (cp_lexer *lexer ATTRIBUTE_UNUSED , - cp_token *token) + cp_token *token) { static int is_extern_c = 0; @@ -904,7 +904,7 @@ cp_declarator * make_call_declarator (cp_declarator *target, cp_parameter_declarator *parms, cp_cv_quals cv_qualifiers, - tree exception_specification) + tree exception_specification) { cp_declarator *declarator; @@ -2082,7 +2082,7 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree scope, tree id) && DECL_NAME (field) == id) { inform ("(perhaps %<typename %T::%E%> was intended)", - BINFO_TYPE (b), id); + BINFO_TYPE (b), id); break; } if (field) @@ -2268,7 +2268,7 @@ cp_parser_skip_to_end_of_statement (cp_parser* parser) scanned, stop -- but only after consuming the token. That way given: - void f g () { ... } + void f g () { ... } typedef int I; we will stop after the body of the erroneously declared @@ -2800,7 +2800,7 @@ cp_parser_primary_expression (cp_parser *parser, case CPP_STRING: case CPP_WSTRING: /* ??? Should wide strings be allowed when parser->translate_strings_p - is false (i.e. in attributes)? If not, we can kill the third + is false (i.e. in attributes)? If not, we can kill the third argument to cp_parser_string_literal. */ return cp_parser_string_literal (parser, parser->translate_strings_p, @@ -2830,7 +2830,7 @@ cp_parser_primary_expression (cp_parser *parser, /* And they're not allowed outside of a function-body; you cannot, for example, write: - int i = ({ int j = 3; j + 1; }); + int i = ({ int j = 3; j + 1; }); at class or namespace scope. */ if (!at_function_scope_p ()) @@ -3229,7 +3229,7 @@ cp_parser_id_expression (cp_parser *parser, static tree cp_parser_unqualified_id (cp_parser* parser, - bool template_keyword_p, + bool template_keyword_p, bool check_dependency_p, bool declarator_p) { @@ -3279,7 +3279,7 @@ cp_parser_unqualified_id (cp_parser* parser, template <typename T> struct S { ~S (); }; template <typename T> S<T>::~S() {} - is invalid, since `~' must be followed by a class-name, but + is invalid, since `~' must be followed by a class-name, but `S<T>' is dependent, and so not known to be a class. That's not right; we need to look in uninstantiated templates. A further complication arises from: @@ -3294,14 +3294,14 @@ cp_parser_unqualified_id (cp_parser* parser, Yet another issue is: - struct S { - int S; - ~S(); - }; + struct S { + int S; + ~S(); + }; - S::~S() {} + S::~S() {} - The standard does not seem to say that the `S' in `~S' + The standard does not seem to say that the `S' in `~S' should refer to the type `S' and not the data member `S::S'. */ @@ -4472,8 +4472,8 @@ cp_parser_postfix_dot_deref_expression (cp_parser *parser, However, if the name was not dependent and has already been resolved; there is no need to build the SCOPE_REF. For example; - struct X { void f(); }; - template <typename T> void f(T* t) { t->X::f(); } + struct X { void f(); }; + template <typename T> void f(T* t) { t->X::f(); } Even though "t" is dependent, "X::f" is not and has been resolved to a BASELINK; there is no need to include scope information. */ @@ -4659,8 +4659,8 @@ cp_parser_parenthesized_expression_list (cp_parser* parser, static void cp_parser_pseudo_destructor_name (cp_parser* parser, - tree* scope, - tree* type) + tree* scope, + tree* type) { bool nested_name_specifier_p; @@ -5003,7 +5003,7 @@ cp_parser_new_expression (cp_parser* parser) /* Look for the closing `)'. */ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"); /* There should not be a direct-new-declarator in this production, - but GCC used to allowed this, so we check and emit a sensible error + but GCC used to allowed this, so we check and emit a sensible error message for this case. */ if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_SQUARE)) { @@ -5211,7 +5211,7 @@ cp_parser_direct_new_declarator (cp_parser* parser) if (!expression) { error ("expression in new-declarator must have integral " - "or enumeration type"); + "or enumeration type"); expression = error_mark_node; } } @@ -5384,9 +5384,9 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p) parser->type_definition_forbidden_message = saved_message; /* If ok so far, parse the dependent expression. We cannot be - sure it is a cast. Consider `(T ())'. It is a parenthesized - ctor of T, but looks like a cast to function returning T - without a dependent expression. */ + sure it is a cast. Consider `(T ())'. It is a parenthesized + ctor of T, but looks like a cast to function returning T + without a dependent expression. */ if (!cp_parser_error_occurred (parser)) expr = cp_parser_cast_expression (parser, /*address_p=*/false, @@ -5524,19 +5524,19 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p) new_prec = TOKEN_PRECEDENCE (token); /* Popping an entry off the stack means we completed a subexpression: - - either we found a token which is not an operator (`>' where it is not - an operator, or prec == PREC_NOT_OPERATOR), in which case popping - will happen repeatedly; - - or, we found an operator which has lower priority. This is the case - where the recursive descent *ascends*, as in `3 * 4 + 5' after - parsing `3 * 4'. */ + - either we found a token which is not an operator (`>' where it is not + an operator, or prec == PREC_NOT_OPERATOR), in which case popping + will happen repeatedly; + - or, we found an operator which has lower priority. This is the case + where the recursive descent *ascends*, as in `3 * 4 + 5' after + parsing `3 * 4'. */ if (new_prec <= prec) - { - if (sp == stack) + { + if (sp == stack) break; - else + else goto pop; - } + } get_rhs: tree_type = binops_by_token[token->type].tree_type; @@ -5545,57 +5545,57 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p) cp_lexer_consume_token (parser->lexer); /* Extract another operand. It may be the RHS of this expression - or the LHS of a new, higher priority expression. */ + or the LHS of a new, higher priority expression. */ rhs = cp_parser_simple_cast_expression (parser); /* Get another operator token. Look up its precedence to avoid - building a useless (immediately popped) stack entry for common - cases such as 3 + 4 + 5 or 3 * 4 + 5. */ + building a useless (immediately popped) stack entry for common + cases such as 3 + 4 + 5 or 3 * 4 + 5. */ token = cp_lexer_peek_token (parser->lexer); lookahead_prec = TOKEN_PRECEDENCE (token); if (lookahead_prec > new_prec) - { - /* ... and prepare to parse the RHS of the new, higher priority - expression. Since precedence levels on the stack are + { + /* ... and prepare to parse the RHS of the new, higher priority + expression. Since precedence levels on the stack are monotonically increasing, we do not have to care about stack overflows. */ - sp->prec = prec; - sp->tree_type = tree_type; - sp->lhs = lhs; - sp++; - lhs = rhs; - prec = new_prec; - new_prec = lookahead_prec; - goto get_rhs; - - pop: - /* If the stack is not empty, we have parsed into LHS the right side + sp->prec = prec; + sp->tree_type = tree_type; + sp->lhs = lhs; + sp++; + lhs = rhs; + prec = new_prec; + new_prec = lookahead_prec; + goto get_rhs; + + pop: + /* If the stack is not empty, we have parsed into LHS the right side (`4' in the example above) of an expression we had suspended. We can use the information on the stack to recover the LHS (`3') from the stack together with the tree code (`MULT_EXPR'), and the precedence of the higher level subexpression (`PREC_ADDITIVE_EXPRESSION'). TOKEN is the CPP_PLUS token, which will be used to actually build the additive expression. */ - --sp; + --sp; prec = sp->prec; - tree_type = sp->tree_type; - rhs = lhs; - lhs = sp->lhs; - } + tree_type = sp->tree_type; + rhs = lhs; + lhs = sp->lhs; + } overloaded_p = false; lhs = build_x_binary_op (tree_type, lhs, rhs, &overloaded_p); /* If the binary operator required the use of an overloaded operator, - then this expression cannot be an integral constant-expression. - An overloaded operator can be used even if both operands are - otherwise permissible in an integral constant-expression if at - least one of the operands is of enumeration type. */ + then this expression cannot be an integral constant-expression. + An overloaded operator can be used even if both operands are + otherwise permissible in an integral constant-expression if at + least one of the operands is of enumeration type. */ if (overloaded_p - && (cp_parser_non_integral_constant_expression - (parser, "calls to overloaded operators"))) - return error_mark_node; + && (cp_parser_non_integral_constant_expression + (parser, "calls to overloaded operators"))) + return error_mark_node; } return lhs; @@ -6165,11 +6165,11 @@ cp_parser_labeled_statement (cp_parser* parser, tree in_statement_expr) ellipsis = cp_lexer_peek_token (parser->lexer); if (ellipsis->type == CPP_ELLIPSIS) { - /* Consume the `...' token. */ + /* Consume the `...' token. */ cp_lexer_consume_token (parser->lexer); expr_hi = cp_parser_constant_expression (parser, - /*allow_non_constant_p=*/false, + /*allow_non_constant_p=*/false, NULL); /* We don't need to emit warnings here, as the common code will do this for us. */ @@ -7074,7 +7074,7 @@ cp_parser_block_declaration (cp_parser *parser, static void cp_parser_simple_declaration (cp_parser* parser, - bool function_definition_allowed_p) + bool function_definition_allowed_p) { cp_decl_specifier_seq decl_specifiers; int declares_class_or_enum; @@ -7203,9 +7203,9 @@ cp_parser_simple_declaration (cp_parser* parser, /* After the first time around, a function-definition is not allowed -- even if it was OK at first. For example: - int i, f() {} + int i, f() {} - is not valid. */ + is not valid. */ function_definition_allowed_p = false; } @@ -7252,9 +7252,9 @@ cp_parser_simple_declaration (cp_parser* parser, flags: 1: one of the decl-specifiers is an elaborated-type-specifier - (i.e., a type declaration) + (i.e., a type declaration) 2: one of the decl-specifiers is an enum-specifier or a - class-specifier (i.e., a type definition) + class-specifier (i.e., a type definition) */ @@ -7335,7 +7335,7 @@ cp_parser_decl_specifier_seq (cp_parser* parser, extern mutable - GNU Extension: + GNU Extension: thread */ case RID_AUTO: /* Consume the token. */ @@ -7641,7 +7641,7 @@ cp_parser_conversion_function_id (cp_parser* parser) conversion-type-id. For example, consider: struct S { - typedef int I; + typedef int I; operator I(); }; @@ -7693,7 +7693,7 @@ cp_parser_conversion_type_id (cp_parser* parser) declarator = cp_parser_conversion_declarator_opt (parser); type_specified = grokdeclarator (declarator, &type_specifiers, TYPENAME, - /*initialized=*/0, &attributes); + /*initialized=*/0, &attributes); if (attributes) cplus_decl_attributes (&type_specified, attributes, /*flags=*/0); return type_specified; @@ -8397,7 +8397,7 @@ cp_parser_type_parameter (cp_parser* parser) tree default_argument; /* If the next token is an identifier, then it names the - parameter. */ + parameter. */ if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)) identifier = cp_parser_identifier (parser); else @@ -8599,7 +8599,7 @@ cp_parser_template_id (cp_parser *parser, /* Change `:' into `::'. */ next_token_2->type = CPP_SCOPE; /* Consume the first token (CPP_OPEN_SQUARE - which we pretend it is - CPP_LESS. */ + CPP_LESS. */ cp_lexer_consume_token (parser->lexer); /* Parse the arguments. */ arguments = cp_parser_enclosed_template_argument_list (parser); @@ -8614,7 +8614,7 @@ cp_parser_template_id (cp_parser *parser, return error_mark_node; } /* Otherwise, emit an error about the invalid digraph, but continue - parsing because we got our argument list. */ + parsing because we got our argument list. */ pedwarn ("%<<::%> cannot begin a template-argument list"); inform ("%<<:%> is an alternate spelling for %<[%>. Insert whitespace " "between %<<%> and %<::%>"); @@ -8733,8 +8733,8 @@ cp_parser_template_id (cp_parser *parser, static tree cp_parser_template_name (cp_parser* parser, - bool template_keyword_p, - bool check_dependency_p, + bool template_keyword_p, + bool check_dependency_p, bool is_declaration, bool *is_identifier) { @@ -8753,10 +8753,10 @@ cp_parser_template_name (cp_parser* parser, identifier = cp_parser_operator_function_id (parser); /* If that didn't work, try a conversion-function-id. */ if (!cp_parser_parse_definitely (parser)) - { + { cp_parser_error (parser, "expected template-name"); return error_mark_node; - } + } } /* Look for the identifier. */ else @@ -9045,7 +9045,7 @@ cp_parser_template_argument (cp_parser* parser) in [temp.arg.nontype]: -- an integral constant-expression of integral or enumeration - type; or + type; or -- the name of a non-type template-parameter; or @@ -9386,7 +9386,7 @@ cp_parser_type_specifier (cp_parser* parser, if (cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_OPEN_BRACE || (cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_NAME && cp_lexer_peek_nth_token (parser->lexer, 3)->type - == CPP_OPEN_BRACE)) + == CPP_OPEN_BRACE)) { if (parser->num_template_parameter_lists) { @@ -9823,7 +9823,7 @@ cp_parser_type_name (cp_parser* parser) elaborated-type-specifier: class-key attributes :: [opt] nested-name-specifier [opt] identifier class-key attributes :: [opt] nested-name-specifier [opt] - template [opt] template-id + template [opt] template-id enum attributes :: [opt] nested-name-specifier [opt] identifier If IS_FRIEND is TRUE, then this elaborated-type-specifier is being @@ -9835,8 +9835,8 @@ cp_parser_type_name (cp_parser* parser) static tree cp_parser_elaborated_type_specifier (cp_parser* parser, - bool is_friend, - bool is_declaration) + bool is_friend, + bool is_declaration) { enum tag_types tag_type; tree identifier; @@ -9906,7 +9906,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, /* Allow the `template' keyword. */ template_p = cp_parser_optional_template_keyword (parser); /* If we didn't see `template', we don't know if there's a - template-id or not. */ + template-id or not. */ if (!template_p) cp_parser_parse_tentatively (parser); /* Parse the template-id. */ @@ -9914,7 +9914,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, /*check_dependency_p=*/true, is_declaration); /* If we didn't find a template-id, look for an ordinary - identifier. */ + identifier. */ if (!template_p && !cp_parser_parse_definitely (parser)) ; /* If DECL is a TEMPLATE_ID_EXPR, and the `typename' keyword is @@ -10055,8 +10055,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, else ts = ts_global; - /* Warn about attributes. They are ignored. */ - if (attributes) + /* Warn about attributes. They are ignored. */ + if (attributes) warning (OPT_Wattributes, "type attributes are honored only at type definition"); @@ -10511,10 +10511,10 @@ cp_parser_using_directive (cp_parser* parser) asm volatile [opt] ( string-literal ) ; asm volatile [opt] ( string-literal : asm-operand-list [opt] ) ; asm volatile [opt] ( string-literal : asm-operand-list [opt] - : asm-operand-list [opt] ) ; + : asm-operand-list [opt] ) ; asm volatile [opt] ( string-literal : asm-operand-list [opt] - : asm-operand-list [opt] - : asm-operand-list [opt] ) ; */ + : asm-operand-list [opt] + : asm-operand-list [opt] ) ; */ static void cp_parser_asm_definition (cp_parser* parser) @@ -10989,8 +10989,8 @@ cp_parser_init_declarator (cp_parser* parser, static cp_declarator * cp_parser_declarator (cp_parser* parser, - cp_parser_declarator_kind dcl_kind, - int* ctor_dtor_or_conv_p, + cp_parser_declarator_kind dcl_kind, + int* ctor_dtor_or_conv_p, bool* parenthesized_p, bool member_p) { @@ -11098,8 +11098,8 @@ cp_parser_declarator (cp_parser* parser, static cp_declarator * cp_parser_direct_declarator (cp_parser* parser, - cp_parser_declarator_kind dcl_kind, - int* ctor_dtor_or_conv_p, + cp_parser_declarator_kind dcl_kind, + int* ctor_dtor_or_conv_p, bool member_p) { cp_token *token; @@ -11117,15 +11117,15 @@ cp_parser_direct_declarator (cp_parser* parser, if (token->type == CPP_OPEN_PAREN) { /* This is either a parameter-declaration-clause, or a - parenthesized declarator. When we know we are parsing a - named declarator, it must be a parenthesized declarator - if FIRST is true. For instance, `(int)' is a - parameter-declaration-clause, with an omitted - direct-abstract-declarator. But `((*))', is a - parenthesized abstract declarator. Finally, when T is a - template parameter `(T)' is a - parameter-declaration-clause, and not a parenthesized - named declarator. + parenthesized declarator. When we know we are parsing a + named declarator, it must be a parenthesized declarator + if FIRST is true. For instance, `(int)' is a + parameter-declaration-clause, with an omitted + direct-abstract-declarator. But `((*))', is a + parenthesized abstract declarator. Finally, when T is a + template parameter `(T)' is a + parameter-declaration-clause, and not a parenthesized + named declarator. We first try and parse a parameter-declaration-clause, and then try a nested declarator (if FIRST is true). @@ -11145,7 +11145,7 @@ cp_parser_direct_declarator (cp_parser* parser, these two alternatives should be selected. Even more complex are examples like: - int i (int (a)); + int i (int (a)); int i (int (3)); The former is a function-declaration; the latter is a @@ -11191,7 +11191,7 @@ cp_parser_direct_declarator (cp_parser* parser, = saved_num_template_parameter_lists; /* If all went well, parse the cv-qualifier-seq and the - exception-specification. */ + exception-specification. */ if (member_p || cp_parser_parse_definitely (parser)) { cp_cv_quals cv_quals; @@ -11215,8 +11215,8 @@ cp_parser_direct_declarator (cp_parser* parser, cv_quals, exception_specification); /* Any subsequent parameter lists are to do with - return type, so are not those of the declared - function. */ + return type, so are not those of the declared + function. */ parser->default_arg_ok_p = false; /* Repeat the main loop. */ @@ -11337,21 +11337,21 @@ cp_parser_direct_declarator (cp_parser* parser, && TREE_CODE (qualifying_scope) == TYPENAME_TYPE) { /* In the declaration of a member of a template class - outside of the class itself, the SCOPE will sometimes - be a TYPENAME_TYPE. For example, given: + outside of the class itself, the SCOPE will sometimes + be a TYPENAME_TYPE. For example, given: - template <typename T> - int S<T>::R::i = 3; + template <typename T> + int S<T>::R::i = 3; - the SCOPE will be a TYPENAME_TYPE for `S<T>::R'. In - this context, we must resolve S<T>::R to an ordinary - type, rather than a typename type. + the SCOPE will be a TYPENAME_TYPE for `S<T>::R'. In + this context, we must resolve S<T>::R to an ordinary + type, rather than a typename type. - The reason we normally avoid resolving TYPENAME_TYPEs - is that a specialization of `S' might render - `S<T>::R' not a type. However, if `S' is - specialized, then this `i' will not be used, so there - is no harm in resolving the types here. */ + The reason we normally avoid resolving TYPENAME_TYPEs + is that a specialization of `S' might render + `S<T>::R' not a type. However, if `S' is + specialized, then this `i' will not be used, so there + is no harm in resolving the types here. */ tree type; /* Resolve the TYPENAME_TYPE. */ @@ -11404,8 +11404,8 @@ cp_parser_direct_declarator (cp_parser* parser, { error ("invalid use of constructor as a template"); inform ("use %<%T::%D%> instead of %<%T::%T%> to name " - "the constructor in a qualified name", - class_type, + "the constructor in a qualified name", + class_type, DECL_NAME (TYPE_TI_TEMPLATE (class_type)), class_type, class_type); } @@ -11470,7 +11470,7 @@ cp_parser_direct_declarator (cp_parser* parser, static enum tree_code cp_parser_ptr_operator (cp_parser* parser, - tree* type, + tree* type, cp_cv_quals *cv_quals) { enum tree_code code = ERROR_MARK; @@ -11740,20 +11740,20 @@ cp_parser_type_specifier_seq (cp_parser* parser, seen_type_specifier = true; /* The standard says that a condition can be: - type-specifier-seq declarator = assignment-expression + type-specifier-seq declarator = assignment-expression However, given: struct S {}; if (int S = ...) - we should treat the "S" as a declarator, not as a - type-specifier. The standard doesn't say that explicitly for - type-specifier-seq, but it does say that for - decl-specifier-seq in an ordinary declaration. Perhaps it - would be clearer just to allow a decl-specifier-seq here, and - then add a semantic restriction that if any decl-specifiers - that are not type-specifiers appear, the program is invalid. */ + we should treat the "S" as a declarator, not as a + type-specifier. The standard doesn't say that explicitly for + type-specifier-seq, but it does say that for + decl-specifier-seq in an ordinary declaration. Perhaps it + would be clearer just to allow a decl-specifier-seq here, and + then add a semantic restriction that if any decl-specifiers + that are not type-specifiers appear, the program is invalid. */ if (is_condition && !is_cv_qualifier) flags |= CP_PARSER_FLAGS_NO_USER_DEFINED_TYPES; } @@ -11913,9 +11913,9 @@ cp_parser_parameter_declaration_list (cp_parser* parser, bool *is_error) cp_lexer_consume_token (parser->lexer); /* When parsing something like: - int i(float f, double d) + int i(float f, double d) - we can tell after seeing the declaration for "f" that we + we can tell after seeing the declaration for "f" that we are not looking at an initialization of a variable "i", but rather at the declaration of a function "i". @@ -12151,14 +12151,14 @@ cp_parser_parameter_declaration (cp_parser *parser, } /* Create a DEFAULT_ARG to represented the unparsed default - argument. */ + argument. */ default_argument = make_node (DEFAULT_ARG); DEFARG_TOKENS (default_argument) = cp_token_cache_new (first_token, token); DEFARG_INSTANTIATIONS (default_argument) = NULL; } /* Outside of a class definition, we can just parse the - assignment-expression. */ + assignment-expression. */ else { bool saved_local_variables_forbidden_p; @@ -12650,7 +12650,7 @@ cp_parser_class_specifier (cp_parser* parser) class-specifier for that class. Consider: struct A { - struct B { void f() { sizeof (A); } }; + struct B { void f() { sizeof (A); } }; }; If `f' were processed before the processing of `A' were @@ -12675,11 +12675,11 @@ cp_parser_class_specifier (cp_parser* parser) This two-phased approach handles cases like: struct S { - void f() { g(); } - void g(int i = 3); - }; + void f() { g(); } + void g(int i = 3); + }; - */ + */ for (TREE_PURPOSE (parser->unparsed_functions_queues) = nreverse (TREE_PURPOSE (parser->unparsed_functions_queues)); (queue_entry = TREE_PURPOSE (parser->unparsed_functions_queues)); @@ -12826,10 +12826,10 @@ cp_parser_class_head (cp_parser* parser, It is OK to define an inaccessible class; for example: - class A { class B; }; - class A::B {}; + class A { class B; }; + class A::B {}; - We do not know if we will see a class-name, or a + We do not know if we will see a class-name, or a template-name. We look for a class-name first, in case the class-name is a template-id; if we looked for the template-name first we would stop after the template-name. */ @@ -12942,13 +12942,13 @@ cp_parser_class_head (cp_parser* parser, if (scope && !is_ancestor (scope, nested_name_specifier)) { error ("declaration of %qD in %qD which does not enclose %qD", - type, scope, nested_name_specifier); + type, scope, nested_name_specifier); type = NULL_TREE; goto done; } /* [dcl.meaning] - A declarator-id shall not be qualified exception of the + A declarator-id shall not be qualified exception of the definition of a ... nested class outside of its class ... [or] a the definition or explicit instantiation of a class member of a namespace outside of its namespace. */ @@ -13306,8 +13306,8 @@ cp_parser_member_declaration (cp_parser* parser) /* In this case: template <typename T> struct A { - friend struct A<T>::B; - }; + friend struct A<T>::B; + }; A<T>::B will be represented by a TYPENAME_TYPE, and therefore not recognized by check_tag_decl. */ @@ -14679,7 +14679,7 @@ cp_parser_maybe_treat_template_as_class (tree decl, bool tag_name_p) the translation from TEMPLATE_DECL to TYPE_DECL occurs: struct A { - template <typename T> struct B; + template <typename T> struct B; }; template <typename T> struct A::B {}; @@ -14689,7 +14689,7 @@ cp_parser_maybe_treat_template_as_class (tree decl, bool tag_name_p) namespace N { struct X{}; } struct A { - template <typename T> friend struct N::X; + template <typename T> friend struct N::X; }; However, if the DECL refers to a class type, and we are in @@ -14698,7 +14698,7 @@ cp_parser_maybe_treat_template_as_class (tree decl, bool tag_name_p) than a TEMPLATE_DECL. For example, in: template <class T> struct S { - S s; + S s; }; there is no need to handle such case. */ @@ -14786,7 +14786,7 @@ cp_parser_check_declarator_template_parameters (cp_parser* parser, static bool cp_parser_check_template_parameters (cp_parser* parser, - unsigned num_templates) + unsigned num_templates) { /* If there are more template classes than parameter lists, we have something like: @@ -15158,7 +15158,7 @@ cp_parser_template_declaration_after_export (cp_parser* parser, bool member_p) else { /* There are no access checks when parsing a template, as we do not - know if a specialization will be a friend. */ + know if a specialization will be a friend. */ push_deferring_access_checks (dk_no_check); decl = cp_parser_single_declaration (parser, @@ -15831,8 +15831,8 @@ cp_parser_friend_p (const cp_decl_specifier_seq *decl_specifiers) static cp_token * cp_parser_require (cp_parser* parser, - enum cpp_ttype type, - const char* token_desc) + enum cpp_ttype type, + const char* token_desc) { if (cp_lexer_next_token_is (parser->lexer, type)) return cp_lexer_consume_token (parser->lexer); @@ -15855,8 +15855,8 @@ cp_parser_require (cp_parser* parser, static void cp_parser_skip_until_found (cp_parser* parser, - enum cpp_ttype type, - const char* token_desc) + enum cpp_ttype type, + const char* token_desc) { cp_token *token; unsigned nesting_depth = 0; @@ -15903,8 +15903,8 @@ cp_parser_skip_until_found (cp_parser* parser, static cp_token * cp_parser_require_keyword (cp_parser* parser, - enum rid keyword, - const char* token_desc) + enum rid keyword, + const char* token_desc) { cp_token *token = cp_parser_require (parser, CPP_KEYWORD, token_desc); @@ -16669,7 +16669,7 @@ cp_parser_objc_protocol_qualifiers (cp_parser* parser) || node == ridpointers [(int) RID_OUT] || node == ridpointers [(int) RID_INOUT] || node == ridpointers [(int) RID_BYCOPY] - || node == ridpointers [(int) RID_BYREF] + || node == ridpointers [(int) RID_BYREF] || node == ridpointers [(int) RID_ONEWAY])) { quals = tree_cons (NULL_TREE, node, quals); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 8a8e1fc..f130859 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -350,7 +350,7 @@ push_inline_template_parms_recursive (tree parmlist, int levels) TEMPLATE_PARMS_FOR_INLINE (current_template_parms) = 1; begin_scope (TREE_VEC_LENGTH (parms) ? sk_template_parms : sk_template_spec, - NULL); + NULL); for (i = 0; i < TREE_VEC_LENGTH (parms); ++i) { tree parm = TREE_VALUE (TREE_VEC_ELT (parms, i)); @@ -542,7 +542,7 @@ begin_template_parm_list (void) e.g.: template <class T> struct S1 { - template <class T> struct S2 {}; + template <class T> struct S2 {}; }; pushtag contains special code to call pushdecl_with_scope on the @@ -1133,7 +1133,7 @@ register_specialization (tree spec, tree tmpl, tree args) with default function arguments. In particular, given something like this: - template <class T> void f(T t1, T t = T()) + template <class T> void f(T t1, T t = T()) the default argument expression is not substituted for in an instantiation unless and until it is actually needed. */ @@ -1315,8 +1315,8 @@ print_candidates (tree fns) static tree determine_specialization (tree template_id, - tree decl, - tree* targs_out, + tree decl, + tree* targs_out, int need_member_template, int template_count) { @@ -1518,7 +1518,7 @@ determine_specialization (tree template_id, the function template to which a function template specialization refers: - -- when an explicit specialization refers to a function + -- when an explicit specialization refers to a function template. So, we do use the partial ordering rules, at least for now. @@ -1539,7 +1539,7 @@ determine_specialization (tree template_id, if (templates == NULL_TREE && candidates == NULL_TREE) { cp_error_at ("template-id %qD for %q+D does not match any template " - "declaration", + "declaration", template_id, decl); return error_mark_node; } @@ -1644,16 +1644,16 @@ copy_default_args_to_explicit_spec (tree decl) if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)) { /* Remove the this pointer, but remember the object's type for - CV quals. */ + CV quals. */ object_type = TREE_TYPE (TREE_VALUE (spec_types)); spec_types = TREE_CHAIN (spec_types); tmpl_types = TREE_CHAIN (tmpl_types); if (DECL_HAS_IN_CHARGE_PARM_P (decl)) - { - /* DECL may contain more parameters than TMPL due to the extra - in-charge parameter in constructors and destructors. */ - in_charge = spec_types; + { + /* DECL may contain more parameters than TMPL due to the extra + in-charge parameter in constructors and destructors. */ + in_charge = spec_types; spec_types = TREE_CHAIN (spec_types); } if (DECL_HAS_VTT_PARM_P (decl)) @@ -1671,15 +1671,15 @@ copy_default_args_to_explicit_spec (tree decl) if (object_type) { if (vtt) - new_spec_types = hash_tree_cons (TREE_PURPOSE (vtt), - TREE_VALUE (vtt), - new_spec_types); + new_spec_types = hash_tree_cons (TREE_PURPOSE (vtt), + TREE_VALUE (vtt), + new_spec_types); if (in_charge) - /* Put the in-charge parameter back. */ - new_spec_types = hash_tree_cons (TREE_PURPOSE (in_charge), - TREE_VALUE (in_charge), - new_spec_types); + /* Put the in-charge parameter back. */ + new_spec_types = hash_tree_cons (TREE_PURPOSE (in_charge), + TREE_VALUE (in_charge), + new_spec_types); new_type = build_method_type_directly (object_type, TREE_TYPE (old_type), @@ -1734,9 +1734,9 @@ copy_default_args_to_explicit_spec (tree decl) tree check_explicit_specialization (tree declarator, - tree decl, - int template_count, - int flags) + tree decl, + int template_count, + int flags) { int have_def = flags & 2; int is_friend = flags & 4; @@ -1779,7 +1779,7 @@ check_explicit_specialization (tree declarator, template <class T> void f<int>(); */ error ("template-id %qD in declaration of primary template", - declarator); + declarator); return decl; } } @@ -1805,7 +1805,7 @@ check_explicit_specialization (tree declarator, case tsk_excessive_parms: case tsk_insufficient_parms: if (tsk == tsk_excessive_parms) - error ("too many template parameter lists in declaration of %qD", + error ("too many template parameter lists in declaration of %qD", decl); else if (template_header_count) error("too few template parameter lists in declaration of %qD", decl); @@ -1833,7 +1833,7 @@ check_explicit_specialization (tree declarator, "is not allowed", declarator); else error ("template-id %qD in declaration of primary template", - declarator); + declarator); return decl; } @@ -1843,7 +1843,7 @@ check_explicit_specialization (tree declarator, template <class T> struct S { template <class U> void f (U); - }; + }; template <> template <class U> void S<int>::f(U) {} That's a specialization -- but of the entire template. */ @@ -1884,11 +1884,11 @@ check_explicit_specialization (tree declarator, else { /* If there is no class context, the explicit instantiation - must be at namespace scope. */ + must be at namespace scope. */ gcc_assert (DECL_NAMESPACE_SCOPE_P (decl)); /* Find the namespace binding, using the declaration - context. */ + context. */ fns = namespace_binding (dname, CP_DECL_CONTEXT (decl)); if (!fns || !is_overloaded_fn (fns)) { @@ -1915,7 +1915,7 @@ check_explicit_specialization (tree declarator, /* It's not valid to write an explicit instantiation in class scope, e.g.: - class C { template void f(); } + class C { template void f(); } This case is caught by the parser. However, on something like: @@ -2211,10 +2211,10 @@ check_template_shadow (tree decl) static tree build_template_parm_index (int index, - int level, - int orig_level, - tree decl, - tree type) + int level, + int orig_level, + tree decl, + tree type) { tree t = make_node (TEMPLATE_PARM_INDEX); TEMPLATE_PARM_IDX (t) = index; @@ -2311,7 +2311,7 @@ process_template_parm (tree list, tree next, bool is_non_type) TREE_INVARIANT (parm) = 1; TREE_READONLY (parm) = 1; if (invalid_nontype_parm_type_p (TREE_TYPE (parm), 1)) - TREE_TYPE (parm) = void_type_node; + TREE_TYPE (parm) = void_type_node; decl = build_decl (CONST_DECL, DECL_NAME (parm), TREE_TYPE (parm)); TREE_CONSTANT (decl) = 1; TREE_INVARIANT (decl) = 1; @@ -2690,9 +2690,9 @@ process_partial_specialization (tree decl) && tpd.arg_uses_template_parms [j]) { error ("type %qT of template argument %qE depends " - "on template parameter(s)", - type, - arg); + "on template parameter(s)", + type, + arg); break; } } @@ -2787,7 +2787,7 @@ check_default_tmpl_args (tree decl, tree parms, int is_primary, int is_partial) if (TREE_CODE (decl) != TYPE_DECL || is_partial || !is_primary) /* For an ordinary class template, default template arguments are allowed at the innermost level, e.g.: - template <class T = int> + template <class T = int> struct S {}; but, in a partial specialization, they're not allowed even there, as we have in [temp.class.spec]: @@ -2817,8 +2817,8 @@ check_default_tmpl_args (tree decl, tree parms, int is_primary, int is_partial) examine the parameters to the class itself. On the one hand, they will be checked when the class is defined, and, on the other, default arguments are valid in things like: - template <class T = double> - struct S { template <class U> void f(U); }; + template <class T = double> + struct S { template <class U> void f(U); }; Here the default argument for `S' has no bearing on the declaration of `f'. */ last_level_to_check = template_class_depth (current_class_type) + 1; @@ -2943,7 +2943,7 @@ push_template_decl_real (tree decl, int is_friend) { /* [temp.mem] - A destructor shall not be a member template. */ + A destructor shall not be a member template. */ error ("destructor %qD declared as member template", decl); return error_mark_node; } @@ -2956,7 +2956,7 @@ push_template_decl_real (tree decl, int is_friend) { /* [basic.stc.dynamic.allocation] - An allocation function can be a function + An allocation function can be a function template. ... Template allocation functions shall have two or more parameters. */ error ("invalid template declaration of %qD", decl); @@ -3089,7 +3089,7 @@ push_template_decl_real (tree decl, int is_friend) if (TMPL_ARGS_DEPTH (args) != i) { error ("expected %d levels of template parms for %q#D, got %d", - i, decl, TMPL_ARGS_DEPTH (args)); + i, decl, TMPL_ARGS_DEPTH (args)); } else for (current = decl; i > 0; --i, parms = TREE_CHAIN (parms)) @@ -3101,15 +3101,15 @@ push_template_decl_real (tree decl, int is_friend) { if (current == decl) error ("got %d template parameters for %q#D", - TREE_VEC_LENGTH (a), decl); + TREE_VEC_LENGTH (a), decl); else error ("got %d template parameters for %q#T", - TREE_VEC_LENGTH (a), current); + TREE_VEC_LENGTH (a), current); error (" but %d required", TREE_VEC_LENGTH (t)); } /* Perhaps we should also check that the parms are used in the - appropriate qualifying scopes in the declarator? */ + appropriate qualifying scopes in the declarator? */ if (current == decl) current = ctx; @@ -3546,7 +3546,7 @@ convert_nontype_argument (tree type, tree expr) if (!real_lvalue_p (expr)) { error ("%qE is not a valid template argument for type %qT " - "because it is not a lvalue", expr, type); + "because it is not a lvalue", expr, type); return NULL_TREE; } @@ -3576,7 +3576,7 @@ convert_nontype_argument (tree type, tree expr) else if (TYPE_PTRFN_P (type)) { /* If the argument is a template-id, we might not have enough - context information to decay the pointer. + context information to decay the pointer. ??? Why static5.C requires decay and subst1.C works fine even without it? */ if (!type_unknown_p (expr_type)) @@ -3684,10 +3684,10 @@ convert_nontype_argument (tree type, tree expr) static int coerce_template_template_parms (tree parm_parms, - tree arg_parms, - tsubst_flags_t complain, + tree arg_parms, + tsubst_flags_t complain, tree in_decl, - tree outer_args) + tree outer_args) { int nparms, nargs, i; tree parm, arg; @@ -3710,11 +3710,11 @@ coerce_template_template_parms (tree parm_parms, arg = TREE_VALUE (TREE_VEC_ELT (arg_parms, i)); if (arg == NULL_TREE || arg == error_mark_node - || parm == NULL_TREE || parm == error_mark_node) + || parm == NULL_TREE || parm == error_mark_node) return 0; if (TREE_CODE (arg) != TREE_CODE (parm)) - return 0; + return 0; switch (TREE_CODE (parm)) { @@ -3766,11 +3766,11 @@ coerce_template_template_parms (tree parm_parms, static tree convert_template_argument (tree parm, - tree arg, - tree args, - tsubst_flags_t complain, - int i, - tree in_decl) + tree arg, + tree args, + tsubst_flags_t complain, + int i, + tree in_decl) { tree val; tree inner_args; @@ -3810,7 +3810,7 @@ convert_template_argument (tree parm, && TREE_CODE (TREE_OPERAND (arg, 0)) == TEMPLATE_TYPE_PARM) { pedwarn ("to refer to a type member of a template parameter, " - "use %<typename %E%>", arg); + "use %<typename %E%>", arg); arg = make_typename_type (TREE_OPERAND (arg, 0), TREE_OPERAND (arg, 1), @@ -3825,12 +3825,12 @@ convert_template_argument (tree parm, if (complain & tf_error) { error ("type/value mismatch at argument %d in template " - "parameter list for %qD", - i + 1, in_decl); + "parameter list for %qD", + i + 1, in_decl); if (is_type) error (" expected a constant of type %qT, got %qT", - TREE_TYPE (parm), - (is_tmpl_type ? DECL_NAME (arg) : arg)); + TREE_TYPE (parm), + (is_tmpl_type ? DECL_NAME (arg) : arg)); else if (requires_tmpl_type) error (" expected a class template, got %qE", arg); else @@ -3844,8 +3844,8 @@ convert_template_argument (tree parm, if (in_decl && (complain & tf_error)) { error ("type/value mismatch at argument %d in template " - "parameter list for %qD", - i + 1, in_decl); + "parameter list for %qD", + i + 1, in_decl); if (is_tmpl_type) error (" expected a type, got %qT", DECL_NAME (arg)); else @@ -3884,10 +3884,10 @@ convert_template_argument (tree parm, if (in_decl && (complain & tf_error)) { error ("type/value mismatch at argument %d in " - "template parameter list for %qD", - i + 1, in_decl); + "template parameter list for %qD", + i + 1, in_decl); error (" expected a template of type %qD, got %qD", - parm, arg); + parm, arg); } val = error_mark_node; @@ -3902,7 +3902,7 @@ convert_template_argument (tree parm, tree t = tsubst (TREE_TYPE (parm), args, complain, in_decl); if (invalid_nontype_parm_type_p (t, complain)) - return error_mark_node; + return error_mark_node; if (!uses_template_parms (arg) && !uses_template_parms (t)) /* We used to call digest_init here. However, digest_init @@ -3940,8 +3940,8 @@ convert_template_argument (tree parm, static tree coerce_template_parms (tree parms, - tree args, - tree in_decl, + tree args, + tree in_decl, tsubst_flags_t complain, int require_all_arguments) { @@ -3962,7 +3962,7 @@ coerce_template_parms (tree parms, if (complain & tf_error) { error ("wrong number of template arguments (%d, should be %d)", - nargs, nparms); + nargs, nparms); if (in_decl) cp_error_at ("provided for %qD", in_decl); @@ -4097,12 +4097,12 @@ mangle_class_name_for_template (const char* name, tree parms, tree arglist) { /* Already substituted with real template. Just output the template name here */ - tree context = DECL_CONTEXT (arg); - if (context) - { - /* The template may be defined in a namespace, or - may be a member template. */ - gcc_assert (TREE_CODE (context) == NAMESPACE_DECL + tree context = DECL_CONTEXT (arg); + if (context) + { + /* The template may be defined in a namespace, or + may be a member template. */ + gcc_assert (TREE_CODE (context) == NAMESPACE_DECL || CLASS_TYPE_P (context)); cat (decl_as_string (DECL_CONTEXT (arg), TFF_PLAIN_IDENTIFIER)); @@ -4277,11 +4277,11 @@ maybe_get_template_decl_from_type_decl (tree decl) tree lookup_template_class (tree d1, - tree arglist, - tree in_decl, - tree context, - int entering_scope, - tsubst_flags_t complain) + tree arglist, + tree in_decl, + tree context, + int entering_scope, + tsubst_flags_t complain) { tree template = NULL_TREE, parmlist; tree t; @@ -4338,20 +4338,20 @@ lookup_template_class (tree d1, if (! template) { if (complain & tf_error) - error ("%qT is not a template", d1); + error ("%qT is not a template", d1); POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); } if (TREE_CODE (template) != TEMPLATE_DECL - /* Make sure it's a user visible template, if it was named by + /* Make sure it's a user visible template, if it was named by the user. */ || ((complain & tf_user) && !DECL_TEMPLATE_PARM_P (template) && !PRIMARY_TEMPLATE_P (template))) { if (complain & tf_error) - { - error ("non-template type %qT used as a template", d1); - if (in_decl) + { + error ("non-template type %qT used as a template", d1); + if (in_decl) cp_error_at ("for template declaration %qD", in_decl); } POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); @@ -4362,7 +4362,7 @@ lookup_template_class (tree d1, if (DECL_TEMPLATE_TEMPLATE_PARM_P (template)) { /* Create a new TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM node to store - template arguments */ + template arguments */ tree parm; tree arglist2; @@ -4389,11 +4389,11 @@ lookup_template_class (tree d1, arglist = add_to_template_args (current_template_args (), arglist); arglist2 = coerce_template_parms (parmlist, arglist, template, - complain, /*require_all_args=*/1); + complain, /*require_all_args=*/1); if (arglist2 == error_mark_node || (!uses_template_parms (arglist2) && check_instantiated_args (template, arglist2, complain))) - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); parm = bind_template_template_parm (TREE_TYPE (template), arglist2); POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, parm); @@ -4419,9 +4419,9 @@ lookup_template_class (tree d1, For example, given: template <class T> struct S1 { - template <class U> struct S2 {}; + template <class U> struct S2 {}; template <class U> struct S2<U*> {}; - }; + }; we will be called with an ARGLIST of `U*', but the TEMPLATE will be `template <class T> template @@ -4458,7 +4458,7 @@ lookup_template_class (tree d1, { tree a = coerce_template_parms (TREE_VALUE (t), arglist, template, - complain, /*require_all_args=*/1); + complain, /*require_all_args=*/1); /* Don't process further if one of the levels fails. */ if (a == error_mark_node) @@ -4487,7 +4487,7 @@ lookup_template_class (tree d1, = coerce_template_parms (INNERMOST_TEMPLATE_PARMS (parmlist), INNERMOST_TEMPLATE_ARGS (arglist), template, - complain, /*require_all_args=*/1); + complain, /*require_all_args=*/1); if (arglist == error_mark_node) /* We were unable to bind the arguments. */ @@ -4525,7 +4525,7 @@ lookup_template_class (tree d1, } } if (found) - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, found); + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, found); /* If we already have this specialization, return it. */ found = retrieve_specialization (template, arglist, @@ -4660,18 +4660,18 @@ lookup_template_class (tree d1, if (!found) { /* There was no partial instantiation. This happens - where C<T> is a member template of A<T> and it's used - in something like + where C<T> is a member template of A<T> and it's used + in something like - template <typename T> struct B { A<T>::C<int> m; }; - B<float>; + template <typename T> struct B { A<T>::C<int> m; }; + B<float>; - Create the partial instantiation. - */ - TREE_VEC_LENGTH (arglist)--; - found = tsubst (template, arglist, complain, NULL_TREE); - TREE_VEC_LENGTH (arglist)++; - } + Create the partial instantiation. + */ + TREE_VEC_LENGTH (arglist)--; + found = tsubst (template, arglist, complain, NULL_TREE); + TREE_VEC_LENGTH (arglist)++; + } } SET_TYPE_TEMPLATE_INFO (t, tree_cons (found, arglist, NULL_TREE)); @@ -4989,13 +4989,13 @@ push_tinst_level (tree d) { /* If the instantiation in question still has unbound template parms, we don't really care if we can't instantiate it, so just return. - This happens with base instantiation for implicit `typename'. */ + This happens with base instantiation for implicit `typename'. */ if (uses_template_parms (d)) return 0; last_template_error_tick = tinst_level_tick; error ("template instantiation depth exceeds maximum of %d (use " - "-ftemplate-depth-NN to increase the maximum) instantiating %qD", + "-ftemplate-depth-NN to increase the maximum) instantiating %qD", max_tinst_depth, d); print_instantiation_context (); @@ -5082,14 +5082,14 @@ tsubst_friend_function (tree decl, tree args) tree ns = decl_namespace_context (TYPE_MAIN_DECL (current_class_type)); /* Friend functions are looked up in the containing namespace scope. - We must enter that scope, to avoid finding member functions of the - current cless with same name. */ + We must enter that scope, to avoid finding member functions of the + current cless with same name. */ push_nested_namespace (ns); fns = tsubst_expr (DECL_TI_TEMPLATE (decl), args, - tf_error | tf_warning, NULL_TREE); + tf_error | tf_warning, NULL_TREE); pop_nested_namespace (ns); arglist = tsubst (DECL_TI_ARGS (decl), args, - tf_error | tf_warning, NULL_TREE); + tf_error | tf_warning, NULL_TREE); template_id = lookup_template_function (fns, arglist); new_friend = tsubst (decl, args, tf_error | tf_warning, NULL_TREE); @@ -5198,8 +5198,8 @@ tsubst_friend_function (tree decl, tree args) friend void f(int); template <class T> class C { - friend void f(T) {} - }; + friend void f(T) {} + }; when `C<int>' is instantiated. Now, `f(int)' is defined in the class. */ @@ -5367,7 +5367,7 @@ tsubst_friend_class (tree friend_tmpl, tree args) tmpl = tsubst (friend_tmpl, args, tf_error | tf_warning, NULL_TREE); /* The new TMPL is not an instantiation of anything, so we - forget its origins. We don't reset CLASSTYPE_TI_TEMPLATE for + forget its origins. We don't reset CLASSTYPE_TI_TEMPLATE for the new type because that is supposed to be the corresponding template decl, i.e., TMPL. */ DECL_USE_TEMPLATE (tmpl) = 0; @@ -5711,7 +5711,7 @@ instantiate_class_template (tree type) if (!COMPLETE_TYPE_P (rtype)) { cxx_incomplete_type_error (r, rtype); - r = error_mark_node; + r = error_mark_node; } } @@ -5726,7 +5726,7 @@ instantiate_class_template (tree type) set_current_access_from_decl (r); finish_member_declaration (r); } - } + } } } else @@ -5742,7 +5742,7 @@ instantiate_class_template (tree type) { /* template <class T> friend class C; */ friend_type = tsubst_friend_class (friend_type, args); - adjust_processing_template_decl = true; + adjust_processing_template_decl = true; } else if (TREE_CODE (friend_type) == UNBOUND_CLASS_TEMPLATE) { @@ -5751,7 +5751,7 @@ instantiate_class_template (tree type) tf_error | tf_warning, NULL_TREE); if (TREE_CODE (friend_type) == TEMPLATE_DECL) friend_type = TREE_TYPE (friend_type); - adjust_processing_template_decl = true; + adjust_processing_template_decl = true; } else if (TREE_CODE (friend_type) == TYPENAME_TYPE) { @@ -5803,7 +5803,7 @@ instantiate_class_template (tree type) friend class C<int>; - We don't have to do anything in these cases. */ + We don't have to do anything in these cases. */ if (adjust_processing_template_decl) /* Trick make_friend_class into realizing that the friend @@ -5814,7 +5814,7 @@ instantiate_class_template (tree type) ++processing_template_decl; if (friend_type != error_mark_node) - make_friend_class (type, friend_type, /*complain=*/false); + make_friend_class (type, friend_type, /*complain=*/false); if (adjust_processing_template_decl) --processing_template_decl; @@ -6016,10 +6016,10 @@ tsubst_template_parms (tree parms, tree args, tsubst_flags_t complain) static tree tsubst_aggr_type (tree t, - tree args, - tsubst_flags_t complain, - tree in_decl, - int entering_scope) + tree args, + tsubst_flags_t complain, + tree in_decl, + int entering_scope) { if (t == NULL_TREE) return NULL_TREE; @@ -6060,7 +6060,7 @@ tsubst_aggr_type (tree t, if (argvec == error_mark_node) return error_mark_node; - r = lookup_template_class (t, argvec, in_decl, context, + r = lookup_template_class (t, argvec, in_decl, context, entering_scope, complain); return cp_build_qualified_type_real (r, TYPE_QUALS (t), complain); @@ -6332,7 +6332,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) there was a specialization of a member template, like this: - template <class T> struct S { template <class U> void f(); } + template <class T> struct S { template <class U> void f(); } template <> template <class U> void S<int>::f(U); Here, we'll be substituting into the specialization, @@ -6371,7 +6371,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) { /* This special case arises when we have something like this: - template <class T> struct S { + template <class T> struct S { friend void f<int>(int, double); }; @@ -6402,9 +6402,9 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) return error_mark_node; /* We do NOT check for matching decls pushed separately at this - point, as they may not represent instantiations of this - template, and in any case are considered separate under the - discrete model. */ + point, as they may not represent instantiations of this + template, and in any case are considered separate under the + discrete model. */ r = copy_decl (t); DECL_USE_TEMPLATE (r) = 0; TREE_TYPE (r) = type; @@ -6458,8 +6458,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) until they are called, for a template. But, for a declaration like: - template <class T> void f () - { extern void g(int i = T()); } + template <class T> void f () + { extern void g(int i = T()); } we should do the substitution when the template is instantiated. We handle the member function case in @@ -6702,9 +6702,9 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) static tree tsubst_arg_types (tree arg_types, - tree args, - tsubst_flags_t complain, - tree in_decl) + tree args, + tsubst_flags_t complain, + tree in_decl) { tree remaining_arg_types; tree type; @@ -6725,11 +6725,11 @@ tsubst_arg_types (tree arg_types, if (VOID_TYPE_P (type)) { if (complain & tf_error) - { - error ("invalid parameter type %qT", type); - if (in_decl) - cp_error_at ("in declaration %qD", in_decl); - } + { + error ("invalid parameter type %qT", type); + if (in_decl) + cp_error_at ("in declaration %qD", in_decl); + } return error_mark_node; } @@ -6745,9 +6745,9 @@ tsubst_arg_types (tree arg_types, if (default_arg && TREE_CODE (default_arg) == DEFAULT_ARG) { /* We've instantiated a template before its default arguments - have been parsed. This can happen for a nested template - class, and is not an error unless we require the default - argument in a call of this function. */ + have been parsed. This can happen for a nested template + class, and is not an error unless we require the default + argument in a call of this function. */ result = tree_cons (default_arg, type, remaining_arg_types); VEC_safe_push (tree, gc, DEFARG_INSTANTIATIONS (default_arg), result); } @@ -6776,9 +6776,9 @@ tsubst_arg_types (tree arg_types, static tree tsubst_function_type (tree t, - tree args, - tsubst_flags_t complain, - tree in_decl) + tree args, + tsubst_flags_t complain, + tree in_decl) { tree return_type; tree arg_types; @@ -6881,9 +6881,9 @@ tsubst_exception_specification (tree fntype, static tree tsubst_call_declarator_parms (tree parms, - tree args, - tsubst_flags_t complain, - tree in_decl) + tree args, + tsubst_flags_t complain, + tree in_decl) { tree new_parms; tree type; @@ -7108,8 +7108,8 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) if (cp_type_quals (t)) { r = tsubst (TYPE_MAIN_VARIANT (t), args, complain, in_decl); - r = cp_build_qualified_type_real - (r, cp_type_quals (t), + r = cp_build_qualified_type_real + (r, cp_type_quals (t), complain | (TREE_CODE (t) == TEMPLATE_TYPE_PARM ? tf_ignore_bad_quals : 0)); } @@ -7232,8 +7232,8 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) error ("forming reference to void"); else error ("forming %s to reference type %qT", - (code == POINTER_TYPE) ? "pointer" : "reference", - type); + (code == POINTER_TYPE) ? "pointer" : "reference", + type); last_loc = input_location; } @@ -7266,7 +7266,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) reasons: -- Attempting to create "pointer to member of T" when T - is not a class type. */ + is not a class type. */ if (complain & tf_error) error ("creating pointer to member of non-class type %qT", r); return error_mark_node; @@ -7286,18 +7286,18 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) gcc_assert (TREE_CODE (type) != METHOD_TYPE); if (TREE_CODE (type) == FUNCTION_TYPE) { - /* The type of the implicit object parameter gets its - cv-qualifiers from the FUNCTION_TYPE. */ + /* The type of the implicit object parameter gets its + cv-qualifiers from the FUNCTION_TYPE. */ tree method_type; - tree this_type = cp_build_qualified_type (TYPE_MAIN_VARIANT (r), - cp_type_quals (type)); - tree memptr; - method_type = build_method_type_directly (this_type, + tree this_type = cp_build_qualified_type (TYPE_MAIN_VARIANT (r), + cp_type_quals (type)); + tree memptr; + method_type = build_method_type_directly (this_type, TREE_TYPE (type), TYPE_ARG_TYPES (type)); - memptr = build_ptrmemfunc_type (build_pointer_type (method_type)); - return cp_build_qualified_type_real (memptr, cp_type_quals (t), - complain); + memptr = build_ptrmemfunc_type (build_pointer_type (method_type)); + return cp_build_qualified_type_real (memptr, cp_type_quals (t), + complain); } else return cp_build_qualified_type_real (build_ptrmem_type (r, type), @@ -7403,7 +7403,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) /* Normally, make_typename_type does not require that the CTX have complete type in order to allow things like: - template <class T> struct S { typename S<T>::X Y; }; + template <class T> struct S { typename S<T>::X Y; }; But, such constructs have already been resolved by this point, so here CTX really should have complete type, unless @@ -7421,11 +7421,11 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) (complain & tf_error) | tf_keep_type_decl); if (f == error_mark_node) return f; - if (TREE_CODE (f) == TYPE_DECL) - { + if (TREE_CODE (f) == TYPE_DECL) + { complain |= tf_ignore_bad_quals; - f = TREE_TYPE (f); - } + f = TREE_TYPE (f); + } if (TREE_CODE (f) != TYPENAME_TYPE) { @@ -7437,8 +7437,8 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) t, f); } - return cp_build_qualified_type_real - (f, cp_type_quals (f) | cp_type_quals (t), complain); + return cp_build_qualified_type_real + (f, cp_type_quals (f) | cp_type_quals (t), complain); } case UNBOUND_CLASS_TEMPLATE: @@ -7775,7 +7775,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) template <template <class> class TT> struct C {}; template <class T> struct D { template <class U> struct E {}; - C<E> c; // #1 + C<E> c; // #1 }; D<int> d; // #2 @@ -7942,7 +7942,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) case TEMPLATE_ID_EXPR: { - /* Substituted template arguments */ + /* Substituted template arguments */ tree fn = TREE_OPERAND (t, 0); tree targs = TREE_OPERAND (t, 1); @@ -8108,15 +8108,15 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl) decl = tsubst (decl, args, complain, in_decl); if (decl != error_mark_node) { - if (init) - DECL_INITIAL (decl) = error_mark_node; - /* By marking the declaration as instantiated, we avoid - trying to instantiate it. Since instantiate_decl can't - handle local variables, and since we've already done - all that needs to be done, that's the right thing to - do. */ - if (TREE_CODE (decl) == VAR_DECL) - DECL_TEMPLATE_INSTANTIATED (decl) = 1; + if (init) + DECL_INITIAL (decl) = error_mark_node; + /* By marking the declaration as instantiated, we avoid + trying to instantiate it. Since instantiate_decl can't + handle local variables, and since we've already done + all that needs to be done, that's the right thing to + do. */ + if (TREE_CODE (decl) == VAR_DECL) + DECL_TEMPLATE_INSTANTIATED (decl) = 1; if (TREE_CODE (decl) == VAR_DECL && ANON_AGGR_TYPE_P (TREE_TYPE (decl))) /* Anonymous aggregates are a special case. */ @@ -8349,9 +8349,9 @@ tsubst_non_call_postfix_expression (tree t, tree args, tree tsubst_copy_and_build (tree t, - tree args, - tsubst_flags_t complain, - tree in_decl, + tree args, + tsubst_flags_t complain, + tree in_decl, bool function_p) { #define RECUR(NODE) \ @@ -9101,10 +9101,10 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain) int fn_type_unification (tree fn, - tree explicit_targs, - tree targs, - tree args, - tree return_type, + tree explicit_targs, + tree targs, + tree args, + tree return_type, unification_kind_t strict) { tree parms; @@ -9148,11 +9148,11 @@ fn_type_unification (tree fn, return 1; /* Substitute the explicit args into the function type. This is - necessary so that, for instance, explicitly declared function - arguments can match null pointed constants. If we were given - an incomplete set of explicit args, we must not do semantic - processing during substitution as we could create partial - instantiations. */ + necessary so that, for instance, explicitly declared function + arguments can match null pointed constants. If we were given + an incomplete set of explicit args, we must not do semantic + processing during substitution as we could create partial + instantiations. */ incomplete = NUM_TMPL_ARGS (explicit_targs) != NUM_TMPL_ARGS (targs); processing_template_decl += incomplete; fntype = tsubst (fntype, converted_args, tf_none, NULL_TREE); @@ -9212,8 +9212,8 @@ fn_type_unification (tree fn, static int maybe_adjust_types_for_deduction (unification_kind_t strict, - tree* parm, - tree* arg) + tree* parm, + tree* arg) { int result = 0; @@ -9296,12 +9296,12 @@ maybe_adjust_types_for_deduction (unification_kind_t strict, static int type_unification_real (tree tparms, - tree targs, - tree xparms, - tree xargs, - int subr, + tree targs, + tree xparms, + tree xargs, + int subr, unification_kind_t strict, - int allow_incomplete) + int allow_incomplete) { tree parm, arg; int i; @@ -9319,7 +9319,7 @@ type_unification_real (tree tparms, { case DEDUCE_CALL: sub_strict = (UNIFY_ALLOW_OUTER_LEVEL | UNIFY_ALLOW_MORE_CV_QUAL - | UNIFY_ALLOW_DERIVED); + | UNIFY_ALLOW_DERIVED); break; case DEDUCE_CONV: @@ -9403,13 +9403,13 @@ type_unification_real (tree tparms, } { - int arg_strict = sub_strict; + int arg_strict = sub_strict; - if (!subr) + if (!subr) arg_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg); - if (unify (tparms, targs, parm, arg, arg_strict)) - return 1; + if (unify (tparms, targs, parm, arg, arg_strict)) + return 1; } } @@ -9452,10 +9452,10 @@ type_unification_real (tree tparms, static int resolve_overloaded_unification (tree tparms, - tree targs, - tree parm, - tree arg, - unification_kind_t strict, + tree targs, + tree parm, + tree arg, + unification_kind_t strict, int sub_strict) { tree tempargs = copy_node (targs); @@ -9551,11 +9551,11 @@ resolve_overloaded_unification (tree tparms, static int try_one_overload (tree tparms, - tree orig_targs, - tree targs, - tree parm, - tree arg, - unification_kind_t strict, + tree orig_targs, + tree targs, + tree parm, + tree arg, + unification_kind_t strict, int sub_strict, bool addr_p) { @@ -9640,7 +9640,7 @@ static int verify_class_unification (tree targs, tree parms, tree args) { parms = tsubst (parms, add_outermost_template_args (args, targs), - tf_none, NULL_TREE); + tf_none, NULL_TREE); if (parms == error_mark_node) return 1; @@ -9680,10 +9680,10 @@ try_class_unification (tree tparms, tree targs, tree parm, tree arg) void f(S<I, J, K>, S<I, I, I>); void g() { - S<0, 0, 0> s0; - S<0, 1, 2> s2; + S<0, 0, 0> s0; + S<0, 1, 2> s2; - f(s0, s2); + f(s0, s2); } Now, by the time we consider the unification involving `s2', we @@ -9782,11 +9782,11 @@ check_cv_quals_for_unify (int strict, tree arg, tree parm) && !(strict & UNIFY_ALLOW_OUTER_MORE_CV_QUAL)) { /* Although a CVR qualifier is ignored when being applied to a - substituted template parameter ([8.3.2]/1 for example), that - does not apply during deduction [14.8.2.4]/1, (even though - that is not explicitly mentioned, [14.8.2.4]/9 indicates - this). Except when we're allowing additional CV qualifiers - at the outer level [14.8.2.1]/3,1st bullet. */ + substituted template parameter ([8.3.2]/1 for example), that + does not apply during deduction [14.8.2.4]/1, (even though + that is not explicitly mentioned, [14.8.2.4]/9 indicates + this). Except when we're allowing additional CV qualifiers + at the outer level [14.8.2.1]/3,1st bullet. */ if ((TREE_CODE (arg) == REFERENCE_TYPE || TREE_CODE (arg) == FUNCTION_TYPE || TREE_CODE (arg) == METHOD_TYPE) @@ -9875,8 +9875,8 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) if (TREE_CODE (arg) == TREE_CODE (parm) && TYPE_P (arg) /* It is the elements of the array which hold the cv quals of an array - type, and the elements might be template type parms. We'll check - when we recurse. */ + type, and the elements might be template type parms. We'll check + when we recurse. */ && TREE_CODE (arg) != ARRAY_TYPE /* We check the cv-qualifiers when unifying with template type parameters below. We want to allow ARG `const T' to unify with @@ -9950,7 +9950,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) class vector. */ if (coerce_template_parms (argtmplvec, parmvec, parmtmpl, 0, 1) - == error_mark_node) + == error_mark_node) return 1; /* Deduce arguments T, i from TT<T> or TT<i>. @@ -9960,7 +9960,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) for (i = 0; i < TREE_VEC_LENGTH (parmvec); ++i) { - if (unify (tparms, targs, + if (unify (tparms, targs, TREE_VEC_ELT (parmvec, i), TREE_VEC_ELT (argvec, i), UNIFY_ALLOW_NONE)) @@ -10070,23 +10070,23 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) case PTRMEM_CST: { - /* A pointer-to-member constant can be unified only with - another constant. */ + /* A pointer-to-member constant can be unified only with + another constant. */ if (TREE_CODE (arg) != PTRMEM_CST) - return 1; + return 1; /* Just unify the class member. It would be useless (and possibly - wrong, depending on the strict flags) to unify also - PTRMEM_CST_CLASS, because we want to be sure that both parm and - arg refer to the same variable, even if through different - classes. For instance: + wrong, depending on the strict flags) to unify also + PTRMEM_CST_CLASS, because we want to be sure that both parm and + arg refer to the same variable, even if through different + classes. For instance: - struct A { int x; }; - struct B : A { }; + struct A { int x; }; + struct B : A { }; - Unification of &A::x and &B::x must succeed. */ + Unification of &A::x and &B::x must succeed. */ return unify (tparms, targs, PTRMEM_CST_MEMBER (parm), - PTRMEM_CST_MEMBER (arg), strict); + PTRMEM_CST_MEMBER (arg), strict); } case POINTER_TYPE: @@ -10269,35 +10269,35 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) case OFFSET_TYPE: /* Unify a pointer to member with a pointer to member function, which - deduces the type of the member as a function type. */ + deduces the type of the member as a function type. */ if (TYPE_PTRMEMFUNC_P (arg)) - { - tree method_type; - tree fntype; - cp_cv_quals cv_quals; - - /* Check top-level cv qualifiers */ - if (!check_cv_quals_for_unify (UNIFY_ALLOW_NONE, arg, parm)) - return 1; - - if (unify (tparms, targs, TYPE_OFFSET_BASETYPE (parm), - TYPE_PTRMEMFUNC_OBJECT_TYPE (arg), UNIFY_ALLOW_NONE)) - return 1; - - /* Determine the type of the function we are unifying against. */ - method_type = TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (arg)); - fntype = - build_function_type (TREE_TYPE (method_type), - TREE_CHAIN (TYPE_ARG_TYPES (method_type))); - - /* Extract the cv-qualifiers of the member function from the - implicit object parameter and place them on the function - type to be restored later. */ - cv_quals = - cp_type_quals(TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (method_type)))); - fntype = build_qualified_type (fntype, cv_quals); - return unify (tparms, targs, TREE_TYPE (parm), fntype, strict); - } + { + tree method_type; + tree fntype; + cp_cv_quals cv_quals; + + /* Check top-level cv qualifiers */ + if (!check_cv_quals_for_unify (UNIFY_ALLOW_NONE, arg, parm)) + return 1; + + if (unify (tparms, targs, TYPE_OFFSET_BASETYPE (parm), + TYPE_PTRMEMFUNC_OBJECT_TYPE (arg), UNIFY_ALLOW_NONE)) + return 1; + + /* Determine the type of the function we are unifying against. */ + method_type = TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (arg)); + fntype = + build_function_type (TREE_TYPE (method_type), + TREE_CHAIN (TYPE_ARG_TYPES (method_type))); + + /* Extract the cv-qualifiers of the member function from the + implicit object parameter and place them on the function + type to be restored later. */ + cv_quals = + cp_type_quals(TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (method_type)))); + fntype = build_qualified_type (fntype, cv_quals); + return unify (tparms, targs, TREE_TYPE (parm), fntype, strict); + } if (TREE_CODE (arg) != OFFSET_TYPE) return 1; @@ -10649,7 +10649,7 @@ get_bindings (tree fn, tree decl, tree explicit_args, bool check_rettype) if (fn_type_unification (fn, explicit_args, targs, decl_arg_types, (check_rettype || DECL_CONV_FN_P (fn) - ? TREE_TYPE (decl_type) : NULL_TREE), + ? TREE_TYPE (decl_type) : NULL_TREE), DEDUCE_EXACT)) return NULL_TREE; @@ -10678,7 +10678,7 @@ get_class_bindings (tree tparms, tree parms, tree args) tree vec = make_tree_vec (ntparms); if (unify (tparms, vec, parms, INNERMOST_TEMPLATE_ARGS (args), - UNIFY_ALLOW_NONE)) + UNIFY_ALLOW_NONE)) return NULL_TREE; for (i = 0; i < ntparms; ++i) @@ -10988,7 +10988,7 @@ do_decl_instantiation (tree decl, tree storage) { if (pedantic && !in_system_header) pedwarn ("ISO C++ forbids the use of %<extern%> on explicit " - "instantiations"); + "instantiations"); extern_p = 1; } else @@ -11064,7 +11064,7 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain) { if (complain & tf_error) error ("explicit instantiation of %q#T before definition of template", - t); + t); return; } @@ -11072,7 +11072,7 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain) { if (pedantic && !in_system_header) pedwarn("ISO C++ forbids the use of %qE on explicit instantiations", - storage); + storage); if (storage == ridpointers[(int) RID_INLINE]) nomem_p = 1; @@ -11083,7 +11083,7 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain) else { error ("storage class %qD applied to template instantiation", - storage); + storage); extern_p = 0; } } @@ -11109,7 +11109,7 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain) No program shall explicitly instantiate any template more than once. - If PREVIOUS_INSTANTIATION_EXTERN_P, then the first explicit + If PREVIOUS_INSTANTIATION_EXTERN_P, then the first explicit instantiation was `extern'. If EXTERN_P then the second is. These cases are OK. */ previous_instantiation_extern_p = CLASSTYPE_INTERFACE_ONLY (t); @@ -11135,7 +11135,7 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain) declarations, and not the definitions, of members are instantiated, we have here: - [temp.explicit] + [temp.explicit] The explicit instantiation of a class template specialization implies the instantiation of all of its members not @@ -11160,7 +11160,7 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain) if (CLASSTYPE_NESTED_UTDS (t)) binding_table_foreach (CLASSTYPE_NESTED_UTDS (t), - bt_instantiate_type_proc, &storage); + bt_instantiate_type_proc, &storage); } } @@ -11279,9 +11279,9 @@ template_for_substitution (tree decl) for the instantiation. This is not always the most general template. Consider, for example: - template <class T> + template <class T> struct S { template <class U> void f(); - template <> void f<int>(); }; + template <> void f<int>(); }; and an instantiation of S<double>::f<int>. We want TD to be the specialization S<T>::f<int>, not the more general S<T>::f<U>. */ @@ -11926,12 +11926,12 @@ dependent_type_p_r (tree type) || TREE_CODE (type) == TEMPLATE_TEMPLATE_PARM) return true; /* -- a qualified-id with a nested-name-specifier which contains a - class-name that names a dependent type or whose unqualified-id + class-name that names a dependent type or whose unqualified-id names a dependent type. */ if (TREE_CODE (type) == TYPENAME_TYPE) return true; /* -- a cv-qualified type where the cv-unqualified type is - dependent. */ + dependent. */ type = TYPE_MAIN_VARIANT (type); /* -- a compound type constructed from any dependent type. */ if (TYPE_PTR_TO_MEMBER_P (type)) @@ -11956,7 +11956,7 @@ dependent_type_p_r (tree type) return false; } /* -- an array type constructed from any dependent type or whose - size is specified by a constant expression that is + size is specified by a constant expression that is value-dependent. */ if (TREE_CODE (type) == ARRAY_TYPE) { @@ -11991,7 +11991,7 @@ dependent_type_p_r (tree type) considered dependent too. For example: template <int I> void f() { - enum E { a = I }; + enum E { a = I }; S<sizeof (E)> s; } @@ -12103,7 +12103,7 @@ value_dependent_expression_p (tree expression) case VAR_DECL: /* A constant with integral or enumeration type and is initialized - with an expression that is value-dependent. */ + with an expression that is value-dependent. */ if (DECL_INITIAL (expression) && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (expression)) && value_dependent_expression_p (DECL_INITIAL (expression))) @@ -12116,8 +12116,8 @@ value_dependent_expression_p (tree expression) case REINTERPRET_CAST_EXPR: case CAST_EXPR: /* These expressions are value-dependent if the type to which - the cast occurs is dependent or the expression being casted - is value-dependent. */ + the cast occurs is dependent or the expression being casted + is value-dependent. */ { tree type = TREE_TYPE (expression); @@ -12150,7 +12150,7 @@ value_dependent_expression_p (tree expression) case SIZEOF_EXPR: case ALIGNOF_EXPR: /* A `sizeof' expression is value-dependent if the operand is - type-dependent. */ + type-dependent. */ expression = TREE_OPERAND (expression, 0); if (TYPE_P (expression)) return dependent_type_p (expression); @@ -12165,11 +12165,11 @@ value_dependent_expression_p (tree expression) case CALL_EXPR: /* A CALL_EXPR is value-dependent if any argument is - value-dependent. Why do we have to handle CALL_EXPRs in this - function at all? First, some function calls, those for which - value_dependent_expression_p is true, man appear in constant - expressions. Second, there appear to be bugs which result in - other CALL_EXPRs reaching this point. */ + value-dependent. Why do we have to handle CALL_EXPRs in this + function at all? First, some function calls, those for which + value_dependent_expression_p is true, man appear in constant + expressions. Second, there appear to be bugs which result in + other CALL_EXPRs reaching this point. */ { tree function = TREE_OPERAND (expression, 0); tree args = TREE_OPERAND (expression, 1); @@ -12193,7 +12193,7 @@ value_dependent_expression_p (tree expression) default: /* A constant expression is value-dependent if any subexpression is - value-dependent. */ + value-dependent. */ switch (TREE_CODE_CLASS (TREE_CODE (expression))) { case tcc_reference: diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 7aa8a1e..ad8b94d 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -320,7 +320,7 @@ get_tinfo_decl (tree type) && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) { error ("cannot create type information for type %qT because " - "its size is variable", + "its size is variable", type); return error_mark_node; } @@ -420,7 +420,7 @@ ifnonnull (tree test, tree result) { return build3 (COND_EXPR, TREE_TYPE (result), build2 (EQ_EXPR, boolean_type_node, test, - cp_convert (TREE_TYPE (test), integer_zero_node)), + cp_convert (TREE_TYPE (test), integer_zero_node)), cp_convert (TREE_TYPE (result), integer_zero_node), result); } @@ -557,21 +557,21 @@ build_dynamic_cast_1 (tree type, tree expr) else { tree retval; - tree result, td2, td3, elems; - tree static_type, target_type, boff; + tree result, td2, td3, elems; + tree static_type, target_type, boff; - /* If we got here, we can't convert statically. Therefore, + /* If we got here, we can't convert statically. Therefore, dynamic_cast<D&>(b) (b an object) cannot succeed. */ if (tc == REFERENCE_TYPE) { if (TREE_CODE (old_expr) == VAR_DECL && TREE_CODE (TREE_TYPE (old_expr)) == RECORD_TYPE) { - tree expr = throw_bad_cast (); + tree expr = throw_bad_cast (); warning (0, "dynamic_cast of %q#D to %q#T can never succeed", - old_expr, type); - /* Bash it to the expected type. */ - TREE_TYPE (expr) = type; + old_expr, type); + /* Bash it to the expected type. */ + TREE_TYPE (expr) = type; return expr; } } @@ -583,7 +583,7 @@ build_dynamic_cast_1 (tree type, tree expr) && TREE_CODE (TREE_TYPE (op)) == RECORD_TYPE) { warning (0, "dynamic_cast of %q#D to %q#T can never succeed", - op, type); + op, type); retval = build_int_cst (type, 0); return retval; } @@ -598,8 +598,8 @@ build_dynamic_cast_1 (tree type, tree expr) mark_used (td3); td3 = build_unary_op (ADDR_EXPR, td3, 0); - /* Determine how T and V are related. */ - boff = dcast_base_hint (static_type, target_type); + /* Determine how T and V are related. */ + boff = dcast_base_hint (static_type, target_type); /* Since expr is used twice below, save it. */ expr = save_expr (expr); @@ -639,10 +639,10 @@ build_dynamic_cast_1 (tree type, tree expr) tmp = build_function_type (ptr_type_node, tmp); dcast_fn = build_library_fn_ptr (name, tmp); DECL_IS_PURE (dcast_fn) = 1; - pop_nested_namespace (ns); - dynamic_cast_node = dcast_fn; + pop_nested_namespace (ns); + dynamic_cast_node = dcast_fn; } - result = build_cxx_call (dcast_fn, elems); + result = build_cxx_call (dcast_fn, elems); if (tc == REFERENCE_TYPE) { @@ -654,7 +654,7 @@ build_dynamic_cast_1 (tree type, tree expr) /* Now back to the type we want from a void*. */ result = cp_convert (type, result); - return ifnonnull (expr, result); + return ifnonnull (expr, result); } } else @@ -662,7 +662,7 @@ build_dynamic_cast_1 (tree type, tree expr) fail: error ("cannot dynamic_cast %qE (of type %q#T) to type %q#T (%s)", - expr, exprtype, type, errstr); + expr, exprtype, type, errstr); return error_mark_node; } @@ -769,8 +769,8 @@ tinfo_base_init (tree desc, tree target) /* Generate the NTBS array variable. */ tree name_type = build_cplus_array_type - (build_qualified_type (char_type_node, TYPE_QUAL_CONST), - NULL_TREE); + (build_qualified_type (char_type_node, TYPE_QUAL_CONST), + NULL_TREE); tree name_string = tinfo_name (target); /* Determine the name of the variable -- and remember with which @@ -811,7 +811,7 @@ tinfo_base_init (tree desc, tree target) if (!COMPLETE_TYPE_P (real_type)) { - /* We never saw a definition of this type, so we need to + /* We never saw a definition of this type, so we need to tell the compiler that this is an exported class, as indeed all of the __*_type_info classes are. */ SET_CLASSTYPE_INTERFACE_KNOWN (real_type); @@ -876,8 +876,8 @@ ptr_initializer (tree desc, tree target) flags |= 8; init = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, flags), init); init = tree_cons (NULL_TREE, - get_tinfo_ptr (TYPE_MAIN_VARIANT (to)), - init); + get_tinfo_ptr (TYPE_MAIN_VARIANT (to)), + init); init = build_constructor (NULL_TREE, nreverse (init)); TREE_CONSTANT (init) = 1; @@ -907,7 +907,7 @@ ptm_initializer (tree desc, tree target) init = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, flags), init); init = tree_cons (NULL_TREE, get_tinfo_ptr (TYPE_MAIN_VARIANT (to)), - init); + init); init = tree_cons (NULL_TREE, get_tinfo_ptr (klass), init); @@ -992,38 +992,38 @@ get_pseudo_ti_init (tree type, tree var_desc) return class_initializer (var_desc, type, NULL_TREE); else if (var_desc == si_class_desc_type_node) { - tree base_binfo = BINFO_BASE_BINFO (TYPE_BINFO (type), 0); + tree base_binfo = BINFO_BASE_BINFO (TYPE_BINFO (type), 0); tree tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo)); tree base_inits = tree_cons (NULL_TREE, tinfo, NULL_TREE); return class_initializer (var_desc, type, base_inits); } else - { + { int hint = ((CLASSTYPE_REPEATED_BASE_P (type) << 0) | (CLASSTYPE_DIAMOND_SHAPED_P (type) << 1)); tree binfo = TYPE_BINFO (type); - int nbases = BINFO_N_BASE_BINFOS (binfo); + int nbases = BINFO_N_BASE_BINFOS (binfo); VEC(tree,gc) *base_accesses = BINFO_BASE_ACCESSES (binfo); - tree base_inits = NULL_TREE; - int ix; - - /* Generate the base information initializer. */ - for (ix = nbases; ix--;) - { - tree base_binfo = BINFO_BASE_BINFO (binfo, ix); - tree base_init = NULL_TREE; - int flags = 0; - tree tinfo; - tree offset; - - if (VEC_index (tree, base_accesses, ix) == access_public_node) - flags |= 2; - tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo)); + tree base_inits = NULL_TREE; + int ix; + + /* Generate the base information initializer. */ + for (ix = nbases; ix--;) + { + tree base_binfo = BINFO_BASE_BINFO (binfo, ix); + tree base_init = NULL_TREE; + int flags = 0; + tree tinfo; + tree offset; + + if (VEC_index (tree, base_accesses, ix) == access_public_node) + flags |= 2; + tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo)); if (BINFO_VIRTUAL_P (base_binfo)) { /* We store the vtable offset at which the virtual - base offset can be found. */ + base offset can be found. */ offset = BINFO_VPTR_FIELD (base_binfo); offset = convert (sizetype, offset); flags |= 1; @@ -1031,16 +1031,16 @@ get_pseudo_ti_init (tree type, tree var_desc) else offset = BINFO_OFFSET (base_binfo); - /* Combine offset and flags into one field. */ - offset = cp_build_binary_op (LSHIFT_EXPR, offset, + /* Combine offset and flags into one field. */ + offset = cp_build_binary_op (LSHIFT_EXPR, offset, build_int_cst (NULL_TREE, 8)); - offset = cp_build_binary_op (BIT_IOR_EXPR, offset, + offset = cp_build_binary_op (BIT_IOR_EXPR, offset, build_int_cst (NULL_TREE, flags)); - base_init = tree_cons (NULL_TREE, offset, base_init); - base_init = tree_cons (NULL_TREE, tinfo, base_init); - base_init = build_constructor (NULL_TREE, base_init); - base_inits = tree_cons (NULL_TREE, base_init, base_inits); - } + base_init = tree_cons (NULL_TREE, offset, base_init); + base_init = tree_cons (NULL_TREE, tinfo, base_init); + base_init = build_constructor (NULL_TREE, base_init); + base_inits = tree_cons (NULL_TREE, base_init, base_inits); + } base_inits = build_constructor (NULL_TREE, base_inits); base_inits = tree_cons (NULL_TREE, base_inits, NULL_TREE); /* Prepend the number of bases. */ @@ -1052,8 +1052,8 @@ get_pseudo_ti_init (tree type, tree var_desc) build_int_cst (NULL_TREE, hint), base_inits); - return class_initializer (var_desc, type, base_inits); - } + return class_initializer (var_desc, type, base_inits); + } break; default: @@ -1250,22 +1250,22 @@ create_tinfo_types (void) NULL); func_desc_type_node = create_pseudo_type_info ("__function_type_info", 0, - NULL); + NULL); enum_desc_type_node = create_pseudo_type_info ("__enum_type_info", 0, - NULL); + NULL); /* Class type_info. Add a flags field. */ class_desc_type_node = create_pseudo_type_info - ("__class_type_info", 0, - NULL); + ("__class_type_info", 0, + NULL); /* Single public non-virtual base class. Add pointer to base class. This is really a descendant of __class_type_info. */ si_class_desc_type_node = create_pseudo_type_info - ("__si_class_type_info", 0, - build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type), - NULL); + ("__si_class_type_info", 0, + build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type), + NULL); /* Base class internal helper. Pointer to base type, offset to base, flags. */ @@ -1302,10 +1302,10 @@ create_tinfo_types (void) This is really a descendant of __pbase_type_info. */ ptm_desc_type_node = create_pseudo_type_info ("__pointer_to_member_type_info", 0, - build_decl (FIELD_DECL, NULL_TREE, integer_type_node), - build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type), - build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type), - NULL); + build_decl (FIELD_DECL, NULL_TREE, integer_type_node), + build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type), + build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type), + NULL); pop_nested_namespace (abi_node); } diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 2854729..a0758c3 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -82,13 +82,13 @@ static int n_contexts_saved; struct lookup_base_data_s { tree t; /* type being searched. */ - tree base; /* The base type we're looking for. */ - tree binfo; /* Found binfo. */ - bool via_virtual; /* Found via a virtual path. */ + tree base; /* The base type we're looking for. */ + tree binfo; /* Found binfo. */ + bool via_virtual; /* Found via a virtual path. */ bool ambiguous; /* Found multiply ambiguous */ - bool repeated_base; /* Whether there are repeated bases in the + bool repeated_base; /* Whether there are repeated bases in the hierarchy. */ - bool want_any; /* Whether we want any matching binfo. */ + bool want_any; /* Whether we want any matching binfo. */ }; /* Worker function for lookup_base. See if we've found the desired @@ -1084,8 +1084,8 @@ lookup_field_r (tree binfo, void *data) nval = NULL_TREE; if (!nval && CLASSTYPE_NESTED_UTDS (type) != NULL) { - binding_entry e = binding_table_find (CLASSTYPE_NESTED_UTDS (type), - lfi->name); + binding_entry e = binding_table_find (CLASSTYPE_NESTED_UTDS (type), + lfi->name); if (e != NULL) nval = TYPE_MAIN_DECL (e->type); else @@ -1256,7 +1256,7 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type) { error (errstr, name, type); if (lfi.ambiguous) - print_candidates (lfi.ambiguous); + print_candidates (lfi.ambiguous); rval = error_mark_node; } @@ -1655,8 +1655,8 @@ dfs_walk_once (tree binfo, tree (*pre_fn) (tree, void *), if (!BINFO_INHERITANCE_CHAIN (binfo)) { /* We are at the top of the hierarchy, and can use the - CLASSTYPE_VBASECLASSES list for unmarking the virtual - bases. */ + CLASSTYPE_VBASECLASSES list for unmarking the virtual + bases. */ VEC(tree,gc) *vbases; unsigned ix; tree base_binfo; @@ -1710,8 +1710,8 @@ dfs_walk_once_accessible_r (tree binfo, bool friends_p, bool once, continue; /* If the base is inherited via private or protected - inheritance, then we can't see it, unless we are a friend of - the current binfo. */ + inheritance, then we can't see it, unless we are a friend of + the current binfo. */ if (BINFO_BASE_ACCESS (binfo, ix) != access_public_node) { tree scope; @@ -1763,8 +1763,8 @@ dfs_walk_once_accessible (tree binfo, bool friends_p, if (!BINFO_INHERITANCE_CHAIN (binfo)) { /* We are at the top of the hierarchy, and can use the - CLASSTYPE_VBASECLASSES list for unmarking the virtual - bases. */ + CLASSTYPE_VBASECLASSES list for unmarking the virtual + bases. */ VEC(tree,gc) *vbases; unsigned ix; tree base_binfo; @@ -1903,7 +1903,7 @@ look_for_overrides (tree type, tree fndecl) tree basetype = BINFO_TYPE (base_binfo); if (TYPE_POLYMORPHIC_P (basetype)) - found += look_for_overrides_r (basetype, fndecl); + found += look_for_overrides_r (basetype, fndecl); } return found; } @@ -1931,21 +1931,21 @@ look_for_overrides_here (tree type, tree fndecl) tree fns = VEC_index (tree, CLASSTYPE_METHOD_VEC (type), ix); for (; fns; fns = OVL_NEXT (fns)) - { - tree fn = OVL_CURRENT (fns); + { + tree fn = OVL_CURRENT (fns); - if (!DECL_VIRTUAL_P (fn)) - /* Not a virtual. */; - else if (DECL_CONTEXT (fn) != type) - /* Introduced with a using declaration. */; + if (!DECL_VIRTUAL_P (fn)) + /* Not a virtual. */; + else if (DECL_CONTEXT (fn) != type) + /* Introduced with a using declaration. */; else if (DECL_STATIC_FUNCTION_P (fndecl)) { tree btypes = TYPE_ARG_TYPES (TREE_TYPE (fn)); tree dtypes = TYPE_ARG_TYPES (TREE_TYPE (fndecl)); - if (compparms (TREE_CHAIN (btypes), dtypes)) + if (compparms (TREE_CHAIN (btypes), dtypes)) return fn; - } - else if (same_signature_p (fndecl, fn)) + } + else if (same_signature_p (fndecl, fn)) return fn; } } @@ -2149,7 +2149,7 @@ check_hidden_convs (tree binfo, int virtual_depth, int virtualness, if (virtual_depth || virtualness) { /* In a virtual hierarchy, we could be hidden, or could hide a - conversion function on the other_convs list. */ + conversion function on the other_convs list. */ for (level = other_convs; level; level = TREE_CHAIN (level)) { int we_hide_them; diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 92a195e..0c55975 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -75,9 +75,9 @@ static tree finalize_nrv_r (tree *, int *, void *); example: class A { - typedef int X; + typedef int X; public: - X f(); + X f(); }; A::X A::f(); @@ -122,8 +122,8 @@ typedef struct deferred_access GTY(()) declared because code like: class A { - class B {}; - B* f(); + class B {}; + B* f(); } A::B* A::f() { return 0; } @@ -498,11 +498,11 @@ finish_cond (tree *cond_p, tree expr) /* If *COND_P specifies a conditional with a declaration, transform the loop such that - while (A x = 42) { } - for (; A x = 42;) { } + while (A x = 42) { } + for (; A x = 42;) { } becomes - while (true) { A x = 42; if (!x) break; } - for (;;) { A x = 42; if (!x) break; } + while (true) { A x = 42; if (!x) break; } + for (;;) { A x = 42; if (!x) break; } The statement list for BODY will be empty if the conditional did not declare anything. */ @@ -827,7 +827,7 @@ finish_for_expr (tree expr, tree for_stmt) if (!processing_template_decl) { if (warn_sequence_point) - verify_sequence_points (expr); + verify_sequence_points (expr); expr = convert_to_void (expr, "3rd expression in for"); } else if (!type_dependent_expression_p (expr)) @@ -1224,7 +1224,7 @@ finish_asm_stmt (int volatile_p, tree string, tree output_operands, if (TREE_TYPE (operand) == unknown_type_node) { error ("type of asm operand %qE could not be determined", - TREE_VALUE (t)); + TREE_VALUE (t)); operand = error_mark_node; } @@ -1445,7 +1445,7 @@ check_accessibility_of_qualified_id (tree decl, I *p; p->A::I::~I(); - In this case, we will have "A::I" as the DECL, but "I" as the + In this case, we will have "A::I" as the DECL, but "I" as the OBJECT_TYPE. */ && CLASS_TYPE_P (object_type) && DERIVED_FROM_P (scope, object_type)) @@ -1822,7 +1822,7 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p) . operator.... [Otherwise] a contrived object of type T becomes the implied object argument. - This paragraph is unclear about this situation: + This paragraph is unclear about this situation: struct A { void f(); }; struct B : public A {}; @@ -1865,7 +1865,7 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p) if (TREE_CODE (fn) == FUNCTION_DECL && (DECL_BUILT_IN_CLASS (fn) == BUILT_IN_NORMAL || DECL_BUILT_IN_CLASS (fn) == BUILT_IN_MD)) - result = resolve_overloaded_builtin (fn, args); + result = resolve_overloaded_builtin (fn, args); if (!result) /* A call to a namespace-scope function. */ @@ -1963,17 +1963,17 @@ finish_pseudo_destructor_expr (tree object, tree scope, tree destructor) /* [expr.pseudo] says both: - The type designated by the pseudo-destructor-name shall be + The type designated by the pseudo-destructor-name shall be the same as the object type. - and: + and: - The cv-unqualified versions of the object type and of the + The cv-unqualified versions of the object type and of the type designated by the pseudo-destructor-name shall be the same type. - We implement the more generous second sentence, since that is - what most other compilers do. */ + We implement the more generous second sentence, since that is + what most other compilers do. */ if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (object), destructor)) { @@ -2122,10 +2122,10 @@ check_template_template_default_arg (tree argument) if (CLASSTYPE_TEMPLATE_INFO (t) && CLASSTYPE_TEMPLATE_INSTANTIATION (t)) error ("invalid use of type %qT as a default value for a " - "template template-parameter", t); + "template template-parameter", t); else error ("invalid use of %qD as a default value for a template " - "template-parameter", argument); + "template-parameter", argument); } else error ("invalid default argument for a template template parameter"); @@ -2151,7 +2151,7 @@ begin_class_definition (tree t) /* A non-implicit typename comes from code like: template <typename T> struct A { - template <typename U> struct A<T>::B ... + template <typename U> struct A<T>::B ... This is erroneous. */ else if (TREE_CODE (t) == TYPENAME_TYPE) @@ -2380,10 +2380,10 @@ finish_base_specifier (tree base, tree access, bool virtual_p) else { if (cp_type_quals (base) != 0) - { - error ("base class %qT has cv qualifiers", base); - base = TYPE_MAIN_VARIANT (base); - } + { + error ("base class %qT has cv qualifiers", base); + base = TYPE_MAIN_VARIANT (base); + } result = build_tree_list (access, base); if (virtual_p) TREE_TYPE (result) = integer_type_node; @@ -2686,8 +2686,8 @@ finish_id_expression (tree id_expression, } /* Only certain kinds of names are allowed in constant - expression. Enumerators and template parameters have already - been handled above. */ + expression. Enumerators and template parameters have already + been handled above. */ if (integral_constant_expression_p && ! DECL_INTEGRAL_CONSTANT_VAR_P (decl) && ! builtin_valid_in_constant_expr_p (decl)) @@ -2851,8 +2851,8 @@ finish_typeof (tree expr) static tree simplify_aggr_init_exprs_r (tree* tp, - int* walk_subtrees, - void* data ATTRIBUTE_UNUSED) + int* walk_subtrees, + void* data ATTRIBUTE_UNUSED) { /* We don't need to walk into types; there's nothing in a type that needs simplification. (And, furthermore, there are places we @@ -3022,9 +3022,9 @@ expand_body (tree fn) if (DECL_CLONED_FUNCTION_P (fn)) { /* If this is a clone, go through the other clones now and mark - their parameters used. We have to do that here, as we don't - know whether any particular clone will be expanded, and - therefore cannot pick one arbitrarily. */ + their parameters used. We have to do that here, as we don't + know whether any particular clone will be expanded, and + therefore cannot pick one arbitrarily. */ tree probe; for (probe = TREE_CHAIN (DECL_CLONED_FUNCTION (fn)); diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 321988a..06b8532 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -59,7 +59,7 @@ static tree handle_init_priority_attribute (tree *, tree, tree, int, bool *); static cp_lvalue_kind lvalue_p_1 (tree ref, - int treat_class_rvalues_as_lvalues) + int treat_class_rvalues_as_lvalues) { cp_lvalue_kind op1_lvalue_kind = clk_none; cp_lvalue_kind op2_lvalue_kind = clk_none; @@ -93,9 +93,9 @@ lvalue_p_1 (tree ref, /* Look at the member designator. */ if (!op1_lvalue_kind /* The "field" can be a FUNCTION_DECL or an OVERLOAD in some - situations. */ - || TREE_CODE (TREE_OPERAND (ref, 1)) != FIELD_DECL) - ; + situations. */ + || TREE_CODE (TREE_OPERAND (ref, 1)) != FIELD_DECL) + ; else if (DECL_C_BIT_FIELD (TREE_OPERAND (ref, 1))) { /* Clear the ordinary bit. If this object was a class @@ -433,8 +433,8 @@ build_cplus_array_type (tree elt_type, tree index_type) tree cp_build_qualified_type_real (tree type, - int type_quals, - tsubst_flags_t complain) + int type_quals, + tsubst_flags_t complain) { tree result; int bad_quals = TYPE_UNQUALIFIED; @@ -528,17 +528,17 @@ cp_build_qualified_type_real (tree type, else { if (complain & tf_ignore_bad_quals) - /* We're not going to warn about constifying things that can't - be constified. */ - bad_quals &= ~TYPE_QUAL_CONST; + /* We're not going to warn about constifying things that can't + be constified. */ + bad_quals &= ~TYPE_QUAL_CONST; if (bad_quals) - { - tree bad_type = build_qualified_type (ptr_type_node, bad_quals); + { + tree bad_type = build_qualified_type (ptr_type_node, bad_quals); - if (!(complain & tf_ignore_bad_quals)) - error ("%qV qualifiers cannot be applied to %qT", + if (!(complain & tf_ignore_bad_quals)) + error ("%qV qualifiers cannot be applied to %qT", bad_type, type); - } + } } /* Retrieve (or create) the appropriately qualified variant. */ @@ -899,7 +899,7 @@ build_exception_variant (tree type, tree raises) for (; v; v = TYPE_NEXT_VARIANT (v)) if (check_qualified_type (v, type, type_quals) - && comp_except_specs (raises, TYPE_RAISES_EXCEPTIONS (v), 1)) + && comp_except_specs (raises, TYPE_RAISES_EXCEPTIONS (v), 1)) return v; /* Need to build a new variant. */ @@ -965,8 +965,8 @@ count_trees (tree t) static tree verify_stmt_tree_r (tree* tp, - int* walk_subtrees ATTRIBUTE_UNUSED , - void* data) + int* walk_subtrees ATTRIBUTE_UNUSED , + void* data) { tree t = *tp; htab_t *statements = (htab_t *) data; @@ -1002,8 +1002,8 @@ verify_stmt_tree (tree t) static tree find_tree_r (tree* tp, - int* walk_subtrees ATTRIBUTE_UNUSED , - void* data) + int* walk_subtrees ATTRIBUTE_UNUSED , + void* data) { if (*tp == (tree) data) return (tree) data; @@ -1146,8 +1146,8 @@ bot_manip (tree* tp, int* walk_subtrees, void* data) if (!TYPE_P (t) && TREE_CONSTANT (t)) { /* There can't be any TARGET_EXPRs or their slot variables below - this point. We used to check !TREE_SIDE_EFFECTS, but then we - failed to copy an ADDR_EXPR of the slot VAR_DECL. */ + this point. We used to check !TREE_SIDE_EFFECTS, but then we + failed to copy an ADDR_EXPR of the slot VAR_DECL. */ *walk_subtrees = 0; return NULL_TREE; } @@ -1193,8 +1193,8 @@ bot_manip (tree* tp, int* walk_subtrees, void* data) static tree bot_replace (tree* t, - int* walk_subtrees ATTRIBUTE_UNUSED , - void* data) + int* walk_subtrees ATTRIBUTE_UNUSED , + void* data) { splay_tree target_remap = ((splay_tree) data); @@ -1642,8 +1642,8 @@ maybe_dummy_object (tree type, tree* binfop) if (current_class_ref && context == current_class_type /* Kludge: Make sure that current_class_type is actually - correct. It might not be if we're in the middle of - tsubst_default_argument. */ + correct. It might not be if we're in the middle of + tsubst_default_argument. */ && same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (current_class_ref)), current_class_type)) decl = current_class_ref; @@ -1722,17 +1722,17 @@ const struct attribute_spec cxx_attribute_table[] = { "java_interface", 0, 0, false, false, false, handle_java_interface_attribute }, { "com_interface", 0, 0, false, false, false, handle_com_interface_attribute }, { "init_priority", 1, 1, true, false, false, handle_init_priority_attribute }, - { NULL, 0, 0, false, false, false, NULL } + { NULL, 0, 0, false, false, false, NULL } }; /* Handle a "java_interface" attribute; arguments as in struct attribute_spec.handler. */ static tree handle_java_interface_attribute (tree* node, - tree name, - tree args ATTRIBUTE_UNUSED , - int flags, - bool* no_add_attrs) + tree name, + tree args ATTRIBUTE_UNUSED , + int flags, + bool* no_add_attrs) { if (DECL_P (*node) || !CLASS_TYPE_P (*node) @@ -1754,10 +1754,10 @@ handle_java_interface_attribute (tree* node, struct attribute_spec.handler. */ static tree handle_com_interface_attribute (tree* node, - tree name, - tree args ATTRIBUTE_UNUSED , - int flags ATTRIBUTE_UNUSED , - bool* no_add_attrs) + tree name, + tree args ATTRIBUTE_UNUSED , + int flags ATTRIBUTE_UNUSED , + bool* no_add_attrs) { static int warned; @@ -1783,10 +1783,10 @@ handle_com_interface_attribute (tree* node, struct attribute_spec.handler. */ static tree handle_init_priority_attribute (tree* node, - tree name, - tree args, - int flags ATTRIBUTE_UNUSED , - bool* no_add_attrs) + tree name, + tree args, + int flags ATTRIBUTE_UNUSED , + bool* no_add_attrs) { tree initp_expr = TREE_VALUE (args); tree decl = *node; @@ -1819,7 +1819,7 @@ handle_init_priority_attribute (tree* node, || current_function_decl) { error ("can only use %qE attribute on file-scope definitions " - "of objects of class type", name); + "of objects of class type", name); *no_add_attrs = true; return NULL_TREE; } @@ -1921,7 +1921,7 @@ cp_walk_subtrees (tree *tp, int *walk_subtrees_p, walk_tree_fn func, case TYPEOF_TYPE: case BASELINK: /* None of these have subtrees other than those already walked - above. */ + above. */ *walk_subtrees_p = 0; break; diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 22c4814..3581ea2 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -380,10 +380,10 @@ type_after_usual_arithmetic_conversions (tree t1, tree t2) attributes); /* Two floating-point types whose TYPE_MAIN_VARIANTs are none of - the standard C++ floating-point types. Logic earlier in this - function has already eliminated the possibility that - TYPE_PRECISION (t2) != TYPE_PRECISION (t1), so there's no - compelling reason to choose one or the other. */ + the standard C++ floating-point types. Logic earlier in this + function has already eliminated the possibility that + TYPE_PRECISION (t2) != TYPE_PRECISION (t1), so there's no + compelling reason to choose one or the other. */ return build_type_attribute_variant (t1, attributes); } } @@ -504,7 +504,7 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2, if (pedantic && TYPE_PTRFN_P (t2)) pedwarn ("ISO C++ forbids %s between pointer of type %<void *%> " - "and pointer-to-function", location); + "and pointer-to-function", location); result_type = cp_build_qualified_type (void_type_node, (cp_type_quals (TREE_TYPE (t1)) @@ -785,23 +785,23 @@ comp_except_types (tree a, tree b, bool exact) else if (!exact) { if (cp_type_quals (a) || cp_type_quals (b)) - return false; + return false; if (TREE_CODE (a) == POINTER_TYPE - && TREE_CODE (b) == POINTER_TYPE) - { - a = TREE_TYPE (a); - b = TREE_TYPE (b); - if (cp_type_quals (a) || cp_type_quals (b)) - return false; - } + && TREE_CODE (b) == POINTER_TYPE) + { + a = TREE_TYPE (a); + b = TREE_TYPE (b); + if (cp_type_quals (a) || cp_type_quals (b)) + return false; + } if (TREE_CODE (a) != RECORD_TYPE - || TREE_CODE (b) != RECORD_TYPE) - return false; + || TREE_CODE (b) != RECORD_TYPE) + return false; if (PUBLICLY_UNIQUELY_DERIVED_P (a, b)) - return true; + return true; } return false; } @@ -822,11 +822,11 @@ comp_except_specs (tree t1, tree t2, bool exact) if (t1 == t2) return true; - if (t1 == NULL_TREE) /* T1 is ... */ + if (t1 == NULL_TREE) /* T1 is ... */ return t2 == NULL_TREE || !exact; - if (!TREE_VALUE (t1)) /* t1 is EMPTY */ + if (!TREE_VALUE (t1)) /* t1 is EMPTY */ return t2 != NULL_TREE && !TREE_VALUE (t2); - if (t2 == NULL_TREE) /* T2 is ... */ + if (t2 == NULL_TREE) /* T2 is ... */ return false; if (TREE_VALUE (t1) && !TREE_VALUE (t2)) /* T2 is EMPTY, T1 is not */ return !exact; @@ -838,20 +838,20 @@ comp_except_specs (tree t1, tree t2, bool exact) for (base = t1; t2 != NULL_TREE; t2 = TREE_CHAIN (t2)) { for (probe = base; probe != NULL_TREE; probe = TREE_CHAIN (probe)) - { - tree a = TREE_VALUE (probe); - tree b = TREE_VALUE (t2); - - if (comp_except_types (a, b, exact)) - { - if (probe == base && exact) - base = TREE_CHAIN (probe); - length++; - break; - } - } + { + tree a = TREE_VALUE (probe); + tree b = TREE_VALUE (t2); + + if (comp_except_types (a, b, exact)) + { + if (probe == base && exact) + base = TREE_CHAIN (probe); + length++; + break; + } + } if (probe == NULL_TREE) - return false; + return false; } return !exact || base == NULL_TREE || length == list_length (t1); } @@ -905,9 +905,9 @@ comp_array_types (tree t1, tree t2, bool allow_redeclaration) && !value_dependent_expression_p (max2)) { /* With abi-1 we do not fold non-dependent array bounds, (and - consequently mangle them incorrectly). We must therefore - fold them here, to verify the domains have the same - value. */ + consequently mangle them incorrectly). We must therefore + fold them here, to verify the domains have the same + value. */ max1 = fold (max1); max2 = fold (max2); } @@ -1058,14 +1058,14 @@ comptypes (tree t1, tree t2, int strict) case TYPENAME_TYPE: if (!cp_tree_equal (TYPENAME_TYPE_FULLNAME (t1), TYPENAME_TYPE_FULLNAME (t2))) - return false; + return false; if (!same_type_p (TYPE_CONTEXT (t1), TYPE_CONTEXT (t2))) return false; break; case UNBOUND_CLASS_TEMPLATE: if (!cp_tree_equal (TYPE_IDENTIFIER (t1), TYPE_IDENTIFIER (t2))) - return false; + return false; if (!same_type_p (TYPE_CONTEXT (t1), TYPE_CONTEXT (t2))) return false; break; @@ -1291,7 +1291,7 @@ cxx_sizeof_or_alignof_expr (tree e, enum tree_code op) else if (is_overloaded_fn (e)) { pedwarn ("ISO C++ forbids applying %qs to an expression of " - "function type", op_name); + "function type", op_name); e = char_type_node; } else if (type_unknown_p (e)) @@ -1632,9 +1632,9 @@ build_class_member_access_expr (tree object, tree member, if (!member_scope || !DERIVED_FROM_P (member_scope, object_type)) { if (TREE_CODE (member) == FIELD_DECL) - error ("invalid use of nonstatic data member %qE", member); + error ("invalid use of nonstatic data member %qE", member); else - error ("%qD is not a member of %qT", member, object_type); + error ("%qD is not a member of %qT", member, object_type); return error_mark_node; } @@ -1685,7 +1685,7 @@ build_class_member_access_expr (tree object, tree member, if (null_object_p && kind == bk_via_virtual) { error ("invalid access to non-static data member %qD of " - "NULL object", + "NULL object", member); error ("(perhaps the %<offsetof%> macro was used incorrectly)"); return error_mark_node; @@ -2088,18 +2088,18 @@ build_indirect_ref (tree ptr, const char *errorstring) If the type of the expression is "pointer to T," the type of the result is "T." - We must use the canonical variant because certain parts of + We must use the canonical variant because certain parts of the back end, like fold, do pointer comparisons between types. */ tree t = canonical_type_variant (TREE_TYPE (type)); if (VOID_TYPE_P (t)) - { - /* A pointer to incomplete type (other than cv void) can be - dereferenced [expr.unary.op]/1 */ - error ("%qT is not a pointer-to-object type", type); - return error_mark_node; - } + { + /* A pointer to incomplete type (other than cv void) can be + dereferenced [expr.unary.op]/1 */ + error ("%qT is not a pointer-to-object type", type); + return error_mark_node; + } else if (TREE_CODE (pointer) == ADDR_EXPR && same_type_p (t, TREE_TYPE (TREE_OPERAND (pointer, 0)))) /* The POINTER was something like `&x'. We simplify `*&x' to @@ -2467,8 +2467,8 @@ build_function_call (tree function, tree params) if (TYPE_PTRMEMFUNC_P (fntype)) { error ("must use %<.*%> or %<->*%> to call pointer-to-member " - "function in %<%E (...)%>", - original); + "function in %<%E (...)%>", + original); return error_mark_node; } @@ -2663,7 +2663,7 @@ convert_arguments (tree typelist, tree values, tree fndecl, int flags) if (fndecl) { cp_error_at ("too few arguments to %s %q+#D", - called_thing, fndecl); + called_thing, fndecl); error ("at this point in file"); } else @@ -2815,7 +2815,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (t != error_mark_node) { pedwarn ("assuming cast to type %qT from overloaded function", - TREE_TYPE (t)); + TREE_TYPE (t)); op0 = t; } } @@ -2825,7 +2825,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (t != error_mark_node) { pedwarn ("assuming cast to type %qT from overloaded function", - TREE_TYPE (t)); + TREE_TYPE (t)); op1 = t; } } @@ -3356,10 +3356,10 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (TREE_CODE (TREE_TYPE (orig_op0)) == ENUMERAL_TYPE && TREE_CODE (TREE_TYPE (orig_op1)) == ENUMERAL_TYPE && TYPE_MAIN_VARIANT (TREE_TYPE (orig_op0)) - != TYPE_MAIN_VARIANT (TREE_TYPE (orig_op1))) + != TYPE_MAIN_VARIANT (TREE_TYPE (orig_op1))) { warning (0, "comparison between types %q#T and %q#T", - TREE_TYPE (orig_op0), TREE_TYPE (orig_op1)); + TREE_TYPE (orig_op0), TREE_TYPE (orig_op1)); } /* Give warnings for comparisons between signed and unsigned @@ -3607,34 +3607,34 @@ build_x_unary_op (enum tree_code code, tree xarg) if (TREE_CODE (xarg) != OFFSET_REF) { error ("invalid use of %qE to form a pointer-to-member-function." - " Use a qualified-id.", + " Use a qualified-id.", xarg); return error_mark_node; } else { error ("parenthesis around %qE cannot be used to form a" - " pointer-to-member-function", + " pointer-to-member-function", xarg); PTRMEM_OK_P (xarg) = 1; } } if (TREE_CODE (xarg) == OFFSET_REF) - { - ptrmem = PTRMEM_OK_P (xarg); + { + ptrmem = PTRMEM_OK_P (xarg); - if (!ptrmem && !flag_ms_extensions - && TREE_CODE (TREE_TYPE (TREE_OPERAND (xarg, 1))) == METHOD_TYPE) + if (!ptrmem && !flag_ms_extensions + && TREE_CODE (TREE_TYPE (TREE_OPERAND (xarg, 1))) == METHOD_TYPE) { /* A single non-static member, make sure we don't allow a - pointer-to-member. */ + pointer-to-member. */ xarg = build2 (OFFSET_REF, TREE_TYPE (xarg), TREE_OPERAND (xarg, 0), ovl_cons (TREE_OPERAND (xarg, 1), NULL_TREE)); PTRMEM_OK_P (xarg) = ptrmem; } - } + } else if (TREE_CODE (xarg) == TARGET_EXPR) warning (0, "taking address of temporary"); exp = build_unary_op (ADDR_EXPR, xarg, 0); @@ -3882,15 +3882,15 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) if (!COMPLETE_OR_VOID_TYPE_P (type)) error ("cannot %s a pointer to incomplete type %qT", - ((code == PREINCREMENT_EXPR - || code == POSTINCREMENT_EXPR) - ? "increment" : "decrement"), TREE_TYPE (argtype)); + ((code == PREINCREMENT_EXPR + || code == POSTINCREMENT_EXPR) + ? "increment" : "decrement"), TREE_TYPE (argtype)); else if ((pedantic || warn_pointer_arith) && !TYPE_PTROB_P (argtype)) pedwarn ("ISO C++ forbids %sing a pointer of type %qT", - ((code == PREINCREMENT_EXPR - || code == POSTINCREMENT_EXPR) - ? "increment" : "decrement"), argtype); + ((code == PREINCREMENT_EXPR + || code == POSTINCREMENT_EXPR) + ? "increment" : "decrement"), argtype); inc = cxx_sizeof_nowarn (TREE_TYPE (argtype)); } else @@ -4007,7 +4007,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) if (TREE_CODE (arg) == COMPONENT_REF && type_unknown_p (arg) && !really_overloaded_fn (TREE_OPERAND (arg, 1))) - { + { /* They're trying to take the address of a unique non-static member function. This is ill-formed (except in MS-land), but let's try to DTRT. @@ -4041,7 +4041,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) base, name); } arg = build_offset_ref (base, name, /*address_p=*/true); - } + } offset_ref: if (type_unknown_p (arg)) @@ -4297,7 +4297,7 @@ cxx_mark_addressable (tree exp) case PARM_DECL: if (x == current_class_ptr) { - error ("cannot take the address of %<this%>, which is an rvalue expression"); + error ("cannot take the address of %<this%>, which is an rvalue expression"); TREE_ADDRESSABLE (x) = 1; /* so compiler doesn't die later. */ return true; } @@ -4442,7 +4442,7 @@ build_compound_expr (tree lhs, tree rhs) if (TREE_CODE (rhs) == TARGET_EXPR) { /* If the rhs is a TARGET_EXPR, then build the compound - expression inside the target_expr's initializer. This + expression inside the target_expr's initializer. This helps the compiler to eliminate unnecessary temporaries. */ tree init = TREE_OPERAND (rhs, 1); @@ -4614,7 +4614,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p, } /* [expr.static.cast] - If T is a reference type, the result is an lvalue; otherwise, + If T is a reference type, the result is an lvalue; otherwise, the result is an rvalue. */ if (TREE_CODE (type) != REFERENCE_TYPE && real_lvalue_p (result)) @@ -4833,7 +4833,7 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, if (! real_lvalue_p (expr)) { error ("invalid cast of an rvalue expression of type " - "%qT to type %qT", + "%qT to type %qT", intype, type); return error_mark_node; } @@ -4892,7 +4892,7 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, { if (TYPE_PRECISION (type) < TYPE_PRECISION (intype)) pedwarn ("cast from %qT to %qT loses precision", - intype, type); + intype, type); } /* [expr.reinterpret.cast] A value of integral or enumeration type can be explicitly @@ -4927,10 +4927,10 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, { if (pedantic) /* Only issue a warning, as we have always supported this - where possible, and it is necessary in some cases. DR 195 - addresses this issue, but as of 2004/10/26 is still in - drafting. */ - warning (0, "ISO C++ forbids casting between pointer-to-function and pointer-to-object"); + where possible, and it is necessary in some cases. DR 195 + addresses this issue, but as of 2004/10/26 is still in + drafting. */ + warning (0, "ISO C++ forbids casting between pointer-to-function and pointer-to-object"); return fold_if_not_in_template (build_nop (type, expr)); } else if (TREE_CODE (type) == VECTOR_TYPE) @@ -5360,8 +5360,8 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) else { /* A binary op has been requested. Combine the old LHS - value with the RHS producing the value we should actually - store into the LHS. */ + value with the RHS producing the value we should actually + store into the LHS. */ gcc_assert (!PROMOTES_TO_AGGR_TYPE (lhstype, REFERENCE_TYPE)); lhs = stabilize_reference (lhs); @@ -5447,7 +5447,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) pedwarn ("ISO C++ forbids assignment of arrays"); from_array = TREE_CODE (TREE_TYPE (newrhs)) == ARRAY_TYPE - ? 1 + (modifycode != INIT_EXPR): 0; + ? 1 + (modifycode != INIT_EXPR): 0; return build_vec_init (lhs, NULL_TREE, newrhs, from_array); } @@ -5674,7 +5674,7 @@ build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p) if (!force && !can_convert_arg (to_type, TREE_TYPE (pfn), pfn)) error ("invalid conversion to type %qT from type %qT", - to_type, pfn_type); + to_type, pfn_type); n = get_delta_difference (TYPE_PTRMEMFUNC_OBJECT_TYPE (pfn_type), TYPE_PTRMEMFUNC_OBJECT_TYPE (to_type), @@ -5765,8 +5765,8 @@ expand_ptrmemfunc_cst (tree cst, tree *delta, tree *pfn) else { /* If we're dealing with a virtual function, we have to adjust 'this' - again, to point to the base which provides the vtable entry for - fn; the call will do the opposite adjustment. */ + again, to point to the base which provides the vtable entry for + fn; the call will do the opposite adjustment. */ tree orig_class = DECL_CONTEXT (fn); tree binfo = binfo_or_else (orig_class, fn_class); *delta = build2 (PLUS_EXPR, TREE_TYPE (*delta), @@ -5918,7 +5918,7 @@ convert_for_assignment (tree type, tree rhs, instantiate_type (type, rhs, tf_error | tf_warning); else if (fndecl) error ("cannot convert %qT to %qT for argument %qP to %qD", - rhstype, type, parmnum, fndecl); + rhstype, type, parmnum, fndecl); else error ("cannot convert %qT to %qT in %s", rhstype, type, errtype); return error_mark_node; @@ -6149,7 +6149,7 @@ check_return_expr (tree retval) finish_expr_stmt (retval); else pedwarn ("return-statement with a value, in function " - "returning 'void'"); + "returning 'void'"); current_function_returns_null = 1; @@ -6180,7 +6180,7 @@ check_return_expr (tree retval) && ! flag_check_new && null_ptr_cst_p (retval)) warning (0, "%<operator new%> must not return NULL unless it is " - "declared %<throw()%> (or -fcheck-new is in effect)"); + "declared %<throw()%> (or -fcheck-new is in effect)"); /* Effective C++ rule 15. See also start_function. */ if (warn_ecpp @@ -6262,7 +6262,7 @@ check_return_expr (tree retval) /* First convert the value to the function's return type, then to the type of return value's location to handle the - case that functype is smaller than the valtype. */ + case that functype is smaller than the valtype. */ retval = convert_for_initialization (NULL_TREE, functype, retval, LOOKUP_NORMAL|LOOKUP_ONLYCONVERTING, "return", NULL_TREE, 0); @@ -6446,14 +6446,14 @@ cp_apply_type_quals_to_decl (int type_quals, tree decl) && type_quals != TYPE_UNQUALIFIED) { /* This was an error in C++98 (cv-qualifiers cannot be added to - a function type), but DR 295 makes the code well-formed by - dropping the extra qualifiers. */ + a function type), but DR 295 makes the code well-formed by + dropping the extra qualifiers. */ if (pedantic) - { - tree bad_type = build_qualified_type (type, type_quals); - pedwarn ("ignoring %qV qualifiers added to function type %qT", - bad_type, type); - } + { + tree bad_type = build_qualified_type (type, type_quals); + pedwarn ("ignoring %qV qualifiers added to function type %qT", + bad_type, type); + } TREE_TYPE (decl) = TYPE_MAIN_VARIANT (type); return; @@ -6494,19 +6494,19 @@ casts_away_constness_r (tree *t1, tree *t2) For two pointer types: - X1 is T1cv1,1 * ... cv1,N * where T1 is not a pointer type - X2 is T2cv2,1 * ... cv2,M * where T2 is not a pointer type - K is min(N,M) + X1 is T1cv1,1 * ... cv1,N * where T1 is not a pointer type + X2 is T2cv2,1 * ... cv2,M * where T2 is not a pointer type + K is min(N,M) casting from X1 to X2 casts away constness if, for a non-pointer type T there does not exist an implicit conversion (clause _conv_) from: - Tcv1,(N-K+1) * cv1,(N-K+2) * ... cv1,N * + Tcv1,(N-K+1) * cv1,(N-K+2) * ... cv1,N * to - Tcv2,(M-K+1) * cv2,(M-K+2) * ... cv2,M *. */ + Tcv2,(M-K+1) * cv2,(M-K+2) * ... cv2,M *. */ if ((!TYPE_PTR_P (*t1) && !TYPE_PTRMEM_P (*t1)) || (!TYPE_PTR_P (*t2) && !TYPE_PTRMEM_P (*t2))) { diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index a3d9201..5094064 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -84,9 +84,9 @@ readonly_error (tree arg, const char* string, int soft) if (TREE_CODE (arg) == COMPONENT_REF) { if (TYPE_READONLY (TREE_TYPE (TREE_OPERAND (arg, 0)))) - fmt = "%s of data-member %qD in read-only structure"; + fmt = "%s of data-member %qD in read-only structure"; else - fmt = "%s of read-only data-member %qD"; + fmt = "%s of read-only data-member %qD"; (*fn) (fmt, string, TREE_OPERAND (arg, 1)); } else if (TREE_CODE (arg) == VAR_DECL) @@ -102,9 +102,9 @@ readonly_error (tree arg, const char* string, int soft) else if (TREE_CODE (arg) == PARM_DECL) (*fn) ("%s of read-only parameter %qD", string, arg); else if (TREE_CODE (arg) == INDIRECT_REF - && TREE_CODE (TREE_TYPE (TREE_OPERAND (arg, 0))) == REFERENCE_TYPE - && (TREE_CODE (TREE_OPERAND (arg, 0)) == VAR_DECL - || TREE_CODE (TREE_OPERAND (arg, 0)) == PARM_DECL)) + && TREE_CODE (TREE_TYPE (TREE_OPERAND (arg, 0))) == REFERENCE_TYPE + && (TREE_CODE (TREE_OPERAND (arg, 0)) == VAR_DECL + || TREE_CODE (TREE_OPERAND (arg, 0)) == PARM_DECL)) (*fn) ("%s of read-only reference %qD", string, TREE_OPERAND (arg, 0)); else if (TREE_CODE (arg) == RESULT_DECL) (*fn) ("%s of read-only named return value %qD", string, arg); @@ -326,8 +326,8 @@ abstract_virtuals_error (tree decl, tree type) for (ix = 0; VEC_iterate (tree, pure, ix, fn); ix++) inform ("%J\t%#D", fn, fn); /* Now truncate the vector. This leaves it non-null, so we know - there are pure virtuals, but empty so we don't list them out - again. */ + there are pure virtuals, but empty so we don't list them out + again. */ VEC_truncate (tree, pure, 0); } else @@ -386,7 +386,7 @@ cxx_incomplete_type_diagnostic (tree value, tree type, int diag_type) case UNION_TYPE: case ENUMERAL_TYPE: if (!decl) - (*p_msg) ("invalid use of undefined type %q#T", type); + (*p_msg) ("invalid use of undefined type %q#T", type); if (!TYPE_TEMPLATE_INFO (type)) (*p_msg_at) ("forward declaration of %q#T", type); else @@ -399,10 +399,10 @@ cxx_incomplete_type_diagnostic (tree value, tree type, int diag_type) case ARRAY_TYPE: if (TYPE_DOMAIN (type)) - { - type = TREE_TYPE (type); - goto retry; - } + { + type = TREE_TYPE (type); + goto retry; + } (*p_msg) ("invalid use of array with unspecified bounds"); break; @@ -417,14 +417,14 @@ cxx_incomplete_type_diagnostic (tree value, tree type, int diag_type) case UNKNOWN_TYPE: if (value && TREE_CODE (value) == COMPONENT_REF) - goto bad_member; + goto bad_member; else if (value && TREE_CODE (value) == ADDR_EXPR) - (*p_msg) ("address of overloaded function with no contextual " - "type information"); + (*p_msg) ("address of overloaded function with no contextual " + "type information"); else if (value && TREE_CODE (value) == OVERLOAD) - (*p_msg) ("overloaded function with no contextual type information"); + (*p_msg) ("overloaded function with no contextual type information"); else - (*p_msg) ("insufficient contextual information to determine type"); + (*p_msg) ("insufficient contextual information to determine type"); break; default: @@ -474,10 +474,10 @@ split_nonconstant_init_1 (tree dest, tree init) if (TREE_CODE (value) == CONSTRUCTOR) { if (array_type_p) - sub = build4 (ARRAY_REF, inner_type, dest, field_index, + sub = build4 (ARRAY_REF, inner_type, dest, field_index, NULL_TREE, NULL_TREE); else - sub = build3 (COMPONENT_REF, inner_type, dest, field_index, + sub = build3 (COMPONENT_REF, inner_type, dest, field_index, NULL_TREE); split_nonconstant_init_1 (sub, value); @@ -487,10 +487,10 @@ split_nonconstant_init_1 (tree dest, tree init) *pelt = TREE_CHAIN (elt); if (array_type_p) - sub = build4 (ARRAY_REF, inner_type, dest, field_index, + sub = build4 (ARRAY_REF, inner_type, dest, field_index, NULL_TREE, NULL_TREE); else - sub = build3 (COMPONENT_REF, inner_type, dest, field_index, + sub = build3 (COMPONENT_REF, inner_type, dest, field_index, NULL_TREE); code = build2 (MODIFY_EXPR, inner_type, sub, value); @@ -580,7 +580,7 @@ store_init_value (tree decl, tree init) if (TREE_CODE (init) == TREE_LIST) { error ("constructor syntax used, but no constructor declared " - "for type %qT", type); + "for type %qT", type); init = build_constructor (NULL_TREE, nreverse (init)); } } @@ -774,7 +774,7 @@ digest_init (tree type, tree init, tree* tail) if (TYPE_NON_AGGREGATE_CLASS (type)) { error ("subobject of type %qT must be initialized by " - "constructor, not by %qE", + "constructor, not by %qE", type, init); return error_mark_node; } @@ -994,17 +994,17 @@ process_init_constructor (tree type, tree init, tree* elts) next1 = build_functional_cast (TREE_TYPE (field), NULL_TREE); else - { + { next1 = build_constructor (NULL_TREE, NULL_TREE); - if (init) - TREE_HAS_CONSTRUCTOR (next1) - = TREE_HAS_CONSTRUCTOR (init); - } + if (init) + TREE_HAS_CONSTRUCTOR (next1) + = TREE_HAS_CONSTRUCTOR (init); + } next1 = digest_init (TREE_TYPE (field), next1, 0); /* Warn when some struct elements are implicitly initialized. */ if (warn_missing_field_initializers - && (!init || BRACE_ENCLOSED_INITIALIZER_P (init))) + && (!init || BRACE_ENCLOSED_INITIALIZER_P (init))) warning (0, "missing initializer for member %qD", field); } else @@ -1019,7 +1019,7 @@ process_init_constructor (tree type, tree init, tree* elts) /* Warn when some struct elements are implicitly initialized to zero. */ if (warn_missing_field_initializers - && (!init || BRACE_ENCLOSED_INITIALIZER_P (init))) + && (!init || BRACE_ENCLOSED_INITIALIZER_P (init))) warning (0, "missing initializer for member %qD", field); if (! zero_init_p (TREE_TYPE (field))) @@ -1074,7 +1074,7 @@ process_init_constructor (tree type, tree init, tree* elts) field = temp, win = 1; else error ("no field %qD in union being initialized", - TREE_PURPOSE (tail)); + TREE_PURPOSE (tail)); } if (!win) TREE_VALUE (tail) = error_mark_node; @@ -1082,7 +1082,7 @@ process_init_constructor (tree type, tree init, tree* elts) else if (field == 0) { error ("union %qT with no named members cannot be initialized", - type); + type); TREE_VALUE (tail) = error_mark_node; } @@ -1288,7 +1288,7 @@ build_m_component_ref (tree datum, tree component) if (!TYPE_PTR_TO_MEMBER_P (ptrmem_type)) { error ("%qE cannot be used as a member pointer, since it is of " - "type %qT", + "type %qT", component, ptrmem_type); return error_mark_node; } @@ -1297,8 +1297,8 @@ build_m_component_ref (tree datum, tree component) if (! IS_AGGR_TYPE (objtype)) { error ("cannot apply member pointer %qE to %qE, which is of " - "non-aggregate type %qT", - component, datum, objtype); + "non-aggregate type %qT", + component, datum, objtype); return error_mark_node; } @@ -1319,7 +1319,7 @@ build_m_component_ref (tree datum, tree component) { mismatch: error ("pointer to member type %qT incompatible with object " - "type %qT", + "type %qT", type, objtype); return error_mark_node; } @@ -1459,9 +1459,9 @@ add_exception_specifier (tree list, tree spec, int complain) { ok = true; /* 15.4/1 says that types in an exception specifier must be complete, - but it seems more reasonable to only require this on definitions - and calls. So just give a pedwarn at this point; we will give an - error later if we hit one of those two cases. */ + but it seems more reasonable to only require this on definitions + and calls. So just give a pedwarn at this point; we will give an + error later if we hit one of those two cases. */ if (!COMPLETE_TYPE_P (complete_type (core))) diag_type = 2; /* pedwarn */ } @@ -1471,8 +1471,8 @@ add_exception_specifier (tree list, tree spec, int complain) tree probe; for (probe = list; probe; probe = TREE_CHAIN (probe)) - if (same_type_p (TREE_VALUE (probe), spec)) - break; + if (same_type_p (TREE_VALUE (probe), spec)) + break; if (!probe) list = tree_cons (NULL_TREE, spec, list); } @@ -1502,20 +1502,20 @@ merge_exception_specifiers (tree list, tree add) tree orig_list = list; for (; add; add = TREE_CHAIN (add)) - { - tree spec = TREE_VALUE (add); - tree probe; - - for (probe = orig_list; probe; probe = TREE_CHAIN (probe)) - if (same_type_p (TREE_VALUE (probe), spec)) - break; - if (!probe) - { - spec = build_tree_list (NULL_TREE, spec); - TREE_CHAIN (spec) = list; - list = spec; - } - } + { + tree spec = TREE_VALUE (add); + tree probe; + + for (probe = orig_list; probe; probe = TREE_CHAIN (probe)) + if (same_type_p (TREE_VALUE (probe), spec)) + break; + if (!probe) + { + spec = build_tree_list (NULL_TREE, spec); + TREE_CHAIN (spec) = list; + list = spec; + } + } } return list; } |