(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.
Greg McGary <gkm@gnu.org>
* decl.c (duplicate_decls): Merge
- DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT,
- DECL_NO_CHECK_MEMORY_USAGE, DECL_NO_LIMIT_STACK.
+ DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT,
+ DECL_NO_CHECK_MEMORY_USAGE, DECL_NO_LIMIT_STACK.
1999-12-02 Mike Stump <mrs@wrs.com>
* pt.c (tsubst_enum): Adjust according to build_enumerator changes.
Wed Nov 10 12:43:21 1999 Philippe De Muyter <phdm@macqel.be>
- Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+ Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'.
* g++spec.c: Include gcc.h.
(lang_specific_driver): Constify a char*. Call xcalloc, not
- xmalloc/bzero. All calls to the function pointer parameter now
- explicitly call `fatal'.
+ xmalloc/bzero. All calls to the function pointer parameter now
+ explicitly call `fatal'.
1999-09-12 Mark Mitchell <mark@codesourcery.com>
(pt.c): Or CP_TYPE_QUALS for an ERROR_MARK.
(typeck.c): Or TYPE_MAIN_VARIANT for a type.
- * pt.c (for_each_template_parm): Rework to match documentation.
+ * pt.c (for_each_template_parm): Rework to match documentation.
Don't be fooled by a COMPONENT_REF with no TREE_TYPE.
1999-05-20 Jason Merrill <jason@yorick.cygnus.com>
2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/5050
- * tree.c (cp_start_inlining): Remove.
- (cp_end_inlining): Remove.
- * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Do not define.
- (LANG_HOOKS_TREE_INLINING_END_INLINING): Do not define.
- * cp-tree.h (cp_start_inlining): Do not declare.
- (cp_end_inlining): Do not declare.
+ * tree.c (cp_start_inlining): Remove.
+ (cp_end_inlining): Remove.
+ * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Do not define.
+ (LANG_HOOKS_TREE_INLINING_END_INLINING): Do not define.
+ * cp-tree.h (cp_start_inlining): Do not declare.
+ (cp_end_inlining): Do not declare.
2003-12-22 Mark Mitchell <mark@codesourcery.com>
* 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
2003-12-02 Richard Henderson <rth@redhat.com>
* name-lookup.h (struct cp_binding_level): Use ENUM_BITFIELD.
- * parser.c (struct cp_token): Likewise.
- (struct cp_parser_token_tree_map_node): Likewise.
+ * parser.c (struct cp_token): Likewise.
+ (struct cp_parser_token_tree_map_node): Likewise.
* lex.c (struct resword): Move const after ENUM_BITFIELD.
2003-11-30 Mark Mitchell <mark@codesourcery.com>
2003-11-14 Giovanni Bajo <giovannibajo@libero.it>
- PR c++/2294
- * name-lookup.c (push_overloaded_decl): Always construct an OVERLOAD
- unless the declaration is a built-in.
- (set_namespace_binding): While binding OVERLOADs with only one
- declaration, we still need to call supplement_binding.
+ PR c++/2294
+ * name-lookup.c (push_overloaded_decl): Always construct an OVERLOAD
+ unless the declaration is a built-in.
+ (set_namespace_binding): While binding OVERLOADs with only one
+ declaration, we still need to call supplement_binding.
2003-11-14 Mark Mitchell <mark@codesourcery.com>
2003-11-14 Giovanni Bajo <giovannibajo@libero.it>
- PR c++/2094
- * pt.c (unify): Add support for PTRMEM_CST and
- FIELD_DECL unification.
+ PR c++/2094
+ * pt.c (unify): Add support for PTRMEM_CST and
+ FIELD_DECL unification.
2003-11-13 Richard Earnshaw <rearnsha@arm.com>
2003-10-21 Robert Bowdidge <bowdidge@apple.com>
* decl.c (cp_finish_decl): Remove clause intended for asm directives
- in struct or class fields: this code is never executed.
+ in struct or class fields: this code is never executed.
2003-10-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2003-09-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
* cp-tree.h, name-lookup.h, decl.c, decl2.c: Remove reference to
- macros BINDING_SCOPE, BINDING_VALUE and BINDING_TYPE.
+ macros BINDING_SCOPE, BINDING_VALUE and BINDING_TYPE.
2003-09-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
2003-09-17 Richard Henderson <rth@redhat.com>
PR c++/12316
- * semantics.c (expand_or_defer_fn): Inc/dec function_depth.
+ * semantics.c (expand_or_defer_fn): Inc/dec function_depth.
2003-09-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
(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.
2003-09-03 Richard Henderson <rth@redhat.com>
- * decl.c (finish_function): Fix misapplied patch. Don't
- free_after_parsing or free_after_compilation. For real this time.
+ * decl.c (finish_function): Fix misapplied patch. Don't
+ free_after_parsing or free_after_compilation. For real this time.
2003-08-22 Jason Merrill <jason@redhat.com>
2003-06-05 Frank Ch. Eigler <fche@redhat.com>
- * cp-mudflap.c (mx_flag): Remove. Update callers to use mf_mark.
+ * cp-mudflap.c (mx_flag): Remove. Update callers to use mf_mark.
2003-05-24 Diego Novillo <dnovillo@redhat.com>
$(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); \
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.
+ Explicit instantiation of template constructors and destructors is
now supported. For instance:
- template A<int>::A(const A&);
+ template A<int>::A(const A&);
Still not supported:
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.
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
#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);
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
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 *);
{
/* In the case of:
- template <class T> struct S { ~S(); };
- int i;
- i.~S();
+ template <class T> struct S { ~S(); };
+ int i;
+ i.~S();
- NAME will be a class template. */
+ NAME will be a class template. */
gcc_assert (DECL_CLASS_TEMPLATE_P (name));
return false;
}
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;
}
&& 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 =
{
/* [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
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,
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)
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.
-- ...
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;
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;
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)
{
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;
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;
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);
}
{
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);
}
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);
in:
struct A {
- A(A&);
+ A(A&);
template <class T> A(const T&);
};
const A f ();
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,
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
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;
{
case COND_EXPR:
error ("%s for ternary %<operator?:%> in %<%E ? %E : %E%>",
- problem, arg1, arg2, arg3);
+ problem, arg1, arg2, arg3);
break;
case POSTINCREMENT_EXPR:
default:
if (arg2)
error ("%s for %<operator%s%> in %<%E %s %E%>",
- problem, opname, arg1, opname, arg2);
+ problem, opname, arg1, opname, arg2);
else
error ("%s for %<operator%s%> in %<%s%E%>",
- problem, opname, opname, arg1);
+ problem, opname, opname, arg1);
break;
}
}
--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
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);
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
!= 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:
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);
{
/* 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);
if (convs[i]->bad_p)
pedwarn ("passing %qT as %<this%> argument of %q#D discards qualifiers",
- TREE_TYPE (argtype), fn);
+ TREE_TYPE (argtype), fn);
/* [class.mfct.nonstatic]: If a nonstatic member function of a class
X is called for an object that is not of type X, or of a type
derived from X, the behavior is undefined.
- So we can assume that anything passed as 'this' is non-null, and
+ So we can assume that anything passed as 'this' is non-null, and
optimize accordingly. */
gcc_assert (TREE_CODE (parmtype) == POINTER_TYPE);
/* Convert to the base in which the function was declared. */
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,
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)
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);
{
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;
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.
- (DECL_NONSTATIC_MEMBER_FUNCTION_P (cand1->fn)
- DECL_CONSTRUCTOR_P (cand1->fn)));
if (winner)
- return winner;
+ return winner;
}
/* or, if not that,
{
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
if (rank1 > rank2)
winner = -1, w = cand2, l = cand1;
if (winner)
- {
+ {
if (warn)
{
pedwarn ("\
}
else
add_warning (w, l);
- return winner;
- }
+ return winner;
+ }
}
gcc_assert (!winner);
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;
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;
}
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;
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)
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);
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;
{
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));
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;
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,
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)));
if (nonprivate_ctor == 0)
{
warning (0, "%q#T only defines private constructors and has no friends",
- t);
+ t);
return;
}
}
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);
&& 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);
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))
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))
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;
}
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));
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;
}
/* 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);
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);
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))
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))
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;
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);
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;
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))
{
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
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;
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)
{
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
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),
/* 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:
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
{
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;
}
/* 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);
{
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);
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
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);
}
/* 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. */
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;
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);
}
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;
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;
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;
}
}
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
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;
*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;
}
/* 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
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:
/* 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)
struct S
{
template <class U, // Index 0, Level 2.
- class V> // Index 1, Level 2.
+ class V> // Index 1, Level 2.
void f();
};
struct S<int>
{
template <class U, // Index 0, Level 1, Orig Level 2
- class V> // Index 1, Level 1, Orig Level 2
+ class V> // Index 1, Level 1, Orig Level 2
void f();
};
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)
#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; })
({ 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)
#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))
/* 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)))
(((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(())
{
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]
#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]
/* 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. */
/* 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) \
/* 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))
\f
/* C++ language-specific tree codes. */
/* 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) \
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
{
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;
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))
clones. This macro should be used like:
FOR_EACH_CLONE (clone, fn)
- { ... }
+ { ... }
*/
#define FOR_EACH_CLONE(CLONE, FN) \
/* 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)
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))
/* 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)
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))
/* 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 \
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); \
arguments are always complete. For example, given:
template <class T> struct S1 {
- template <class U> struct S2 {};
+ template <class U> struct S2 {};
template <class U> struct S2<U*> {};
};
partial instantiation. For example, given:
template <class T> struct S {
- template <class U> void f(U);
+ template <class U> void f(U);
template <> void f(T);
};
/* 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
/* 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 {
/* 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
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],
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. */
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;
/* 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)))
/* 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. */
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. */
/* 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. */
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);
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 */
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);
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);
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);
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);
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);
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 */
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);
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);
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);
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, ...);
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);
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);
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 *);
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);
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);
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++ */
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.
if (!COMPLETE_TYPE_P (intype))
{
error ("can't convert from incomplete type %qT to %qT",
- intype, type);
+ intype, type);
return error_mark_node;
}
{
if (rval == error_mark_node)
error ("conversion of %qE from %qT to %qT is ambiguous",
- expr, intype, type);
+ expr, intype, type);
return rval;
}
}
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;
}
{
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.
}
}
error ("cannot convert %qE from type %qT to type %qT",
- expr, intype, type);
+ expr, intype, type);
return error_mark_node;
}
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;
}
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)))
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);
}
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;
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);
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)))
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
{
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))
{
{
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));
}
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;
}
{
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:
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:;
case FUNCTION_TYPE:
case ARRAY_TYPE:
return (desires & WANT_POINTER) ? decay_conversion (expr)
- : NULL_TREE;
+ : NULL_TREE;
default:
return NULL_TREE;
}
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;
}
case IDENTIFIER_NODE:
if (t == NULL)
- pp_cxx_identifier (pp, "<unnamed>");
+ pp_cxx_identifier (pp, "<unnamed>");
else if (IDENTIFIER_TYPENAME_P (t))
- pp_cxx_conversion_function_id (pp, t);
+ pp_cxx_conversion_function_id (pp, t);
else
- {
- if (is_destructor_name (t))
- {
- pp_complement (pp);
- /* FIXME: Why is this necessary? */
- if (TREE_TYPE (t))
- t = constructor_name (TREE_TYPE (t));
- }
- pp_cxx_tree_identifier (pp, t);
- }
+ {
+ if (is_destructor_name (t))
+ {
+ pp_complement (pp);
+ /* FIXME: Why is this necessary? */
+ if (TREE_TYPE (t))
+ t = constructor_name (TREE_TYPE (t));
+ }
+ pp_cxx_tree_identifier (pp, t);
+ }
break;
case TEMPLATE_ID_EXPR:
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:
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;
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;
}
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
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:
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);
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;
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:
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;
/* 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:
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:
{
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;
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;
}
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);
}
}
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:
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);
}
{
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);
}
/* 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 ) */
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;
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;
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, ',');
}
}
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);
/* 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 ) */
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:
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;
{
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);
}
}
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");
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);
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);
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);
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))
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");
break;
/* expression-statement:
- expression(opt) ; */
+ expression(opt) ; */
case EXPR_STMT:
pp_cxx_expression (pp, EXPR_STMT_EXPR (t));
pp_cxx_semicolon (pp);
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));
}
}
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;
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))
{
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:
#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)
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);
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;
/* We've not seen enough template headers to match all the
specialized classes present. For example:
- template <class T> void R<T>::S<T>::f(int);
+ template <class T> void R<T>::S<T>::f(int);
This is invalid; there needs to be one set of template
parameters for each class. */
/* We're processing a non-template declaration (even though it may
be a member of a template class.) For example:
- template <class T> void S<T>::f(int);
+ template <class T> void S<T>::f(int);
The `class T' maches the `S<T>', leaving no template headers
corresponding to the `f'. */
else if (n_template_parm_scopes > n_class_scopes + 1)
/* We've got too many template headers. For example:
- template <> template <class T> void f (T);
+ template <> template <class T> void f (T);
There need to be more enclosing classes. */
return tsk_excessive_parms;
else
/* This must be a template. It's of the form:
- template <class T> template <class U> void S<T>::f(U);
+ template <class T> template <class U> void S<T>::f(U);
This is a specialization if the innermost level was a
specialization; otherwise it's just a definition of the
#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. */
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;
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. */
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
))
{
#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);
{
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
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;
}
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. */
{
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. */
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)),
{
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
{
/* 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.
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
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));
}
}
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);
}
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. */
&& ! 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);
}
}
}
/* 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)
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. */
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
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;
{
if (complain & tf_error)
error ("no class template named %q#T in %q#T",
- name, context);
+ name, context);
return error_mark_node;
}
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))
{
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;
/* 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;
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;
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. */
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);
}
}
&& 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);
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;
if (! toplevel_bindings_p ()
&& DECL_EXTERNAL (decl))
warning (0, "declaration of %q#D has %<extern%> and is initialized",
- decl);
+ decl);
DECL_EXTERNAL (decl) = 0;
if (toplevel_bindings_p ())
TREE_STATIC (decl) = 1;
{
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);
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. */
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;
}
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);
}
}
if (TYPE_NON_AGGREGATE_CLASS (type))
{
error ("%qD must be initialized by constructor, "
- "not by %<{...}%>",
+ "not by %<{...}%>",
decl);
init = error_mark_node;
}
{
/* The declaration for `atexit' is:
- int atexit (void (*)());
+ int atexit (void (*)());
We build up the argument types and then then function type
itself. */
/* Emit code to perform this initialization but once. This code
looks like:
- static <type> guard;
- if (!guard.first_byte) {
+ static <type> guard;
+ if (!guard.first_byte) {
if (__cxa_guard_acquire (&guard)) {
bool flag = false;
try {
- // Do initialization.
- flag = true; __cxa_guard_release (&guard);
- // Register variable for destruction at end of program.
+ // Do initialization.
+ flag = true; __cxa_guard_release (&guard);
+ // Register variable for destruction at end of program.
} catch {
- if (!flag) __cxa_guard_abort (&guard);
+ if (!flag) __cxa_guard_abort (&guard);
}
}
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. */
static void
bad_specifiers (tree object,
- const char* type,
- int virtualp,
- int quals,
- int inlinep,
- int friendp,
- int raises)
+ const char* type,
+ int virtualp,
+ int quals,
+ int inlinep,
+ int friendp,
+ int raises)
{
if (virtualp)
error ("%qD declared as a %<virtual%> %s", object, type);
error ("%qD declared as an %<inline%> %s", object, type);
if (quals)
error ("%<const%> and %<volatile%> function specifiers on "
- "%qD invalid in %s declaration",
- object, type);
+ "%qD invalid in %s declaration",
+ object, type);
if (friendp)
cp_error_at ("%qD declared as a friend", object);
if (raises
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;
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
{
/* Something like `template <class T> friend void f<T>()'. */
error ("invalid use of template-id %qD in declaration "
- "of primary template",
- orig_declarator);
+ "of primary template",
+ orig_declarator);
return NULL_TREE;
}
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);
if (has_default_arg)
{
error ("default arguments are not allowed in declaration "
- "of friend template specialization %qD",
- decl);
+ "of friend template specialization %qD",
+ decl);
return NULL_TREE;
}
if (inlinep)
{
error ("%<inline%> is not allowed in declaration of friend "
- "template specialization %qD",
- decl);
+ "template specialization %qD",
+ decl);
return NULL_TREE;
}
}
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;
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
}
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;
}
/* `(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");
}
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,
/* 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");
{
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;
}
static tree
check_special_function_return_type (special_function_kind sfk,
- tree type,
- tree optype)
+ tree type,
+ tree optype)
{
switch (sfk)
{
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;
type_quals |= TYPE_QUAL_RESTRICT;
if (sfk == sfk_conversion && type_quals != TYPE_UNQUALIFIED)
error ("qualifiers are not allowed on declaration of %<operator %T%>",
- ctor_return_type);
+ ctor_return_type);
if (TREE_CODE (type) == FUNCTION_TYPE
&& type_quals != TYPE_UNQUALIFIED)
{
/* This was an error in C++98 (cv-qualifiers cannot be added to
- a function type), but DR 295 makes the code well-formed by
- dropping the extra qualifiers. */
+ a function type), but DR 295 makes the code well-formed by
+ dropping the extra qualifiers. */
if (pedantic)
- {
- tree bad_type = build_qualified_type (type, type_quals);
- pedwarn ("ignoring %qV qualifiers added to function type %qT",
- bad_type, type);
- }
+ {
+ tree bad_type = build_qualified_type (type, type_quals);
+ pedwarn ("ignoring %qV qualifiers added to function type %qT",
+ bad_type, type);
+ }
type_quals = TYPE_UNQUALIFIED;
}
type_quals |= cp_type_quals (type);
type = cp_build_qualified_type_real
(type, type_quals, ((typedef_decl && !DECL_ARTIFICIAL (typedef_decl)
- ? tf_ignore_bad_quals : 0) | tf_error | tf_warning));
+ ? tf_ignore_bad_quals : 0) | tf_error | tf_warning));
/* We might have ignored or rejected some of the qualifiers. */
type_quals = cp_type_quals (type);
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. */
return void_type_node;
}
}
- else /* It's a constructor. */
+ else /* It's a constructor. */
{
if (explicitp == 1)
explicitp = 2;
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,
}
type = build_function_type (type, arg_types);
- type = cp_build_qualified_type (type, quals);
+ type = cp_build_qualified_type (type, quals);
}
break;
{
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,
else
{
error ("cannot declare member function %<%T::%s%> within %<%T%>",
- ctype, name, current_class_type);
+ ctype, name, current_class_type);
return error_mark_node;
}
}
if (explicitp == 1 || (explicitp && friendp))
{
/* [dcl.fct.spec] The explicit specifier shall only be used in
- declarations of constructors within a class definition. */
+ declarations of constructors within a class definition. */
error ("only declarations of constructors can be %<explicit%>");
explicitp = 0;
}
if (storage_class == sc_mutable)
{
if (decl_context != FIELD || friendp)
- {
+ {
error ("non-member %qs cannot be declared %<mutable%>", name);
storage_class = sc_none;
- }
+ }
else if (decl_context == TYPENAME || declspecs->specs[(int)ds_typedef])
{
error ("non-object member %qs cannot be declared %<mutable%>", name);
storage_class = sc_none;
}
else if (TREE_CODE (type) == FUNCTION_TYPE
- || TREE_CODE (type) == METHOD_TYPE)
- {
+ || TREE_CODE (type) == METHOD_TYPE)
+ {
error ("function %qs cannot be declared %<mutable%>", name);
storage_class = sc_none;
- }
+ }
else if (staticp)
{
error ("static %qs cannot be declared %<mutable%>", name);
{
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);
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),
if (TREE_CODE (type) == TEMPLATE_TYPE_PARM)
pedwarn ("template parameters cannot be friends");
else if (TREE_CODE (type) == TYPENAME_TYPE)
- pedwarn ("friend declaration requires class-key, "
+ pedwarn ("friend declaration requires class-key, "
"i.e. %<friend class %T::%D%>",
TYPE_CONTEXT (type), TYPENAME_TYPE_FULLNAME (type));
else
- pedwarn ("friend declaration requires class-key, "
+ pedwarn ("friend declaration requires class-key, "
"i.e. %<friend %#T%>",
type);
}
/*complain=*/true);
else
error ("trying to make class %qT a friend of global scope",
- type);
+ type);
type = void_type_node;
}
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)
{
if (virtualp)
{
error ("%qD cannot be declared virtual, since it "
- "is always static",
+ "is always static",
unqualified_id);
virtualp = 0;
}
&& declspecs->type
&& declspecs->type == type)
error (" in instantiation of template %qT",
- current_class_type);
+ current_class_type);
type = error_mark_node;
decl = NULL_TREE;
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;
/* 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)
{
{
if (storage_class == sc_static)
pedwarn ("%<static%> specified invalid for function %qs "
- "declared out of global scope", name);
+ "declared out of global scope", name);
else
pedwarn ("%<inline%> specifier invalid for function %qs "
- "declared out of global scope", name);
+ "declared out of global scope", name);
}
if (ctype == NULL_TREE)
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)
DECL_CONTEXT (decl) = ctype;
if (staticp == 1)
{
- pedwarn ("%<static%> may not be used when defining "
- "(as opposed to declaring) a static data member");
- staticp = 0;
+ pedwarn ("%<static%> may not be used when defining "
+ "(as opposed to declaring) a static data member");
+ staticp = 0;
storage_class = sc_none;
}
if (storage_class == sc_register && TREE_STATIC (decl))
}
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;
}
}
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);
{
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;
}
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)
{
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)
{
/* [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;
{
/* [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);
{
/* [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;
|| !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
{
|| operator_code == TRUTH_ORIF_EXPR
|| operator_code == COMPOUND_EXPR))
warning (0, "user-defined %qD always evaluates both arguments",
- decl);
+ decl);
}
/* Effective C++ rule 23. */
/* [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);
+ }
}
DECL_ANTICIPATED (TYPE_TI_TEMPLATE (t)) = 0;
DECL_FRIEND_P (TYPE_TI_TEMPLATE (t)) = 0;
}
- }
+ }
}
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
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)));
/* 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. */
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)
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);
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;
}
}
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);
else
{
error ("invalid types %<%T[%T]%> for array subscript",
- type, TREE_TYPE (index_exp));
+ type, TREE_TYPE (index_exp));
return error_mark_node;
}
if (t == NULL_TREE || t == error_mark_node)
{
error ("type %q#T argument given to %<delete%>, expected pointer",
- TREE_TYPE (exp));
+ TREE_TYPE (exp));
return error_mark_node;
}
if (TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
{
error ("cannot delete a function. Only pointer-to-objects are "
- "valid arguments to %<delete%>");
+ "valid arguments to %<delete%>");
return error_mark_node;
}
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))
{
if (!acceptable_java_type (ret_type))
{
error ("Java method %qD has non-Java return type %qT",
- method, ret_type);
+ method, ret_type);
jerr = true;
}
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;
}
}
we're not going to find the declaration in the class.
For example, in:
- struct S { template <typename T> void f(T); };
- template <> void S::f(int);
+ struct S { template <typename T> void f(T); };
+ template <> void S::f(int);
we're not going to find `S::f(int)', but there's no
reason we should, either. We let our callers know we didn't
void
finish_static_data_member_decl (tree decl, tree init, tree asmspec_tree,
- int flags)
+ int flags)
{
gcc_assert (TREE_PUBLIC (decl));
error ("initializer invalid for static member with constructor");
if (!explained)
- {
+ {
error ("(an out of class initialization is required)");
explained = 1;
}
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;
&& 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)
else
{
/* We allow initializers to become parameters to base
- initializers. */
+ initializers. */
if (TREE_CODE (init) == TREE_LIST)
{
if (TREE_CHAIN (init) == NULL_TREE)
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;
}
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;
}
{
e = 2;
if (args && args != void_list_node)
- args = TREE_CHAIN (args);
+ args = TREE_CHAIN (args);
pedwarn ("%<operator new%> takes type %<size_t%> (%qT) "
- "as first parameter", size_type_node);
+ "as first parameter", size_type_node);
}
switch (e)
{
/* 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:;
}
{
e = 2;
if (args && args != void_list_node)
- args = TREE_CHAIN (args);
+ args = TREE_CHAIN (args);
error ("%<operator delete%> takes type %qT as first parameter",
- ptr_type_node);
+ ptr_type_node);
}
switch (e)
{
/* 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:;
}
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;
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.
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,