From 0cbd7506455e100f19b3bc4f74d1f8e62e5939f2 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Wed, 15 Jun 2005 00:41:35 +0000 Subject: [PATCH] Canonicalize whitespace. From-SVN: r100965 --- gcc/cp/ChangeLog | 2 +- gcc/cp/ChangeLog-1999 | 12 +- gcc/cp/ChangeLog-2003 | 40 +- gcc/cp/ChangeLog-2004 | 2 +- gcc/cp/ChangeLog.tree-ssa | 6 +- gcc/cp/Make-lang.in | 2 +- gcc/cp/NEWS | 16 +- gcc/cp/call.c | 182 ++++---- gcc/cp/class.c | 252 ++++++------ gcc/cp/cp-gimplify.c | 2 +- gcc/cp/cp-objcp-common.c | 22 +- gcc/cp/cp-tree.def | 16 +- gcc/cp/cp-tree.h | 1004 +++++++++++++++++++++++---------------------- gcc/cp/cvt.c | 132 +++--- gcc/cp/cxx-pretty-print.c | 420 +++++++++---------- gcc/cp/cxx-pretty-print.h | 30 +- gcc/cp/decl.c | 590 +++++++++++++------------- gcc/cp/decl2.c | 122 +++--- gcc/cp/dump.c | 64 +-- gcc/cp/error.c | 394 +++++++++--------- gcc/cp/except.c | 42 +- gcc/cp/friend.c | 14 +- gcc/cp/init.c | 28 +- gcc/cp/lang-specs.h | 2 +- gcc/cp/lex.c | 8 +- gcc/cp/mangle.c | 224 +++++----- gcc/cp/method.c | 72 ++-- gcc/cp/name-lookup.c | 300 +++++++------- gcc/cp/name-lookup.h | 24 +- gcc/cp/parser.c | 318 +++++++------- gcc/cp/pt.c | 584 +++++++++++++------------- gcc/cp/rtti.c | 126 +++--- gcc/cp/search.c | 50 +-- gcc/cp/semantics.c | 64 +-- gcc/cp/tree.c | 80 ++-- gcc/cp/typeck.c | 204 ++++----- gcc/cp/typeck2.c | 110 ++--- 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 * 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 @@ -860,7 +860,7 @@ Thu Nov 11 12:42:11 MST 1999 Diego Novillo * pt.c (tsubst_enum): Adjust according to build_enumerator changes. Wed Nov 10 12:43:21 1999 Philippe De Muyter - Kaveh R. Ghazi + Kaveh R. Ghazi * cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'. @@ -2183,8 +2183,8 @@ Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi * 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 @@ -4791,7 +4791,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva (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 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 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 @@ -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 * 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 @@ -630,11 +630,11 @@ 2003-11-14 Giovanni Bajo - 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 @@ -647,9 +647,9 @@ 2003-11-14 Giovanni Bajo - 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 @@ -801,7 +801,7 @@ 2003-10-21 Robert Bowdidge * 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 @@ -1194,7 +1194,7 @@ 2003-09-27 Gabriel Dos Reis * 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 @@ -1344,7 +1344,7 @@ 2003-09-17 Richard Henderson 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 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 - * 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 @@ -314,7 +314,7 @@ 2003-06-05 Frank Ch. Eigler - * 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 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::A(const A&); + template A::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 struct S { ~S(); }; - int i; - i.~S(); + template 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 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 % 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 % in %<%E %s %E%>", - problem, opname, arg1, opname, arg2); + problem, opname, arg1, opname, arg2); else error ("%s for % 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 % 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 // 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 { template // 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 struct S1 { - template struct S2 {}; + template struct S2 {}; template struct S2 {}; }; @@ -2687,7 +2687,7 @@ struct lang_decl GTY(()) partial instantiation. For example, given: template struct S { - template void f(U); + template 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, ""); + pp_cxx_identifier (pp, ""); 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 void R::S::f(int); + template void R::S::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 void S::f(int); + template void S::f(int); The `class T' maches the `S', 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 void f (T); + template <> template 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 template void S::f(U); + template template void S::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 % 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 guard; - if (!guard.first_byte) { + static 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 % %s", object, type); @@ -5449,8 +5449,8 @@ bad_specifiers (tree object, error ("%qD declared as an % %s", object, type); if (quals) error ("% and % 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 friend void f()'. */ 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 ("% 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 %", - 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 %"); 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 %", name); storage_class = sc_none; - } + } else if (decl_context == TYPENAME || declspecs->specs[(int)ds_typedef]) { error ("non-object member %qs cannot be declared %", 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 %", name); storage_class = sc_none; - } + } else if (staticp) { error ("static %qs cannot be declared %", 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. %", TYPE_CONTEXT (type), TYPENAME_TYPE_FULLNAME (type)); else - pedwarn ("friend declaration requires class-key, " + pedwarn ("friend declaration requires class-key, " "i.e. %", 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 ("% specified invalid for function %qs " - "declared out of global scope", name); + "declared out of global scope", name); else pedwarn ("% 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 ("% may not be used when defining " - "(as opposed to declaring) a static data member"); - staticp = 0; + pedwarn ("% 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 %, 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 %"); + "valid arguments to %"); 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 void f(T); }; - template <> void S::f(int); + struct S { template 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 ("% takes type % (%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 ("% 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, ""); + pp_identifier (cxx_pp, ""); else - pp_printf (pp_base (cxx_pp), "", variety); + pp_printf (pp_base (cxx_pp), "", 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, ""); - 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, ""); + 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, "