Remove extra white spacing at end of lines.
From-SVN: r100952
This commit is contained in:
parent
581fb421b9
commit
c8094d835f
|
@ -117,7 +117,7 @@
|
|||
* parser.c (cp_parser_postfix_expression): Allow non-constant
|
||||
expressions as arguments to __builtin_constant_p.
|
||||
* tree.c (builtin_valid_in_constant_expr_p): Use
|
||||
DECL_IS_BUILTIN_CONSTANT_P.
|
||||
DECL_IS_BUILTIN_CONSTANT_P.
|
||||
|
||||
2005-06-03 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
|
@ -315,7 +315,7 @@
|
|||
Mike Stump <mrs@apple.com>
|
||||
|
||||
Yet more Objective-C++...
|
||||
|
||||
|
||||
* cp-objcp-common.h (cxx_get_alias_set): Move from
|
||||
here...
|
||||
(cxx_warn_unused_global_decl): Likewise.
|
||||
|
@ -422,7 +422,7 @@
|
|||
|
||||
* typeck.c (build_unary_op): Do not resort to address arithmetic
|
||||
when taking the address of a COMPONENT_REF.
|
||||
|
||||
|
||||
2005-05-08 Kazu Hirata <kazu@cs.umass.edu>
|
||||
|
||||
* class.c (vtbl_init_data_s): Change the type of fns to
|
||||
|
@ -593,7 +593,7 @@
|
|||
* decl2.c (check_classfn): Adjust.
|
||||
* init.c (sort_mem_initializers, push_base_cleanups): Adjust.
|
||||
* method.c (do_build_copy_constructor): Adjust.
|
||||
* name-lookup.c (new_class_binding, store_binding,
|
||||
* name-lookup.c (new_class_binding, store_binding,
|
||||
store_bindings, store_class_bindings): Adjust.
|
||||
* name-lookup.h: Define VEC(cxx_saved_binding,gc),
|
||||
VEC(cp_class_binding,gc).
|
||||
|
@ -649,7 +649,7 @@
|
|||
* typeck.c (cxx_sizeof_or_alignof_type): Check whether the type to
|
||||
which sizeof/alignof is dependent, rather than just whether we are
|
||||
processing_template_decl.
|
||||
|
||||
|
||||
2005-04-17 Kazu Hirata <kazu@cs.umass.edu>
|
||||
|
||||
* cp-tree.h (LOOKUP_GLOBAL): Remove.
|
||||
|
@ -679,7 +679,7 @@
|
|||
|
||||
* decl2.c (determine_visibility): Don't use export_class_data.
|
||||
(import_export_decl): Honor TARGET_CXX_CLASS_DATA_ALWAYS_WEAK and
|
||||
TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY.
|
||||
TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY.
|
||||
|
||||
2005-04-09 Kazu Hirata <kazu@cs.umass.edu>
|
||||
|
||||
|
@ -738,7 +738,7 @@
|
|||
(cp_parser_type_specifier_seq): In a condition, do not allow
|
||||
invalid type-specifier combinations.
|
||||
(cp_parser_exception_declaration): Adjust call to
|
||||
cp_parser_type_specifier_seq.
|
||||
cp_parser_type_specifier_seq.
|
||||
|
||||
* cp-tree.def (TINST_LEVEL): Document TINST_IN_SYSTEM_HEADER_P.
|
||||
* cp-tree.h (struct tinst_level): Add in_system_header_p.
|
||||
|
@ -1021,14 +1021,14 @@
|
|||
(lookup_template_class, instantiate_class_template): Adjust call
|
||||
to pushtag.
|
||||
* semantics.c (begin_class_definition): Likewise.
|
||||
* rtti.c (init_rtti_processing, build_dynamic_cast_1,
|
||||
* rtti.c (init_rtti_processing, build_dynamic_cast_1,
|
||||
tinfo_base_init, emit_support_tinfos): Use ts_current instead of
|
||||
ts_global.
|
||||
|
||||
2005-03-13 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/20157
|
||||
* pt.c (determine_specialization): Reject non-specializations.
|
||||
* pt.c (determine_specialization): Reject non-specializations.
|
||||
|
||||
2005-03-11 Per Bothner <per@bothner.com>
|
||||
|
||||
|
@ -1054,7 +1054,7 @@
|
|||
|
||||
2005-03-09 Paolo Carlini <pcarlini@suse.de>
|
||||
|
||||
PR c++/16859
|
||||
PR c++/16859
|
||||
* decl.c (complete_array_type): In pedantic mode, return
|
||||
3 for an empty initializer list as the initializer for an
|
||||
array of unknown bound (8.5.1/4).
|
||||
|
@ -1075,7 +1075,7 @@
|
|||
(cp_finish_decl): Remove dead code.
|
||||
* init.c (build_vec_init): When determining whether or not the
|
||||
element type has an asignment operator, look through all array
|
||||
dimensions.
|
||||
dimensions.
|
||||
* typeck.c (target_type): Remove.
|
||||
|
||||
2005-03-07 Mark Mitchell <mark@codesourcery.com>
|
||||
|
@ -1109,7 +1109,7 @@
|
|||
|
||||
PR c++/20232
|
||||
* class.c (update_vtable_entry_for_fn): Don't crash on invalid
|
||||
covariancy.
|
||||
covariancy.
|
||||
|
||||
* cp-tree.g (THUNK_TARGET): Expand comment.
|
||||
* method.c (use_thunk): Make sure we also use the target, if that
|
||||
|
@ -1164,7 +1164,7 @@
|
|||
PR c++/20152
|
||||
* parser.c (cp_parser_class_head): Check for redefintions here.
|
||||
* semantics.c (begin_class_definition): Not here.
|
||||
|
||||
|
||||
PR c++/20153
|
||||
* decl2.c (build_anon_union_vars): Add type parameter.
|
||||
(finish_anon_union): Pass it.
|
||||
|
@ -1177,15 +1177,15 @@
|
|||
* parser.c (cp_parser_direct_declarator): Always complain about
|
||||
non-constant array bounds when in a function scope.
|
||||
* semantics.c (finish_id_expression): Do not mark dependent names
|
||||
as non-constant.
|
||||
as non-constant.
|
||||
|
||||
2005-02-21 Douglas Gregor <dgregor@cs.indiana.edu>
|
||||
|
||||
|
||||
PR c++/19076
|
||||
PR c++/6628
|
||||
* cp-tree.h (cp_apply_type_quals_to_decl): Declared.
|
||||
* decl.c (grokdeclarator): Pedwarn about qualifying a function
|
||||
type.
|
||||
type.
|
||||
Add qualifiers when declaring a typedef of a function type.
|
||||
Member function pointers pick up the qualifiers of the typedef
|
||||
used to declare them.
|
||||
|
@ -1196,7 +1196,7 @@
|
|||
(start_preparsed_function): Use cp_apply_type_quals_to_decl.
|
||||
(grokclassfn): Use cp_apply_type_quals_to_decl.
|
||||
* error.c (dump_type_suffix): Print qualifiers for function
|
||||
types.
|
||||
types.
|
||||
* pt.c (tsubst_decl): Use cp_apply_type_quals_to_decl.
|
||||
(tsubst): When substituting a function type into a member
|
||||
pointer type, pass along the qualifiers.
|
||||
|
|
|
@ -805,7 +805,7 @@ Sat Oct 1 15:18:49 1994 Jason Merrill <jason@phydeaux.cygnus.com>
|
|||
push_c_function_context.
|
||||
(pop_cp_function_context): Similarly.
|
||||
(finish_function): Reverse order of poplevel and pop_nested_class so
|
||||
that current_class_decl is restored properly.
|
||||
that current_class_decl is restored properly.
|
||||
(start_function): Likewise.
|
||||
(finish_function): Add parameter 'nested'. Don't call
|
||||
permanent_allocation if (nested).
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -190,7 +190,7 @@
|
|||
other parsing fails.
|
||||
(cp_parser_enclosed_template_argument_list): If the argument list is
|
||||
parsed correctly, but the next token is '>>', emit a diagnostic.
|
||||
(cp_parser_next_token_ends_template_argument): Accept '>>' as
|
||||
(cp_parser_next_token_ends_template_argument): Accept '>>' as
|
||||
delimiter of template argument, it will be later detected as a typo.
|
||||
|
||||
2003-12-17 Kelley Cook <kcook@gcc.gnu.org>
|
||||
|
@ -396,7 +396,7 @@
|
|||
|
||||
PR c/13134
|
||||
* decl.c (duplicate_decls): Copy visibility flag when appropriate.
|
||||
|
||||
|
||||
2003-12-09 Giovanni Bajo <giovannibajo@gcc.gnu.org>
|
||||
|
||||
* init.c (build_new_1): Deal with an OVERLOAD set when
|
||||
|
@ -414,7 +414,7 @@
|
|||
|
||||
PR c++/11929
|
||||
* call.c (magic_varargs_p): New fn.
|
||||
(build_over_call): Do no ellipsis conversions for arguments to
|
||||
(build_over_call): Do no ellipsis conversions for arguments to
|
||||
functions with magic varargs.
|
||||
|
||||
* name-lookup.c, init.c, except.c: Revert Giovanni's patch from
|
||||
|
@ -460,7 +460,7 @@
|
|||
PR c++/13305
|
||||
* parser.c (cp_parser_elaborated_type_specifier): Accept
|
||||
attributes.
|
||||
|
||||
|
||||
2003-12-05 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/13314
|
||||
|
@ -514,7 +514,7 @@
|
|||
2003-12-02 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* name-lookup.h (struct cp_binding_level): Use ENUM_BITFIELD.
|
||||
* parser.c (struct cp_token): Likewise.
|
||||
* parser.c (struct cp_token): Likewise.
|
||||
(struct cp_parser_token_tree_map_node): Likewise.
|
||||
* lex.c (struct resword): Move const after ENUM_BITFIELD.
|
||||
|
||||
|
@ -709,7 +709,7 @@
|
|||
* decl.c (duplicate_decls): copy DECL_VISIBILITY field.
|
||||
* method.c (use_thunk): give thunk same visibility as function.
|
||||
* optimize.c (maybe_clone_body): copy DECL_VISIBILITY field.
|
||||
|
||||
|
||||
2003-11-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
||||
PR c++/11616
|
||||
|
@ -799,7 +799,8 @@
|
|||
mangle a non-existant middle operator to the ?: operator.
|
||||
|
||||
2003-10-21 Robert Bowdidge <bowdidge@apple.com>
|
||||
* decl.c (cp_finish_decl): Remove clause intended for asm directives
|
||||
|
||||
* decl.c (cp_finish_decl): Remove clause intended for asm directives
|
||||
in struct or class fields: this code is never executed.
|
||||
|
||||
2003-10-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
@ -961,7 +962,7 @@
|
|||
|
||||
2003-10-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
Break out decl.c (2/n)
|
||||
Break out decl.c (2/n)
|
||||
* name-lookup.c: Include diagnostic.h
|
||||
(cxx_binding_free): Make static.
|
||||
(cxx_binding_make): Likewise.
|
||||
|
@ -1056,7 +1057,7 @@
|
|||
(maybe_process_template_type_declaration): Likewise.
|
||||
(pop_binding): Likewise.
|
||||
* cp-tree.h: Move corresponding declarations to name-lookup.h
|
||||
|
||||
|
||||
2003-10-12 Steven Bosscher <steven@gcc.gnu.org>
|
||||
|
||||
* cvt.c (ocp_convert): Move warning to C common code.
|
||||
|
@ -1096,7 +1097,7 @@
|
|||
pp_cxx_flag_qualified_id and pp_cxx_flag_global_scope.
|
||||
* cxx-pretty-print.c (pp_cxx_id_expression): Always display
|
||||
qualified entities using qualified names.
|
||||
|
||||
|
||||
PR c++/12337
|
||||
* init.c (build_new_1): Make sure that the expression returned is
|
||||
not an lvalue.
|
||||
|
@ -1122,7 +1123,7 @@
|
|||
2003-10-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
* name-lookup.c (binding_entry_free): Nullify name and type
|
||||
fields.
|
||||
fields.
|
||||
|
||||
2003-10-02 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
|
@ -1143,7 +1144,7 @@
|
|||
2003-09-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
* decl.c (pop_binding): Don't mess with nullifying binding->scope
|
||||
here.
|
||||
here.
|
||||
* name-lookup.c: Re-format.
|
||||
(cxx_binding_free): Nullify binding->scope.
|
||||
|
||||
|
@ -1286,7 +1287,7 @@
|
|||
2003-09-19 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
* decl.c (cxx_scope_descriptor): Fix thinko.
|
||||
(struct cp_binding_level): Adjust type of binding_depth field.
|
||||
(struct cp_binding_level): Adjust type of binding_depth field.
|
||||
|
||||
2003-09-18 Danny Smith <dannysmith@users.sourceforge.net>
|
||||
|
||||
|
@ -1317,7 +1318,7 @@
|
|||
2003-09-18 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
* error.c (dump_type): Simplify. Use pp_type_specifier_seq for
|
||||
"C" types.
|
||||
"C" types.
|
||||
* cxx-pretty-print.c (pp_cxx_type_specifier_seq): Fix thinko.
|
||||
|
||||
2003-09-17 Richard Henderson <rth@redhat.com>
|
||||
|
@ -1397,7 +1398,7 @@
|
|||
the various flags.
|
||||
(set_block): Remove check for doing_semantic_analysis_p.
|
||||
(pushlevel_class): Use "kind" field in binding_level, not
|
||||
the various flags.
|
||||
the various flags.
|
||||
(poplevel_class): Likewise.
|
||||
(initial_push_namespace_scope): Likewise.
|
||||
(maybe_push_to_top_level): Likewise.
|
||||
|
@ -1427,7 +1428,7 @@
|
|||
(save_function-data): Do not set expanding_p.
|
||||
(cxx_push_function_context): Do not clear expanding_p.
|
||||
* semantics.c (cxx_expand_function_start): Do not set expanding_p.
|
||||
|
||||
|
||||
2003-09-14 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* class.c (layout_class_type): Make DECL_MODE match TYPE_MODE for
|
||||
|
@ -1487,7 +1488,7 @@
|
|||
|
||||
2003-09-09 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* semantics.c (expand_or_defer_fn): Update call to
|
||||
* semantics.c (expand_or_defer_fn): Update call to
|
||||
cgraph_finalize_function.
|
||||
|
||||
* semantics.c (expand_or_defer_fn): Use cgraph_finalize_function
|
||||
|
@ -1540,7 +1541,7 @@
|
|||
* error.c (dump_decl): Handle namespace-alias-definition.
|
||||
* decl.c (warn_extern_redeclared_static): There is no point in
|
||||
checking changes in storage class specifier for a namespace
|
||||
declaration.
|
||||
declaration.
|
||||
(duplicate_decls): Tidy diagnostic message.
|
||||
* cxx-pretty-print.c (pp_cxx_left_brace): New macro.
|
||||
(pp_cxx_right_brace): Likewise.
|
||||
|
@ -1571,7 +1572,7 @@
|
|||
(push_class_binding): Likewise.
|
||||
(set_identifier_type_value_with_scope): Likewise.
|
||||
* name-lookup.c (supplement_binding): Rename from add_binding.
|
||||
Return a bool. Improve documentation.
|
||||
Return a bool. Improve documentation.
|
||||
(set_namespace_binding): Adjust.
|
||||
* Make-lang.in (cp/name-lookup.o): Depend on toplev.h
|
||||
|
||||
|
@ -1785,7 +1786,7 @@
|
|||
|
||||
PR c++/11811
|
||||
* cxx-pretty-print.c (pp_cxx_canonical_template_parameter): New
|
||||
function.
|
||||
function.
|
||||
* cxx-pretty-print.h: Declare.
|
||||
* error.c (dump_template_parameter): Use it.
|
||||
(dump_type): Likewise.
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
* init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to
|
||||
the proper type.
|
||||
|
||||
|
||||
2004-02-24 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/13944
|
||||
|
@ -89,7 +89,7 @@
|
|||
* call.c, cvt.c, init.c, typeck.c: Use TREE_NO_WARNING instead
|
||||
of TREE_NO_UNUSED_WARNING.
|
||||
* cvt.c (convert_to_void): Also use it for "has no effect" warning.
|
||||
|
||||
|
||||
2004-01-30 Frank Ch. Eigler <fche@redhat.com>
|
||||
|
||||
* cp-mudflap.c (mflang_flush_calls): Mark static ctor as TREE_USED.
|
||||
|
@ -138,7 +138,7 @@
|
|||
* cp-lang.c (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Kill.
|
||||
* cp-tree.h (cxx_callgraph_analyze_expr): Kill.
|
||||
* decl2.c (cxx_callgraph_analyze_expr): Kill.
|
||||
|
||||
|
||||
2003-12-14 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* cp-lang.c (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Kill.
|
||||
|
|
|
@ -60,7 +60,7 @@ g++spec.o: $(srcdir)/cp/g++spec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) $(CON
|
|||
$(INCLUDES) $(srcdir)/cp/g++spec.c)
|
||||
|
||||
# Create the compiler driver for g++.
|
||||
GXX_OBJS = gcc.o g++spec.o intl.o prefix.o version.o
|
||||
GXX_OBJS = gcc.o g++spec.o intl.o prefix.o version.o
|
||||
g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
|
||||
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
|
||||
$(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
|
||||
|
@ -181,7 +181,7 @@ c++.install-common: installdirs
|
|||
doc/g++.1: doc/gcc.1
|
||||
cp doc/gcc.1 doc/g++.1
|
||||
|
||||
c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
|
||||
c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
|
||||
|
||||
$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 installdirs
|
||||
-rm -f $@
|
||||
|
|
36
gcc/cp/NEWS
36
gcc/cp/NEWS
|
@ -9,15 +9,15 @@
|
|||
* G++ no longer allows in-class initializations of static data members
|
||||
that do not have arithmetic or enumeration type. For example:
|
||||
|
||||
struct S {
|
||||
struct S {
|
||||
static const char* const p = "abc";
|
||||
};
|
||||
|
||||
is no longer accepted.
|
||||
is no longer accepted.
|
||||
|
||||
Use the standards-conformant form:
|
||||
|
||||
struct S {
|
||||
struct S {
|
||||
static const char* const p;
|
||||
};
|
||||
|
||||
|
@ -39,12 +39,12 @@
|
|||
pointer to cv-qualified member function types.
|
||||
|
||||
* The C++ ABI has been changed to correctly handle this code:
|
||||
|
||||
|
||||
struct A {
|
||||
void operator delete[] (void *, size_t);
|
||||
};
|
||||
|
||||
struct B : public A {
|
||||
struct B : public A {
|
||||
};
|
||||
|
||||
new B[10];
|
||||
|
@ -52,17 +52,17 @@
|
|||
The amount of storage allocated for the array will be greater than
|
||||
it was in 3.0, in order to store the number of elements in the
|
||||
array, so that the correct size can be passed to `operator delete[]'
|
||||
when the array is deleted. Previously, the value passed to
|
||||
when the array is deleted. Previously, the value passed to
|
||||
`operator delete[]' was unpredictable.
|
||||
|
||||
This change will only affect code that declares a two-argument
|
||||
`operator delete[]' with a second parameter of type `size_t'
|
||||
in a base class, and does not override that definition in a
|
||||
in a base class, and does not override that definition in a
|
||||
derived class.
|
||||
|
||||
* The C++ ABI has been changed so that:
|
||||
|
||||
struct A {
|
||||
struct A {
|
||||
void operator delete[] (void *, size_t);
|
||||
void operator delete[] (void *);
|
||||
};
|
||||
|
@ -109,7 +109,7 @@
|
|||
are those whose types involve non-type template arguments whose
|
||||
mangled representations require more than one digit.
|
||||
|
||||
* Support for assignment to `this' has been removed. This idiom
|
||||
* Support for assignment to `this' has been removed. This idiom
|
||||
was used in the very early days of C++, before users were allowed
|
||||
to overload `operator new'; it is no longer allowed by the C++
|
||||
standard.
|
||||
|
@ -124,15 +124,15 @@
|
|||
|
||||
* G++ previously allowed `sizeof (X::Y)' where Y was a non-static
|
||||
member of X, even if the `sizeof' expression occurred outside
|
||||
of a non-static member function of X (or one of its derived classes,
|
||||
of a non-static member function of X (or one of its derived classes,
|
||||
or a member-initializer for X or one of its derived classes.) This
|
||||
extension has been removed.
|
||||
|
||||
* G++ no longer allows you to overload the conditional operator (i.e.,
|
||||
* G++ no longer allows you to overload the conditional operator (i.e.,
|
||||
the `?:' operator.)
|
||||
|
||||
* The "named return value" extension:
|
||||
|
||||
|
||||
int f () return r { r = 3; }
|
||||
|
||||
has been deprecated, and will be removed in a future version of G++.
|
||||
|
@ -175,7 +175,7 @@
|
|||
|
||||
*** Changes in EGCS 1.1:
|
||||
|
||||
* Namespaces are fully supported. The library has not yet been converted
|
||||
* Namespaces are fully supported. The library has not yet been converted
|
||||
to use namespace std, however, and the old std-faking code is still on by
|
||||
default. To turn it off, you can use -fhonor-std.
|
||||
|
||||
|
@ -252,7 +252,7 @@
|
|||
|
||||
http://www.cygnus.com/misc/wp/dec96pub/template.html#temp.res
|
||||
|
||||
+ Guiding declarations are no longer supported. Function declarations,
|
||||
+ Guiding declarations are no longer supported. Function declarations,
|
||||
including friend declarations, do not refer to template instantiations.
|
||||
You can restore the old behavior with -fguiding-decls until you fix
|
||||
your code.
|
||||
|
@ -315,7 +315,7 @@
|
|||
converting from a bound member function pointer to function
|
||||
pointer).
|
||||
|
||||
+ A flag -Weffc++ has been added for violations of some of the style
|
||||
+ A flag -Weffc++ has been added for violations of some of the style
|
||||
guidelines in Scott Meyers' _Effective C++_ books.
|
||||
|
||||
+ -Woverloaded-virtual now warns if a virtual function in a base
|
||||
|
@ -336,13 +336,13 @@
|
|||
|
||||
* __FUNCTION__ and __PRETTY_FUNCTION__ are now treated as variables by the
|
||||
parser; previously they were treated as string constants. So code like
|
||||
`printf (__FUNCTION__ ": foo")' must be rewritten to
|
||||
`printf (__FUNCTION__ ": foo")' must be rewritten to
|
||||
`printf ("%s: foo", __FUNCTION__)'. This is necessary for templates.
|
||||
|
||||
* local static variables in extern inline functions will be shared between
|
||||
translation units.
|
||||
|
||||
* -fvtable-thunks is supported for all targets, and is the default for
|
||||
* -fvtable-thunks is supported for all targets, and is the default for
|
||||
Linux with glibc 2.x (also called libc 6.x).
|
||||
|
||||
* bool is now always the same size as another built-in type. Previously,
|
||||
|
@ -395,7 +395,7 @@
|
|||
* Joe Buck <jbuck@synopsys.com>, the maintainer of the g++ FAQ.
|
||||
* Brendan Kehoe <brendan@cygnus.com>, who coordinates testing of g++.
|
||||
* Jason Merrill <jason@cygnus.com>, the g++ maintainer.
|
||||
* Mark Mitchell <mmitchell@usa.net>, who implemented member function
|
||||
* Mark Mitchell <mmitchell@usa.net>, who implemented member function
|
||||
templates and explicit qualification of function templates.
|
||||
* Mike Stump <mrs@wrs.com>, the previous g++ maintainer, who did most of
|
||||
the exception handling work.
|
||||
|
|
518
gcc/cp/call.c
518
gcc/cp/call.c
File diff suppressed because it is too large
Load Diff
618
gcc/cp/class.c
618
gcc/cp/class.c
File diff suppressed because it is too large
Load Diff
|
@ -635,7 +635,7 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
|
|||
CLEANUP_EXPR (stmt));
|
||||
|
||||
pointer_set_insert (p_set, *stmt_p);
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ cp_expr_size (tree exp)
|
|||
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
|
||||
caught by the assert above. */
|
||||
return (is_empty_class (type)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* This file contains the definitions and documentation for the
|
||||
additional tree codes used in the GNU C++ compiler (see tree.def
|
||||
for the standard codes).
|
||||
Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, 2003, 2004, 2005,
|
||||
Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, 2003, 2004, 2005,
|
||||
1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Hacked by Michael Tiemann (tiemann@cygnus.com)
|
||||
|
||||
|
@ -22,7 +22,7 @@ along with GCC; see the file COPYING. If not, write to
|
|||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
|
||||
/* An OFFSET_REF is used in two situations:
|
||||
|
||||
1. An expression of the form `A::m' where `A' is a class and `m' is
|
||||
|
@ -33,7 +33,7 @@ Boston, MA 02111-1307, USA. */
|
|||
The expression is a pointer-to-member if its address is taken,
|
||||
but simply denotes a member of the object if its address is not
|
||||
taken.
|
||||
|
||||
|
||||
This form is only used during the parsing phase; once semantic
|
||||
analysis has taken place they are eliminated.
|
||||
|
||||
|
@ -97,7 +97,7 @@ DEFTREECODE (ALIAS_DECL, "alias_decl", tcc_declaration, 0)
|
|||
functions. BASELINK_BINFO gives the base from which the functions
|
||||
come, i.e., the base to which the `this' pointer must be converted
|
||||
before the functions are called. BASELINK_ACCESS_BINFO gives the
|
||||
base used to name the functions.
|
||||
base used to name the functions.
|
||||
|
||||
A BASELINK is an expression; the TREE_TYPE of the BASELINK gives
|
||||
the type of the expression. This type is either a FUNCTION_TYPE,
|
||||
|
@ -127,14 +127,14 @@ DEFTREECODE (TEMPLATE_DECL, "template_decl", tcc_declaration, 0)
|
|||
gives the level (from 1) of the parameter.
|
||||
|
||||
Here's an example:
|
||||
|
||||
|
||||
template <class T> // Index 0, Level 1.
|
||||
struct S
|
||||
{
|
||||
template <class U, // Index 0, Level 2.
|
||||
class V> // Index 1, Level 2.
|
||||
void f();
|
||||
};
|
||||
};
|
||||
|
||||
The DESCENDANTS will be a chain of TEMPLATE_PARM_INDEXs descended
|
||||
from this one. The first descendant will have the same IDX, but
|
||||
|
@ -151,17 +151,17 @@ DEFTREECODE (TEMPLATE_DECL, "template_decl", tcc_declaration, 0)
|
|||
class V> // Index 1, Level 1, Orig Level 2
|
||||
void f();
|
||||
};
|
||||
|
||||
|
||||
The LEVEL is the level of the parameter when we are worrying about
|
||||
the types of things; the ORIG_LEVEL is the level when we are
|
||||
worrying about instantiating things. */
|
||||
DEFTREECODE (TEMPLATE_PARM_INDEX, "template_parm_index", tcc_exceptional, 0)
|
||||
|
||||
/* Index into a template parameter list for template template parameters.
|
||||
This parameter must be a type. The TYPE_FIELDS value will be a
|
||||
This parameter must be a type. The TYPE_FIELDS value will be a
|
||||
TEMPLATE_PARM_INDEX.
|
||||
|
||||
It is used without template arguments like TT in C<TT>,
|
||||
It is used without template arguments like TT in C<TT>,
|
||||
TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO is NULL_TREE
|
||||
and TYPE_NAME is a TEMPLATE_DECL. */
|
||||
DEFTREECODE (TEMPLATE_TEMPLATE_PARM, "template_template_parm", tcc_type, 0)
|
||||
|
@ -170,7 +170,7 @@ DEFTREECODE (TEMPLATE_TEMPLATE_PARM, "template_template_parm", tcc_type, 0)
|
|||
macros in tree.h. Changing the order will degrade the speed of the
|
||||
compiler. TEMPLATE_TYPE_PARM, TYPENAME_TYPE, TYPEOF_TYPE,
|
||||
BOUND_TEMPLATE_TEMPLATE_PARM. */
|
||||
|
||||
|
||||
/* Index into a template parameter list. This parameter must be a type.
|
||||
The type.value field will be a TEMPLATE_PARM_INDEX. */
|
||||
DEFTREECODE (TEMPLATE_TYPE_PARM, "template_type_parm", tcc_type, 0)
|
||||
|
@ -185,7 +185,7 @@ DEFTREECODE (TYPENAME_TYPE, "typename_type", tcc_type, 0)
|
|||
expression in question. */
|
||||
DEFTREECODE (TYPEOF_TYPE, "typeof_type", tcc_type, 0)
|
||||
|
||||
/* Like TEMPLATE_TEMPLATE_PARM it is used with bound template arguments
|
||||
/* Like TEMPLATE_TEMPLATE_PARM it is used with bound template arguments
|
||||
like TT<int>.
|
||||
In this case, TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO contains the
|
||||
template name and its bound arguments. TYPE_NAME is a TYPE_DECL. */
|
||||
|
@ -203,7 +203,7 @@ DEFTREECODE (UNBOUND_CLASS_TEMPLATE, "unbound_class_template", tcc_type, 0)
|
|||
not an alias, but is later expanded into multiple aliases. */
|
||||
DEFTREECODE (USING_DECL, "using_decl", tcc_declaration, 0)
|
||||
|
||||
/* A using directive. The operand is USING_STMT_NAMESPACE. */
|
||||
/* A using directive. The operand is USING_STMT_NAMESPACE. */
|
||||
DEFTREECODE (USING_STMT, "using_directive", tcc_statement, 1)
|
||||
|
||||
/* An un-parsed default argument. Holds a vector of input tokens and
|
||||
|
@ -218,7 +218,7 @@ DEFTREECODE (DEFAULT_ARG, "default_arg", tcc_exceptional, 0)
|
|||
member template, the template may be an IDENTIFIER_NODE. */
|
||||
DEFTREECODE (TEMPLATE_ID_EXPR, "template_id_expr", tcc_expression, 2)
|
||||
|
||||
/* A list-like node for chaining overloading candidates. TREE_TYPE is
|
||||
/* A list-like node for chaining overloading candidates. TREE_TYPE is
|
||||
the original name, and the parameter is the FUNCTION_DECL. */
|
||||
DEFTREECODE (OVERLOAD, "overload", tcc_exceptional, 0)
|
||||
|
||||
|
@ -226,12 +226,12 @@ DEFTREECODE (OVERLOAD, "overload", tcc_exceptional, 0)
|
|||
"OBJECT.SCOPE::~DESTRUCTOR. The first operand is the OBJECT. The
|
||||
second operand (if non-NULL) is the SCOPE. The third operand is
|
||||
the TYPE node corresponding to the DESTRUCTOR. The type of the
|
||||
first operand will always be a scalar type.
|
||||
first operand will always be a scalar type.
|
||||
|
||||
The type of a PSEUDO_DTOR_EXPR is always "void", even though it can
|
||||
be used as if it were a zero-argument function. We handle the
|
||||
function-call case specially, and giving it "void" type prevents it
|
||||
being used in expressions in ways that are not permitted. */
|
||||
being used in expressions in ways that are not permitted. */
|
||||
DEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", tcc_expression, 3)
|
||||
|
||||
/* A whole bunch of tree codes for the initial, superficial parsing of
|
||||
|
@ -281,7 +281,7 @@ DEFTREECODE (CLEANUP_STMT, "cleanup_stmt", tcc_statement, 3)
|
|||
|
||||
/* Represents an 'if' statement. The operands are IF_COND,
|
||||
THEN_CLAUSE, and ELSE_CLAUSE, respectively. */
|
||||
/* ??? It is currently still necessary to distinguish between IF_STMT
|
||||
/* ??? It is currently still necessary to distinguish between IF_STMT
|
||||
and COND_EXPR for the benefit of templates. */
|
||||
DEFTREECODE (IF_STMT, "if_stmt", tcc_statement, 3)
|
||||
|
||||
|
|
|
@ -1041,7 +1041,7 @@ struct lang_type_class GTY(())
|
|||
unsigned java_interface : 1;
|
||||
unsigned debug_requested : 1;
|
||||
unsigned fields_readonly : 1;
|
||||
|
||||
|
||||
unsigned use_template : 2;
|
||||
unsigned ptrmemfunc_flag : 1;
|
||||
unsigned was_anonymous : 1;
|
||||
|
@ -1170,7 +1170,7 @@ struct lang_type GTY(())
|
|||
it has not yet been declared. */
|
||||
#define CLASSTYPE_LAZY_DESTRUCTOR(NODE) \
|
||||
(LANG_TYPE_CLASS_CHECK (NODE)->lazy_destructor)
|
||||
|
||||
|
||||
/* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */
|
||||
#define TYPE_HAS_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_assign_ref)
|
||||
|
||||
|
@ -1529,7 +1529,7 @@ struct lang_decl_flags GTY(())
|
|||
unsigned initialized_in_class : 1;
|
||||
unsigned assignment_operator_p : 1;
|
||||
unsigned u1sel : 1;
|
||||
|
||||
|
||||
unsigned u2sel : 1;
|
||||
unsigned can_be_full : 1;
|
||||
unsigned thunk_p : 1;
|
||||
|
@ -1578,7 +1578,7 @@ struct lang_decl GTY(())
|
|||
unsigned u3sel : 1;
|
||||
unsigned pending_inline_p : 1;
|
||||
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. */
|
||||
|
@ -1597,12 +1597,12 @@ struct lang_decl GTY(())
|
|||
/* In a non-thunk FUNCTION_DECL or TEMPLATE_DECL, this is
|
||||
DECL_CLONED_FUNCTION. */
|
||||
tree GTY ((tag ("0"))) cloned_function;
|
||||
|
||||
|
||||
/* In a FUNCTION_DECL for which THUNK_P holds this is the
|
||||
THUNK_FIXED_OFFSET. */
|
||||
HOST_WIDE_INT GTY ((tag ("1"))) fixed_offset;
|
||||
} GTY ((desc ("%0.decl_flags.thunk_p"))) u5;
|
||||
|
||||
|
||||
union lang_decl_u3
|
||||
{
|
||||
struct sorted_fields_type * GTY ((tag ("0"), reorder ("resort_sorted_fields")))
|
||||
|
@ -1911,7 +1911,7 @@ struct lang_decl GTY(())
|
|||
(TREE_CODE (NODE) == FUNCTION_DECL \
|
||||
&& DECL_LANG_SPECIFIC (NODE) \
|
||||
&& DECL_LANG_SPECIFIC (NODE)->decl_flags.thunk_p)
|
||||
|
||||
|
||||
/* Set DECL_THUNK_P for node. */
|
||||
#define SET_DECL_THUNK_P(NODE, THIS_ADJUSTING) \
|
||||
(DECL_LANG_SPECIFIC (NODE)->decl_flags.thunk_p = 1, \
|
||||
|
|
82
gcc/cp/cvt.c
82
gcc/cp/cvt.c
|
@ -140,7 +140,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
|
|||
intype_class = TREE_TYPE (intype);
|
||||
type_class = TREE_TYPE (type);
|
||||
|
||||
same_p = same_type_p (TYPE_MAIN_VARIANT (intype_class),
|
||||
same_p = same_type_p (TYPE_MAIN_VARIANT (intype_class),
|
||||
TYPE_MAIN_VARIANT (type_class));
|
||||
binfo = NULL_TREE;
|
||||
/* Try derived to base conversion. */
|
||||
|
@ -174,7 +174,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
|
|||
}
|
||||
else if (TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype))
|
||||
{
|
||||
tree b1;
|
||||
tree b1;
|
||||
tree b2;
|
||||
tree binfo;
|
||||
enum tree_code code = PLUS_EXPR;
|
||||
|
@ -211,7 +211,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
|
|||
expr = cplus_expand_constant (expr);
|
||||
|
||||
if (binfo && !integer_zerop (BINFO_OFFSET (binfo)))
|
||||
expr = size_binop (code,
|
||||
expr = size_binop (code,
|
||||
build_nop (sizetype, expr),
|
||||
BINFO_OFFSET (binfo));
|
||||
return build_nop (type, expr);
|
||||
|
@ -255,7 +255,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
|
|||
}
|
||||
else
|
||||
expr = build_int_cst (type, 0);
|
||||
|
||||
|
||||
return expr;
|
||||
}
|
||||
else if (TYPE_PTR_TO_MEMBER_P (type) && INTEGRAL_CODE_P (form))
|
||||
|
@ -274,7 +274,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
|
|||
as a pointer. */
|
||||
gcc_assert (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr)))
|
||||
== GET_MODE_SIZE (TYPE_MODE (type)));
|
||||
|
||||
|
||||
return convert_to_pointer (type, expr);
|
||||
}
|
||||
|
||||
|
@ -295,7 +295,7 @@ convert_to_pointer_force (tree type, tree expr)
|
|||
{
|
||||
tree intype = TREE_TYPE (expr);
|
||||
enum tree_code form = TREE_CODE (intype);
|
||||
|
||||
|
||||
if (form == POINTER_TYPE)
|
||||
{
|
||||
intype = TYPE_MAIN_VARIANT (intype);
|
||||
|
@ -363,7 +363,7 @@ build_up_reference (tree type, tree arg, int flags, tree decl)
|
|||
|
||||
/* Process the initializer for the declaration. */
|
||||
DECL_INITIAL (arg) = targ;
|
||||
cp_finish_decl (arg, targ, NULL_TREE,
|
||||
cp_finish_decl (arg, targ, NULL_TREE,
|
||||
LOOKUP_ONLYCONVERTING|DIRECT_BIND);
|
||||
}
|
||||
else if (!(flags & DIRECT_BIND) && ! lvalue_p (arg))
|
||||
|
@ -398,7 +398,7 @@ build_up_reference (tree type, tree arg, int flags, tree decl)
|
|||
/* Subroutine of convert_to_reference. REFTYPE is the target reference type.
|
||||
INTYPE is the original rvalue type and DECL is an optional _DECL node
|
||||
for diagnostics.
|
||||
|
||||
|
||||
[dcl.init.ref] says that if an rvalue is used to
|
||||
initialize a reference, then the reference must be to a
|
||||
non-volatile const type. */
|
||||
|
@ -407,7 +407,7 @@ static void
|
|||
warn_ref_binding (tree reftype, tree intype, tree decl)
|
||||
{
|
||||
tree ttl = TREE_TYPE (reftype);
|
||||
|
||||
|
||||
if (!CP_TYPE_CONST_NON_VOLATILE_P (ttl))
|
||||
{
|
||||
const char *msg;
|
||||
|
@ -446,9 +446,9 @@ convert_to_reference (tree reftype, tree expr, int convtype,
|
|||
tree rval_as_conversion = NULL_TREE;
|
||||
bool can_convert_intype_to_type;
|
||||
|
||||
if (TREE_CODE (type) == FUNCTION_TYPE
|
||||
if (TREE_CODE (type) == FUNCTION_TYPE
|
||||
&& TREE_TYPE (expr) == unknown_type_node)
|
||||
expr = instantiate_type (type, expr,
|
||||
expr = instantiate_type (type, expr,
|
||||
(flags & LOOKUP_COMPLAIN)
|
||||
? tf_error | tf_warning : tf_none);
|
||||
|
||||
|
@ -491,7 +491,7 @@ convert_to_reference (tree reftype, tree expr, int convtype,
|
|||
|
||||
if (! real_lvalue_p (expr))
|
||||
warn_ref_binding (reftype, intype, decl);
|
||||
|
||||
|
||||
if (! (convtype & CONV_CONST)
|
||||
&& !at_least_as_qualified_p (ttl, ttr))
|
||||
pedwarn ("conversion from %qT to %qT discards qualifiers",
|
||||
|
@ -514,7 +514,7 @@ convert_to_reference (tree reftype, tree expr, int convtype,
|
|||
COMPARE_BASE | COMPARE_DERIVED)))
|
||||
warning (0, "casting %qT to %qT does not dereference pointer",
|
||||
intype, reftype);
|
||||
|
||||
|
||||
rval = build_unary_op (ADDR_EXPR, expr, 0);
|
||||
if (rval != error_mark_node)
|
||||
rval = convert_force (build_pointer_type (TREE_TYPE (reftype)),
|
||||
|
@ -554,7 +554,7 @@ convert_from_reference (tree val)
|
|||
{
|
||||
tree t = canonical_type_variant (TREE_TYPE (TREE_TYPE (val)));
|
||||
tree ref = build1 (INDIRECT_REF, t, val);
|
||||
|
||||
|
||||
/* We *must* set TREE_READONLY when dereferencing a pointer to const,
|
||||
so that we get the proper error message if the result is used
|
||||
to assign to. Also, &* is supposed to be a no-op. */
|
||||
|
@ -565,7 +565,7 @@ convert_from_reference (tree val)
|
|||
REFERENCE_REF_P (ref) = 1;
|
||||
val = ref;
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
|
@ -752,7 +752,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
|
|||
the target with the temp (see [dcl.init]). */
|
||||
ctor = build_user_type_conversion (type, ctor, flags);
|
||||
else
|
||||
ctor = build_special_member_call (NULL_TREE,
|
||||
ctor = build_special_member_call (NULL_TREE,
|
||||
complete_ctor_identifier,
|
||||
build_tree_list (NULL_TREE, ctor),
|
||||
type, flags);
|
||||
|
@ -780,13 +780,13 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
|
|||
volatile references we do not do this interpretation, because that would
|
||||
make it impossible to ignore the reference return value from functions. We
|
||||
issue warnings in the confusing cases.
|
||||
|
||||
|
||||
IMPLICIT is tells us the context of an implicit void conversion. */
|
||||
|
||||
tree
|
||||
convert_to_void (tree expr, const char *implicit)
|
||||
{
|
||||
if (expr == error_mark_node
|
||||
if (expr == error_mark_node
|
||||
|| TREE_TYPE (expr) == error_mark_node)
|
||||
return error_mark_node;
|
||||
if (!TREE_TYPE (expr))
|
||||
|
@ -813,12 +813,12 @@ convert_to_void (tree expr, const char *implicit)
|
|||
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;
|
||||
}
|
||||
|
||||
|
||||
case COMPOUND_EXPR:
|
||||
{
|
||||
/* The second part of a compound expr contains the value. */
|
||||
|
@ -826,7 +826,7 @@ convert_to_void (tree expr, const char *implicit)
|
|||
tree new_op1 = convert_to_void
|
||||
(op1, (implicit && !TREE_NO_WARNING (expr)
|
||||
? "right-hand operand of comma" : NULL));
|
||||
|
||||
|
||||
if (new_op1 != op1)
|
||||
{
|
||||
tree t = build2 (COMPOUND_EXPR, TREE_TYPE (new_op1),
|
||||
|
@ -836,15 +836,15 @@ convert_to_void (tree expr, const char *implicit)
|
|||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case NON_LVALUE_EXPR:
|
||||
case NOP_EXPR:
|
||||
/* These have already decayed to rvalue. */
|
||||
break;
|
||||
|
||||
|
||||
case CALL_EXPR: /* We have a special meaning for volatile void fn(). */
|
||||
break;
|
||||
|
||||
|
||||
case INDIRECT_REF:
|
||||
{
|
||||
tree type = TREE_TYPE (expr);
|
||||
|
@ -852,7 +852,7 @@ convert_to_void (tree expr, const char *implicit)
|
|||
== 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");
|
||||
|
@ -862,16 +862,16 @@ convert_to_void (tree expr, const char *implicit)
|
|||
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");
|
||||
|
@ -882,7 +882,7 @@ convert_to_void (tree expr, const char *implicit)
|
|||
}
|
||||
{
|
||||
tree probe = expr;
|
||||
|
||||
|
||||
if (TREE_CODE (probe) == ADDR_EXPR)
|
||||
probe = TREE_OPERAND (expr, 0);
|
||||
if (type_unknown_p (probe))
|
||||
|
@ -898,7 +898,7 @@ convert_to_void (tree expr, const char *implicit)
|
|||
warning (0, "%s is a reference, not call, to function %qE",
|
||||
implicit, expr);
|
||||
}
|
||||
|
||||
|
||||
if (expr != error_mark_node && !VOID_TYPE_P (TREE_TYPE (expr)))
|
||||
{
|
||||
if (implicit && warn_unused_value && !TREE_NO_WARNING (expr))
|
||||
|
@ -907,12 +907,12 @@ convert_to_void (tree expr, const char *implicit)
|
|||
been explicitly cast to void, so we must do so here. */
|
||||
if (!TREE_SIDE_EFFECTS (expr))
|
||||
warning (0, "%s has no effect", implicit);
|
||||
else
|
||||
{
|
||||
else
|
||||
{
|
||||
tree e;
|
||||
enum tree_code code;
|
||||
enum tree_code_class class;
|
||||
|
||||
|
||||
e = expr;
|
||||
/* We might like to warn about (say) "(int) f()", as the
|
||||
cast has no effect, but the compiler itself will
|
||||
|
@ -931,7 +931,7 @@ convert_to_void (tree expr, const char *implicit)
|
|||
class = TREE_CODE_CLASS (code);
|
||||
if (class == tcc_comparison
|
||||
|| class == tcc_unary
|
||||
|| (class == tcc_binary
|
||||
|| (class == tcc_binary
|
||||
&& !(code == MODIFY_EXPR
|
||||
|| code == INIT_EXPR
|
||||
|| code == PREDECREMENT_EXPR
|
||||
|
@ -991,7 +991,7 @@ convert_force (tree type, tree expr, int convtype)
|
|||
enum tree_code code = TREE_CODE (type);
|
||||
|
||||
if (code == REFERENCE_TYPE)
|
||||
return (fold_if_not_in_template
|
||||
return (fold_if_not_in_template
|
||||
(convert_to_reference (type, e, CONV_C_CAST, LOOKUP_COMPLAIN,
|
||||
NULL_TREE)));
|
||||
|
||||
|
@ -1043,11 +1043,11 @@ build_expr_type_conversion (int desires, tree expr, bool complain)
|
|||
tree conv = NULL_TREE;
|
||||
tree winner = NULL_TREE;
|
||||
|
||||
if (expr == null_node
|
||||
&& (desires & WANT_INT)
|
||||
if (expr == null_node
|
||||
&& (desires & WANT_INT)
|
||||
&& !(desires & WANT_NULL))
|
||||
warning (0, "converting NULL to non-pointer type");
|
||||
|
||||
|
||||
basetype = TREE_TYPE (expr);
|
||||
|
||||
if (basetype == error_mark_node)
|
||||
|
@ -1070,7 +1070,7 @@ build_expr_type_conversion (int desires, tree expr, bool complain)
|
|||
return (desires & WANT_FLOAT) ? expr : NULL_TREE;
|
||||
case POINTER_TYPE:
|
||||
return (desires & WANT_POINTER) ? expr : NULL_TREE;
|
||||
|
||||
|
||||
case FUNCTION_TYPE:
|
||||
case ARRAY_TYPE:
|
||||
return (desires & WANT_POINTER) ? decay_conversion (expr)
|
||||
|
@ -1180,7 +1180,7 @@ type_promotes_to (tree type)
|
|||
}
|
||||
else if (type == float_type_node)
|
||||
type = double_type_node;
|
||||
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
|
@ -1193,7 +1193,7 @@ type_promotes_to (tree type)
|
|||
to TYPE. Return the resulting expression, or error_mark_node if
|
||||
the conversion was impossible. */
|
||||
|
||||
tree
|
||||
tree
|
||||
perform_qualification_conversions (tree type, tree expr)
|
||||
{
|
||||
tree expr_type;
|
||||
|
|
|
@ -147,7 +147,7 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t)
|
|||
break;
|
||||
|
||||
case OVERLOAD:
|
||||
t = OVL_CURRENT (t);
|
||||
t = OVL_CURRENT (t);
|
||||
case VAR_DECL:
|
||||
case PARM_DECL:
|
||||
case CONST_DECL:
|
||||
|
@ -159,7 +159,7 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t)
|
|||
case USING_DECL:
|
||||
case TEMPLATE_DECL:
|
||||
t = DECL_NAME (t);
|
||||
|
||||
|
||||
case IDENTIFIER_NODE:
|
||||
if (t == NULL)
|
||||
pp_cxx_identifier (pp, "<unnamed>");
|
||||
|
@ -383,7 +383,7 @@ static void
|
|||
pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t)
|
||||
{
|
||||
enum tree_code code = TREE_CODE (t);
|
||||
|
||||
|
||||
switch (code)
|
||||
{
|
||||
case AGGR_INIT_EXPR:
|
||||
|
@ -407,19 +407,19 @@ pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t)
|
|||
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
|
||||
else
|
||||
{
|
||||
pp_cxx_postfix_expression (pp, object);
|
||||
pp_cxx_arrow (pp);
|
||||
|
@ -587,8 +587,8 @@ pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t)
|
|||
pp_right_bracket (pp);
|
||||
}
|
||||
pp_c_cast_expression (pp_c_base (pp), TREE_OPERAND (t, 0));
|
||||
break;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
pp_unsupported_tree (pp, t);
|
||||
}
|
||||
|
@ -626,7 +626,7 @@ pp_cxx_unary_expression (cxx_pretty_printer *pp, tree t)
|
|||
case VEC_DELETE_EXPR:
|
||||
pp_cxx_delete_expression (pp, t);
|
||||
break;
|
||||
|
||||
|
||||
case SIZEOF_EXPR:
|
||||
case ALIGNOF_EXPR:
|
||||
pp_cxx_identifier (pp, code == SIZEOF_EXPR ? "sizeof" : "__alignof__");
|
||||
|
@ -855,9 +855,9 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t)
|
|||
pp_cxx_unqualified_id (pp, t);
|
||||
break;
|
||||
|
||||
#if 0
|
||||
#if 0
|
||||
case OFFSET_REF:
|
||||
#endif
|
||||
#endif
|
||||
case SCOPE_REF:
|
||||
case PTRMEM_CST:
|
||||
pp_cxx_qualified_id (pp, t);
|
||||
|
@ -884,9 +884,9 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t)
|
|||
case STATIC_CAST_EXPR:
|
||||
case REINTERPRET_CAST_EXPR:
|
||||
case CONST_CAST_EXPR:
|
||||
#if 0
|
||||
#if 0
|
||||
case MEMBER_REF:
|
||||
#endif
|
||||
#endif
|
||||
case EMPTY_CLASS_EXPR:
|
||||
case TYPEID_EXPR:
|
||||
case PSEUDO_DTOR_EXPR:
|
||||
|
@ -944,7 +944,7 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t)
|
|||
|
||||
default:
|
||||
pp_c_expression (pp_c_base (pp), t);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -996,7 +996,7 @@ pp_cxx_decl_specifier_seq (cxx_pretty_printer *pp, tree t)
|
|||
pp_cxx_storage_class_specifier (pp, t);
|
||||
pp_cxx_decl_specifier_seq (pp, TREE_TYPE (t));
|
||||
break;
|
||||
|
||||
|
||||
case TYPE_DECL:
|
||||
pp_cxx_identifier (pp, "typedef");
|
||||
pp_cxx_decl_specifier_seq (pp, TREE_TYPE (t));
|
||||
|
@ -1193,7 +1193,7 @@ static void
|
|||
pp_cxx_parameter_declaration_clause (cxx_pretty_printer *pp, tree t)
|
||||
{
|
||||
tree args = TYPE_P (t) ? NULL : FUNCTION_FIRST_USER_PARM (t);
|
||||
tree types =
|
||||
tree types =
|
||||
TYPE_P (t) ? TYPE_ARG_TYPES (t) : FUNCTION_FIRST_USER_PARMTYPE (t);
|
||||
const bool abstract = args == NULL
|
||||
|| pp_c_base (pp)->flags & pp_c_flag_abstract;
|
||||
|
@ -1269,12 +1269,12 @@ pp_cxx_direct_declarator (cxx_pretty_printer *pp, tree t)
|
|||
}
|
||||
pp_cxx_abstract_declarator (pp, TREE_TYPE (t));
|
||||
break;
|
||||
|
||||
|
||||
case FUNCTION_DECL:
|
||||
pp_cxx_space_for_pointer_operator (pp, TREE_TYPE (TREE_TYPE (t)));
|
||||
pp_cxx_id_expression (pp, t);
|
||||
pp_cxx_parameter_declaration_clause (pp, t);
|
||||
|
||||
|
||||
if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
|
||||
{
|
||||
pp_base (pp)->padding = pp_before;
|
||||
|
@ -1421,7 +1421,7 @@ pp_cxx_direct_abstract_declarator (cxx_pretty_printer *pp, tree t)
|
|||
|
||||
default:
|
||||
pp_c_direct_abstract_declarator (pp_c_base (pp), t);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1545,7 +1545,7 @@ pp_cxx_statement (cxx_pretty_printer *pp, tree t)
|
|||
handler handler-seq(opt)
|
||||
|
||||
handler:
|
||||
catch ( exception-declaration ) compound-statement
|
||||
catch ( exception-declaration ) compound-statement
|
||||
|
||||
exception-declaration:
|
||||
type-specifier-seq declarator
|
||||
|
@ -1812,7 +1812,7 @@ pp_cxx_canonical_template_parameter (cxx_pretty_printer *pp, tree parm)
|
|||
if (code == TEMPLATE_TYPE_PARM || code == TEMPLATE_TEMPLATE_PARM
|
||||
|| code == BOUND_TEMPLATE_TEMPLATE_PARM)
|
||||
parm = TEMPLATE_TYPE_PARM_INDEX (parm);
|
||||
|
||||
|
||||
pp_cxx_begin_template_argument_list (pp);
|
||||
pp_cxx_identifier (pp, "template-parameter-");
|
||||
pp_wide_integer (pp, TEMPLATE_PARM_LEVEL (parm));
|
||||
|
@ -1887,7 +1887,7 @@ pp_cxx_declaration (cxx_pretty_printer *pp, tree t)
|
|||
case 1:
|
||||
pp_cxx_template_declaration (pp, t);
|
||||
break;
|
||||
|
||||
|
||||
case 2:
|
||||
pp_cxx_explicit_specialization (pp, t);
|
||||
break;
|
||||
|
@ -1905,7 +1905,7 @@ pp_cxx_declaration (cxx_pretty_printer *pp, tree t)
|
|||
case TYPE_DECL:
|
||||
pp_cxx_simple_declaration (pp, t);
|
||||
break;
|
||||
|
||||
|
||||
case FUNCTION_DECL:
|
||||
if (DECL_SAVED_TREE (t))
|
||||
pp_cxx_function_definition (pp, t);
|
||||
|
|
|
@ -31,7 +31,7 @@ typedef enum
|
|||
{
|
||||
/* Ask for an qualified-id. */
|
||||
pp_cxx_flag_default_argument = 1 << pp_c_flag_last_bit
|
||||
|
||||
|
||||
} cxx_pretty_printer_flags;
|
||||
|
||||
typedef struct
|
||||
|
|
|
@ -633,14 +633,14 @@ poplevel (int keep, int reverse, int functionbody)
|
|||
else
|
||||
{
|
||||
tree name;
|
||||
|
||||
|
||||
/* Remove the binding. */
|
||||
decl = link;
|
||||
|
||||
if (TREE_CODE (decl) == TREE_LIST)
|
||||
decl = TREE_VALUE (decl);
|
||||
name = decl;
|
||||
|
||||
|
||||
if (TREE_CODE (name) == OVERLOAD)
|
||||
name = OVL_FUNCTION (name);
|
||||
|
||||
|
@ -1317,16 +1317,16 @@ duplicate_decls (tree newdecl, tree olddecl)
|
|||
else if (TREE_CODE (newdecl) == NAMESPACE_DECL)
|
||||
{
|
||||
/* In [namespace.alias] we have:
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
Therefore, if we encounter a second alias directive for the same
|
||||
alias, we can just ignore the second directive. */
|
||||
if (DECL_NAMESPACE_ALIAS (newdecl)
|
||||
&& (DECL_NAMESPACE_ALIAS (newdecl)
|
||||
&& (DECL_NAMESPACE_ALIAS (newdecl)
|
||||
== DECL_NAMESPACE_ALIAS (olddecl)))
|
||||
return olddecl;
|
||||
/* [namespace.alias]
|
||||
|
@ -1672,14 +1672,14 @@ duplicate_decls (tree newdecl, tree olddecl)
|
|||
DECL_COMDAT (newdecl) |= DECL_COMDAT (olddecl);
|
||||
DECL_TEMPLATE_INSTANTIATED (newdecl)
|
||||
|= DECL_TEMPLATE_INSTANTIATED (olddecl);
|
||||
|
||||
|
||||
/* If the OLDDECL is an instantiation and/or specialization,
|
||||
then the NEWDECL must be too. But, it may not yet be marked
|
||||
as such if the caller has created NEWDECL, but has not yet
|
||||
figured out that it is a redeclaration. */
|
||||
if (!DECL_USE_TEMPLATE (newdecl))
|
||||
DECL_USE_TEMPLATE (newdecl) = DECL_USE_TEMPLATE (olddecl);
|
||||
|
||||
|
||||
/* Don't really know how much of the language-specific
|
||||
values we should copy from old to new. */
|
||||
DECL_IN_AGGR_P (newdecl) = DECL_IN_AGGR_P (olddecl);
|
||||
|
@ -1800,7 +1800,7 @@ duplicate_decls (tree newdecl, tree olddecl)
|
|||
COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl);
|
||||
|
||||
/* Warn about conflicting visibility specifications. */
|
||||
if (DECL_VISIBILITY_SPECIFIED (olddecl)
|
||||
if (DECL_VISIBILITY_SPECIFIED (olddecl)
|
||||
&& DECL_VISIBILITY_SPECIFIED (newdecl)
|
||||
&& DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl))
|
||||
{
|
||||
|
@ -1820,7 +1820,7 @@ duplicate_decls (tree newdecl, tree olddecl)
|
|||
with that from NEWDECL below. */
|
||||
if (DECL_LANG_SPECIFIC (olddecl))
|
||||
{
|
||||
gcc_assert (DECL_LANG_SPECIFIC (olddecl)
|
||||
gcc_assert (DECL_LANG_SPECIFIC (olddecl)
|
||||
!= DECL_LANG_SPECIFIC (newdecl));
|
||||
ggc_free (DECL_LANG_SPECIFIC (olddecl));
|
||||
}
|
||||
|
@ -2465,7 +2465,7 @@ typename_compare (const void * k1, const void * k2)
|
|||
|
||||
/* Build a TYPENAME_TYPE. If the type is `typename T::t', CONTEXT is
|
||||
the type of `T', NAME is the IDENTIFIER_NODE for `t'.
|
||||
|
||||
|
||||
Returns the new TYPENAME_TYPE. */
|
||||
|
||||
static GTY ((param_is (union tree_node))) htab_t typename_htab;
|
||||
|
@ -2484,7 +2484,7 @@ build_typename_type (tree context, tree name, tree fullname,
|
|||
typename_htab = htab_create_ggc (61, &typename_hash,
|
||||
&typename_compare, NULL);
|
||||
|
||||
ti.scope = FROB_CONTEXT (context);
|
||||
ti.scope = FROB_CONTEXT (context);
|
||||
ti.name = name;
|
||||
ti.template_id = fullname;
|
||||
ti.enum_p = tag_type == enum_type;
|
||||
|
@ -2506,7 +2506,7 @@ build_typename_type (tree context, tree name, tree fullname,
|
|||
TYPENAME_TYPE_FULLNAME (t) = ti.template_id;
|
||||
TYPENAME_IS_ENUM_P (t) = ti.enum_p;
|
||||
TYPENAME_IS_CLASS_P (t) = ti.class_p;
|
||||
|
||||
|
||||
/* Build the corresponding TYPE_DECL. */
|
||||
d = build_decl (TYPE_DECL, name, t);
|
||||
TYPE_NAME (TREE_TYPE (d)) = d;
|
||||
|
@ -2517,7 +2517,7 @@ build_typename_type (tree context, tree name, tree fullname,
|
|||
/* Store it in the hash table. */
|
||||
*e = t;
|
||||
}
|
||||
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
|
@ -2641,7 +2641,7 @@ make_typename_type (tree context, tree name, enum tag_types tag_type,
|
|||
}
|
||||
|
||||
/* Resolve `CONTEXT::template NAME'. Returns a TEMPLATE_DECL if the name
|
||||
can be resolved or an UNBOUND_CLASS_TEMPLATE, unless an error occurs,
|
||||
can be resolved or an UNBOUND_CLASS_TEMPLATE, unless an error occurs,
|
||||
in which case error_mark_node is returned.
|
||||
|
||||
If PARM_LIST is non-NULL, also make sure that the template parameter
|
||||
|
@ -3574,7 +3574,7 @@ start_decl (const cp_declarator *declarator,
|
|||
cp_decl_specifier_seq *declspecs,
|
||||
int initialized,
|
||||
tree attributes,
|
||||
tree prefix_attributes,
|
||||
tree prefix_attributes,
|
||||
tree *pushed_scope_p)
|
||||
{
|
||||
tree decl;
|
||||
|
@ -3582,7 +3582,7 @@ start_decl (const cp_declarator *declarator,
|
|||
tree context;
|
||||
|
||||
*pushed_scope_p = NULL_TREE;
|
||||
|
||||
|
||||
/* This should only be done once on the top most decl. */
|
||||
if (have_extern_spec)
|
||||
{
|
||||
|
@ -3615,7 +3615,7 @@ start_decl (const cp_declarator *declarator,
|
|||
if (context)
|
||||
{
|
||||
*pushed_scope_p = push_scope (context);
|
||||
|
||||
|
||||
/* We are only interested in class contexts, later. */
|
||||
if (TREE_CODE (context) == NAMESPACE_DECL)
|
||||
context = NULL_TREE;
|
||||
|
@ -3719,15 +3719,15 @@ start_decl (const cp_declarator *declarator,
|
|||
/* Do not mark DECL as an explicit specialization if it was not
|
||||
already marked as an instantiation; a declaration should
|
||||
never be marked as a specialization unless we know what
|
||||
template is being specialized. */
|
||||
template is being specialized. */
|
||||
if (DECL_LANG_SPECIFIC (decl) && DECL_USE_TEMPLATE (decl))
|
||||
{
|
||||
SET_DECL_TEMPLATE_SPECIALIZATION (decl);
|
||||
|
||||
|
||||
/* [temp.expl.spec] An explicit specialization of a static data
|
||||
member of a template is a definition if the declaration
|
||||
includes an initializer; otherwise, it is a declaration.
|
||||
|
||||
|
||||
We check for processing_specialization so this only applies
|
||||
to the new specialization syntax. */
|
||||
if (!DECL_INITIAL (decl)
|
||||
|
@ -4362,7 +4362,7 @@ reshape_init (tree type, tree *initp)
|
|||
}
|
||||
|
||||
/* If there are more initializers than necessary, issue a
|
||||
diagnostic. */
|
||||
diagnostic. */
|
||||
if (*initp)
|
||||
{
|
||||
if (brace_enclosed_p)
|
||||
|
@ -4771,7 +4771,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
|
|||
&& !DECL_PRETTY_FUNCTION_P (decl)
|
||||
&& !dependent_type_p (TREE_TYPE (decl)))
|
||||
maybe_deduce_size_from_array_init (decl, init);
|
||||
|
||||
|
||||
goto finish_end;
|
||||
}
|
||||
|
||||
|
@ -4802,7 +4802,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
|
|||
}
|
||||
|
||||
/* A reference will be modified here, as it is initialized. */
|
||||
if (! DECL_EXTERNAL (decl)
|
||||
if (! DECL_EXTERNAL (decl)
|
||||
&& TREE_READONLY (decl)
|
||||
&& TREE_CODE (type) == REFERENCE_TYPE)
|
||||
{
|
||||
|
@ -4843,7 +4843,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
|
|||
DECL_INITIALIZED_IN_CLASS_P (decl) = 0;
|
||||
init = NULL_TREE;
|
||||
}
|
||||
|
||||
|
||||
/* Handle:
|
||||
|
||||
[dcl.init]
|
||||
|
@ -4933,7 +4933,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
|
|||
else if (!TREE_STATIC (decl))
|
||||
initialize_local_var (decl, init);
|
||||
}
|
||||
|
||||
|
||||
/* If a variable is defined, and then a subsequent
|
||||
definition with external linkage is encountered, we will
|
||||
get here twice for the same variable. We want to avoid
|
||||
|
@ -4943,8 +4943,8 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
|
|||
initializer. It is not legal to redeclare a static data
|
||||
member, so this issue does not arise in that case. */
|
||||
if (var_definition_p && TREE_STATIC (decl))
|
||||
expand_static_init (decl, init);
|
||||
}
|
||||
expand_static_init (decl, init);
|
||||
}
|
||||
}
|
||||
|
||||
/* If a CLEANUP_STMT was created to destroy a temporary bound to a
|
||||
|
@ -5273,7 +5273,7 @@ expand_static_init (tree decl, tree init)
|
|||
|
||||
[stmt.dcl]
|
||||
|
||||
If the initialization exits by throwing an exception, the
|
||||
If the initialization exits by throwing an exception, the
|
||||
initialization is not complete, so it will be tried again
|
||||
the next time control enters the declaration.
|
||||
|
||||
|
@ -5735,7 +5735,7 @@ grokfndecl (tree ctype,
|
|||
(processing_template_decl
|
||||
> template_class_depth (ctype))
|
||||
? current_template_parms
|
||||
: NULL_TREE);
|
||||
: NULL_TREE);
|
||||
|
||||
if (old_decl && TREE_CODE (old_decl) == TEMPLATE_DECL)
|
||||
/* Because grokfndecl is always supposed to return a
|
||||
|
@ -6359,7 +6359,7 @@ check_var_type (tree identifier, tree type)
|
|||
error ("variable or field declared void");
|
||||
type = integer_type_node;
|
||||
}
|
||||
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
|
@ -6534,13 +6534,13 @@ grokdeclarator (const cp_declarator *declarator,
|
|||
error ("declaration of %qD as non-function", decl);
|
||||
return error_mark_node;
|
||||
}
|
||||
else if (!qualifying_scope
|
||||
else if (!qualifying_scope
|
||||
&& !(current_class_type && at_class_scope_p ()))
|
||||
{
|
||||
error ("declaration of %qD as non-member", decl);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
||||
type = TREE_OPERAND (decl, 0);
|
||||
name = IDENTIFIER_POINTER (constructor_name (type));
|
||||
}
|
||||
|
@ -6899,7 +6899,7 @@ grokdeclarator (const cp_declarator *declarator,
|
|||
error ("qualifiers are not allowed on declaration of %<operator %T%>",
|
||||
ctor_return_type);
|
||||
|
||||
if (TREE_CODE (type) == FUNCTION_TYPE
|
||||
if (TREE_CODE (type) == FUNCTION_TYPE
|
||||
&& type_quals != TYPE_UNQUALIFIED)
|
||||
{
|
||||
/* This was an error in C++98 (cv-qualifiers cannot be added to
|
||||
|
@ -7286,7 +7286,7 @@ grokdeclarator (const cp_declarator *declarator,
|
|||
|| (quals && TREE_CODE (type) == METHOD_TYPE)))
|
||||
{
|
||||
tree dummy;
|
||||
|
||||
|
||||
/* If the type is a FUNCTION_TYPE, pick up the
|
||||
qualifiers from that function type. No other
|
||||
qualifiers may be supplied. */
|
||||
|
@ -7539,7 +7539,7 @@ grokdeclarator (const cp_declarator *declarator,
|
|||
if (!current_function_decl)
|
||||
DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
|
||||
else if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (current_function_decl)
|
||||
|| (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P
|
||||
|| (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P
|
||||
(current_function_decl)))
|
||||
/* The TYPE_DECL is "abstract" because there will be
|
||||
clones of this constructor/destructor, and there will
|
||||
|
@ -7643,7 +7643,7 @@ grokdeclarator (const cp_declarator *declarator,
|
|||
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] */
|
||||
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) )
|
||||
{
|
||||
|
@ -7651,7 +7651,7 @@ grokdeclarator (const cp_declarator *declarator,
|
|||
(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);
|
||||
|
@ -7852,11 +7852,11 @@ grokdeclarator (const cp_declarator *declarator,
|
|||
|
||||
/* Check that the name used for a destructor makes sense. */
|
||||
if (sfk == sfk_destructor
|
||||
&& !same_type_p (TREE_OPERAND
|
||||
&& !same_type_p (TREE_OPERAND
|
||||
(id_declarator->u.id.unqualified_name, 0),
|
||||
ctype))
|
||||
{
|
||||
error ("declaration of %qD as member of %qT",
|
||||
error ("declaration of %qD as member of %qT",
|
||||
id_declarator->u.id.unqualified_name,
|
||||
ctype);
|
||||
return error_mark_node;
|
||||
|
@ -7922,8 +7922,8 @@ grokdeclarator (const cp_declarator *declarator,
|
|||
unqualified_id,
|
||||
virtualp, flags, quals, raises,
|
||||
friendp ? -1 : 0, friendp, 1, 0, sfk,
|
||||
funcdef_flag, template_count, in_namespace,
|
||||
attrlist);
|
||||
funcdef_flag, template_count, in_namespace,
|
||||
attrlist);
|
||||
if (decl == NULL_TREE)
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
@ -8476,7 +8476,7 @@ copy_fn_p (tree d)
|
|||
|
||||
gcc_assert (DECL_FUNCTION_MEMBER_P (d));
|
||||
|
||||
if (DECL_TEMPLATE_INFO (d)
|
||||
if (DECL_TEMPLATE_INFO (d)
|
||||
&& DECL_MEMBER_TEMPLATE_P (DECL_TI_TEMPLATE (d)))
|
||||
/* Instantiations of template member functions are never copy
|
||||
functions. Note that member functions of templated classes are
|
||||
|
@ -8767,7 +8767,7 @@ grok_op_properties (tree decl, bool complain)
|
|||
return;
|
||||
|
||||
/* Warn about conversion operators that will never be used. */
|
||||
if (IDENTIFIER_TYPENAME_P (name)
|
||||
if (IDENTIFIER_TYPENAME_P (name)
|
||||
&& ! DECL_TEMPLATE_INFO (decl)
|
||||
&& warn_conversion
|
||||
/* Warn only declaring the function; there is no need to
|
||||
|
@ -9425,7 +9425,7 @@ xref_basetypes (tree ref, tree base_list)
|
|||
CLASSTYPE_REPEATED_BASE_P (ref)
|
||||
|= CLASSTYPE_REPEATED_BASE_P (basetype);
|
||||
}
|
||||
|
||||
|
||||
/* We must do this test after we've seen through a typedef
|
||||
type. */
|
||||
if (TYPE_MARKED_P (basetype))
|
||||
|
@ -9688,7 +9688,7 @@ finish_enum (tree enumtype)
|
|||
|
||||
/* Do not clobber shared ints. */
|
||||
value = copy_node (value);
|
||||
|
||||
|
||||
TREE_TYPE (value) = enumtype;
|
||||
DECL_INITIAL (decl) = value;
|
||||
TREE_VALUE (values) = value;
|
||||
|
@ -10149,7 +10149,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
|
|||
DECL_NOT_REALLY_EXTERN (decl1) = 0;
|
||||
DECL_INTERFACE_KNOWN (decl1) = 1;
|
||||
/* If this function is in an interface implemented in this file,
|
||||
make sure that the backend knows to emit this function
|
||||
make sure that the backend knows to emit this function
|
||||
here. */
|
||||
if (!DECL_EXTERNAL (decl1))
|
||||
mark_needed (decl1);
|
||||
|
|
|
@ -31,6 +31,6 @@ enum decl_context
|
|||
};
|
||||
|
||||
/* We need this in here to get the decl_context definition. */
|
||||
extern tree grokdeclarator (const cp_declarator *,
|
||||
const cp_decl_specifier_seq *,
|
||||
extern tree grokdeclarator (const cp_declarator *,
|
||||
const cp_decl_specifier_seq *,
|
||||
enum decl_context, int, tree*);
|
||||
|
|
184
gcc/cp/decl2.c
184
gcc/cp/decl2.c
|
@ -256,7 +256,7 @@ maybe_retrofit_in_chrg (tree fn)
|
|||
QUALS are the qualifiers for the this pointer. */
|
||||
|
||||
void
|
||||
grokclassfn (tree ctype, tree function, enum overload_flags flags,
|
||||
grokclassfn (tree ctype, tree function, enum overload_flags flags,
|
||||
cp_cv_quals quals)
|
||||
{
|
||||
tree fn_name = DECL_NAME (function);
|
||||
|
@ -355,9 +355,9 @@ grok_array_decl (tree array_expr, tree index_exp)
|
|||
else
|
||||
p2 = build_expr_type_conversion (WANT_POINTER, index_exp, false);
|
||||
|
||||
i1 = build_expr_type_conversion (WANT_INT | WANT_ENUM, array_expr,
|
||||
i1 = build_expr_type_conversion (WANT_INT | WANT_ENUM, array_expr,
|
||||
false);
|
||||
i2 = build_expr_type_conversion (WANT_INT | WANT_ENUM, index_exp,
|
||||
i2 = build_expr_type_conversion (WANT_INT | WANT_ENUM, index_exp,
|
||||
false);
|
||||
|
||||
if ((p1 && i2) && (i1 && p2))
|
||||
|
@ -447,7 +447,7 @@ delete_sanity (tree exp, tree size, bool doing_vec, int use_global_delete)
|
|||
return build1 (NOP_EXPR, void_type_node, t);
|
||||
|
||||
if (doing_vec)
|
||||
return build_vec_delete (t, /*maxindex=*/NULL_TREE,
|
||||
return build_vec_delete (t, /*maxindex=*/NULL_TREE,
|
||||
sfk_deleting_destructor,
|
||||
use_global_delete);
|
||||
else
|
||||
|
@ -472,26 +472,26 @@ check_member_template (tree tmpl)
|
|||
{
|
||||
if (current_function_decl)
|
||||
/* 14.5.2.2 [temp.mem]
|
||||
|
||||
|
||||
A local class shall not have member templates. */
|
||||
error ("invalid declaration of member template %q#D in local class",
|
||||
decl);
|
||||
|
||||
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VIRTUAL_P (decl))
|
||||
{
|
||||
/* 14.5.2.3 [temp.mem]
|
||||
|
||||
A member function template shall not be virtual. */
|
||||
error
|
||||
error
|
||||
("invalid use of %<virtual%> in template declaration of %q#D",
|
||||
decl);
|
||||
DECL_VIRTUAL_P (decl) = 0;
|
||||
}
|
||||
|
||||
/* The debug-information generating code doesn't know what to do
|
||||
with member templates. */
|
||||
with member templates. */
|
||||
DECL_IGNORED_P (tmpl) = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
error ("template declaration of %q#D", decl);
|
||||
}
|
||||
|
@ -552,7 +552,7 @@ check_java_method (tree method)
|
|||
arg_types = TREE_CHAIN (arg_types);
|
||||
if (DECL_HAS_VTT_PARM_P (method))
|
||||
arg_types = TREE_CHAIN (arg_types);
|
||||
|
||||
|
||||
for (; arg_types != NULL_TREE; arg_types = TREE_CHAIN (arg_types))
|
||||
{
|
||||
tree type = TREE_VALUE (arg_types);
|
||||
|
@ -569,7 +569,7 @@ check_java_method (tree method)
|
|||
/* Sanity check: report error if this function FUNCTION is not
|
||||
really a member of the class (CTYPE) it is supposed to belong to.
|
||||
TEMPLATE_PARMS is used to specify the template parameters of a member
|
||||
template passed as FUNCTION_DECL. If the member template is passed as a
|
||||
template passed as FUNCTION_DECL. If the member template is passed as a
|
||||
TEMPLATE_DECL, it can be NULL since the parameters can be extracted
|
||||
from the declaration. If the function is not a function template, it
|
||||
must be NULL.
|
||||
|
@ -581,7 +581,7 @@ check_classfn (tree ctype, tree function, tree template_parms)
|
|||
{
|
||||
int ix;
|
||||
bool is_template;
|
||||
|
||||
|
||||
if (DECL_USE_TEMPLATE (function)
|
||||
&& !(TREE_CODE (function) == TEMPLATE_DECL
|
||||
&& DECL_TEMPLATE_SPECIALIZATION (function))
|
||||
|
@ -589,10 +589,10 @@ check_classfn (tree ctype, tree function, tree template_parms)
|
|||
/* Since this is a specialization of a member template,
|
||||
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);
|
||||
|
||||
|
||||
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
|
||||
find the method, but we don't complain. */
|
||||
|
@ -602,8 +602,8 @@ check_classfn (tree ctype, tree function, tree template_parms)
|
|||
either were not passed, or they are the same of DECL_TEMPLATE_PARMS. */
|
||||
if (TREE_CODE (function) == TEMPLATE_DECL)
|
||||
{
|
||||
gcc_assert (!template_parms
|
||||
|| comp_template_parms (template_parms,
|
||||
gcc_assert (!template_parms
|
||||
|| comp_template_parms (template_parms,
|
||||
DECL_TEMPLATE_PARMS (function)));
|
||||
template_parms = DECL_TEMPLATE_PARMS (function);
|
||||
}
|
||||
|
@ -619,13 +619,13 @@ check_classfn (tree ctype, tree function, tree template_parms)
|
|||
bool is_conv_op;
|
||||
tree pushed_scope;
|
||||
const char *format = NULL;
|
||||
|
||||
|
||||
pushed_scope = push_scope (ctype);
|
||||
for (fndecls = VEC_index (tree, methods, ix);
|
||||
fndecls; fndecls = OVL_NEXT (fndecls))
|
||||
{
|
||||
tree p1, p2;
|
||||
|
||||
|
||||
fndecl = OVL_CURRENT (fndecls);
|
||||
p1 = TYPE_ARG_TYPES (TREE_TYPE (function));
|
||||
p2 = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
|
||||
|
@ -633,8 +633,8 @@ check_classfn (tree ctype, tree function, tree template_parms)
|
|||
/* We cannot simply call decls_match because this doesn't
|
||||
work for static member functions that are pretending to
|
||||
be methods, and because the name may have been changed by
|
||||
asm("new_name"). */
|
||||
|
||||
asm("new_name"). */
|
||||
|
||||
/* Get rid of the this parameter on functions that become
|
||||
static. */
|
||||
if (DECL_STATIC_FUNCTION_P (fndecl)
|
||||
|
@ -645,17 +645,17 @@ check_classfn (tree ctype, tree function, tree template_parms)
|
|||
declaration. */
|
||||
if (is_template != (TREE_CODE (fndecl) == TEMPLATE_DECL))
|
||||
continue;
|
||||
|
||||
|
||||
if (same_type_p (TREE_TYPE (TREE_TYPE (function)),
|
||||
TREE_TYPE (TREE_TYPE (fndecl)))
|
||||
&& compparms (p1, p2)
|
||||
&& (!is_template
|
||||
|| comp_template_parms (template_parms,
|
||||
|| comp_template_parms (template_parms,
|
||||
DECL_TEMPLATE_PARMS (fndecl)))
|
||||
&& (DECL_TEMPLATE_SPECIALIZATION (function)
|
||||
== DECL_TEMPLATE_SPECIALIZATION (fndecl))
|
||||
&& (!DECL_TEMPLATE_SPECIALIZATION (function)
|
||||
|| (DECL_TI_TEMPLATE (function)
|
||||
|| (DECL_TI_TEMPLATE (function)
|
||||
== DECL_TI_TEMPLATE (fndecl))))
|
||||
break;
|
||||
}
|
||||
|
@ -767,7 +767,7 @@ finish_static_data_member_decl (tree decl, tree init, tree asmspec_tree,
|
|||
if (init != NULL_TREE && TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)))
|
||||
{
|
||||
static int explained = 0;
|
||||
|
||||
|
||||
error ("initializer invalid for static member with constructor");
|
||||
if (!explained)
|
||||
{
|
||||
|
@ -805,8 +805,8 @@ finish_static_data_member_decl (tree decl, tree init, tree asmspec_tree,
|
|||
CHANGES TO CODE IN `start_method'. */
|
||||
|
||||
tree
|
||||
grokfield (const cp_declarator *declarator,
|
||||
cp_decl_specifier_seq *declspecs,
|
||||
grokfield (const cp_declarator *declarator,
|
||||
cp_decl_specifier_seq *declspecs,
|
||||
tree init, tree asmspec_tree,
|
||||
tree attrlist)
|
||||
{
|
||||
|
@ -816,7 +816,7 @@ grokfield (const cp_declarator *declarator,
|
|||
|
||||
if (!declspecs->any_specifiers_p
|
||||
&& declarator->kind == cdk_id
|
||||
&& declarator->u.id.qualifying_scope
|
||||
&& declarator->u.id.qualifying_scope
|
||||
&& TREE_CODE (declarator->u.id.unqualified_name) == IDENTIFIER_NODE)
|
||||
/* Access declaration */
|
||||
return do_class_using_decl (declarator->u.id.qualifying_scope,
|
||||
|
@ -919,7 +919,7 @@ grokfield (const cp_declarator *declarator,
|
|||
init = digest_init (TREE_TYPE (value), init, (tree *)0);
|
||||
else
|
||||
init = integral_constant_value (init);
|
||||
|
||||
|
||||
if (init != error_mark_node && ! TREE_CONSTANT (init))
|
||||
{
|
||||
/* We can allow references to things that are effectively
|
||||
|
@ -951,7 +951,7 @@ grokfield (const cp_declarator *declarator,
|
|||
switch (TREE_CODE (value))
|
||||
{
|
||||
case VAR_DECL:
|
||||
finish_static_data_member_decl (value, init, asmspec_tree,
|
||||
finish_static_data_member_decl (value, init, asmspec_tree,
|
||||
flags);
|
||||
return value;
|
||||
|
||||
|
@ -970,7 +970,7 @@ grokfield (const cp_declarator *declarator,
|
|||
set_user_assembler_name (value, asmspec);
|
||||
if (!DECL_FRIEND_P (value))
|
||||
grok_special_member_properties (value);
|
||||
|
||||
|
||||
cp_finish_decl (value, init, asmspec_tree, flags);
|
||||
|
||||
/* Pass friends back this way. */
|
||||
|
@ -979,7 +979,7 @@ grokfield (const cp_declarator *declarator,
|
|||
|
||||
DECL_IN_AGGR_P (value) = 1;
|
||||
return value;
|
||||
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
@ -990,7 +990,7 @@ grokfield (const cp_declarator *declarator,
|
|||
WIDTH is non-NULL for bit fields only, and is an INTEGER_CST node. */
|
||||
|
||||
tree
|
||||
grokbitfield (const cp_declarator *declarator,
|
||||
grokbitfield (const cp_declarator *declarator,
|
||||
cp_decl_specifier_seq *declspecs, tree width)
|
||||
{
|
||||
tree value = grokdeclarator (declarator, declspecs, BITFIELD, 0, NULL);
|
||||
|
@ -1074,8 +1074,8 @@ build_anon_union_vars (tree type, tree object)
|
|||
if (TREE_CODE (type) != UNION_TYPE)
|
||||
error ("anonymous struct not inside named type");
|
||||
|
||||
for (field = TYPE_FIELDS (type);
|
||||
field != NULL_TREE;
|
||||
for (field = TYPE_FIELDS (type);
|
||||
field != NULL_TREE;
|
||||
field = TREE_CHAIN (field))
|
||||
{
|
||||
tree decl;
|
||||
|
@ -1106,7 +1106,7 @@ build_anon_union_vars (tree type, tree object)
|
|||
if (DECL_NAME (field))
|
||||
{
|
||||
decl = build_decl (ALIAS_DECL, DECL_NAME (field), TREE_TYPE (field));
|
||||
DECL_INITIAL (decl) = ref;
|
||||
DECL_INITIAL (decl) = ref;
|
||||
TREE_PUBLIC (decl) = 0;
|
||||
TREE_STATIC (decl) = 0;
|
||||
DECL_EXTERNAL (decl) = 1;
|
||||
|
@ -1143,7 +1143,7 @@ finish_anon_union (tree anon_union_decl)
|
|||
|
||||
/* The VAR_DECL's context is the same as the TYPE's context. */
|
||||
DECL_CONTEXT (anon_union_decl) = DECL_CONTEXT (TYPE_NAME (type));
|
||||
|
||||
|
||||
if (TYPE_FIELDS (type) == NULL_TREE)
|
||||
return;
|
||||
|
||||
|
@ -1188,7 +1188,7 @@ coerce_new_type (tree type)
|
|||
tree args = TYPE_ARG_TYPES (type);
|
||||
|
||||
gcc_assert (TREE_CODE (type) == FUNCTION_TYPE);
|
||||
|
||||
|
||||
if (!same_type_p (TREE_TYPE (type), ptr_type_node))
|
||||
{
|
||||
e = 1;
|
||||
|
@ -1224,7 +1224,7 @@ coerce_delete_type (tree type)
|
|||
{
|
||||
int e = 0;
|
||||
tree args = TYPE_ARG_TYPES (type);
|
||||
|
||||
|
||||
gcc_assert (TREE_CODE (type) == FUNCTION_TYPE);
|
||||
|
||||
if (!same_type_p (TREE_TYPE (type), void_type_node))
|
||||
|
@ -1282,7 +1282,7 @@ mark_vtable_entries (tree decl)
|
|||
we output the vtables that contain them. With vcall offsets,
|
||||
we know all the thunks we'll need when we emit a virtual
|
||||
function, so we emit the thunks there instead. */
|
||||
if (DECL_THUNK_P (fn))
|
||||
if (DECL_THUNK_P (fn))
|
||||
use_thunk (fn, /*emit_p=*/0);
|
||||
mark_used (fn);
|
||||
}
|
||||
|
@ -1296,17 +1296,17 @@ comdat_linkage (tree decl)
|
|||
{
|
||||
if (flag_weak)
|
||||
make_decl_one_only (decl);
|
||||
else if (TREE_CODE (decl) == FUNCTION_DECL
|
||||
else if (TREE_CODE (decl) == FUNCTION_DECL
|
||||
|| (TREE_CODE (decl) == VAR_DECL && DECL_ARTIFICIAL (decl)))
|
||||
/* We can just emit function and compiler-generated variables
|
||||
statically; having multiple copies is (for the most part) only
|
||||
a waste of space.
|
||||
a waste of space.
|
||||
|
||||
There are two correctness issues, however: the address of a
|
||||
template instantiation with external linkage should be the
|
||||
same, independent of what translation unit asks for the
|
||||
address, and this will not hold when we emit multiple copies of
|
||||
the function. However, there's little else we can do.
|
||||
the function. However, there's little else we can do.
|
||||
|
||||
Also, by default, the typeinfo implementation assumes that
|
||||
there will be only one copy of the string used as the name for
|
||||
|
@ -1342,8 +1342,8 @@ comdat_linkage (tree decl)
|
|||
|
||||
/* For win32 we also want to put explicit instantiations in
|
||||
linkonce sections, so that they will be merged with implicit
|
||||
instantiations; otherwise we get duplicate symbol errors.
|
||||
For Darwin we do not want explicit instantiations to be
|
||||
instantiations; otherwise we get duplicate symbol errors.
|
||||
For Darwin we do not want explicit instantiations to be
|
||||
linkonce. */
|
||||
|
||||
void
|
||||
|
@ -1490,7 +1490,7 @@ decl_needed_p (tree decl)
|
|||
return true;
|
||||
/* If this entity was used, let the back-end see it; it will decide
|
||||
whether or not to emit it into the object file. */
|
||||
if (TREE_USED (decl)
|
||||
if (TREE_USED (decl)
|
||||
|| (DECL_ASSEMBLER_NAME_SET_P (decl)
|
||||
&& TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
|
||||
return true;
|
||||
|
@ -1536,7 +1536,7 @@ maybe_emit_vtables (tree ctype)
|
|||
/* If the references to this class' vtables are optimized away,
|
||||
still emit the appropriate debugging information. See
|
||||
dfs_debug_mark. */
|
||||
if (DECL_COMDAT (primary_vtbl)
|
||||
if (DECL_COMDAT (primary_vtbl)
|
||||
&& CLASSTYPE_DEBUG_REQUESTED (ctype))
|
||||
note_debug_info_needed (ctype);
|
||||
return false;
|
||||
|
@ -1552,7 +1552,7 @@ maybe_emit_vtables (tree ctype)
|
|||
if (TREE_TYPE (DECL_INITIAL (vtbl)) == 0)
|
||||
{
|
||||
tree expr = store_init_value (vtbl, DECL_INITIAL (vtbl));
|
||||
|
||||
|
||||
/* It had better be all done at compile-time. */
|
||||
gcc_assert (!expr);
|
||||
}
|
||||
|
@ -1778,7 +1778,7 @@ import_export_decl (tree decl)
|
|||
else if (CLASSTYPE_INTERFACE_KNOWN (class_type))
|
||||
{
|
||||
/* CLASS_TYPE is being exported from this translation unit,
|
||||
so DECL should be defined here. */
|
||||
so DECL should be defined here. */
|
||||
if (!flag_weak && CLASSTYPE_EXPLICIT_INSTANTIATION (class_type))
|
||||
/* If a class is declared in a header with the "extern
|
||||
template" extension, then it will not be instantiated,
|
||||
|
@ -1829,7 +1829,7 @@ import_export_decl (tree decl)
|
|||
wherever it is used. */
|
||||
&& flag_rtti)
|
||||
import_p = true;
|
||||
else
|
||||
else
|
||||
{
|
||||
if (CLASSTYPE_INTERFACE_KNOWN (type)
|
||||
&& !CLASSTYPE_INTERFACE_ONLY (type))
|
||||
|
@ -1856,7 +1856,7 @@ import_export_decl (tree decl)
|
|||
data member. */
|
||||
if (flag_implicit_templates
|
||||
|| (flag_implicit_inline_templates
|
||||
&& TREE_CODE (decl) == FUNCTION_DECL
|
||||
&& TREE_CODE (decl) == FUNCTION_DECL
|
||||
&& DECL_DECLARED_INLINE_P (decl)))
|
||||
comdat_p = true;
|
||||
else
|
||||
|
@ -1874,7 +1874,7 @@ import_export_decl (tree decl)
|
|||
{
|
||||
DECL_NOT_REALLY_EXTERN (decl)
|
||||
= ! (CLASSTYPE_INTERFACE_ONLY (ctype)
|
||||
|| (DECL_DECLARED_INLINE_P (decl)
|
||||
|| (DECL_DECLARED_INLINE_P (decl)
|
||||
&& ! flag_implement_inlines
|
||||
&& !DECL_VINDEX (decl)));
|
||||
|
||||
|
@ -1922,7 +1922,7 @@ import_export_decl (tree decl)
|
|||
&& DECL_VISIBILITY_SPECIFIED (decl)
|
||||
&& (!class_type || !CLASSTYPE_VISIBILITY_SPECIFIED (class_type)))
|
||||
targetm.cxx.determine_class_data_visibility (decl);
|
||||
|
||||
|
||||
DECL_INTERFACE_KNOWN (decl) = 1;
|
||||
}
|
||||
|
||||
|
@ -1976,7 +1976,7 @@ get_guard (tree decl)
|
|||
as an integer counter. */
|
||||
guard_type = targetm.cxx.guard_type ();
|
||||
guard = build_decl (VAR_DECL, sname, guard_type);
|
||||
|
||||
|
||||
/* The guard should have the same linkage as what it guards. */
|
||||
TREE_PUBLIC (guard) = TREE_PUBLIC (decl);
|
||||
TREE_STATIC (guard) = TREE_STATIC (decl);
|
||||
|
@ -1984,7 +1984,7 @@ get_guard (tree decl)
|
|||
DECL_ONE_ONLY (guard) = DECL_ONE_ONLY (decl);
|
||||
if (TREE_PUBLIC (decl))
|
||||
DECL_WEAK (guard) = DECL_WEAK (decl);
|
||||
|
||||
|
||||
DECL_ARTIFICIAL (guard) = 1;
|
||||
DECL_IGNORED_P (guard) = 1;
|
||||
TREE_USED (guard) = 1;
|
||||
|
@ -2003,11 +2003,11 @@ get_guard_bits (tree guard)
|
|||
{
|
||||
/* We only set the first byte of the guard, in order to leave room
|
||||
for a mutex in the high-order bits. */
|
||||
guard = build1 (ADDR_EXPR,
|
||||
guard = build1 (ADDR_EXPR,
|
||||
build_pointer_type (TREE_TYPE (guard)),
|
||||
guard);
|
||||
guard = build1 (NOP_EXPR,
|
||||
build_pointer_type (char_type_node),
|
||||
guard = build1 (NOP_EXPR,
|
||||
build_pointer_type (char_type_node),
|
||||
guard);
|
||||
guard = build1 (INDIRECT_REF, char_type_node, guard);
|
||||
}
|
||||
|
@ -2084,7 +2084,7 @@ start_objects (int method_type, int initp)
|
|||
else
|
||||
sprintf (type, "%c", method_type);
|
||||
|
||||
fndecl = build_lang_decl (FUNCTION_DECL,
|
||||
fndecl = build_lang_decl (FUNCTION_DECL,
|
||||
get_file_function_name_long (type),
|
||||
build_function_type (void_type_node,
|
||||
void_list_node));
|
||||
|
@ -2181,7 +2181,7 @@ static splay_tree priority_info_map;
|
|||
nonzero, it performs initializations. Otherwise, it performs
|
||||
destructions. It only performs those initializations or
|
||||
destructions with the indicated __PRIORITY. The generated function
|
||||
returns no value.
|
||||
returns no value.
|
||||
|
||||
It is assumed that this function will only be called once per
|
||||
translation unit. */
|
||||
|
@ -2205,7 +2205,7 @@ start_static_storage_duration_function (unsigned count)
|
|||
type = build_function_type (void_type_node, parm_types);
|
||||
|
||||
/* Create the FUNCTION_DECL itself. */
|
||||
ssdf_decl = build_lang_decl (FUNCTION_DECL,
|
||||
ssdf_decl = build_lang_decl (FUNCTION_DECL,
|
||||
get_identifier (id),
|
||||
type);
|
||||
TREE_PUBLIC (ssdf_decl) = 0;
|
||||
|
@ -2253,7 +2253,7 @@ start_static_storage_duration_function (unsigned count)
|
|||
function as:
|
||||
|
||||
static void __ssdf (int __initialize_p, init __priority_p);
|
||||
|
||||
|
||||
It is static because we only need to call this function from the
|
||||
various constructor and destructor functions for this module. */
|
||||
start_preparsed_function (ssdf_decl,
|
||||
|
@ -2293,7 +2293,7 @@ get_priority_info (int priority)
|
|||
priority_info pi;
|
||||
splay_tree_node n;
|
||||
|
||||
n = splay_tree_lookup (priority_info_map,
|
||||
n = splay_tree_lookup (priority_info_map,
|
||||
(splay_tree_key) priority);
|
||||
if (!n)
|
||||
{
|
||||
|
@ -2353,7 +2353,7 @@ start_static_initialization_or_destruction (tree decl, int initp)
|
|||
the conversion functions, or the destructor called to
|
||||
create and destroy a static data member is performed as
|
||||
if these calls appeared in the scope of the member's
|
||||
class.
|
||||
class.
|
||||
|
||||
we pretend we are in a static member function of the class of
|
||||
which the DECL is a member. */
|
||||
|
@ -2362,7 +2362,7 @@ start_static_initialization_or_destruction (tree decl, int initp)
|
|||
DECL_CONTEXT (current_function_decl) = DECL_CONTEXT (decl);
|
||||
DECL_STATIC_FUNCTION_P (current_function_decl) = 1;
|
||||
}
|
||||
|
||||
|
||||
/* Conditionalize this initialization on being in the right priority
|
||||
and being initializing/finalizing appropriately. */
|
||||
guard_if_stmt = begin_if_stmt ();
|
||||
|
@ -2381,7 +2381,7 @@ start_static_initialization_or_destruction (tree decl, int initp)
|
|||
might be initialized in more than one place. (For example, a
|
||||
static data member of a template, when the data member requires
|
||||
construction.) */
|
||||
if (TREE_PUBLIC (decl) && (DECL_COMMON (decl)
|
||||
if (TREE_PUBLIC (decl) && (DECL_COMMON (decl)
|
||||
|| DECL_ONE_ONLY (decl)
|
||||
|| DECL_WEAK (decl)))
|
||||
{
|
||||
|
@ -2406,14 +2406,14 @@ start_static_initialization_or_destruction (tree decl, int initp)
|
|||
destructions only if the GUARD is one, i.e., if we are the
|
||||
last to destroy the variable. */
|
||||
else if (initp)
|
||||
guard_cond
|
||||
guard_cond
|
||||
= cp_build_binary_op (EQ_EXPR,
|
||||
build_unary_op (PREINCREMENT_EXPR,
|
||||
guard,
|
||||
/*noconvert=*/1),
|
||||
integer_one_node);
|
||||
else
|
||||
guard_cond
|
||||
guard_cond
|
||||
= cp_build_binary_op (EQ_EXPR,
|
||||
build_unary_op (PREDECREMENT_EXPR,
|
||||
guard,
|
||||
|
@ -2540,7 +2540,7 @@ prune_vars_needing_no_initialization (tree *vars)
|
|||
|
||||
/* Also, if the initializer already contains errors, we can bail
|
||||
out now. */
|
||||
if (init && TREE_CODE (init) == TREE_LIST
|
||||
if (init && TREE_CODE (init) == TREE_LIST
|
||||
&& value_member (error_mark_node, init))
|
||||
{
|
||||
var = &TREE_CHAIN (t);
|
||||
|
@ -2596,7 +2596,7 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority,
|
|||
#else
|
||||
locus->line++;
|
||||
#endif
|
||||
|
||||
|
||||
/* We use `I' to indicate initialization and `D' to indicate
|
||||
destruction. */
|
||||
function_key = constructor_p ? 'I' : 'D';
|
||||
|
@ -2616,7 +2616,7 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority,
|
|||
|
||||
/* Call the static storage duration function with appropriate
|
||||
arguments. */
|
||||
for (i = 0; VEC_iterate (tree, ssdf_decls, i, fndecl); ++i)
|
||||
for (i = 0; VEC_iterate (tree, ssdf_decls, i, fndecl); ++i)
|
||||
{
|
||||
/* Calls to pure or const functions will expand to nothing. */
|
||||
if (! (flags_from_decl_or_type (fndecl) & (ECF_CONST | ECF_PURE)))
|
||||
|
@ -2625,7 +2625,7 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority,
|
|||
body = start_objects (function_key, priority);
|
||||
|
||||
arguments = tree_cons (NULL_TREE,
|
||||
build_int_cst (NULL_TREE, priority),
|
||||
build_int_cst (NULL_TREE, priority),
|
||||
NULL_TREE);
|
||||
arguments = tree_cons (NULL_TREE,
|
||||
build_int_cst (NULL_TREE, constructor_p),
|
||||
|
@ -2641,7 +2641,7 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority,
|
|||
{
|
||||
tree fns;
|
||||
|
||||
for (fns = constructor_p ? static_ctors : static_dtors;
|
||||
for (fns = constructor_p ? static_ctors : static_dtors;
|
||||
fns;
|
||||
fns = TREE_CHAIN (fns))
|
||||
{
|
||||
|
@ -2718,7 +2718,7 @@ cxx_callgraph_analyze_expr (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
|
|||
vtbl = TREE_CHAIN (vtbl))
|
||||
mark_decl_referenced (vtbl);
|
||||
}
|
||||
else if (DECL_CONTEXT (t)
|
||||
else if (DECL_CONTEXT (t)
|
||||
&& TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL)
|
||||
/* If we need a static variable in a function, then we
|
||||
need the containing function. */
|
||||
|
@ -2818,7 +2818,7 @@ cp_finish_file (void)
|
|||
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.
|
||||
o Virtual function tables.
|
||||
|
||||
All of these may cause others to be needed. For example,
|
||||
instantiating one function may cause another to be needed, and
|
||||
|
@ -2829,7 +2829,7 @@ cp_finish_file (void)
|
|||
|
||||
emit_support_tinfos ();
|
||||
|
||||
do
|
||||
do
|
||||
{
|
||||
tree t;
|
||||
tree decl;
|
||||
|
@ -2853,12 +2853,12 @@ cp_finish_file (void)
|
|||
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)))
|
||||
|
@ -2868,7 +2868,7 @@ cp_finish_file (void)
|
|||
}
|
||||
else
|
||||
t = next;
|
||||
|
||||
|
||||
next = TREE_CHAIN (t);
|
||||
}
|
||||
}
|
||||
|
@ -2950,7 +2950,7 @@ cp_finish_file (void)
|
|||
locus.line++;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Go through the set of inline functions whose bodies have not
|
||||
been emitted yet. If out-of-line copies of these functions
|
||||
are required, emit them. */
|
||||
|
@ -3023,7 +3023,7 @@ cp_finish_file (void)
|
|||
reconsider = true;
|
||||
|
||||
/* Static data members are just like namespace-scope globals. */
|
||||
for (i = 0; VEC_iterate (tree, pending_statics, i, decl); ++i)
|
||||
for (i = 0; VEC_iterate (tree, pending_statics, i, decl); ++i)
|
||||
{
|
||||
if (var_finalized_p (decl) || DECL_REALLY_EXTERN (decl))
|
||||
continue;
|
||||
|
@ -3039,7 +3039,7 @@ cp_finish_file (void)
|
|||
reconsider = true;
|
||||
|
||||
retries++;
|
||||
}
|
||||
}
|
||||
while (reconsider);
|
||||
|
||||
/* All used inline functions must have a definition at this point. */
|
||||
|
@ -3068,19 +3068,19 @@ cp_finish_file (void)
|
|||
TREE_PUBLIC (decl) = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* We give C linkage to static constructors and destructors. */
|
||||
push_lang_context (lang_name_c);
|
||||
|
||||
/* Generate initialization and destruction functions for all
|
||||
priorities for which they are required. */
|
||||
if (priority_info_map)
|
||||
splay_tree_foreach (priority_info_map,
|
||||
splay_tree_foreach (priority_info_map,
|
||||
generate_ctor_and_dtor_functions_for_priority,
|
||||
/*data=*/&locus);
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
if (static_ctors)
|
||||
generate_ctor_or_dtor_function (/*constructor_p=*/true,
|
||||
DEFAULT_INIT_PRIORITY, &locus);
|
||||
|
@ -3127,7 +3127,7 @@ cp_finish_file (void)
|
|||
dump_end (TDI_tu, stream);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
timevar_pop (TV_VARCONST);
|
||||
|
||||
if (flag_detailed_statistics)
|
||||
|
@ -3198,7 +3198,7 @@ build_offset_ref_call_from_tree (tree fn, tree args)
|
|||
return build_min_non_dep (CALL_EXPR, expr, orig_fn, orig_args, NULL_TREE);
|
||||
return expr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
check_default_args (tree x)
|
||||
|
@ -3232,23 +3232,23 @@ mark_used (tree decl)
|
|||
{
|
||||
if (DECL_DEFERRED_FN (decl))
|
||||
return;
|
||||
|
||||
|
||||
/* Remember the current location for a function we will end up
|
||||
synthesizing. Then we can inform the user where it was
|
||||
required in the case of error. */
|
||||
if (DECL_ARTIFICIAL (decl) && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
|
||||
&& !DECL_THUNK_P (decl))
|
||||
DECL_SOURCE_LOCATION (decl) = input_location;
|
||||
|
||||
|
||||
note_vague_linkage_fn (decl);
|
||||
}
|
||||
|
||||
|
||||
assemble_external (decl);
|
||||
|
||||
/* Is it a synthesized method that needs to be synthesized? */
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL
|
||||
&& DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
|
||||
&& DECL_ARTIFICIAL (decl)
|
||||
&& DECL_ARTIFICIAL (decl)
|
||||
&& !DECL_THUNK_P (decl)
|
||||
&& ! DECL_INITIAL (decl)
|
||||
/* Kludge: don't synthesize for default args. Unfortunately this
|
||||
|
@ -3270,8 +3270,8 @@ mark_used (tree decl)
|
|||
if ((DECL_NON_THUNK_FUNCTION_P (decl) || TREE_CODE (decl) == VAR_DECL)
|
||||
&& DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)
|
||||
&& (!DECL_EXPLICIT_INSTANTIATION (decl)
|
||||
|| (TREE_CODE (decl) == FUNCTION_DECL
|
||||
&& DECL_INLINE (DECL_TEMPLATE_RESULT
|
||||
|| (TREE_CODE (decl) == FUNCTION_DECL
|
||||
&& DECL_INLINE (DECL_TEMPLATE_RESULT
|
||||
(template_for_substitution (decl))))))
|
||||
/* We put off instantiating functions in order to improve compile
|
||||
times. Maintaining a stack of active functions is expensive,
|
||||
|
|
|
@ -186,7 +186,7 @@ dump_op (dump_info_p di, tree t)
|
|||
dump_string (di, "subs");
|
||||
break;
|
||||
case POSTINCREMENT_EXPR:
|
||||
dump_string (di, "postinc");
|
||||
dump_string (di, "postinc");
|
||||
break;
|
||||
case POSTDECREMENT_EXPR:
|
||||
dump_string (di, "postdec");
|
||||
|
@ -257,7 +257,7 @@ cp_dump_tree (void* dump_info, tree t)
|
|||
dump_child ("bfld", TYPE_CONTEXT (t));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (! IS_AGGR_TYPE (t))
|
||||
break;
|
||||
|
||||
|
@ -270,12 +270,12 @@ cp_dump_tree (void* dump_info, tree t)
|
|||
int i;
|
||||
tree binfo;
|
||||
tree base_binfo;
|
||||
|
||||
|
||||
for (binfo = TYPE_BINFO (t), i = 0;
|
||||
BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i)
|
||||
{
|
||||
dump_child ("base", BINFO_TYPE (base_binfo));
|
||||
if (BINFO_VIRTUAL_P (base_binfo))
|
||||
if (BINFO_VIRTUAL_P (base_binfo))
|
||||
dump_string (di, "virtual");
|
||||
dump_access (di, base_binfo);
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ cp_dump_tree (void* dump_info, tree t)
|
|||
dump_access (di, t);
|
||||
if (TREE_STATIC (t) && !TREE_PUBLIC (t))
|
||||
dump_string (di, "static");
|
||||
break;
|
||||
break;
|
||||
|
||||
case FUNCTION_DECL:
|
||||
if (!DECL_THUNK_P (t))
|
||||
|
@ -302,7 +302,7 @@ cp_dump_tree (void* dump_info, tree t)
|
|||
dump_string (di, "operator");
|
||||
dump_op (di, t);
|
||||
}
|
||||
if (DECL_FUNCTION_MEMBER_P (t))
|
||||
if (DECL_FUNCTION_MEMBER_P (t))
|
||||
{
|
||||
dump_string (di, "member");
|
||||
dump_access (di, t);
|
||||
|
@ -327,7 +327,7 @@ cp_dump_tree (void* dump_info, tree t)
|
|||
else
|
||||
{
|
||||
tree virt = THUNK_VIRTUAL_OFFSET (t);
|
||||
|
||||
|
||||
dump_string (di, "thunk");
|
||||
if (DECL_THIS_THUNK_P (t))
|
||||
dump_string (di, "this adjusting");
|
||||
|
@ -393,7 +393,7 @@ cp_dump_tree (void* dump_info, tree t)
|
|||
dump_child ("args", TREE_OPERAND (t, 1));
|
||||
dump_child ("decl", TREE_OPERAND (t, 2));
|
||||
break;
|
||||
|
||||
|
||||
case HANDLER:
|
||||
dump_stmt (di, t);
|
||||
dump_child ("parm", HANDLER_PARMS (t));
|
||||
|
|
|
@ -348,8 +348,8 @@ dump_type (tree t, int flags)
|
|||
}
|
||||
case TYPENAME_TYPE:
|
||||
pp_cxx_cv_qualifier_seq (cxx_pp, t);
|
||||
pp_cxx_identifier (cxx_pp,
|
||||
TYPENAME_IS_ENUM_P (t) ? "enum"
|
||||
pp_cxx_identifier (cxx_pp,
|
||||
TYPENAME_IS_ENUM_P (t) ? "enum"
|
||||
: TYPENAME_IS_CLASS_P (t) ? "class"
|
||||
: "typename");
|
||||
dump_typename (t, flags);
|
||||
|
@ -481,7 +481,7 @@ dump_aggr_type (tree t, int flags)
|
|||
Arrays must also do this for DECL nodes, like int a[], and for things like
|
||||
int *[]&. */
|
||||
|
||||
static void
|
||||
static void
|
||||
dump_type_prefix (tree t, int flags)
|
||||
{
|
||||
if (TYPE_PTRMEMFUNC_P (t))
|
||||
|
@ -722,7 +722,7 @@ dump_decl (tree t, int flags)
|
|||
&& TREE_CODE (TREE_TYPE (t)) == TEMPLATE_TYPE_PARM)
|
||||
/* Say `class T' not just `T'. */
|
||||
pp_cxx_identifier (cxx_pp, "class");
|
||||
|
||||
|
||||
dump_type (TREE_TYPE (t), flags);
|
||||
break;
|
||||
}
|
||||
|
@ -826,7 +826,7 @@ dump_decl (tree t, int flags)
|
|||
dump_decl (DECL_NAME (t), flags);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* If there's only one function, just treat it like an ordinary
|
||||
FUNCTION_DECL. */
|
||||
t = OVL_CURRENT (t);
|
||||
|
@ -848,7 +848,7 @@ dump_decl (tree t, int flags)
|
|||
case TEMPLATE_ID_EXPR:
|
||||
{
|
||||
tree name = TREE_OPERAND (t, 0);
|
||||
|
||||
|
||||
if (is_overloaded_fn (name))
|
||||
name = DECL_NAME (get_first_fn (name));
|
||||
dump_decl (name, flags);
|
||||
|
@ -1214,7 +1214,7 @@ dump_template_parms (tree info, int primary, int flags)
|
|||
|
||||
if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (args))
|
||||
args = TREE_VEC_ELT (args, TREE_VEC_LENGTH (args) - 1);
|
||||
|
||||
|
||||
len = TREE_VEC_LENGTH (args);
|
||||
|
||||
for (ix = 0; ix != len; ix++)
|
||||
|
@ -1223,7 +1223,7 @@ dump_template_parms (tree info, int primary, int flags)
|
|||
|
||||
if (ix)
|
||||
pp_separate_with_comma (cxx_pp);
|
||||
|
||||
|
||||
if (!arg)
|
||||
pp_identifier (cxx_pp, "<template parameter error>");
|
||||
else
|
||||
|
@ -1273,7 +1273,7 @@ dump_expr (tree t, int flags)
|
|||
{
|
||||
if (t == 0)
|
||||
return;
|
||||
|
||||
|
||||
switch (TREE_CODE (t))
|
||||
{
|
||||
case VAR_DECL:
|
||||
|
@ -1295,7 +1295,7 @@ dump_expr (tree t, int flags)
|
|||
if (PAREN_STRING_LITERAL_P (t))
|
||||
pp_cxx_right_paren (cxx_pp);
|
||||
break;
|
||||
|
||||
|
||||
case INTEGER_CST:
|
||||
case REAL_CST:
|
||||
pp_c_constant (pp_c_base (cxx_pp), t);
|
||||
|
@ -1595,7 +1595,7 @@ dump_expr (tree t, int flags)
|
|||
case CONVERT_EXPR:
|
||||
{
|
||||
tree op = TREE_OPERAND (t, 0);
|
||||
|
||||
|
||||
if (!same_type_p (TREE_TYPE (op), TREE_TYPE (t)))
|
||||
{
|
||||
/* It is a cast, but we cannot tell whether it is a
|
||||
|
@ -1613,7 +1613,7 @@ dump_expr (tree t, int flags)
|
|||
dump_expr (op, flags);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case CONSTRUCTOR:
|
||||
if (TREE_TYPE (t) && TYPE_PTRMEMFUNC_P (TREE_TYPE (t)))
|
||||
{
|
||||
|
@ -1670,7 +1670,7 @@ dump_expr (tree t, int flags)
|
|||
dump_expr_list (CONSTRUCTOR_ELTS (t), flags);
|
||||
pp_cxx_right_brace (cxx_pp);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case OFFSET_REF:
|
||||
|
@ -1683,7 +1683,7 @@ dump_expr (tree t, int flags)
|
|||
/* A::f */
|
||||
dump_expr (t, flags | TFF_EXPR_IN_PARENS);
|
||||
else if (BASELINK_P (t))
|
||||
dump_expr (OVL_CURRENT (BASELINK_FUNCTIONS (t)),
|
||||
dump_expr (OVL_CURRENT (BASELINK_FUNCTIONS (t)),
|
||||
flags | TFF_EXPR_IN_PARENS);
|
||||
else
|
||||
dump_decl (t, flags);
|
||||
|
@ -1950,7 +1950,7 @@ location_of (tree t)
|
|||
t = TYPE_MAIN_DECL (t);
|
||||
else if (TREE_CODE (t) == OVERLOAD)
|
||||
t = OVL_FUNCTION (t);
|
||||
|
||||
|
||||
return DECL_SOURCE_LOCATION (t);
|
||||
}
|
||||
|
||||
|
@ -2182,7 +2182,7 @@ print_instantiation_full_context (diagnostic_context *context)
|
|||
{
|
||||
tree p = current_instantiation ();
|
||||
location_t location = input_location;
|
||||
|
||||
|
||||
if (p)
|
||||
{
|
||||
if (current_function_decl != TINST_DECL (p)
|
||||
|
@ -2295,7 +2295,7 @@ cp_printer (pretty_printer *pp, text_info *text)
|
|||
case 'Q': result = assop_to_string (next_tcode); break;
|
||||
case 'T': result = type_to_string (next_tree, verbose); break;
|
||||
case 'V': result = cv_to_string (next_tree, verbose); break;
|
||||
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ cp_protect_cleanup_actions (void)
|
|||
When the destruction of an object during stack unwinding exits
|
||||
using an exception ... void terminate(); is called. */
|
||||
return build_call (terminate_node, NULL_TREE);
|
||||
}
|
||||
}
|
||||
|
||||
static tree
|
||||
prepare_eh_type (tree type)
|
||||
|
@ -346,7 +346,7 @@ choose_personality_routine (enum languages lang)
|
|||
|
||||
/* Initialize the catch parameter DECL. */
|
||||
|
||||
static void
|
||||
static void
|
||||
initialize_handler_parm (tree decl, tree exp)
|
||||
{
|
||||
tree init;
|
||||
|
@ -357,7 +357,7 @@ initialize_handler_parm (tree decl, tree exp)
|
|||
TREE_USED (decl) = 1;
|
||||
|
||||
/* Figure out the type that the initializer is. Pointers are returned
|
||||
adjusted by value from __cxa_begin_catch. Others are returned by
|
||||
adjusted by value from __cxa_begin_catch. Others are returned by
|
||||
reference. */
|
||||
init_type = TREE_TYPE (decl);
|
||||
if (!POINTER_TYPE_P (init_type))
|
||||
|
@ -528,7 +528,7 @@ do_allocate_exception (tree type)
|
|||
tree tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
|
||||
fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp));
|
||||
}
|
||||
|
||||
|
||||
return build_function_call (fn, tree_cons (NULL_TREE, size_in_bytes (type),
|
||||
NULL_TREE));
|
||||
}
|
||||
|
@ -600,7 +600,7 @@ build_throw (tree exp)
|
|||
|
||||
if (exp == null_node)
|
||||
warning (0, "throwing NULL, which has integral, not pointer type");
|
||||
|
||||
|
||||
if (exp != NULL_TREE)
|
||||
{
|
||||
if (!is_admissible_throw_operand (exp))
|
||||
|
@ -645,7 +645,7 @@ build_throw (tree exp)
|
|||
tmp = build_function_type (void_type_node, tmp);
|
||||
cleanup_type = build_pointer_type (tmp);
|
||||
}
|
||||
|
||||
|
||||
fn = get_identifier ("__cxa_throw");
|
||||
if (!get_global_value_if_present (fn, &fn))
|
||||
{
|
||||
|
@ -658,7 +658,7 @@ build_throw (tree exp)
|
|||
tmp = build_function_type (void_type_node, tmp);
|
||||
fn = push_throw_library_fn (fn, tmp);
|
||||
}
|
||||
|
||||
|
||||
/* throw expression */
|
||||
/* First, decay it. */
|
||||
exp = decay_conversion (exp);
|
||||
|
@ -751,7 +751,7 @@ build_throw (tree exp)
|
|||
}
|
||||
else
|
||||
cleanup = build_int_cst (cleanup_type, 0);
|
||||
|
||||
|
||||
tmp = tree_cons (NULL_TREE, cleanup, NULL_TREE);
|
||||
tmp = tree_cons (NULL_TREE, throw_type, tmp);
|
||||
tmp = tree_cons (NULL_TREE, ptr, tmp);
|
||||
|
@ -774,7 +774,7 @@ build_throw (tree exp)
|
|||
}
|
||||
|
||||
/* ??? Indicate that this function call allows exceptions of the type
|
||||
of the enclosing catch block (if known). */
|
||||
of the enclosing catch block (if known). */
|
||||
exp = build_function_call (fn, NULL_TREE);
|
||||
}
|
||||
|
||||
|
@ -792,18 +792,18 @@ static int
|
|||
complete_ptr_ref_or_void_ptr_p (tree type, tree from)
|
||||
{
|
||||
int is_ptr;
|
||||
|
||||
|
||||
/* Check complete. */
|
||||
type = complete_type_or_else (type, from);
|
||||
if (!type)
|
||||
return 0;
|
||||
|
||||
|
||||
/* Or a pointer or ref to one, or cv void *. */
|
||||
is_ptr = TREE_CODE (type) == POINTER_TYPE;
|
||||
if (is_ptr || TREE_CODE (type) == REFERENCE_TYPE)
|
||||
{
|
||||
tree core = TREE_TYPE (type);
|
||||
|
||||
|
||||
if (is_ptr && VOID_TYPE_P (core))
|
||||
/* OK */;
|
||||
else if (!complete_type_or_else (core, from))
|
||||
|
|
|
@ -46,11 +46,11 @@ cplus_expand_constant (tree cst)
|
|||
{
|
||||
tree type = TREE_TYPE (cst);
|
||||
tree member;
|
||||
|
||||
|
||||
/* Find the member. */
|
||||
member = PTRMEM_CST_MEMBER (cst);
|
||||
|
||||
if (TREE_CODE (member) == FIELD_DECL)
|
||||
if (TREE_CODE (member) == FIELD_DECL)
|
||||
{
|
||||
/* Find the offset for the field. */
|
||||
cst = byte_position (member);
|
||||
|
|
|
@ -85,18 +85,18 @@ is_friend (tree type, tree supplicant)
|
|||
context = TYPE_CONTEXT (context))
|
||||
if (type == context)
|
||||
return 1;
|
||||
|
||||
|
||||
list = CLASSTYPE_FRIEND_CLASSES (TREE_TYPE (TYPE_MAIN_DECL (type)));
|
||||
for (; list ; list = TREE_CHAIN (list))
|
||||
{
|
||||
tree t = TREE_VALUE (list);
|
||||
|
||||
if (TREE_CODE (t) == TEMPLATE_DECL ?
|
||||
if (TREE_CODE (t) == TEMPLATE_DECL ?
|
||||
is_specialization_of_friend (TYPE_MAIN_DECL (supplicant), t) :
|
||||
same_type_p (supplicant, t))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (declp && DECL_FUNCTION_MEMBER_P (supplicant))
|
||||
context = DECL_CONTEXT (supplicant);
|
||||
|
@ -174,7 +174,7 @@ add_friend (tree type, tree decl, bool complain)
|
|||
= tree_cons (DECL_NAME (decl), build_tree_list (NULL_TREE, decl),
|
||||
DECL_FRIENDLIST (typedecl));
|
||||
if (!uses_template_parms (type))
|
||||
DECL_BEFRIENDING_CLASSES (decl)
|
||||
DECL_BEFRIENDING_CLASSES (decl)
|
||||
= tree_cons (NULL_TREE, type,
|
||||
DECL_BEFRIENDING_CLASSES (decl));
|
||||
}
|
||||
|
@ -375,8 +375,8 @@ make_friend_class (tree type, tree friend_type, bool complain)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!classes)
|
||||
|
||||
if (!classes)
|
||||
{
|
||||
maybe_add_class_template_decl_list (type, friend_type, /*friend_p=*/1);
|
||||
|
||||
|
@ -386,12 +386,12 @@ make_friend_class (tree type, tree friend_type, bool complain)
|
|||
friend_type = TREE_TYPE (friend_type);
|
||||
if (!uses_template_parms (type))
|
||||
CLASSTYPE_BEFRIENDING_CLASSES (friend_type)
|
||||
= tree_cons (NULL_TREE, type,
|
||||
CLASSTYPE_BEFRIENDING_CLASSES (friend_type));
|
||||
= tree_cons (NULL_TREE, type,
|
||||
CLASSTYPE_BEFRIENDING_CLASSES (friend_type));
|
||||
}
|
||||
}
|
||||
|
||||
/* Main friend processor.
|
||||
/* Main friend processor.
|
||||
|
||||
CTYPE is the class this friend belongs to.
|
||||
|
||||
|
@ -406,7 +406,7 @@ make_friend_class (tree type, tree friend_type, bool complain)
|
|||
|
||||
tree
|
||||
do_friend (tree ctype, tree declarator, tree decl,
|
||||
tree attrlist, enum overload_flags flags,
|
||||
tree attrlist, enum overload_flags flags,
|
||||
cp_cv_quals quals,
|
||||
int funcdef_flag)
|
||||
{
|
||||
|
@ -482,8 +482,8 @@ do_friend (tree ctype, tree declarator, tree decl,
|
|||
validity of the declaration later. */
|
||||
decl = push_template_decl_real (decl, /*is_friend=*/1);
|
||||
else
|
||||
decl = check_classfn (ctype, decl,
|
||||
template_member_p
|
||||
decl = check_classfn (ctype, decl,
|
||||
template_member_p
|
||||
? current_template_parms
|
||||
: NULL_TREE);
|
||||
|
||||
|
@ -527,7 +527,7 @@ do_friend (tree ctype, tree declarator, tree decl,
|
|||
general, such a declaration depends on template
|
||||
parameters. Instead, we call pushdecl when the class
|
||||
is instantiated. */
|
||||
decl = push_template_decl_real (decl, /*is_friend=*/1);
|
||||
decl = push_template_decl_real (decl, /*is_friend=*/1);
|
||||
else if (current_function_decl)
|
||||
/* This must be a local class, so pushdecl will be ok, and
|
||||
insert an unqualified friend into the local scope
|
||||
|
@ -541,7 +541,7 @@ do_friend (tree ctype, tree declarator, tree decl,
|
|||
unqualified friend decl into the template parameter
|
||||
scope, rather than the namespace containing it. */
|
||||
tree ns = decl_namespace_context (decl);
|
||||
|
||||
|
||||
push_nested_namespace (ns);
|
||||
decl = pushdecl_namespace_level (decl);
|
||||
pop_nested_namespace (ns);
|
||||
|
@ -565,8 +565,8 @@ do_friend (tree ctype, tree declarator, tree decl,
|
|||
|
||||
if (decl == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
add_friend (current_class_type,
|
||||
|
||||
add_friend (current_class_type,
|
||||
is_friend_template ? DECL_TI_TEMPLATE (decl) : decl,
|
||||
/*complain=*/true);
|
||||
DECL_FRIEND_P (decl) = 1;
|
||||
|
|
|
@ -190,7 +190,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
|
|||
cause a warning. */
|
||||
library = -1;
|
||||
}
|
||||
else if (strcmp (argv[i], "-static-libgcc") == 0
|
||||
else if (strcmp (argv[i], "-static-libgcc") == 0
|
||||
|| strcmp (argv[i], "-static") == 0)
|
||||
shared_libgcc = 0;
|
||||
else if (DEFAULT_WORD_SWITCH_TAKES_ARG (&argv[i][1]))
|
||||
|
@ -201,7 +201,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
|
|||
}
|
||||
else
|
||||
{
|
||||
int len;
|
||||
int len;
|
||||
|
||||
if (saw_speclang)
|
||||
{
|
||||
|
@ -213,7 +213,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
|
|||
But not if a specified -x option is currently active. */
|
||||
len = strlen (argv[i]);
|
||||
if (len > 2
|
||||
&& (argv[i][len - 1] == 'c'
|
||||
&& (argv[i][len - 1] == 'c'
|
||||
|| argv[i][len - 1] == 'i'
|
||||
|| argv[i][len - 1] == 'h')
|
||||
&& argv[i][len - 2] == '.')
|
||||
|
@ -221,7 +221,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
|
|||
args[i] |= LANGSPEC;
|
||||
added += 2;
|
||||
}
|
||||
|
||||
|
||||
/* If we don't know that this is a header file, we might
|
||||
need to be linking in the libraries. */
|
||||
if (library == 0)
|
||||
|
@ -256,7 +256,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
|
|||
|
||||
i = 0;
|
||||
j = 0;
|
||||
|
||||
|
||||
/* Copy the 0th argument, i.e., the name of the program itself. */
|
||||
arglist[i++] = argv[j++];
|
||||
|
||||
|
@ -344,7 +344,7 @@ int lang_specific_pre_link (void) /* Not used for C++. */
|
|||
/* Number of extra output files that lang_specific_pre_link may generate. */
|
||||
int lang_specific_extra_outfiles = 0; /* Not used for C++. */
|
||||
|
||||
/* Table of language-specific spec functions. */
|
||||
/* Table of language-specific spec functions. */
|
||||
const struct spec_function lang_specific_spec_functions[] =
|
||||
{
|
||||
{ 0, 0 }
|
||||
|
|
178
gcc/cp/init.c
178
gcc/cp/init.c
|
@ -70,7 +70,7 @@ static bool
|
|||
begin_init_stmts (tree *stmt_expr_p, tree *compound_stmt_p)
|
||||
{
|
||||
bool is_global = !building_stmt_tree ();
|
||||
|
||||
|
||||
*stmt_expr_p = begin_stmt_expr ();
|
||||
*compound_stmt_p = begin_compound_stmt (BCS_NO_SCOPE);
|
||||
|
||||
|
@ -82,13 +82,13 @@ begin_init_stmts (tree *stmt_expr_p, tree *compound_stmt_p)
|
|||
|
||||
static tree
|
||||
finish_init_stmts (bool is_global, tree stmt_expr, tree compound_stmt)
|
||||
{
|
||||
{
|
||||
finish_compound_stmt (compound_stmt);
|
||||
|
||||
|
||||
stmt_expr = finish_stmt_expr (stmt_expr, true);
|
||||
|
||||
gcc_assert (!building_stmt_tree () == is_global);
|
||||
|
||||
|
||||
return stmt_expr;
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ dfs_initialize_vtbl_ptrs (tree binfo, void *data)
|
|||
{
|
||||
if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo)))
|
||||
return dfs_skip_bases;
|
||||
|
||||
|
||||
if (!BINFO_PRIMARY_P (binfo) || BINFO_VIRTUAL_P (binfo))
|
||||
{
|
||||
tree base_ptr = TREE_VALUE ((tree) data);
|
||||
|
@ -200,7 +200,7 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
|
|||
over TYPE_FIELDs will result in correct initialization of
|
||||
all of the subobjects. */
|
||||
if (static_storage_p && !zero_init_p (TREE_TYPE (field)))
|
||||
inits = tree_cons (field,
|
||||
inits = tree_cons (field,
|
||||
build_zero_init (TREE_TYPE (field),
|
||||
/*nelts=*/NULL_TREE,
|
||||
static_storage_p),
|
||||
|
@ -236,16 +236,16 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
|
|||
/*nelts=*/NULL_TREE,
|
||||
static_storage_p);
|
||||
tree range;
|
||||
|
||||
|
||||
/* If this is a one element array, we just use a regular init. */
|
||||
if (tree_int_cst_equal (size_zero_node, max_index))
|
||||
range = size_zero_node;
|
||||
else
|
||||
range = build2 (RANGE_EXPR, sizetype, size_zero_node, max_index);
|
||||
|
||||
|
||||
inits = tree_cons (range, elt_init, inits);
|
||||
}
|
||||
|
||||
|
||||
CONSTRUCTOR_ELTS (init) = nreverse (inits);
|
||||
}
|
||||
else
|
||||
|
@ -292,7 +292,7 @@ build_default_init (tree type, tree nelts)
|
|||
a class with a pointer-to-data member as a non-static data member
|
||||
does not have TYPE_NEEDS_CONSTRUCTING set.) Therefore, we end up
|
||||
passing non-PODs to build_zero_init below, which is contrary to
|
||||
the semantics quoted above from [dcl.init].
|
||||
the semantics quoted above from [dcl.init].
|
||||
|
||||
It happens, however, that the behavior of the constructor the
|
||||
standard says we should have generated would be precisely the
|
||||
|
@ -301,7 +301,7 @@ build_default_init (tree type, tree nelts)
|
|||
if (TYPE_NEEDS_CONSTRUCTING (type)
|
||||
|| (nelts && TREE_CODE (nelts) != INTEGER_CST))
|
||||
return NULL_TREE;
|
||||
|
||||
|
||||
/* At this point, TYPE is either a POD class type, an array of POD
|
||||
classes, or something even more innocuous. */
|
||||
return build_zero_init (type, nelts, /*static_storage_p=*/false);
|
||||
|
@ -409,7 +409,7 @@ perform_member_init (tree member, tree init)
|
|||
/* Returns a TREE_LIST containing (as the TREE_PURPOSE of each node) all
|
||||
the FIELD_DECLs on the TYPE_FIELDS list for T, in reverse order. */
|
||||
|
||||
static tree
|
||||
static tree
|
||||
build_field_list (tree t, tree list, int *uses_unions_p)
|
||||
{
|
||||
tree fields;
|
||||
|
@ -425,7 +425,7 @@ build_field_list (tree t, tree list, int *uses_unions_p)
|
|||
/* Skip CONST_DECLs for enumeration constants and so forth. */
|
||||
if (TREE_CODE (fields) != FIELD_DECL || DECL_ARTIFICIAL (fields))
|
||||
continue;
|
||||
|
||||
|
||||
/* Keep track of whether or not any fields are unions. */
|
||||
if (TREE_CODE (TREE_TYPE (fields)) == UNION_TYPE)
|
||||
*uses_unions_p = 1;
|
||||
|
@ -439,7 +439,7 @@ build_field_list (tree t, tree list, int *uses_unions_p)
|
|||
initialize the entire aggregate. */
|
||||
list = tree_cons (fields, NULL_TREE, list);
|
||||
/* And now add the fields in the anonymous aggregate. */
|
||||
list = build_field_list (TREE_TYPE (fields), list,
|
||||
list = build_field_list (TREE_TYPE (fields), list,
|
||||
uses_unions_p);
|
||||
}
|
||||
/* Add this field. */
|
||||
|
@ -474,12 +474,12 @@ sort_mem_initializers (tree t, tree mem_inits)
|
|||
TREE_VALUE will be the constructor arguments, or NULL if no
|
||||
explicit initialization was provided. */
|
||||
sorted_inits = NULL_TREE;
|
||||
|
||||
|
||||
/* Process the virtual bases. */
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (t), i = 0;
|
||||
VEC_iterate (tree, vbases, i, base); i++)
|
||||
sorted_inits = tree_cons (base, NULL_TREE, sorted_inits);
|
||||
|
||||
|
||||
/* Process the direct bases. */
|
||||
for (binfo = TYPE_BINFO (t), i = 0;
|
||||
BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i)
|
||||
|
@ -508,10 +508,10 @@ sort_mem_initializers (tree t, tree mem_inits)
|
|||
subobject = TREE_PURPOSE (init);
|
||||
|
||||
/* If the explicit initializers are in sorted order, then
|
||||
SUBOBJECT will be NEXT_SUBOBJECT, or something following
|
||||
SUBOBJECT will be NEXT_SUBOBJECT, or something following
|
||||
it. */
|
||||
for (subobject_init = next_subobject;
|
||||
subobject_init;
|
||||
for (subobject_init = next_subobject;
|
||||
subobject_init;
|
||||
subobject_init = TREE_CHAIN (subobject_init))
|
||||
if (TREE_PURPOSE (subobject_init) == subobject)
|
||||
break;
|
||||
|
@ -541,7 +541,7 @@ sort_mem_initializers (tree t, tree mem_inits)
|
|||
while (TREE_PURPOSE (subobject_init) != subobject)
|
||||
subobject_init = TREE_CHAIN (subobject_init);
|
||||
}
|
||||
|
||||
|
||||
/* It is invalid to initialize the same subobject more than
|
||||
once. */
|
||||
if (TREE_VALUE (subobject_init))
|
||||
|
@ -550,7 +550,7 @@ sort_mem_initializers (tree t, tree mem_inits)
|
|||
error ("%Jmultiple initializations given for %qD",
|
||||
current_function_decl, subobject);
|
||||
else
|
||||
error ("%Jmultiple initializations given for base %qT",
|
||||
error ("%Jmultiple initializations given for base %qT",
|
||||
current_function_decl, subobject);
|
||||
}
|
||||
|
||||
|
@ -574,7 +574,7 @@ sort_mem_initializers (tree t, tree mem_inits)
|
|||
int done;
|
||||
|
||||
/* Skip uninitialized members and base classes. */
|
||||
if (!TREE_VALUE (init)
|
||||
if (!TREE_VALUE (init)
|
||||
|| TREE_CODE (TREE_PURPOSE (init)) != FIELD_DECL)
|
||||
continue;
|
||||
/* See if this field is a member of a union, or a member of a
|
||||
|
@ -628,7 +628,7 @@ sort_mem_initializers (tree t, tree mem_inits)
|
|||
|
||||
last_field_type = TYPE_CONTEXT (last_field_type);
|
||||
}
|
||||
|
||||
|
||||
/* If we've reached the outermost class, then we're
|
||||
done. */
|
||||
if (same_type_p (field_type, t))
|
||||
|
@ -659,15 +659,15 @@ emit_mem_initializers (tree mem_inits)
|
|||
the type is incomplete. */
|
||||
if (!COMPLETE_TYPE_P (current_class_type))
|
||||
return;
|
||||
|
||||
|
||||
/* Sort the mem-initializers into the order in which the
|
||||
initializations should be performed. */
|
||||
mem_inits = sort_mem_initializers (current_class_type, mem_inits);
|
||||
|
||||
in_base_initializer = 1;
|
||||
|
||||
|
||||
/* Initialize base classes. */
|
||||
while (mem_inits
|
||||
while (mem_inits
|
||||
&& TREE_CODE (TREE_PURPOSE (mem_inits)) != FIELD_DECL)
|
||||
{
|
||||
tree subobject = TREE_PURPOSE (mem_inits);
|
||||
|
@ -676,7 +676,7 @@ emit_mem_initializers (tree mem_inits)
|
|||
/* If these initializations are taking place in a copy
|
||||
constructor, the base class should probably be explicitly
|
||||
initialized. */
|
||||
if (extra_warnings && !arguments
|
||||
if (extra_warnings && !arguments
|
||||
&& DECL_COPY_CONSTRUCTOR_P (current_function_decl)
|
||||
&& TYPE_NEEDS_CONSTRUCTING (BINFO_TYPE (subobject)))
|
||||
warning (0, "%Jbase class %q#T should be explicitly initialized in the "
|
||||
|
@ -694,11 +694,11 @@ emit_mem_initializers (tree mem_inits)
|
|||
else
|
||||
{
|
||||
tree base_addr;
|
||||
|
||||
|
||||
base_addr = build_base_path (PLUS_EXPR, current_class_ptr,
|
||||
subobject, 1);
|
||||
expand_aggr_init_1 (subobject, NULL_TREE,
|
||||
build_indirect_ref (base_addr, NULL),
|
||||
build_indirect_ref (base_addr, NULL),
|
||||
arguments,
|
||||
LOOKUP_NORMAL);
|
||||
expand_cleanup_for_base (subobject, NULL_TREE);
|
||||
|
@ -710,7 +710,7 @@ emit_mem_initializers (tree mem_inits)
|
|||
|
||||
/* Initialize the vptrs. */
|
||||
initialize_vtbl_ptrs (current_class_ptr);
|
||||
|
||||
|
||||
/* Initialize the data members. */
|
||||
while (mem_inits)
|
||||
{
|
||||
|
@ -777,8 +777,8 @@ expand_virtual_init (tree binfo, tree decl)
|
|||
|
||||
/* Compute the value to use, when there's a VTT. */
|
||||
vtt_parm = current_vtt_parm;
|
||||
vtbl2 = build2 (PLUS_EXPR,
|
||||
TREE_TYPE (vtt_parm),
|
||||
vtbl2 = build2 (PLUS_EXPR,
|
||||
TREE_TYPE (vtt_parm),
|
||||
vtt_parm,
|
||||
vtt_index);
|
||||
vtbl2 = build_indirect_ref (vtbl2, NULL);
|
||||
|
@ -787,11 +787,11 @@ expand_virtual_init (tree binfo, tree decl)
|
|||
/* The actual initializer is the VTT value only in the subobject
|
||||
constructor. In maybe_clone_body we'll substitute NULL for
|
||||
the vtt_parm in the case of the non-subobject constructor. */
|
||||
vtbl = build3 (COND_EXPR,
|
||||
TREE_TYPE (vtbl),
|
||||
vtbl = build3 (COND_EXPR,
|
||||
TREE_TYPE (vtbl),
|
||||
build2 (EQ_EXPR, boolean_type_node,
|
||||
current_in_charge_parm, integer_zero_node),
|
||||
vtbl2,
|
||||
vtbl2,
|
||||
vtbl);
|
||||
}
|
||||
|
||||
|
@ -820,7 +820,7 @@ expand_cleanup_for_base (tree binfo, tree flag)
|
|||
return;
|
||||
|
||||
/* Call the destructor. */
|
||||
expr = build_special_member_call (current_class_ref,
|
||||
expr = build_special_member_call (current_class_ref,
|
||||
base_dtor_identifier,
|
||||
NULL_TREE,
|
||||
binfo,
|
||||
|
@ -841,7 +841,7 @@ construct_virtual_base (tree vbase, tree arguments)
|
|||
{
|
||||
tree inner_if_stmt;
|
||||
tree exp;
|
||||
tree flag;
|
||||
tree flag;
|
||||
|
||||
/* If there are virtual base classes with destructors, we need to
|
||||
emit cleanups to destroy them if an exception is thrown during
|
||||
|
@ -867,7 +867,7 @@ construct_virtual_base (tree vbase, tree arguments)
|
|||
we already know where it is. */
|
||||
exp = convert_to_base_statically (current_class_ref, vbase);
|
||||
|
||||
expand_aggr_init_1 (vbase, current_class_ref, exp, arguments,
|
||||
expand_aggr_init_1 (vbase, current_class_ref, exp, arguments,
|
||||
LOOKUP_COMPLAIN);
|
||||
finish_then_clause (inner_if_stmt);
|
||||
finish_if_stmt (inner_if_stmt);
|
||||
|
@ -893,7 +893,7 @@ initializing_context (tree field)
|
|||
is erroneous. FIELD is the member we decided to initialize.
|
||||
TYPE is the type for which the initialization is being performed.
|
||||
FIELD must be a member of TYPE.
|
||||
|
||||
|
||||
MEMBER_NAME is the name of the member. */
|
||||
|
||||
static int
|
||||
|
@ -1003,7 +1003,7 @@ expand_member_init (tree name)
|
|||
virtual_binfo = binfo_for_vbase (basetype, current_class_type);
|
||||
|
||||
/* [class.base.init]
|
||||
|
||||
|
||||
If a mem-initializer-id is ambiguous because it designates
|
||||
both a direct non-virtual base class and an inherited virtual
|
||||
base class, the mem-initializer is ill-formed. */
|
||||
|
@ -1366,7 +1366,7 @@ build_offset_ref (tree type, tree name, bool address_p)
|
|||
|
||||
if (type == NULL_TREE)
|
||||
return error_mark_node;
|
||||
|
||||
|
||||
/* Handle namespace names fully here. */
|
||||
if (TREE_CODE (type) == NAMESPACE_DECL)
|
||||
{
|
||||
|
@ -1411,7 +1411,7 @@ build_offset_ref (tree type, tree name, bool address_p)
|
|||
else
|
||||
{
|
||||
member = lookup_member (basebinfo, name, 1, 0);
|
||||
|
||||
|
||||
if (member == error_mark_node)
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -1465,9 +1465,9 @@ build_offset_ref (tree type, tree name, bool address_p)
|
|||
t = build2 (TEMPLATE_ID_EXPR, TREE_TYPE (t), t,
|
||||
TREE_OPERAND (orig_name, 1));
|
||||
t = build2 (OFFSET_REF, unknown_type_node, decl, t);
|
||||
|
||||
|
||||
PTRMEM_OK_P (t) = 1;
|
||||
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
|
@ -1539,7 +1539,7 @@ build_offset_ref (tree type, tree name, bool address_p)
|
|||
PTRMEM_OK_P (member) = 1;
|
||||
return build_unary_op (ADDR_EXPR, member, 0);
|
||||
}
|
||||
error ("invalid use of non-static member function %qD",
|
||||
error ("invalid use of non-static member function %qD",
|
||||
TREE_OPERAND (member, 1));
|
||||
return member;
|
||||
}
|
||||
|
@ -1597,7 +1597,7 @@ decl_constant_value (tree decl)
|
|||
then re-evaluating it could give different results. */
|
||||
&& TREE_CONSTANT (DECL_INITIAL (decl)))
|
||||
return DECL_INITIAL (decl);
|
||||
|
||||
|
||||
return decl;
|
||||
}
|
||||
|
||||
|
@ -1622,7 +1622,7 @@ build_builtin_delete_call (tree addr)
|
|||
explicitly wrote "::new" rather than just "new". */
|
||||
|
||||
tree
|
||||
build_new (tree placement, tree type, tree nelts, tree init,
|
||||
build_new (tree placement, tree type, tree nelts, tree init,
|
||||
int use_global_new)
|
||||
{
|
||||
tree rval;
|
||||
|
@ -1632,7 +1632,7 @@ build_new (tree placement, tree type, tree nelts, tree init,
|
|||
|
||||
if (processing_template_decl)
|
||||
{
|
||||
rval = build_min (NEW_EXPR, build_pointer_type (type),
|
||||
rval = build_min (NEW_EXPR, build_pointer_type (type),
|
||||
placement, type, nelts, init);
|
||||
NEW_EXPR_USE_GLOBAL (rval) = use_global_new;
|
||||
TREE_SIDE_EFFECTS (rval) = 1;
|
||||
|
@ -1735,13 +1735,13 @@ build_new_1 (tree exp)
|
|||
tree placement, init;
|
||||
tree size, rval;
|
||||
/* True iff this is a call to "operator new[]" instead of just
|
||||
"operator new". */
|
||||
"operator new". */
|
||||
bool array_p = false;
|
||||
/* True iff ARRAY_P is true and the bound of the array type is
|
||||
not necessarily a compile time constant. For example, VLA_P is
|
||||
true for "new int[f()]". */
|
||||
bool vla_p = false;
|
||||
/* The type being allocated. If ARRAY_P is true, this will be an
|
||||
/* The type being allocated. If ARRAY_P is true, this will be an
|
||||
ARRAY_TYPE. */
|
||||
tree full_type;
|
||||
/* If ARRAY_P is true, the element type of the array. This is an
|
||||
|
@ -1801,7 +1801,7 @@ build_new_1 (tree exp)
|
|||
outer_nelts = nelts;
|
||||
array_p = true;
|
||||
|
||||
/* ??? The middle-end will error on us for building a VLA outside a
|
||||
/* ??? The middle-end will error on us for building a VLA outside a
|
||||
function context. Methinks that's not it's purvey. So we'll do
|
||||
our own VLA layout later. */
|
||||
vla_p = true;
|
||||
|
@ -1827,7 +1827,7 @@ build_new_1 (tree exp)
|
|||
for (elt_type = type;
|
||||
TREE_CODE (elt_type) == ARRAY_TYPE;
|
||||
elt_type = TREE_TYPE (elt_type))
|
||||
nelts = cp_build_binary_op (MULT_EXPR, nelts,
|
||||
nelts = cp_build_binary_op (MULT_EXPR, nelts,
|
||||
array_type_nelts_top (elt_type));
|
||||
|
||||
if (!complete_type_or_else (elt_type, exp))
|
||||
|
@ -1876,7 +1876,7 @@ build_new_1 (tree exp)
|
|||
|
||||
use_java_new = 1;
|
||||
alloc_decl = NULL;
|
||||
if (!get_global_value_if_present (get_identifier (alloc_name),
|
||||
if (!get_global_value_if_present (get_identifier (alloc_name),
|
||||
&alloc_decl))
|
||||
{
|
||||
error ("call to Java constructor with %qs undefined", alloc_name);
|
||||
|
@ -1900,7 +1900,7 @@ build_new_1 (tree exp)
|
|||
|
||||
fnname = ansi_opname (array_p ? VEC_NEW_EXPR : NEW_EXPR);
|
||||
|
||||
if (!globally_qualified_p
|
||||
if (!globally_qualified_p
|
||||
&& CLASS_TYPE_P (elt_type)
|
||||
&& (array_p
|
||||
? TYPE_HAS_ARRAY_NEW_OPERATOR (elt_type)
|
||||
|
@ -1937,7 +1937,7 @@ build_new_1 (tree exp)
|
|||
else
|
||||
cookie_size = NULL_TREE;
|
||||
|
||||
alloc_call = build_operator_new_call (fnname, placement,
|
||||
alloc_call = build_operator_new_call (fnname, placement,
|
||||
&size, &cookie_size);
|
||||
}
|
||||
}
|
||||
|
@ -1958,7 +1958,7 @@ build_new_1 (tree exp)
|
|||
alloc_node = TARGET_EXPR_SLOT (alloc_expr);
|
||||
|
||||
/* Strip any COMPOUND_EXPRs from ALLOC_CALL. */
|
||||
while (TREE_CODE (alloc_call) == COMPOUND_EXPR)
|
||||
while (TREE_CODE (alloc_call) == COMPOUND_EXPR)
|
||||
alloc_call = TREE_OPERAND (alloc_call, 1);
|
||||
alloc_fn = get_callee_fndecl (alloc_call);
|
||||
gcc_assert (alloc_fn != NULL_TREE);
|
||||
|
@ -1973,8 +1973,8 @@ build_new_1 (tree exp)
|
|||
there is no explicit placement argument. If there is more than
|
||||
one argument, or there are variable arguments, then this is a
|
||||
placement allocation function. */
|
||||
placement_allocation_fn_p
|
||||
= (type_num_arguments (TREE_TYPE (alloc_fn)) > 1
|
||||
placement_allocation_fn_p
|
||||
= (type_num_arguments (TREE_TYPE (alloc_fn)) > 1
|
||||
|| varargs_function_p (alloc_fn));
|
||||
|
||||
/* Preevaluate the placement args so that we don't reevaluate them for a
|
||||
|
@ -2069,7 +2069,7 @@ build_new_1 (tree exp)
|
|||
}
|
||||
else if (TYPE_NEEDS_CONSTRUCTING (type))
|
||||
{
|
||||
init_expr = build_special_member_call (init_expr,
|
||||
init_expr = build_special_member_call (init_expr,
|
||||
complete_ctor_identifier,
|
||||
init, elt_type,
|
||||
LOOKUP_NORMAL);
|
||||
|
@ -2110,9 +2110,9 @@ build_new_1 (tree exp)
|
|||
/* The Standard is unclear here, but the right thing to do
|
||||
is to use the same method for finding deallocation
|
||||
functions that we use for finding allocation functions. */
|
||||
cleanup = build_op_delete_call (dcode, alloc_node, size,
|
||||
cleanup = build_op_delete_call (dcode, alloc_node, size,
|
||||
globally_qualified_p,
|
||||
(placement_allocation_fn_p
|
||||
(placement_allocation_fn_p
|
||||
? alloc_call : NULL_TREE));
|
||||
|
||||
if (!cleanup)
|
||||
|
@ -2153,7 +2153,7 @@ build_new_1 (tree exp)
|
|||
build2 (COMPOUND_EXPR, void_type_node, init_expr,
|
||||
end));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2277,10 +2277,10 @@ build_vec_delete_1 (tree base, tree maxindex, tree type,
|
|||
tree cookie_size;
|
||||
|
||||
cookie_size = targetm.cxx.get_cookie_size (type);
|
||||
base_tbd
|
||||
base_tbd
|
||||
= cp_convert (ptype,
|
||||
cp_build_binary_op (MINUS_EXPR,
|
||||
cp_convert (string_type_node,
|
||||
cp_convert (string_type_node,
|
||||
base),
|
||||
cookie_size));
|
||||
/* True size with header. */
|
||||
|
@ -2300,10 +2300,10 @@ build_vec_delete_1 (tree base, tree maxindex, tree type,
|
|||
body = deallocate_expr;
|
||||
else
|
||||
body = build_compound_expr (body, deallocate_expr);
|
||||
|
||||
|
||||
if (!body)
|
||||
body = integer_zero_node;
|
||||
|
||||
|
||||
/* Outermost wrapper: If pointer is null, punt. */
|
||||
body = fold_build3 (COND_EXPR, void_type_node,
|
||||
fold_build2 (NE_EXPR, boolean_type_node, base,
|
||||
|
@ -2325,13 +2325,13 @@ build_vec_delete_1 (tree base, tree maxindex, tree type,
|
|||
return convert_to_void (body, /*implicit=*/NULL);
|
||||
}
|
||||
|
||||
/* Create an unnamed variable of the indicated TYPE. */
|
||||
/* Create an unnamed variable of the indicated TYPE. */
|
||||
|
||||
tree
|
||||
create_temporary_var (tree type)
|
||||
{
|
||||
tree decl;
|
||||
|
||||
|
||||
decl = build_decl (VAR_DECL, NULL_TREE, type);
|
||||
TREE_USED (decl) = 1;
|
||||
DECL_ARTIFICIAL (decl) = 1;
|
||||
|
@ -2356,7 +2356,7 @@ get_temp_regvar (tree type, tree init)
|
|||
|
||||
decl = create_temporary_var (type);
|
||||
add_decl_expr (decl);
|
||||
|
||||
|
||||
finish_expr_stmt (build_modify_expr (decl, INIT_EXPR, init));
|
||||
|
||||
return decl;
|
||||
|
@ -2390,7 +2390,7 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
|
|||
tree atype = TREE_TYPE (base);
|
||||
/* The type of an element in the array. */
|
||||
tree type = TREE_TYPE (atype);
|
||||
/* The element type reached after removing all outer array
|
||||
/* The element type reached after removing all outer array
|
||||
types. */
|
||||
tree inner_elt_type;
|
||||
/* The type of a pointer to an element in the array. */
|
||||
|
@ -2401,7 +2401,7 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
|
|||
tree try_block = NULL_TREE;
|
||||
int num_initialized_elts = 0;
|
||||
bool is_global;
|
||||
|
||||
|
||||
if (TYPE_DOMAIN (atype))
|
||||
maxindex = array_type_nelts (atype);
|
||||
|
||||
|
@ -2411,7 +2411,7 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
|
|||
inner_elt_type = strip_array_types (atype);
|
||||
if (init
|
||||
&& (from_array == 2
|
||||
? (!CLASS_TYPE_P (inner_elt_type)
|
||||
? (!CLASS_TYPE_P (inner_elt_type)
|
||||
|| !TYPE_HAS_COMPLEX_ASSIGN_REF (inner_elt_type))
|
||||
: !TYPE_NEEDS_CONSTRUCTING (type))
|
||||
&& ((TREE_CODE (init) == CONSTRUCTOR
|
||||
|
@ -2450,14 +2450,14 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
|
|||
}
|
||||
rval;
|
||||
})
|
||||
|
||||
|
||||
We can omit the try and catch blocks if we know that the
|
||||
initialization will never throw an exception, or if the array
|
||||
elements do not have destructors. We can omit the loop completely if
|
||||
the elements of the array do not have constructors.
|
||||
the elements of the array do not have constructors.
|
||||
|
||||
We actually wrap the entire body of the above in a STMT_EXPR, for
|
||||
tidiness.
|
||||
tidiness.
|
||||
|
||||
When copying from array to another, when the array elements have
|
||||
only trivial copy constructors, we should use __builtin_memcpy
|
||||
|
@ -2515,7 +2515,7 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
|
|||
{
|
||||
/* If initializing one array from another, initialize element by
|
||||
element. We rely upon the below calls the do argument
|
||||
checking. */
|
||||
checking. */
|
||||
if (init)
|
||||
{
|
||||
base2 = decay_conversion (init);
|
||||
|
@ -2585,9 +2585,9 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
|
|||
0, 0, 0);
|
||||
}
|
||||
else
|
||||
elt_init = build_aggr_init (build1 (INDIRECT_REF, type, base),
|
||||
elt_init = build_aggr_init (build1 (INDIRECT_REF, type, base),
|
||||
init, 0);
|
||||
|
||||
|
||||
current_stmt_tree ()->stmts_are_full_exprs_p = 1;
|
||||
finish_expr_stmt (elt_init);
|
||||
current_stmt_tree ()->stmts_are_full_exprs_p = 0;
|
||||
|
@ -2613,7 +2613,7 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
|
|||
array_type_nelts_total (type));
|
||||
|
||||
finish_cleanup_try_block (try_block);
|
||||
e = build_vec_delete_1 (rval, m,
|
||||
e = build_vec_delete_1 (rval, m,
|
||||
inner_elt_type, sfk_base_destructor,
|
||||
/*use_global_delete=*/0);
|
||||
finish_cleanup (e, try_block);
|
||||
|
@ -2629,7 +2629,7 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
|
|||
atype = build_pointer_type (atype);
|
||||
stmt_expr = build1 (NOP_EXPR, atype, stmt_expr);
|
||||
stmt_expr = build_indirect_ref (stmt_expr, NULL);
|
||||
|
||||
|
||||
current_stmt_tree ()->stmts_are_full_exprs_p = destroy_temps;
|
||||
return stmt_expr;
|
||||
}
|
||||
|
@ -2655,7 +2655,7 @@ build_x_delete (tree addr, int which_delete, tree virtual_size)
|
|||
int use_vec_delete = !!(which_delete & 2);
|
||||
enum tree_code code = use_vec_delete ? VEC_DELETE_EXPR : DELETE_EXPR;
|
||||
|
||||
return build_op_delete_call (code, addr, virtual_size, use_global_delete,
|
||||
return build_op_delete_call (code, addr, virtual_size, use_global_delete,
|
||||
NULL_TREE);
|
||||
}
|
||||
|
||||
|
@ -2685,7 +2685,7 @@ build_dtor_call (tree exp, special_function_kind dtor_kind, int flags)
|
|||
gcc_unreachable ();
|
||||
}
|
||||
fn = lookup_fnfields (TREE_TYPE (exp), name, /*protect=*/2);
|
||||
return build_new_method_call (exp, fn,
|
||||
return build_new_method_call (exp, fn,
|
||||
/*args=*/NULL_TREE,
|
||||
/*conversion_path=*/NULL_TREE,
|
||||
flags);
|
||||
|
@ -2756,7 +2756,7 @@ build_delete (tree type, tree addr, special_function_kind auto_delete,
|
|||
else if (TREE_CODE (type) == ARRAY_TYPE)
|
||||
{
|
||||
handle_array:
|
||||
|
||||
|
||||
if (TYPE_DOMAIN (type) == NULL_TREE)
|
||||
{
|
||||
error ("unknown array size in delete");
|
||||
|
@ -2884,11 +2884,11 @@ push_base_cleanups (void)
|
|||
{
|
||||
if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (BINFO_TYPE (base_binfo)))
|
||||
{
|
||||
expr = build_special_member_call (current_class_ref,
|
||||
expr = build_special_member_call (current_class_ref,
|
||||
base_dtor_identifier,
|
||||
NULL_TREE,
|
||||
base_binfo,
|
||||
(LOOKUP_NORMAL
|
||||
(LOOKUP_NORMAL
|
||||
| LOOKUP_NONVIRTUAL));
|
||||
expr = build3 (COND_EXPR, void_type_node, cond,
|
||||
expr, void_zero_node);
|
||||
|
@ -2905,9 +2905,9 @@ push_base_cleanups (void)
|
|||
|| BINFO_VIRTUAL_P (base_binfo))
|
||||
continue;
|
||||
|
||||
expr = build_special_member_call (current_class_ref,
|
||||
expr = build_special_member_call (current_class_ref,
|
||||
base_dtor_identifier,
|
||||
NULL_TREE, base_binfo,
|
||||
NULL_TREE, base_binfo,
|
||||
LOOKUP_NORMAL | LOOKUP_NONVIRTUAL);
|
||||
finish_decl_cleanup (NULL_TREE, expr);
|
||||
}
|
||||
|
@ -2919,8 +2919,8 @@ push_base_cleanups (void)
|
|||
continue;
|
||||
if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (member)))
|
||||
{
|
||||
tree this_member = (build_class_member_access_expr
|
||||
(current_class_ref, member,
|
||||
tree this_member = (build_class_member_access_expr
|
||||
(current_class_ref, member,
|
||||
/*access_path=*/NULL_TREE,
|
||||
/*preserve_reference=*/false));
|
||||
tree this_type = TREE_TYPE (member);
|
||||
|
|
|
@ -633,16 +633,16 @@ unqualified_fn_lookup_error (tree name)
|
|||
declaration of "f" is available. Historically, G++ and most
|
||||
other compilers accepted that usage since they deferred all name
|
||||
lookup until instantiation time rather than doing unqualified
|
||||
name lookup at template definition time; explain to the user what
|
||||
name lookup at template definition time; explain to the user what
|
||||
is going wrong.
|
||||
|
||||
Note that we have the exact wording of the following message in
|
||||
the manual (trouble.texi, node "Name lookup"), so they need to
|
||||
be kept in synch. */
|
||||
pedwarn ("there are no arguments to %qD that depend on a template "
|
||||
"parameter, so a declaration of %qD must be available",
|
||||
"parameter, so a declaration of %qD must be available",
|
||||
name, name);
|
||||
|
||||
|
||||
if (!flag_permissive)
|
||||
{
|
||||
static bool hint;
|
||||
|
@ -670,7 +670,7 @@ build_lang_decl (enum tree_code code, tree name, tree type)
|
|||
|
||||
/* All nesting of C++ functions is lexical; there is never a "static
|
||||
chain" in the sense of GNU C nested functions. */
|
||||
if (code == FUNCTION_DECL)
|
||||
if (code == FUNCTION_DECL)
|
||||
DECL_NO_STATIC_CHAIN (t) = 1;
|
||||
|
||||
return t;
|
||||
|
|
224
gcc/cp/mangle.c
224
gcc/cp/mangle.c
|
@ -319,7 +319,7 @@ decl_is_template_id (const tree decl, tree* const template_info)
|
|||
*template_info = TYPE_TEMPLATE_INFO (type);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Check if this is a primary template. */
|
||||
|
@ -362,12 +362,12 @@ dump_substitution_candidates (void)
|
|||
else if (TYPE_NAME (el))
|
||||
name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (el)));
|
||||
fprintf (stderr, " S%d_ = ", i - 1);
|
||||
if (TYPE_P (el) &&
|
||||
(CP_TYPE_RESTRICT_P (el)
|
||||
|| CP_TYPE_VOLATILE_P (el)
|
||||
if (TYPE_P (el) &&
|
||||
(CP_TYPE_RESTRICT_P (el)
|
||||
|| CP_TYPE_VOLATILE_P (el)
|
||||
|| CP_TYPE_CONST_P (el)))
|
||||
fprintf (stderr, "CV-");
|
||||
fprintf (stderr, "%s (%s at %p)\n",
|
||||
fprintf (stderr, "%s (%s at %p)\n",
|
||||
name, tree_code_name[TREE_CODE (el)], (void *) el);
|
||||
}
|
||||
}
|
||||
|
@ -400,7 +400,7 @@ add_substitution (tree node)
|
|||
tree c;
|
||||
|
||||
if (DEBUG_MANGLE)
|
||||
fprintf (stderr, " ++ add_substitution (%s at %10p)\n",
|
||||
fprintf (stderr, " ++ add_substitution (%s at %10p)\n",
|
||||
tree_code_name[TREE_CODE (node)], (void *) node);
|
||||
|
||||
/* Get the canonicalized substitution candidate for NODE. */
|
||||
|
@ -419,7 +419,7 @@ add_substitution (tree node)
|
|||
for (i = 0; VEC_iterate (tree, G.substitutions, i, candidate); i++)
|
||||
{
|
||||
gcc_assert (!(DECL_P (node) && node == candidate));
|
||||
gcc_assert (!(TYPE_P (node) && TYPE_P (candidate)
|
||||
gcc_assert (!(TYPE_P (node) && TYPE_P (candidate)
|
||||
&& same_type_p (node, candidate)));
|
||||
}
|
||||
}
|
||||
|
@ -436,7 +436,7 @@ add_substitution (tree node)
|
|||
which may be a decl or a CLASS_TYPE, is a template-id with template
|
||||
name of substitution_index[INDEX] in the ::std namespace. */
|
||||
|
||||
static inline int
|
||||
static inline int
|
||||
is_std_substitution (const tree node,
|
||||
const substitution_identifier_index_t index)
|
||||
{
|
||||
|
@ -453,14 +453,14 @@ is_std_substitution (const tree node,
|
|||
type = node;
|
||||
decl = TYPE_NAME (node);
|
||||
}
|
||||
else
|
||||
else
|
||||
/* These are not the droids you're looking for. */
|
||||
return 0;
|
||||
|
||||
return (DECL_NAMESPACE_STD_P (CP_DECL_CONTEXT (decl))
|
||||
&& TYPE_LANG_SPECIFIC (type)
|
||||
&& TYPE_LANG_SPECIFIC (type)
|
||||
&& TYPE_TEMPLATE_INFO (type)
|
||||
&& (DECL_NAME (TYPE_TI_TEMPLATE (type))
|
||||
&& (DECL_NAME (TYPE_TI_TEMPLATE (type))
|
||||
== subst_identifiers[index]));
|
||||
}
|
||||
|
||||
|
@ -479,14 +479,14 @@ is_std_substitution_char (const tree node,
|
|||
return 0;
|
||||
/* Figure out its template args. */
|
||||
if (DECL_P (node))
|
||||
args = DECL_TI_ARGS (node);
|
||||
args = DECL_TI_ARGS (node);
|
||||
else if (CLASS_TYPE_P (node))
|
||||
args = CLASSTYPE_TI_ARGS (node);
|
||||
else
|
||||
/* Oops, not a template. */
|
||||
return 0;
|
||||
/* NODE's template arg list should be <char>. */
|
||||
return
|
||||
return
|
||||
TREE_VEC_LENGTH (args) == 1
|
||||
&& TREE_VEC_ELT (args, 0) == char_type_node;
|
||||
}
|
||||
|
@ -496,28 +496,28 @@ is_std_substitution_char (const tree node,
|
|||
|
||||
First, check standard special-case substitutions.
|
||||
|
||||
<substitution> ::= St
|
||||
<substitution> ::= St
|
||||
# ::std
|
||||
|
||||
::= Sa
|
||||
::= Sa
|
||||
# ::std::allocator
|
||||
|
||||
::= Sb
|
||||
::= Sb
|
||||
# ::std::basic_string
|
||||
|
||||
::= Ss
|
||||
::= Ss
|
||||
# ::std::basic_string<char,
|
||||
::std::char_traits<char>,
|
||||
::std::allocator<char> >
|
||||
|
||||
::= Si
|
||||
::= Si
|
||||
# ::std::basic_istream<char, ::std::char_traits<char> >
|
||||
|
||||
::= So
|
||||
::= So
|
||||
# ::std::basic_ostream<char, ::std::char_traits<char> >
|
||||
|
||||
::= Sd
|
||||
# ::std::basic_iostream<char, ::std::char_traits<char> >
|
||||
::= Sd
|
||||
# ::std::basic_iostream<char, ::std::char_traits<char> >
|
||||
|
||||
Then examine the stack of currently available substitution
|
||||
candidates for entities appearing earlier in the same mangling
|
||||
|
@ -547,7 +547,7 @@ find_substitution (tree node)
|
|||
type = TYPE_P (node) ? node : TREE_TYPE (node);
|
||||
|
||||
/* Check for std::allocator. */
|
||||
if (decl
|
||||
if (decl
|
||||
&& is_std_substitution (decl, SUBID_ALLOCATOR)
|
||||
&& !CLASSTYPE_USE_TEMPLATE (TREE_TYPE (decl)))
|
||||
{
|
||||
|
@ -560,8 +560,8 @@ find_substitution (tree node)
|
|||
{
|
||||
if (TYPE_P (node))
|
||||
{
|
||||
/* If this is a type (i.e. a fully-qualified template-id),
|
||||
check for
|
||||
/* If this is a type (i.e. a fully-qualified template-id),
|
||||
check for
|
||||
std::basic_string <char,
|
||||
std::char_traits<char>,
|
||||
std::allocator<char> > . */
|
||||
|
@ -596,7 +596,7 @@ find_substitution (tree node)
|
|||
&& CLASSTYPE_USE_TEMPLATE (type)
|
||||
&& CLASSTYPE_TEMPLATE_INFO (type) != NULL)
|
||||
{
|
||||
/* First, check for the template
|
||||
/* First, check for the template
|
||||
args <char, std::char_traits<char> > . */
|
||||
tree args = CLASSTYPE_TI_ARGS (type);
|
||||
if (TREE_VEC_LENGTH (args) == 2
|
||||
|
@ -659,7 +659,7 @@ find_substitution (tree node)
|
|||
/* TOP_LEVEL is true, if this is being called at outermost level of
|
||||
mangling. It should be false when mangling a decl appearing in an
|
||||
expression within some other mangling.
|
||||
|
||||
|
||||
<mangled-name> ::= _Z <encoding> */
|
||||
|
||||
static void
|
||||
|
@ -673,7 +673,7 @@ write_mangled_name (const tree decl, bool top_level)
|
|||
&& !DECL_OVERLOADED_OPERATOR_P (decl))
|
||||
{
|
||||
unmangled_name:;
|
||||
|
||||
|
||||
if (top_level)
|
||||
write_string (IDENTIFIER_POINTER (DECL_NAME (decl)));
|
||||
else
|
||||
|
@ -761,7 +761,7 @@ write_encoding (const tree decl)
|
|||
d = decl;
|
||||
}
|
||||
|
||||
write_bare_function_type (fn_type,
|
||||
write_bare_function_type (fn_type,
|
||||
(!DECL_CONSTRUCTOR_P (decl)
|
||||
&& !DECL_DESTRUCTOR_P (decl)
|
||||
&& !DECL_CONV_FN_P (decl)
|
||||
|
@ -773,7 +773,7 @@ write_encoding (const tree decl)
|
|||
/* <name> ::= <unscoped-name>
|
||||
::= <unscoped-template-name> <template-args>
|
||||
::= <nested-name>
|
||||
::= <local-name>
|
||||
::= <local-name>
|
||||
|
||||
If IGNORE_LOCAL_SCOPE is nonzero, this production of <name> is
|
||||
called from <local-name>, which mangles the enclosing scope
|
||||
|
@ -803,8 +803,8 @@ write_name (tree decl, const int ignore_local_scope)
|
|||
latter with a special substitution. Also, a name that is
|
||||
directly in a local function scope is also mangled with
|
||||
<unscoped-name> rather than a full <nested-name>. */
|
||||
if (context == NULL
|
||||
|| context == global_namespace
|
||||
if (context == NULL
|
||||
|| context == global_namespace
|
||||
|| DECL_NAMESPACE_STD_P (context)
|
||||
|| (ignore_local_scope && TREE_CODE (context) == FUNCTION_DECL))
|
||||
{
|
||||
|
@ -880,10 +880,10 @@ write_unscoped_name (const tree decl)
|
|||
{
|
||||
/* If not, it should be either in the global namespace, or directly
|
||||
in a local function scope. */
|
||||
gcc_assert (context == global_namespace
|
||||
gcc_assert (context == global_namespace
|
||||
|| context == NULL
|
||||
|| TREE_CODE (context) == FUNCTION_DECL);
|
||||
|
||||
|
||||
write_unqualified_name (decl);
|
||||
}
|
||||
}
|
||||
|
@ -904,7 +904,7 @@ write_unscoped_template_name (const tree decl)
|
|||
|
||||
/* Write the nested name, including CV-qualifiers, of DECL.
|
||||
|
||||
<nested-name> ::= N [<CV-qualifiers>] <prefix> <unqualified-name> E
|
||||
<nested-name> ::= N [<CV-qualifiers>] <prefix> <unqualified-name> E
|
||||
::= N [<CV-qualifiers>] <template-prefix> <template-args> E
|
||||
|
||||
<CV-qualifiers> ::= [r] [V] [K] */
|
||||
|
@ -917,9 +917,9 @@ write_nested_name (const tree decl)
|
|||
MANGLE_TRACE_TREE ("nested-name", decl);
|
||||
|
||||
write_char ('N');
|
||||
|
||||
|
||||
/* Write CV-qualifiers, if this is a member function. */
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL
|
||||
&& DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
|
||||
{
|
||||
if (DECL_VOLATILE_MEMFUNC_P (decl))
|
||||
|
@ -988,7 +988,7 @@ write_prefix (const tree node)
|
|||
}
|
||||
|
||||
/* In G++ 3.2, the name of the template parameter was used. */
|
||||
if (TREE_CODE (node) == TEMPLATE_TYPE_PARM
|
||||
if (TREE_CODE (node) == TEMPLATE_TYPE_PARM
|
||||
&& !abi_version_at_least (2))
|
||||
G.need_abi_warning = true;
|
||||
|
||||
|
@ -1033,7 +1033,7 @@ write_template_prefix (const tree node)
|
|||
else
|
||||
{
|
||||
gcc_assert (CLASSTYPE_TEMPLATE_ID_P (type));
|
||||
|
||||
|
||||
template = TYPE_TI_TEMPLATE (type);
|
||||
}
|
||||
|
||||
|
@ -1085,10 +1085,10 @@ write_template_prefix (const tree node)
|
|||
}
|
||||
|
||||
/* We don't need to handle thunks, vtables, or VTTs here. Those are
|
||||
mangled through special entry points.
|
||||
mangled through special entry points.
|
||||
|
||||
<unqualified-name> ::= <operator-name>
|
||||
::= <special-name>
|
||||
::= <special-name>
|
||||
::= <source-name> */
|
||||
|
||||
static void
|
||||
|
@ -1102,9 +1102,9 @@ write_unqualified_name (const tree decl)
|
|||
write_special_name_destructor (decl);
|
||||
else if (DECL_NAME (decl) == NULL_TREE)
|
||||
write_source_name (DECL_ASSEMBLER_NAME (decl));
|
||||
else if (DECL_CONV_FN_P (decl))
|
||||
else if (DECL_CONV_FN_P (decl))
|
||||
{
|
||||
/* Conversion operator. Handle it right here.
|
||||
/* Conversion operator. Handle it right here.
|
||||
<operator> ::= cv <type> */
|
||||
tree type;
|
||||
if (decl_is_template_id (decl, NULL))
|
||||
|
@ -1126,7 +1126,7 @@ write_unqualified_name (const tree decl)
|
|||
oni = assignment_operator_name_info;
|
||||
else
|
||||
oni = operator_name_info;
|
||||
|
||||
|
||||
write_string (oni[DECL_OVERLOADED_OPERATOR_P (decl)].mangled_name);
|
||||
}
|
||||
else
|
||||
|
@ -1142,7 +1142,7 @@ write_conversion_operator_name (const tree type)
|
|||
write_type (type);
|
||||
}
|
||||
|
||||
/* Non-terminal <source-name>. IDENTIFIER is an IDENTIFIER_NODE.
|
||||
/* Non-terminal <source-name>. IDENTIFIER is an IDENTIFIER_NODE.
|
||||
|
||||
<source-name> ::= </length/ number> <identifier> */
|
||||
|
||||
|
@ -1172,11 +1172,11 @@ hwint_to_ascii (unsigned HOST_WIDE_INT number, const unsigned int base,
|
|||
{
|
||||
static const char base_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
unsigned digits = 0;
|
||||
|
||||
|
||||
while (number)
|
||||
{
|
||||
unsigned HOST_WIDE_INT d = number / base;
|
||||
|
||||
|
||||
*--buffer = base_digits[number - d * base];
|
||||
digits++;
|
||||
number = d;
|
||||
|
@ -1234,14 +1234,14 @@ write_integer_cst (const tree cst)
|
|||
representable. */
|
||||
chunk = 1000000000;
|
||||
chunk_digits = 9;
|
||||
|
||||
|
||||
if (sizeof (HOST_WIDE_INT) >= 8)
|
||||
{
|
||||
/* It is at least 64 bits, so 10^18 is representable. */
|
||||
chunk_digits = 18;
|
||||
chunk *= chunk;
|
||||
}
|
||||
|
||||
|
||||
type = c_common_signed_or_unsigned_type (1, TREE_TYPE (cst));
|
||||
base = build_int_cstu (type, chunk);
|
||||
n = build_int_cst_wide (type,
|
||||
|
@ -1269,11 +1269,11 @@ write_integer_cst (const tree cst)
|
|||
while (!done);
|
||||
write_chars (ptr, count);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
/* A small num. */
|
||||
unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (cst);
|
||||
|
||||
|
||||
if (sign < 0)
|
||||
{
|
||||
write_char ('n');
|
||||
|
@ -1283,8 +1283,8 @@ write_integer_cst (const tree cst)
|
|||
}
|
||||
}
|
||||
|
||||
/* Write out a floating-point literal.
|
||||
|
||||
/* Write out a floating-point literal.
|
||||
|
||||
"Floating-point literals are encoded using the bit pattern of the
|
||||
target processor's internal representation of that number, as a
|
||||
fixed-length lowercase hexadecimal string, high-order bytes first
|
||||
|
@ -1341,7 +1341,7 @@ write_real_cst (const tree value)
|
|||
format for REAL_VALUE_TYPE. */
|
||||
size_t i;
|
||||
for (i = 0; i < sizeof (TREE_REAL_CST (value)); ++i)
|
||||
write_number (((unsigned char *) &TREE_REAL_CST (value))[i],
|
||||
write_number (((unsigned char *) &TREE_REAL_CST (value))[i],
|
||||
/*unsigned_p*/ 1,
|
||||
/*base*/ 16);
|
||||
G.need_abi_warning = 1;
|
||||
|
@ -1360,13 +1360,13 @@ write_identifier (const char *identifier)
|
|||
}
|
||||
|
||||
/* Handle constructor productions of non-terminal <special-name>.
|
||||
CTOR is a constructor FUNCTION_DECL.
|
||||
CTOR is a constructor FUNCTION_DECL.
|
||||
|
||||
<special-name> ::= C1 # complete object constructor
|
||||
::= C2 # base object constructor
|
||||
::= C3 # complete object allocating constructor
|
||||
|
||||
Currently, allocating constructors are never used.
|
||||
Currently, allocating constructors are never used.
|
||||
|
||||
We also need to provide mangled names for the maybe-in-charge
|
||||
constructor, so we treat it here too. mangle_decl_string will
|
||||
|
@ -1390,7 +1390,7 @@ write_special_name_constructor (const tree ctor)
|
|||
}
|
||||
|
||||
/* Handle destructor productions of non-terminal <special-name>.
|
||||
DTOR is a destructor FUNCTION_DECL.
|
||||
DTOR is a destructor FUNCTION_DECL.
|
||||
|
||||
<special-name> ::= D0 # deleting (in-charge) destructor
|
||||
::= D1 # complete object (in-charge) destructor
|
||||
|
@ -1434,7 +1434,7 @@ discriminator_for_local_entity (tree entity)
|
|||
else if (TREE_CODE (entity) == TYPE_DECL)
|
||||
{
|
||||
int ix;
|
||||
|
||||
|
||||
/* Scan the list of local classes. */
|
||||
entity = TREE_TYPE (entity);
|
||||
for (ix = 0; ; ix++)
|
||||
|
@ -1446,7 +1446,7 @@ discriminator_for_local_entity (tree entity)
|
|||
&& TYPE_CONTEXT (type) == TYPE_CONTEXT (entity))
|
||||
++discriminator;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return discriminator;
|
||||
}
|
||||
|
@ -1463,7 +1463,7 @@ discriminator_for_string_literal (tree function ATTRIBUTE_UNUSED,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* <discriminator> := _ <number>
|
||||
/* <discriminator> := _ <number>
|
||||
|
||||
The discriminator is used only for the second and later occurrences
|
||||
of the same name within a single function. In this case <number> is
|
||||
|
@ -1501,7 +1501,7 @@ write_local_name (const tree function, const tree local_entity,
|
|||
if (TREE_CODE (entity) == STRING_CST)
|
||||
{
|
||||
write_char ('s');
|
||||
write_discriminator (discriminator_for_string_literal (function,
|
||||
write_discriminator (discriminator_for_string_literal (function,
|
||||
entity));
|
||||
}
|
||||
else
|
||||
|
@ -1514,7 +1514,7 @@ write_local_name (const tree function, const tree local_entity,
|
|||
}
|
||||
}
|
||||
|
||||
/* Non-terminals <type> and <CV-qualifier>.
|
||||
/* Non-terminals <type> and <CV-qualifier>.
|
||||
|
||||
<type> ::= <builtin-type>
|
||||
::= <function-type>
|
||||
|
@ -1528,11 +1528,11 @@ write_local_name (const tree function, const tree local_entity,
|
|||
::= R <type> # reference-to
|
||||
::= C <type> # complex pair (C 2000)
|
||||
::= G <type> # imaginary (C 2000) [not supported]
|
||||
::= U <source-name> <type> # vendor extended type qualifier
|
||||
::= U <source-name> <type> # vendor extended type qualifier
|
||||
|
||||
TYPE is a type node. */
|
||||
|
||||
static void
|
||||
static void
|
||||
write_type (tree type)
|
||||
{
|
||||
/* This gets set to nonzero if TYPE turns out to be a (possibly
|
||||
|
@ -1546,7 +1546,7 @@ write_type (tree type)
|
|||
|
||||
if (find_substitution (type))
|
||||
return;
|
||||
|
||||
|
||||
if (write_CV_qualifiers_for_type (type) > 0)
|
||||
/* If TYPE was CV-qualified, we just wrote the qualifiers; now
|
||||
mangle the unqualified type. The recursive call is needed here
|
||||
|
@ -1639,7 +1639,7 @@ write_type (tree type)
|
|||
|
||||
case BOUND_TEMPLATE_TEMPLATE_PARM:
|
||||
write_template_template_param (type);
|
||||
write_template_args
|
||||
write_template_args
|
||||
(TI_ARGS (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (type)));
|
||||
break;
|
||||
|
||||
|
@ -1672,7 +1672,7 @@ write_CV_qualifiers_for_type (const tree type)
|
|||
|
||||
"In cases where multiple order-insensitive qualifiers are
|
||||
present, they should be ordered 'K' (closest to the base type),
|
||||
'V', 'r', and 'U' (farthest from the base type) ..."
|
||||
'V', 'r', and 'U' (farthest from the base type) ..."
|
||||
|
||||
Note that we do not use cp_type_quals below; given "const
|
||||
int[3]", the "const" is emitted with the "int", not with the
|
||||
|
@ -1697,9 +1697,9 @@ write_CV_qualifiers_for_type (const tree type)
|
|||
return num_qualifiers;
|
||||
}
|
||||
|
||||
/* Non-terminal <builtin-type>.
|
||||
/* Non-terminal <builtin-type>.
|
||||
|
||||
<builtin-type> ::= v # void
|
||||
<builtin-type> ::= v # void
|
||||
::= b # bool
|
||||
::= w # wchar_t
|
||||
::= c # char
|
||||
|
@ -1712,16 +1712,16 @@ write_CV_qualifiers_for_type (const tree type)
|
|||
::= l # long
|
||||
::= m # unsigned long
|
||||
::= x # long long, __int64
|
||||
::= y # unsigned long long, __int64
|
||||
::= y # unsigned long long, __int64
|
||||
::= n # __int128
|
||||
::= o # unsigned __int128
|
||||
::= f # float
|
||||
::= d # double
|
||||
::= e # long double, __float80
|
||||
::= e # long double, __float80
|
||||
::= g # __float128 [not supported]
|
||||
::= u <source-name> # vendor extended type */
|
||||
|
||||
static void
|
||||
static void
|
||||
write_builtin_type (tree type)
|
||||
{
|
||||
switch (TREE_CODE (type))
|
||||
|
@ -1849,7 +1849,7 @@ write_function_type (const tree type)
|
|||
extern "C" function_t f; // Vice versa.
|
||||
|
||||
See [dcl.link]. */
|
||||
write_bare_function_type (type, /*include_return_type_p=*/1,
|
||||
write_bare_function_type (type, /*include_return_type_p=*/1,
|
||||
/*decl=*/NULL);
|
||||
write_char ('E');
|
||||
}
|
||||
|
@ -1872,7 +1872,7 @@ write_bare_function_type (const tree type, const int include_return_type_p,
|
|||
write_type (TREE_TYPE (type));
|
||||
|
||||
/* Now mangle the types of the arguments. */
|
||||
write_method_parms (TYPE_ARG_TYPES (type),
|
||||
write_method_parms (TYPE_ARG_TYPES (type),
|
||||
TREE_CODE (type) == METHOD_TYPE,
|
||||
decl);
|
||||
}
|
||||
|
@ -1894,10 +1894,10 @@ write_method_parms (tree parm_types, const int method_p, const tree decl)
|
|||
int varargs_p = 1;
|
||||
|
||||
/* If this is a member function, skip the first arg, which is the
|
||||
this pointer.
|
||||
this pointer.
|
||||
"Member functions do not encode the type of their implicit this
|
||||
parameter."
|
||||
|
||||
parameter."
|
||||
|
||||
Similarly, there's no need to mangle artificial parameters, like
|
||||
the VTT parameters for constructors and destructors. */
|
||||
if (method_p)
|
||||
|
@ -1912,8 +1912,8 @@ write_method_parms (tree parm_types, const int method_p, const tree decl)
|
|||
}
|
||||
}
|
||||
|
||||
for (first_parm_type = parm_types;
|
||||
parm_types;
|
||||
for (first_parm_type = parm_types;
|
||||
parm_types;
|
||||
parm_types = TREE_CHAIN (parm_types))
|
||||
{
|
||||
tree parm = TREE_VALUE (parm_types);
|
||||
|
@ -1941,7 +1941,7 @@ write_method_parms (tree parm_types, const int method_p, const tree decl)
|
|||
|
||||
/* <class-enum-type> ::= <name> */
|
||||
|
||||
static void
|
||||
static void
|
||||
write_class_enum_type (const tree type)
|
||||
{
|
||||
write_name (TYPE_NAME (type), /*ignore_local_scope=*/0);
|
||||
|
@ -1957,7 +1957,7 @@ write_template_args (tree args)
|
|||
{
|
||||
int i;
|
||||
int length = TREE_VEC_LENGTH (args);
|
||||
|
||||
|
||||
MANGLE_TRACE_TREE ("template-args", args);
|
||||
|
||||
write_char ('I');
|
||||
|
@ -1973,7 +1973,7 @@ write_template_args (tree args)
|
|||
}
|
||||
for (i = 0; i < length; ++i)
|
||||
write_template_arg (TREE_VEC_ELT (args, i));
|
||||
|
||||
|
||||
write_char ('E');
|
||||
}
|
||||
|
||||
|
@ -1983,7 +1983,7 @@ write_template_args (tree args)
|
|||
|
||||
<expr-primary> ::= <template-param>
|
||||
::= L <type> <value number> E # literal
|
||||
::= L <mangled-name> E # external name
|
||||
::= L <mangled-name> E # external name
|
||||
::= sr <type> <unqualified-name>
|
||||
::= sr <type> <unqualified-name> <template-args> */
|
||||
|
||||
|
@ -2016,7 +2016,7 @@ write_expression (tree expr)
|
|||
}
|
||||
|
||||
/* Handle template parameters. */
|
||||
if (code == TEMPLATE_TYPE_PARM
|
||||
if (code == TEMPLATE_TYPE_PARM
|
||||
|| code == TEMPLATE_TEMPLATE_PARM
|
||||
|| code == BOUND_TEMPLATE_TEMPLATE_PARM
|
||||
|| code == TEMPLATE_PARM_INDEX)
|
||||
|
@ -2035,7 +2035,7 @@ write_expression (tree expr)
|
|||
write_mangled_name (expr, false);
|
||||
write_char ('E');
|
||||
}
|
||||
else if (TREE_CODE (expr) == SIZEOF_EXPR
|
||||
else if (TREE_CODE (expr) == SIZEOF_EXPR
|
||||
&& TYPE_P (TREE_OPERAND (expr, 0)))
|
||||
{
|
||||
write_string ("st");
|
||||
|
@ -2095,7 +2095,7 @@ write_expression (tree expr)
|
|||
else if (assignment_operator_name_info[i].identifier
|
||||
== member)
|
||||
{
|
||||
mangled_name
|
||||
mangled_name
|
||||
= assignment_operator_name_info[i].mangled_name;
|
||||
break;
|
||||
}
|
||||
|
@ -2156,7 +2156,7 @@ write_expression (tree expr)
|
|||
write_expression (TREE_OPERAND (expr, 0));
|
||||
break;
|
||||
|
||||
|
||||
|
||||
/* Handle pointers-to-members specially. */
|
||||
case SCOPE_REF:
|
||||
write_type (TREE_OPERAND (expr, 0));
|
||||
|
@ -2204,7 +2204,7 @@ write_expression (tree expr)
|
|||
}
|
||||
}
|
||||
|
||||
/* Literal subcase of non-terminal <template-arg>.
|
||||
/* Literal subcase of non-terminal <template-arg>.
|
||||
|
||||
"Literal arguments, e.g. "A<42L>", are encoded with their type
|
||||
and value. Negative integer values are preceded with "n"; for
|
||||
|
@ -2222,7 +2222,7 @@ write_template_arg_literal (const tree value)
|
|||
case CONST_DECL:
|
||||
write_integer_cst (DECL_INITIAL (value));
|
||||
break;
|
||||
|
||||
|
||||
case INTEGER_CST:
|
||||
gcc_assert (!same_type_p (TREE_TYPE (value), boolean_type_node)
|
||||
|| integer_zerop (value) || integer_onep (value));
|
||||
|
@ -2236,11 +2236,11 @@ write_template_arg_literal (const tree value)
|
|||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
|
||||
write_char ('E');
|
||||
}
|
||||
|
||||
/* Non-terminal <template-arg>.
|
||||
/* Non-terminal <template-arg>.
|
||||
|
||||
<template-arg> ::= <type> # type
|
||||
::= L <type> </value/ number> E # literal
|
||||
|
@ -2266,7 +2266,7 @@ write_template_arg (tree node)
|
|||
code = TREE_CODE (node);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (TREE_CODE (node) == NOP_EXPR
|
||||
&& TREE_CODE (TREE_TYPE (node)) == REFERENCE_TYPE)
|
||||
{
|
||||
|
@ -2291,7 +2291,7 @@ write_template_arg (tree node)
|
|||
else if (DECL_P (node))
|
||||
{
|
||||
/* Until ABI version 2, non-type template arguments of
|
||||
enumeration type were mangled using their names. */
|
||||
enumeration type were mangled using their names. */
|
||||
if (code == CONST_DECL && !abi_version_at_least (2))
|
||||
G.need_abi_warning = 1;
|
||||
write_char ('L');
|
||||
|
@ -2332,9 +2332,9 @@ write_template_template_arg (const tree decl)
|
|||
}
|
||||
|
||||
|
||||
/* Non-terminal <array-type>. TYPE is an ARRAY_TYPE.
|
||||
/* Non-terminal <array-type>. TYPE is an ARRAY_TYPE.
|
||||
|
||||
<array-type> ::= A [</dimension/ number>] _ </element/ type>
|
||||
<array-type> ::= A [</dimension/ number>] _ </element/ type>
|
||||
::= A <expression> _ </element/ type>
|
||||
|
||||
"Array types encode the dimension (number of elements) and the
|
||||
|
@ -2375,7 +2375,7 @@ write_array_type (const tree type)
|
|||
}
|
||||
write_expression (max);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
write_char ('_');
|
||||
write_type (TREE_TYPE (type));
|
||||
|
@ -2437,7 +2437,7 @@ write_template_param (const tree parm)
|
|||
}
|
||||
|
||||
/* <template-template-param>
|
||||
::= <template-param>
|
||||
::= <template-param>
|
||||
::= <substitution> */
|
||||
|
||||
static void
|
||||
|
@ -2450,7 +2450,7 @@ write_template_template_param (const tree parm)
|
|||
only the template. */
|
||||
if (TREE_CODE (parm) == BOUND_TEMPLATE_TEMPLATE_PARM)
|
||||
{
|
||||
template
|
||||
template
|
||||
= TI_TEMPLATE (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (parm));
|
||||
if (find_substitution (template))
|
||||
return;
|
||||
|
@ -2463,7 +2463,7 @@ write_template_template_param (const tree parm)
|
|||
add_substitution (template);
|
||||
}
|
||||
|
||||
/* Non-terminal <substitution>.
|
||||
/* Non-terminal <substitution>.
|
||||
|
||||
<substitution> ::= S <seq-id> _
|
||||
::= S_ */
|
||||
|
@ -2486,7 +2486,7 @@ start_mangling (const tree entity, const bool ident_p)
|
|||
{
|
||||
G.entity = entity;
|
||||
G.need_abi_warning = false;
|
||||
if (!ident_p)
|
||||
if (!ident_p)
|
||||
{
|
||||
obstack_free (&name_obstack, name_base);
|
||||
mangle_obstack = &name_obstack;
|
||||
|
@ -2549,7 +2549,7 @@ mangle_decl_string (const tree decl)
|
|||
write_type (TREE_TYPE (decl));
|
||||
else
|
||||
write_mangled_name (decl, true);
|
||||
|
||||
|
||||
result = finish_mangling (/*warn=*/true);
|
||||
if (DEBUG_MANGLE)
|
||||
fprintf (stderr, "mangle_decl_string = '%s'\n\n", result);
|
||||
|
@ -2562,7 +2562,7 @@ mangle_decl_string (const tree decl)
|
|||
static inline tree
|
||||
get_identifier_nocopy (const char *name)
|
||||
{
|
||||
hashnode ht_node = ht_lookup (ident_hash, (const unsigned char *) name,
|
||||
hashnode ht_node = ht_lookup (ident_hash, (const unsigned char *) name,
|
||||
strlen (name), HT_ALLOCED);
|
||||
return HT_IDENT_TO_GCC_IDENT (ht_node);
|
||||
}
|
||||
|
@ -2572,7 +2572,7 @@ get_identifier_nocopy (const char *name)
|
|||
void
|
||||
mangle_decl (const tree decl)
|
||||
{
|
||||
SET_DECL_ASSEMBLER_NAME (decl,
|
||||
SET_DECL_ASSEMBLER_NAME (decl,
|
||||
get_identifier_nocopy (mangle_decl_string (decl)));
|
||||
}
|
||||
|
||||
|
@ -2654,13 +2654,13 @@ mangle_vtt_for_type (const tree type)
|
|||
|
||||
/* Return an identifier for a construction vtable group. TYPE is
|
||||
the most derived class in the hierarchy; BINFO is the base
|
||||
subobject for which this construction vtable group will be used.
|
||||
subobject for which this construction vtable group will be used.
|
||||
|
||||
This mangling isn't part of the ABI specification; in the ABI
|
||||
specification, the vtable group is dumped in the same COMDAT as the
|
||||
main vtable, and is referenced only from that vtable, so it doesn't
|
||||
need an external name. For binary formats without COMDAT sections,
|
||||
though, we need external names for the vtable groups.
|
||||
though, we need external names for the vtable groups.
|
||||
|
||||
We use the production
|
||||
|
||||
|
@ -2687,10 +2687,10 @@ mangle_ctor_vtbl_for_type (const tree type, const tree binfo)
|
|||
}
|
||||
|
||||
/* Mangle a this pointer or result pointer adjustment.
|
||||
|
||||
|
||||
<call-offset> ::= h <fixed offset number> _
|
||||
::= v <fixed offset number> _ <virtual offset number> _ */
|
||||
|
||||
|
||||
static void
|
||||
mangle_call_offset (const tree fixed_offset, const tree virtual_offset)
|
||||
{
|
||||
|
@ -2727,12 +2727,12 @@ mangle_thunk (tree fn_decl, const int this_adjusting, tree fixed_offset,
|
|||
tree virtual_offset)
|
||||
{
|
||||
const char *result;
|
||||
|
||||
|
||||
start_mangling (fn_decl, /*ident_p=*/true);
|
||||
|
||||
write_string ("_Z");
|
||||
write_char ('T');
|
||||
|
||||
|
||||
if (!this_adjusting)
|
||||
{
|
||||
/* Covariant thunk with no this adjustment */
|
||||
|
@ -2797,16 +2797,16 @@ mangle_conv_op_name_for_type (const tree type)
|
|||
void **slot;
|
||||
tree identifier;
|
||||
|
||||
if (conv_type_names == NULL)
|
||||
if (conv_type_names == NULL)
|
||||
conv_type_names = htab_create_ggc (31, &hash_type, &compare_type, NULL);
|
||||
|
||||
slot = htab_find_slot_with_hash (conv_type_names, type,
|
||||
slot = htab_find_slot_with_hash (conv_type_names, type,
|
||||
(hashval_t) TYPE_UID (type), INSERT);
|
||||
identifier = (tree)*slot;
|
||||
if (!identifier)
|
||||
{
|
||||
char buffer[64];
|
||||
|
||||
|
||||
/* Create a unique name corresponding to TYPE. */
|
||||
sprintf (buffer, "operator %lu",
|
||||
(unsigned long) htab_elements (conv_type_names));
|
||||
|
@ -2821,7 +2821,7 @@ mangle_conv_op_name_for_type (const tree type)
|
|||
IDENTIFIER_OPNAME_P (identifier) = 1;
|
||||
IDENTIFIER_TYPENAME_P (identifier) = 1;
|
||||
}
|
||||
|
||||
|
||||
return identifier;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/* Handle the hair of processing (but not expanding) inline functions.
|
||||
Also manage function and variable name overloading.
|
||||
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
||||
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
||||
1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Contributed by Michael Tiemann (tiemann@cygnus.com)
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
|
@ -89,22 +89,22 @@ make_thunk (tree function, bool this_adjusting,
|
|||
{
|
||||
HOST_WIDE_INT d;
|
||||
tree thunk;
|
||||
|
||||
|
||||
gcc_assert (TREE_CODE (function) == FUNCTION_DECL);
|
||||
/* We can have this thunks to covariant thunks, but not vice versa. */
|
||||
gcc_assert (!DECL_THIS_THUNK_P (function));
|
||||
gcc_assert (!DECL_RESULT_THUNK_P (function) || this_adjusting);
|
||||
|
||||
|
||||
/* Scale the VIRTUAL_OFFSET to be in terms of bytes. */
|
||||
if (this_adjusting && virtual_offset)
|
||||
virtual_offset
|
||||
virtual_offset
|
||||
= size_binop (MULT_EXPR,
|
||||
virtual_offset,
|
||||
convert (ssizetype,
|
||||
TYPE_SIZE_UNIT (vtable_entry_type)));
|
||||
|
||||
|
||||
d = tree_low_cst (fixed_offset, 0);
|
||||
|
||||
|
||||
/* See if we already have the thunk in question. For this_adjusting
|
||||
thunks VIRTUAL_OFFSET will be an INTEGER_CST, for covariant thunks it
|
||||
will be a BINFO. */
|
||||
|
@ -118,7 +118,7 @@ make_thunk (tree function, bool this_adjusting,
|
|||
virtual_offset)
|
||||
: THUNK_VIRTUAL_OFFSET (thunk) == virtual_offset)))
|
||||
return thunk;
|
||||
|
||||
|
||||
/* All thunks must be created before FUNCTION is actually emitted;
|
||||
the ABI requires that all thunks be emitted together with the
|
||||
function to which they transfer control. */
|
||||
|
@ -132,7 +132,7 @@ make_thunk (tree function, bool this_adjusting,
|
|||
DECL_LANG_SPECIFIC (thunk) = DECL_LANG_SPECIFIC (function);
|
||||
cxx_dup_lang_specific_decl (thunk);
|
||||
DECL_THUNKS (thunk) = NULL_TREE;
|
||||
|
||||
|
||||
DECL_CONTEXT (thunk) = DECL_CONTEXT (function);
|
||||
TREE_READONLY (thunk) = TREE_READONLY (function);
|
||||
TREE_THIS_VOLATILE (thunk) = TREE_THIS_VOLATILE (function);
|
||||
|
@ -144,7 +144,7 @@ make_thunk (tree function, bool this_adjusting,
|
|||
THUNK_FIXED_OFFSET (thunk) = d;
|
||||
THUNK_VIRTUAL_OFFSET (thunk) = virtual_offset;
|
||||
THUNK_ALIAS (thunk) = NULL_TREE;
|
||||
|
||||
|
||||
/* The thunk itself is not a constructor or destructor, even if
|
||||
the thing it is thunking to is. */
|
||||
DECL_INTERFACE_KNOWN (thunk) = 1;
|
||||
|
@ -163,7 +163,7 @@ make_thunk (tree function, bool this_adjusting,
|
|||
DECL_DECLARED_INLINE_P (thunk) = 0;
|
||||
/* Nor has it been deferred. */
|
||||
DECL_DEFERRED_FN (thunk) = 0;
|
||||
|
||||
|
||||
/* Add it to the list of thunks associated with FUNCTION. */
|
||||
TREE_CHAIN (thunk) = DECL_THUNKS (function);
|
||||
DECL_THUNKS (function) = thunk;
|
||||
|
@ -206,7 +206,7 @@ finish_thunk (tree thunk)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DECL_NAME (thunk) = name;
|
||||
SET_DECL_ASSEMBLER_NAME (thunk, name);
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ thunk_adjust (tree ptr, bool this_adjusting,
|
|||
ptr = save_expr (ptr);
|
||||
/* The vptr is always at offset zero in the object. */
|
||||
vtable = build1 (NOP_EXPR,
|
||||
build_pointer_type (build_pointer_type
|
||||
build_pointer_type (build_pointer_type
|
||||
(vtable_entry_type)),
|
||||
ptr);
|
||||
/* Form the vtable address. */
|
||||
|
@ -246,7 +246,7 @@ thunk_adjust (tree ptr, bool this_adjusting,
|
|||
/* Adjust the `this' pointer. */
|
||||
ptr = fold_build2 (PLUS_EXPR, TREE_TYPE (ptr), ptr, vtable);
|
||||
}
|
||||
|
||||
|
||||
if (!this_adjusting)
|
||||
/* Adjust the pointer by the constant. */
|
||||
ptr = fold_build2 (PLUS_EXPR, TREE_TYPE (ptr), ptr,
|
||||
|
@ -332,7 +332,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
|
|||
|
||||
if (TREE_ASM_WRITTEN (thunk_fndecl))
|
||||
return;
|
||||
|
||||
|
||||
function = THUNK_TARGET (thunk_fndecl);
|
||||
if (DECL_RESULT (thunk_fndecl))
|
||||
/* We already turned this thunk into an ordinary function.
|
||||
|
@ -342,7 +342,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
|
|||
if (DECL_THUNK_P (function))
|
||||
/* The target is itself a thunk, process it now. */
|
||||
use_thunk (function, emit_p);
|
||||
|
||||
|
||||
/* Thunks are always addressable; they only appear in vtables. */
|
||||
TREE_ADDRESSABLE (thunk_fndecl) = 1;
|
||||
|
||||
|
@ -370,7 +370,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
|
|||
}
|
||||
else
|
||||
virtual_value = 0;
|
||||
|
||||
|
||||
/* And, if we need to emit the thunk, it's used. */
|
||||
mark_used (thunk_fndecl);
|
||||
/* This thunk is actually defined. */
|
||||
|
@ -379,7 +379,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
|
|||
rewrite. */
|
||||
TREE_PUBLIC (thunk_fndecl) = TREE_PUBLIC (function);
|
||||
DECL_VISIBILITY (thunk_fndecl) = DECL_VISIBILITY (function);
|
||||
DECL_VISIBILITY_SPECIFIED (thunk_fndecl)
|
||||
DECL_VISIBILITY_SPECIFIED (thunk_fndecl)
|
||||
= DECL_VISIBILITY_SPECIFIED (function);
|
||||
if (flag_weak && TREE_PUBLIC (thunk_fndecl))
|
||||
comdat_linkage (thunk_fndecl);
|
||||
|
@ -423,7 +423,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
|
|||
a = nreverse (t);
|
||||
DECL_ARGUMENTS (thunk_fndecl) = a;
|
||||
BLOCK_VARS (DECL_INITIAL (thunk_fndecl)) = a;
|
||||
|
||||
|
||||
if (this_adjusting
|
||||
&& targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset,
|
||||
virtual_value, alias))
|
||||
|
@ -468,7 +468,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
|
|||
if (this_adjusting)
|
||||
t = thunk_adjust (t, /*this_adjusting=*/1,
|
||||
fixed_offset, virtual_offset);
|
||||
|
||||
|
||||
/* Build up the call to the real function. */
|
||||
t = tree_cons (NULL_TREE, t, NULL_TREE);
|
||||
for (a = TREE_CHAIN (a); a; a = TREE_CHAIN (a))
|
||||
|
@ -476,7 +476,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
|
|||
t = nreverse (t);
|
||||
t = build_call (alias, t);
|
||||
CALL_FROM_THUNK_P (t) = 1;
|
||||
|
||||
|
||||
if (VOID_TYPE_P (TREE_TYPE (t)))
|
||||
finish_expr_stmt (t);
|
||||
else
|
||||
|
@ -494,7 +494,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
|
|||
t = save_expr (t);
|
||||
cond = cp_convert (boolean_type_node, t);
|
||||
}
|
||||
|
||||
|
||||
t = thunk_adjust (t, /*this_adjusting=*/0,
|
||||
fixed_offset, virtual_offset);
|
||||
if (cond)
|
||||
|
@ -560,7 +560,7 @@ do_build_copy_constructor (tree fndecl)
|
|||
for (vbases = CLASSTYPE_VBASECLASSES (current_class_type), i = 0;
|
||||
VEC_iterate (tree, vbases, i, binfo); i++)
|
||||
{
|
||||
member_init_list
|
||||
member_init_list
|
||||
= tree_cons (binfo,
|
||||
build_tree_list (NULL_TREE,
|
||||
build_base_path (PLUS_EXPR, parm,
|
||||
|
@ -572,9 +572,9 @@ do_build_copy_constructor (tree fndecl)
|
|||
BINFO_BASE_ITERATE (binfo, i, base_binfo); i++)
|
||||
{
|
||||
if (BINFO_VIRTUAL_P (base_binfo))
|
||||
continue;
|
||||
continue;
|
||||
|
||||
member_init_list
|
||||
member_init_list
|
||||
= tree_cons (base_binfo,
|
||||
build_tree_list (NULL_TREE,
|
||||
build_base_path (PLUS_EXPR, parm,
|
||||
|
@ -611,12 +611,12 @@ do_build_copy_constructor (tree fndecl)
|
|||
if (TREE_CODE (expr_type) != REFERENCE_TYPE)
|
||||
{
|
||||
int quals = cvquals;
|
||||
|
||||
|
||||
if (DECL_MUTABLE_P (field))
|
||||
quals &= ~TYPE_QUAL_CONST;
|
||||
expr_type = cp_build_qualified_type (expr_type, quals);
|
||||
}
|
||||
|
||||
|
||||
init = build3 (COMPONENT_REF, expr_type, init, field, NULL_TREE);
|
||||
init = build_tree_list (NULL_TREE, init);
|
||||
|
||||
|
@ -661,18 +661,18 @@ do_build_assign_ref (tree fndecl)
|
|||
explicitly since the base class may be ambiguous. */
|
||||
converted_parm = build_base_path (PLUS_EXPR, parm, base_binfo, 1);
|
||||
/* Call the base class assignment operator. */
|
||||
finish_expr_stmt
|
||||
(build_special_member_call (current_class_ref,
|
||||
finish_expr_stmt
|
||||
(build_special_member_call (current_class_ref,
|
||||
ansi_assopname (NOP_EXPR),
|
||||
build_tree_list (NULL_TREE,
|
||||
build_tree_list (NULL_TREE,
|
||||
converted_parm),
|
||||
base_binfo,
|
||||
LOOKUP_NORMAL | LOOKUP_NONVIRTUAL));
|
||||
}
|
||||
|
||||
/* Assign to each of the non-static data members. */
|
||||
for (fields = TYPE_FIELDS (current_class_type);
|
||||
fields;
|
||||
for (fields = TYPE_FIELDS (current_class_type);
|
||||
fields;
|
||||
fields = TREE_CHAIN (fields))
|
||||
{
|
||||
tree comp = current_class_ref;
|
||||
|
@ -685,7 +685,7 @@ do_build_assign_ref (tree fndecl)
|
|||
continue;
|
||||
|
||||
expr_type = TREE_TYPE (field);
|
||||
|
||||
|
||||
if (CP_TYPE_CONST_P (expr_type))
|
||||
{
|
||||
error ("non-static const member %q#D, can't use default "
|
||||
|
@ -712,13 +712,13 @@ do_build_assign_ref (tree fndecl)
|
|||
continue;
|
||||
|
||||
comp = build3 (COMPONENT_REF, expr_type, comp, field, NULL_TREE);
|
||||
|
||||
|
||||
/* Compute the type of init->field */
|
||||
quals = cvquals;
|
||||
if (DECL_MUTABLE_P (field))
|
||||
quals &= ~TYPE_QUAL_CONST;
|
||||
expr_type = cp_build_qualified_type (expr_type, quals);
|
||||
|
||||
|
||||
init = build3 (COMPONENT_REF, expr_type, init, field, NULL_TREE);
|
||||
|
||||
if (DECL_NAME (field))
|
||||
|
@ -749,7 +749,7 @@ synthesize_method (tree fndecl)
|
|||
deferred, and thus have saved where we were first needed. */
|
||||
DECL_SOURCE_LOCATION (fndecl)
|
||||
= DECL_SOURCE_LOCATION (TYPE_NAME (DECL_CONTEXT (fndecl)));
|
||||
|
||||
|
||||
/* If we've been asked to synthesize a clone, just synthesize the
|
||||
cloned function instead. Doing so will automatically fill in the
|
||||
body for the clone. */
|
||||
|
@ -832,7 +832,7 @@ synthesize_exception_spec (tree type, tree (*extractor) (tree, void*),
|
|||
if (fn)
|
||||
{
|
||||
tree fn_raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn));
|
||||
|
||||
|
||||
raises = merge_exception_specifiers (raises, fn_raises);
|
||||
}
|
||||
}
|
||||
|
@ -840,19 +840,19 @@ synthesize_exception_spec (tree type, tree (*extractor) (tree, void*),
|
|||
{
|
||||
tree type = TREE_TYPE (fields);
|
||||
tree fn;
|
||||
|
||||
|
||||
if (TREE_CODE (fields) != FIELD_DECL || DECL_ARTIFICIAL (fields))
|
||||
continue;
|
||||
while (TREE_CODE (type) == ARRAY_TYPE)
|
||||
type = TREE_TYPE (type);
|
||||
if (TREE_CODE (type) != RECORD_TYPE)
|
||||
continue;
|
||||
|
||||
|
||||
fn = (*extractor) (type, client);
|
||||
if (fn)
|
||||
{
|
||||
tree fn_raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn));
|
||||
|
||||
|
||||
raises = merge_exception_specifiers (raises, fn_raises);
|
||||
}
|
||||
}
|
||||
|
@ -873,7 +873,7 @@ static tree
|
|||
locate_ctor (tree type, void *client ATTRIBUTE_UNUSED)
|
||||
{
|
||||
tree fns;
|
||||
|
||||
|
||||
if (!TYPE_HAS_DEFAULT_CONSTRUCTOR (type))
|
||||
return NULL_TREE;
|
||||
|
||||
|
@ -886,7 +886,7 @@ locate_ctor (tree type, void *client ATTRIBUTE_UNUSED)
|
|||
{
|
||||
tree fn = OVL_CURRENT (fns);
|
||||
tree parms = TYPE_ARG_TYPES (TREE_TYPE (fn));
|
||||
|
||||
|
||||
if (sufficient_parms_p (TREE_CHAIN (parms)))
|
||||
return fn;
|
||||
}
|
||||
|
@ -910,7 +910,7 @@ locate_copy (tree type, void *client_)
|
|||
tree fns;
|
||||
tree best = NULL_TREE;
|
||||
bool excess_p = false;
|
||||
|
||||
|
||||
if (client->name)
|
||||
{
|
||||
int ix;
|
||||
|
@ -936,7 +936,7 @@ locate_copy (tree type, void *client_)
|
|||
tree src_type;
|
||||
int excess;
|
||||
int quals;
|
||||
|
||||
|
||||
parms = TREE_CHAIN (parms);
|
||||
if (!parms)
|
||||
continue;
|
||||
|
@ -1022,7 +1022,7 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p)
|
|||
case sfk_assignment_operator:
|
||||
{
|
||||
struct copy_data data;
|
||||
|
||||
|
||||
data.name = NULL;
|
||||
data.quals = 0;
|
||||
if (kind == sfk_assignment_operator)
|
||||
|
@ -1121,7 +1121,7 @@ lazily_declare_fn (special_function_kind sfk, tree type)
|
|||
/* Add it to CLASSTYPE_METHOD_VEC. */
|
||||
add_method (type, fn, NULL_TREE);
|
||||
/* Add it to TYPE_METHODS. */
|
||||
if (sfk == sfk_destructor
|
||||
if (sfk == sfk_destructor
|
||||
&& DECL_VIRTUAL_P (fn)
|
||||
&& abi_version_at_least (2))
|
||||
/* The ABI requires that a virtual destructor go at the end of the
|
||||
|
@ -1131,7 +1131,7 @@ lazily_declare_fn (special_function_kind sfk, tree type)
|
|||
{
|
||||
/* G++ 3.2 put the implicit destructor at the *beginning* of the
|
||||
TYPE_METHODS list, which cause the destructor to be emitted
|
||||
in an incorrect location in the vtable. */
|
||||
in an incorrect location in the vtable. */
|
||||
if (warn_abi && DECL_VIRTUAL_P (fn))
|
||||
warning (0, "vtable layout for class %qT may not be ABI-compliant"
|
||||
"and may change in a future version of GCC due to "
|
||||
|
|
|
@ -300,7 +300,7 @@ new_class_binding (tree name, tree value, tree type, cxx_scope *scope)
|
|||
{
|
||||
cp_class_binding *cb;
|
||||
cxx_binding *binding;
|
||||
|
||||
|
||||
if (VEC_length (cp_class_binding, scope->class_shadowed))
|
||||
{
|
||||
cp_class_binding *old_base;
|
||||
|
@ -309,7 +309,7 @@ new_class_binding (tree name, tree value, tree type, cxx_scope *scope)
|
|||
{
|
||||
/* Fixup the current bindings, as they might have moved. */
|
||||
size_t i;
|
||||
|
||||
|
||||
for (i = 0;
|
||||
VEC_iterate (cp_class_binding, scope->class_shadowed, i, cb);
|
||||
i++)
|
||||
|
@ -325,7 +325,7 @@ new_class_binding (tree name, tree value, tree type, cxx_scope *scope)
|
|||
}
|
||||
else
|
||||
cb = VEC_safe_push (cp_class_binding, gc, scope->class_shadowed, NULL);
|
||||
|
||||
|
||||
cb->identifier = name;
|
||||
binding = &cb->base;
|
||||
binding->scope = scope;
|
||||
|
@ -348,7 +348,7 @@ push_binding (tree id, tree decl, cxx_scope* level)
|
|||
}
|
||||
else
|
||||
binding = new_class_binding (id, decl, /*type=*/NULL_TREE, level);
|
||||
|
||||
|
||||
/* Now, fill in the binding information. */
|
||||
binding->previous = IDENTIFIER_BINDING (id);
|
||||
INHERITED_VALUE_BINDING_P (binding) = 0;
|
||||
|
@ -430,7 +430,7 @@ supplement_binding (cxx_binding *binding, tree decl)
|
|||
else if (/* BVAL is null when push_class_level_binding moves an
|
||||
inherited type-binding out of the way to make room for a
|
||||
new value binding. */
|
||||
!bval
|
||||
!bval
|
||||
/* BVAL is error_mark_node when DECL's name has been used
|
||||
in a non-class scope prior declaration. In that case,
|
||||
we should have already issued a diagnostic; for graceful
|
||||
|
@ -469,7 +469,7 @@ supplement_binding (cxx_binding *binding, tree decl)
|
|||
|
||||
In a given scope, a typedef specifier can be used to redefine
|
||||
the name of any type declared in that scope to refer to the
|
||||
type to which it already refers.
|
||||
type to which it already refers.
|
||||
|
||||
However, in class scopes, this rule does not apply due to the
|
||||
stricter language in [class.mem] prohibiting redeclarations of
|
||||
|
@ -496,7 +496,7 @@ supplement_binding (cxx_binding *binding, tree decl)
|
|||
&& DECL_NAMESPACE_ALIAS (bval)
|
||||
&& ORIGINAL_NAMESPACE (bval) == ORIGINAL_NAMESPACE (decl))
|
||||
/* [namespace.alias]
|
||||
|
||||
|
||||
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
|
||||
|
@ -517,7 +517,7 @@ supplement_binding (cxx_binding *binding, tree decl)
|
|||
static void
|
||||
add_decl_to_level (tree decl, cxx_scope *b)
|
||||
{
|
||||
if (TREE_CODE (decl) == NAMESPACE_DECL
|
||||
if (TREE_CODE (decl) == NAMESPACE_DECL
|
||||
&& !DECL_NAMESPACE_ALIAS (decl))
|
||||
{
|
||||
TREE_CHAIN (decl) = b->namespaces;
|
||||
|
@ -528,7 +528,7 @@ add_decl_to_level (tree decl, cxx_scope *b)
|
|||
TREE_CHAIN (decl) = b->vtables;
|
||||
b->vtables = decl;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
/* We build up the list in reverse order, and reverse it later if
|
||||
necessary. */
|
||||
|
@ -537,7 +537,7 @@ add_decl_to_level (tree decl, cxx_scope *b)
|
|||
b->names_size++;
|
||||
|
||||
/* If appropriate, add decl to separate list of statics. We
|
||||
include extern variables because they might turn out to be
|
||||
include extern variables because they might turn out to be
|
||||
static later. It's OK for this list to contain a few false
|
||||
positives. */
|
||||
if (b->kind == sk_namespace)
|
||||
|
@ -698,7 +698,7 @@ pushdecl (tree x)
|
|||
else
|
||||
{
|
||||
tree olddecl = duplicate_decls (x, t);
|
||||
|
||||
|
||||
/* If the redeclaration failed, we can stop at this
|
||||
point. */
|
||||
if (olddecl == error_mark_node)
|
||||
|
@ -717,9 +717,9 @@ pushdecl (tree x)
|
|||
{
|
||||
/* A redeclaration of main, but not a duplicate of the
|
||||
previous one.
|
||||
|
||||
|
||||
[basic.start.main]
|
||||
|
||||
|
||||
This function shall not be overloaded. */
|
||||
cp_error_at ("invalid redeclaration of %qD", t);
|
||||
error ("as %qD", x);
|
||||
|
@ -958,7 +958,7 @@ pushdecl (tree x)
|
|||
/*want_type=*/false);
|
||||
else
|
||||
member = NULL_TREE;
|
||||
|
||||
|
||||
if (member && !TREE_STATIC (member))
|
||||
{
|
||||
/* Location of previous decl is not useful in this case. */
|
||||
|
@ -1228,7 +1228,7 @@ cxx_scope *
|
|||
begin_scope (scope_kind kind, tree entity)
|
||||
{
|
||||
cxx_scope *scope;
|
||||
|
||||
|
||||
/* Reuse or create a struct for this binding level. */
|
||||
if (!ENABLE_SCOPE_CHECKING && free_binding_level)
|
||||
{
|
||||
|
@ -1246,7 +1246,7 @@ begin_scope (scope_kind kind, tree entity)
|
|||
case sk_cleanup:
|
||||
scope->keep = true;
|
||||
break;
|
||||
|
||||
|
||||
case sk_template_spec:
|
||||
scope->explicit_spec_p = true;
|
||||
kind = sk_template_parms;
|
||||
|
@ -1296,7 +1296,7 @@ leave_scope (void)
|
|||
/* We cannot leave a scope, if there are none left. */
|
||||
if (NAMESPACE_LEVEL (global_namespace))
|
||||
gcc_assert (!global_scope_p (scope));
|
||||
|
||||
|
||||
if (ENABLE_SCOPE_CHECKING)
|
||||
{
|
||||
indent (--binding_depth);
|
||||
|
@ -1524,9 +1524,9 @@ print_binding_level (struct cp_binding_level* lvl)
|
|||
size_t i;
|
||||
cp_class_binding *b;
|
||||
fprintf (stderr, " class-shadowed:");
|
||||
for (i = 0;
|
||||
for (i = 0;
|
||||
VEC_iterate(cp_class_binding, lvl->class_shadowed, i, b);
|
||||
++i)
|
||||
++i)
|
||||
fprintf (stderr, " %s ", IDENTIFIER_POINTER (b->identifier));
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
|
@ -1635,7 +1635,7 @@ set_identifier_type_value_with_scope (tree id, tree decl, cxx_scope *b)
|
|||
supplement_binding (binding, decl);
|
||||
else
|
||||
binding->value = decl;
|
||||
|
||||
|
||||
/* Store marker instead of real type. */
|
||||
type = global_type_node;
|
||||
}
|
||||
|
@ -1684,10 +1684,10 @@ constructor_name_p (tree name, tree type)
|
|||
|
||||
if (!name)
|
||||
return false;
|
||||
|
||||
|
||||
if (TREE_CODE (name) != IDENTIFIER_NODE)
|
||||
return false;
|
||||
|
||||
|
||||
ctor_name = constructor_name_full (type);
|
||||
if (name == ctor_name)
|
||||
return true;
|
||||
|
@ -1713,7 +1713,7 @@ make_anon_name (void)
|
|||
return get_identifier (buf);
|
||||
}
|
||||
|
||||
/* Return (from the stack of) the BINDING, if any, established at SCOPE. */
|
||||
/* Return (from the stack of) the BINDING, if any, established at SCOPE. */
|
||||
|
||||
static inline cxx_binding *
|
||||
find_binding (cxx_scope *scope, cxx_binding *binding)
|
||||
|
@ -2034,7 +2034,7 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype,
|
|||
/* It is impossible to overload a built-in function; any explicit
|
||||
declaration eliminates the built-in declaration. So, if OLDVAL
|
||||
is a built-in, then we can just pretend it isn't there. */
|
||||
if (oldval
|
||||
if (oldval
|
||||
&& TREE_CODE (oldval) == FUNCTION_DECL
|
||||
&& DECL_ANTICIPATED (oldval))
|
||||
oldval = NULL_TREE;
|
||||
|
@ -2094,7 +2094,7 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype,
|
|||
scope. */
|
||||
if (tmp1)
|
||||
continue;
|
||||
|
||||
|
||||
/* If we are adding to an existing OVERLOAD, then we no
|
||||
longer know the type of the set of functions. */
|
||||
if (*newval && TREE_CODE (*newval) == OVERLOAD)
|
||||
|
@ -2113,7 +2113,7 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype,
|
|||
OVL_USED (*newval) = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
*newval = decls.value;
|
||||
if (oldval && !decls_match (*newval, oldval))
|
||||
|
@ -2164,9 +2164,9 @@ do_local_using_decl (tree decl, tree scope, tree name)
|
|||
term = OVL_FUNCTION (oldval);
|
||||
else
|
||||
term = oldval;
|
||||
for (fn = newval; fn && OVL_CURRENT (fn) != term;
|
||||
for (fn = newval; fn && OVL_CURRENT (fn) != term;
|
||||
fn = OVL_NEXT (fn))
|
||||
push_overloaded_decl (OVL_CURRENT (fn),
|
||||
push_overloaded_decl (OVL_CURRENT (fn),
|
||||
PUSH_LOCAL | PUSH_USING);
|
||||
}
|
||||
else
|
||||
|
@ -2194,7 +2194,7 @@ is_ancestor (tree root, tree child)
|
|||
|| CLASS_TYPE_P (root)));
|
||||
gcc_assert ((TREE_CODE (child) == NAMESPACE_DECL
|
||||
|| CLASS_TYPE_P (child)));
|
||||
|
||||
|
||||
/* The global namespace encloses everything. */
|
||||
if (root == global_namespace)
|
||||
return true;
|
||||
|
@ -2299,7 +2299,7 @@ push_inner_scope_r (tree outer, tree inner)
|
|||
pushing name into scope. In case a template parameter scope is present,
|
||||
namespace is pushed under the template parameter scope according to
|
||||
name lookup rule in 14.6.1/6.
|
||||
|
||||
|
||||
Return the former current scope suitable for pop_inner_scope. */
|
||||
|
||||
tree
|
||||
|
@ -2515,7 +2515,7 @@ get_class_binding (tree name, cxx_scope *scope)
|
|||
;
|
||||
else if (value_binding)
|
||||
{
|
||||
if (TREE_CODE (value_binding) == TREE_LIST
|
||||
if (TREE_CODE (value_binding) == TREE_LIST
|
||||
&& TREE_TYPE (value_binding) == error_mark_node)
|
||||
/* NAME is ambiguous. */
|
||||
;
|
||||
|
@ -2528,8 +2528,8 @@ get_class_binding (tree name, cxx_scope *scope)
|
|||
new binding object. */
|
||||
if (type_binding || value_binding)
|
||||
{
|
||||
binding = new_class_binding (name,
|
||||
value_binding,
|
||||
binding = new_class_binding (name,
|
||||
value_binding,
|
||||
type_binding,
|
||||
scope);
|
||||
/* This is a class-scope binding, not a block-scope binding. */
|
||||
|
@ -2541,7 +2541,7 @@ get_class_binding (tree name, cxx_scope *scope)
|
|||
|
||||
return binding;
|
||||
}
|
||||
|
||||
|
||||
/* Make the declaration(s) of X appear in CLASS scope under the name
|
||||
NAME. Returns true if the binding is valid. */
|
||||
|
||||
|
@ -2563,7 +2563,7 @@ push_class_level_binding (tree name, tree x)
|
|||
/* We could have been passed a tree list if this is an ambiguous
|
||||
declaration. If so, pull the declaration out because
|
||||
check_template_shadow will not handle a TREE_LIST. */
|
||||
if (TREE_CODE (decl) == TREE_LIST
|
||||
if (TREE_CODE (decl) == TREE_LIST
|
||||
&& TREE_TYPE (decl) == error_mark_node)
|
||||
decl = TREE_VALUE (decl);
|
||||
|
||||
|
@ -2693,7 +2693,7 @@ do_class_using_decl (tree scope, tree name)
|
|||
tree value, decl, binfo;
|
||||
base_kind b_kind;
|
||||
bool dependent_p;
|
||||
|
||||
|
||||
if (!scope || !TYPE_P (scope))
|
||||
{
|
||||
error ("using-declaration for non-member at class scope");
|
||||
|
@ -2712,13 +2712,13 @@ do_class_using_decl (tree scope, tree name)
|
|||
else
|
||||
b_kind = bk_proper_base;
|
||||
}
|
||||
|
||||
|
||||
if (b_kind < bk_proper_base)
|
||||
{
|
||||
error_not_base_type (scope, current_class_type);
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
|
||||
/* Make sure the name is not invalid */
|
||||
if (TREE_CODE (name) == BIT_NOT_EXPR)
|
||||
{
|
||||
|
@ -2745,7 +2745,7 @@ do_class_using_decl (tree scope, tree name)
|
|||
if (!dependent_p)
|
||||
{
|
||||
decl = lookup_member (binfo, name, 0, false);
|
||||
|
||||
|
||||
if (!decl)
|
||||
{
|
||||
error ("no members matching %<%T::%D%> in %q#T", scope, name, scope);
|
||||
|
@ -2811,18 +2811,18 @@ void
|
|||
set_decl_namespace (tree decl, tree scope, bool friendp)
|
||||
{
|
||||
tree old;
|
||||
|
||||
|
||||
/* Get rid of namespace aliases. */
|
||||
scope = ORIGINAL_NAMESPACE (scope);
|
||||
|
||||
|
||||
/* It is ok for friends to be qualified in parallel space. */
|
||||
if (!friendp && !is_ancestor (current_namespace, scope))
|
||||
error ("declaration of %qD not in a namespace surrounding %qD",
|
||||
decl, scope);
|
||||
DECL_CONTEXT (decl) = FROB_CONTEXT (scope);
|
||||
|
||||
/* Writing "int N::i" to declare a variable within "N" is invalid. */
|
||||
if (scope == current_namespace)
|
||||
/* Writing "int N::i" to declare a variable within "N" is invalid. */
|
||||
if (scope == current_namespace)
|
||||
{
|
||||
if (at_namespace_scope_p ())
|
||||
error ("explicit qualification in declaration of `%D'",
|
||||
|
@ -2862,7 +2862,7 @@ set_decl_namespace (tree decl, tree scope, bool friendp)
|
|||
return;
|
||||
complain:
|
||||
error ("%qD should have been declared inside %qD", decl, scope);
|
||||
}
|
||||
}
|
||||
|
||||
/* Return the namespace where the current declaration is declared. */
|
||||
|
||||
|
@ -2878,7 +2878,7 @@ current_decl_namespace (void)
|
|||
result = decl_namespace_context (current_class_type);
|
||||
else if (current_function_decl)
|
||||
result = decl_namespace_context (current_function_decl);
|
||||
else
|
||||
else
|
||||
result = current_namespace;
|
||||
return result;
|
||||
}
|
||||
|
@ -2895,7 +2895,7 @@ push_namespace (tree name)
|
|||
bool anon = !name;
|
||||
|
||||
timevar_push (TV_NAME_LOOKUP);
|
||||
|
||||
|
||||
/* We should not get here if the global_namespace is not yet constructed
|
||||
nor if NAME designates the global namespace: The global scope is
|
||||
constructed elsewhere. */
|
||||
|
@ -3017,7 +3017,7 @@ pop_decl_namespace (void)
|
|||
decl_namespace_list = TREE_CHAIN (decl_namespace_list);
|
||||
}
|
||||
|
||||
/* Return the namespace that is the common ancestor
|
||||
/* Return the namespace that is the common ancestor
|
||||
of two given namespaces. */
|
||||
|
||||
static tree
|
||||
|
@ -3045,7 +3045,7 @@ do_namespace_alias (tree alias, tree namespace)
|
|||
namespace = ORIGINAL_NAMESPACE (namespace);
|
||||
|
||||
/* Build the alias. */
|
||||
alias = build_lang_decl (NAMESPACE_DECL, alias, void_type_node);
|
||||
alias = build_lang_decl (NAMESPACE_DECL, alias, void_type_node);
|
||||
DECL_NAMESPACE_ALIAS (alias) = namespace;
|
||||
DECL_EXTERNAL (alias) = 1;
|
||||
DECL_CONTEXT (alias) = FROB_CONTEXT (current_scope ());
|
||||
|
@ -3104,7 +3104,7 @@ pushdecl_namespace_level (tree x)
|
|||
/* Insert USED into the using list of USER. Set INDIRECT_flag if this
|
||||
directive is not directly from the source. Also find the common
|
||||
ancestor and let our users know about the new namespace */
|
||||
static void
|
||||
static void
|
||||
add_using_namespace (tree user, tree used, bool indirect)
|
||||
{
|
||||
tree t;
|
||||
|
@ -3129,8 +3129,8 @@ add_using_namespace (tree user, tree used, bool indirect)
|
|||
}
|
||||
|
||||
/* Add used to the user's using list. */
|
||||
DECL_NAMESPACE_USING (user)
|
||||
= tree_cons (used, namespace_ancestor (user, used),
|
||||
DECL_NAMESPACE_USING (user)
|
||||
= tree_cons (used, namespace_ancestor (user, used),
|
||||
DECL_NAMESPACE_USING (user));
|
||||
|
||||
TREE_INDIRECT_USING (DECL_NAMESPACE_USING (user)) = indirect;
|
||||
|
@ -3162,7 +3162,7 @@ do_toplevel_using_decl (tree decl, tree scope, tree name)
|
|||
decl = validate_nonmember_using_decl (decl, scope, name);
|
||||
if (decl == NULL_TREE)
|
||||
return;
|
||||
|
||||
|
||||
binding = binding_for_name (NAMESPACE_LEVEL (current_namespace), name);
|
||||
|
||||
oldval = binding->value;
|
||||
|
@ -3191,7 +3191,7 @@ do_using_directive (tree namespace)
|
|||
|
||||
if (building_stmt_tree ())
|
||||
add_stmt (build_stmt (USING_STMT, namespace));
|
||||
|
||||
|
||||
/* using namespace A::B::C; */
|
||||
if (TREE_CODE (namespace) == SCOPE_REF)
|
||||
namespace = TREE_OPERAND (namespace, 1);
|
||||
|
@ -3221,7 +3221,7 @@ do_using_directive (tree namespace)
|
|||
if (current_namespace != global_namespace)
|
||||
context = current_namespace;
|
||||
}
|
||||
|
||||
|
||||
/* Emit debugging info. */
|
||||
if (!processing_template_decl)
|
||||
(*debug_hooks->imported_module_or_decl) (namespace, context);
|
||||
|
@ -3311,12 +3311,12 @@ merge_functions (tree s1, tree s2)
|
|||
need to add it again. For `extern "C"' functions, we
|
||||
might have two FUNCTION_DECLs for the same function, in
|
||||
different namespaces; again, we only need one of them. */
|
||||
if (fn1 == fn2
|
||||
if (fn1 == fn2
|
||||
|| (DECL_EXTERN_C_P (fn1) && DECL_EXTERN_C_P (fn2)
|
||||
&& DECL_NAME (fn1) == DECL_NAME (fn2)))
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* If we exhausted all of the functions in S1, FN2 is new. */
|
||||
if (!fns1)
|
||||
s1 = build_overload (fn2, s1);
|
||||
|
@ -3368,7 +3368,7 @@ ambiguous_decl (tree name, struct scope_binding *old, cxx_binding *new,
|
|||
if (LOOKUP_QUALIFIERS_ONLY (flags))
|
||||
val = NULL_TREE;
|
||||
}
|
||||
|
||||
|
||||
if (!old->value)
|
||||
old->value = val;
|
||||
else if (val && val != old->value)
|
||||
|
@ -3451,7 +3451,7 @@ qualify_lookup (tree val, int flags)
|
|||
return true;
|
||||
}
|
||||
|
||||
/* Given a lookup that returned VAL, decide if we want to ignore it or
|
||||
/* Given a lookup that returned VAL, decide if we want to ignore it or
|
||||
not based on DECL_ANTICIPATED_P. */
|
||||
|
||||
bool
|
||||
|
@ -3564,7 +3564,7 @@ select_decl (const struct scope_binding *binding, int flags)
|
|||
if (binding->type && (!val || (flags & LOOKUP_PREFER_TYPES)))
|
||||
val = binding->type;
|
||||
/* Don't return non-types if we really prefer types. */
|
||||
else if (val && LOOKUP_TYPES_ONLY (flags)
|
||||
else if (val && LOOKUP_TYPES_ONLY (flags)
|
||||
&& ! DECL_DECLARES_TYPE_P (val))
|
||||
val = NULL_TREE;
|
||||
|
||||
|
@ -3633,7 +3633,7 @@ unqualified_namespace_lookup (tree name, int flags)
|
|||
|
||||
/* Look up NAME (an IDENTIFIER_NODE) in SCOPE (either a NAMESPACE_DECL
|
||||
or a class TYPE). If IS_TYPE_P is TRUE, then ignore non-type
|
||||
bindings.
|
||||
bindings.
|
||||
|
||||
Returns a DECL (or OVERLOAD, or BASELINK) representing the
|
||||
declaration found. If no suitable declaration can be found,
|
||||
|
@ -3768,7 +3768,7 @@ qualified_lookup_using_namespace (tree name, tree scope,
|
|||
CLASS_P is false, then class bindings are ignored. */
|
||||
|
||||
cxx_binding *
|
||||
outer_binding (tree name,
|
||||
outer_binding (tree name,
|
||||
cxx_binding *binding,
|
||||
bool class_p)
|
||||
{
|
||||
|
@ -3795,10 +3795,10 @@ outer_binding (tree name,
|
|||
if (class_p)
|
||||
while (scope && scope != outer_scope && scope->kind != sk_namespace)
|
||||
{
|
||||
if (scope->kind == sk_class)
|
||||
if (scope->kind == sk_class)
|
||||
{
|
||||
cxx_binding *class_binding;
|
||||
|
||||
|
||||
class_binding = get_class_binding (name, scope);
|
||||
if (class_binding)
|
||||
{
|
||||
|
@ -3856,22 +3856,22 @@ lookup_name_real (tree name, int prefer_type, int nonclass, bool block_p,
|
|||
/* Conversion operators are handled specially because ordinary
|
||||
unqualified name lookup will not find template conversion
|
||||
operators. */
|
||||
if (IDENTIFIER_TYPENAME_P (name))
|
||||
if (IDENTIFIER_TYPENAME_P (name))
|
||||
{
|
||||
struct cp_binding_level *level;
|
||||
|
||||
for (level = current_binding_level;
|
||||
for (level = current_binding_level;
|
||||
level && level->kind != sk_namespace;
|
||||
level = level->level_chain)
|
||||
{
|
||||
tree class_type;
|
||||
tree operators;
|
||||
|
||||
/* A conversion operator can only be declared in a class
|
||||
|
||||
/* A conversion operator can only be declared in a class
|
||||
scope. */
|
||||
if (level->kind != sk_class)
|
||||
continue;
|
||||
|
||||
|
||||
/* Lookup the conversion operator in the class. */
|
||||
class_type = level->this_entity;
|
||||
operators = lookup_fnfields (class_type, name, /*protect=*/0);
|
||||
|
@ -3895,11 +3895,11 @@ lookup_name_real (tree name, int prefer_type, int nonclass, bool block_p,
|
|||
iter = outer_binding (name, iter, !nonclass))
|
||||
{
|
||||
tree binding;
|
||||
|
||||
|
||||
/* Skip entities we don't want. */
|
||||
if (LOCAL_BINDING_P (iter) ? !block_p : nonclass)
|
||||
continue;
|
||||
|
||||
|
||||
/* If this is the kind of thing we're looking for, we're done. */
|
||||
if (qualify_lookup (iter->value, flags)
|
||||
&& !hidden_name_p (iter->value))
|
||||
|
@ -3910,7 +3910,7 @@ lookup_name_real (tree name, int prefer_type, int nonclass, bool block_p,
|
|||
binding = iter->type;
|
||||
else
|
||||
binding = NULL_TREE;
|
||||
|
||||
|
||||
if (binding)
|
||||
{
|
||||
val = binding;
|
||||
|
@ -3941,9 +3941,9 @@ lookup_name_nonclass (tree name)
|
|||
tree
|
||||
lookup_function_nonclass (tree name, tree args, bool block_p)
|
||||
{
|
||||
return
|
||||
lookup_arg_dependent (name,
|
||||
lookup_name_real (name, 0, 1, block_p, 0,
|
||||
return
|
||||
lookup_arg_dependent (name,
|
||||
lookup_name_real (name, 0, 1, block_p, 0,
|
||||
LOOKUP_COMPLAIN),
|
||||
args);
|
||||
}
|
||||
|
@ -3951,7 +3951,7 @@ lookup_function_nonclass (tree name, tree args, bool block_p)
|
|||
tree
|
||||
lookup_name (tree name, int prefer_type)
|
||||
{
|
||||
return lookup_name_real (name, prefer_type, 0, /*block_p=*/true,
|
||||
return lookup_name_real (name, prefer_type, 0, /*block_p=*/true,
|
||||
0, LOOKUP_COMPLAIN);
|
||||
}
|
||||
|
||||
|
@ -3964,7 +3964,7 @@ lookup_name (tree name, int prefer_type)
|
|||
Unlike lookup_name_real, we make sure that NAME is actually
|
||||
declared in the desired scope, not from inheritance, nor using
|
||||
directive. For using declaration, there is DR138 still waiting
|
||||
to be resolved. Hidden name coming from earlier an friend
|
||||
to be resolved. Hidden name coming from earlier an friend
|
||||
declaration is also returned.
|
||||
|
||||
A TYPE_DECL best matching the NAME is returned. Catching error
|
||||
|
@ -3984,9 +3984,9 @@ lookup_type_scope (tree name, tag_scope scope)
|
|||
for (; iter; iter = outer_binding (name, iter, /*class_p=*/ true))
|
||||
{
|
||||
/* Check if this is the kind of thing we're looking for.
|
||||
If SCOPE is TS_CURRENT, also make sure it doesn't come from
|
||||
If SCOPE is TS_CURRENT, also make sure it doesn't come from
|
||||
base class. For ITER->VALUE, we can simply use
|
||||
INHERITED_VALUE_BINDING_P. For ITER->TYPE, we have to use
|
||||
INHERITED_VALUE_BINDING_P. For ITER->TYPE, we have to use
|
||||
our own check.
|
||||
|
||||
We check ITER->TYPE before ITER->VALUE in order to handle
|
||||
|
@ -4021,7 +4021,7 @@ lookup_type_scope (tree name, tag_scope scope)
|
|||
else if (qualify_lookup (iter->value, LOOKUP_PREFER_TYPES))
|
||||
val = iter->value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Type found, check if it is in the allowed scopes, ignoring cleanup
|
||||
|
@ -4151,7 +4151,7 @@ add_function (struct arg_lookup *k, tree fn)
|
|||
case. */
|
||||
|
||||
/* We must find only functions, or exactly one non-function. */
|
||||
if (!k->functions)
|
||||
if (!k->functions)
|
||||
k->functions = fn;
|
||||
else if (fn == k->functions)
|
||||
;
|
||||
|
@ -4219,7 +4219,7 @@ arg_assoc_namespace (struct arg_lookup *k, tree scope)
|
|||
value = TREE_CHAIN (value))
|
||||
if (arg_assoc_namespace (k, TREE_PURPOSE (value)))
|
||||
return true;
|
||||
|
||||
|
||||
value = namespace_binding (k->name, scope);
|
||||
if (!value)
|
||||
return false;
|
||||
|
@ -4227,7 +4227,7 @@ arg_assoc_namespace (struct arg_lookup *k, tree scope)
|
|||
for (; value; value = OVL_NEXT (value))
|
||||
if (add_function (k, OVL_CURRENT (value)))
|
||||
return true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -4260,7 +4260,7 @@ arg_assoc_template_arg (struct arg_lookup *k, tree arg)
|
|||
if (TREE_CODE (ctx) == NAMESPACE_DECL)
|
||||
return arg_assoc_namespace (k, ctx);
|
||||
/* Otherwise, it must be member template. */
|
||||
else
|
||||
else
|
||||
return arg_assoc_class (k, ctx);
|
||||
}
|
||||
/* It's not a template template argument, but it is a type template
|
||||
|
@ -4280,7 +4280,7 @@ arg_assoc_class (struct arg_lookup *k, tree type)
|
|||
{
|
||||
tree list, friends, context;
|
||||
int i;
|
||||
|
||||
|
||||
/* Backend build structures, such as __builtin_va_list, aren't
|
||||
affected by all this. */
|
||||
if (!CLASS_TYPE_P (type))
|
||||
|
@ -4289,7 +4289,7 @@ arg_assoc_class (struct arg_lookup *k, tree type)
|
|||
if (purpose_member (type, k->classes))
|
||||
return false;
|
||||
k->classes = tree_cons (type, NULL_TREE, k->classes);
|
||||
|
||||
|
||||
context = decl_namespace_context (type);
|
||||
if (arg_assoc_namespace (k, context))
|
||||
return true;
|
||||
|
@ -4298,18 +4298,18 @@ arg_assoc_class (struct arg_lookup *k, tree type)
|
|||
{
|
||||
/* Process baseclasses. */
|
||||
tree binfo, base_binfo;
|
||||
|
||||
|
||||
for (binfo = TYPE_BINFO (type), i = 0;
|
||||
BINFO_BASE_ITERATE (binfo, i, base_binfo); i++)
|
||||
if (arg_assoc_class (k, BINFO_TYPE (base_binfo)))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Process friends. */
|
||||
for (list = DECL_FRIENDLIST (TYPE_MAIN_DECL (type)); list;
|
||||
for (list = DECL_FRIENDLIST (TYPE_MAIN_DECL (type)); list;
|
||||
list = TREE_CHAIN (list))
|
||||
if (k->name == FRIEND_NAME (list))
|
||||
for (friends = FRIEND_DECLS (list); friends;
|
||||
for (friends = FRIEND_DECLS (list); friends;
|
||||
friends = TREE_CHAIN (friends))
|
||||
{
|
||||
tree fn = TREE_VALUE (friends);
|
||||
|
@ -4328,11 +4328,11 @@ arg_assoc_class (struct arg_lookup *k, tree type)
|
|||
}
|
||||
|
||||
/* Process template arguments. */
|
||||
if (CLASSTYPE_TEMPLATE_INFO (type)
|
||||
if (CLASSTYPE_TEMPLATE_INFO (type)
|
||||
&& PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type)))
|
||||
{
|
||||
list = INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (type));
|
||||
for (i = 0; i < TREE_VEC_LENGTH (list); ++i)
|
||||
for (i = 0; i < TREE_VEC_LENGTH (list); ++i)
|
||||
arg_assoc_template_arg (k, TREE_VEC_ELT (list, i));
|
||||
}
|
||||
|
||||
|
@ -4455,7 +4455,7 @@ arg_assoc (struct arg_lookup *k, tree n)
|
|||
|
||||
if (TREE_CODE (template) == COMPONENT_REF)
|
||||
template = TREE_OPERAND (template, 1);
|
||||
|
||||
|
||||
/* First, the template. There may actually be more than one if
|
||||
this is an overloaded function template. But, in that case,
|
||||
we only need the first; all the functions will be in the same
|
||||
|
@ -4463,7 +4463,7 @@ arg_assoc (struct arg_lookup *k, tree n)
|
|||
template = OVL_CURRENT (template);
|
||||
|
||||
ctx = CP_DECL_CONTEXT (template);
|
||||
|
||||
|
||||
if (TREE_CODE (ctx) == NAMESPACE_DECL)
|
||||
{
|
||||
if (arg_assoc_namespace (k, ctx) == 1)
|
||||
|
@ -4513,7 +4513,7 @@ lookup_arg_dependent (tree name, tree fns, tree args)
|
|||
should be visible during argument-dependent lookup. */
|
||||
if (fns)
|
||||
fn = OVL_CURRENT (fns);
|
||||
if (fn && TREE_CODE (fn) == FUNCTION_DECL
|
||||
if (fn && TREE_CODE (fn) == FUNCTION_DECL
|
||||
&& (CP_DECL_CONTEXT (fn) != current_decl_namespace ()
|
||||
|| DECL_LOCAL_FUNCTION_P (fn)))
|
||||
k.namespaces = NULL_TREE;
|
||||
|
@ -4686,7 +4686,7 @@ pushtag (tree name, tree type, tag_scope scope)
|
|||
context = current_namespace;
|
||||
|
||||
if (b->kind == sk_class
|
||||
|| (b->kind == sk_template_parms
|
||||
|| (b->kind == sk_template_parms
|
||||
&& b->level_chain->kind == sk_class))
|
||||
in_class = 1;
|
||||
|
||||
|
@ -4799,7 +4799,7 @@ store_binding (tree id, VEC(cxx_saved_binding,gc) **old_bindings)
|
|||
|
||||
if (IDENTIFIER_MARKED (id))
|
||||
return;
|
||||
|
||||
|
||||
IDENTIFIER_MARKED (id) = 1;
|
||||
|
||||
saved = VEC_safe_push (cxx_saved_binding, gc, *old_bindings, NULL);
|
||||
|
@ -4833,7 +4833,7 @@ store_bindings (tree names, VEC(cxx_saved_binding,gc) **old_bindings)
|
|||
objects, rather than a TREE_LIST. */
|
||||
|
||||
static void
|
||||
store_class_bindings (VEC(cp_class_binding,gc) *names,
|
||||
store_class_bindings (VEC(cp_class_binding,gc) *names,
|
||||
VEC(cxx_saved_binding,gc) **old_bindings)
|
||||
{
|
||||
size_t i;
|
||||
|
@ -4919,7 +4919,7 @@ pop_from_top_level (void)
|
|||
cxx_saved_binding *saved;
|
||||
size_t i;
|
||||
|
||||
timevar_push (TV_NAME_LOOKUP);
|
||||
timevar_push (TV_NAME_LOOKUP);
|
||||
/* Clear out class-level bindings cache. */
|
||||
if (previous_class_level)
|
||||
invalidate_class_lookup_cache ();
|
||||
|
@ -4964,15 +4964,15 @@ pop_everything (void)
|
|||
}
|
||||
|
||||
/* Emit debugging information for using declarations and directives.
|
||||
If input tree is overloaded fn then emit debug info for all
|
||||
If input tree is overloaded fn then emit debug info for all
|
||||
candidates. */
|
||||
|
||||
void
|
||||
cp_emit_debug_info_for_using (tree t, tree context)
|
||||
{
|
||||
/* Ignore this FUNCTION_DECL if it refers to a builtin declaration
|
||||
/* Ignore this FUNCTION_DECL if it refers to a builtin declaration
|
||||
of a builtin function. */
|
||||
if (TREE_CODE (t) == FUNCTION_DECL
|
||||
if (TREE_CODE (t) == FUNCTION_DECL
|
||||
&& DECL_EXTERNAL (t)
|
||||
&& DECL_BUILT_IN (t))
|
||||
return;
|
||||
|
@ -4981,10 +4981,10 @@ cp_emit_debug_info_for_using (tree t, tree context)
|
|||
it is a global namespace. */
|
||||
if (context == global_namespace)
|
||||
context = NULL_TREE;
|
||||
|
||||
|
||||
if (BASELINK_P (t))
|
||||
t = BASELINK_FUNCTIONS (t);
|
||||
|
||||
|
||||
/* FIXME: Handle TEMPLATE_DECLs. */
|
||||
for (t = OVL_CURRENT (t); t; t = OVL_NEXT (t))
|
||||
if (TREE_CODE (t) != TEMPLATE_DECL)
|
||||
|
|
|
@ -191,7 +191,7 @@ struct cp_binding_level GTY(())
|
|||
VEC(tree,gc) *static_decls;
|
||||
|
||||
/* A chain of VTABLE_DECL nodes. */
|
||||
tree vtables;
|
||||
tree vtables;
|
||||
|
||||
/* A list of USING_DECL nodes. */
|
||||
tree usings;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* -*-C-*-
|
||||
|
||||
|
||||
This file contains definitions of the various C++ operators,
|
||||
including both overloadable operators (like `+') and
|
||||
non-overloadable operators (like the `?:' ternary operator).
|
||||
non-overloadable operators (like the `?:' ternary operator).
|
||||
Written by Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
Copyright (C) 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
|
@ -32,7 +32,7 @@ Boston, MA 02111-1307, USA. */
|
|||
preceding `operator'. This is the name that would be given in
|
||||
the source program. For `operator +', for example, this would be
|
||||
`+'.
|
||||
|
||||
|
||||
CODE
|
||||
|
||||
The tree_code for this operator. For `operator +', for example,
|
||||
|
@ -47,7 +47,7 @@ Boston, MA 02111-1307, USA. */
|
|||
would be "pl".
|
||||
|
||||
ARITY
|
||||
|
||||
|
||||
The arity of the operator, or -1 if any arity is allowed. (As
|
||||
for `operator ()'.) Postincrement and postdecrement operators
|
||||
are marked as binary.
|
||||
|
@ -57,12 +57,12 @@ Boston, MA 02111-1307, USA. */
|
|||
A boolean value. If nonzero, this is an assignment operator.
|
||||
|
||||
Before including this file, you should define DEFOPERATOR
|
||||
to take these arguments.
|
||||
to take these arguments.
|
||||
|
||||
There is code (such as in grok_op_properties) that depends on the
|
||||
order the operators are presented in this file. In particular,
|
||||
unary operators must precede binary operators. */
|
||||
|
||||
|
||||
/* Use DEF_SIMPLE_OPERATOR to define a non-assignment operator. Its
|
||||
arguments are as for DEF_OPERATOR, but there is no need to provide
|
||||
an ASSIGNMENT_P argument; it is always zero. */
|
||||
|
|
|
@ -62,9 +62,9 @@ update_cloned_parm (tree parm, tree cloned_parm)
|
|||
|
||||
/* The definition might have different constness. */
|
||||
TREE_READONLY (cloned_parm) = TREE_READONLY (parm);
|
||||
|
||||
|
||||
TREE_USED (cloned_parm) = TREE_USED (parm);
|
||||
|
||||
|
||||
/* The name may have changed from the declaration. */
|
||||
DECL_NAME (cloned_parm) = DECL_NAME (parm);
|
||||
DECL_SOURCE_LOCATION (cloned_parm) = DECL_SOURCE_LOCATION (parm);
|
||||
|
|
192
gcc/cp/parser.c
192
gcc/cp/parser.c
|
@ -93,7 +93,7 @@ typedef struct cp_lexer GTY (())
|
|||
/* If the lexer owns the buffer, this is the number of tokens in the
|
||||
buffer. */
|
||||
size_t buffer_length;
|
||||
|
||||
|
||||
/* A pointer just past the last available token. The tokens
|
||||
in this lexer are [buffer, last_token). */
|
||||
cp_token_position GTY ((skip)) last_token;
|
||||
|
@ -258,13 +258,13 @@ cp_lexer_new_main (void)
|
|||
/* Allocate the memory. */
|
||||
lexer = GGC_CNEW (cp_lexer);
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
#ifdef ENABLE_CHECKING
|
||||
/* Initially we are not debugging. */
|
||||
lexer->debugging_p = false;
|
||||
#endif /* ENABLE_CHECKING */
|
||||
lexer->saved_tokens = VEC_alloc (cp_token_position, heap,
|
||||
CP_SAVED_TOKEN_STACK);
|
||||
|
||||
|
||||
/* Create the buffer. */
|
||||
alloc = CP_LEXER_BUFFER_SIZE;
|
||||
buffer = ggc_alloc (alloc * sizeof (cp_token));
|
||||
|
@ -273,7 +273,7 @@ cp_lexer_new_main (void)
|
|||
space = alloc;
|
||||
pos = buffer;
|
||||
*pos = first_token;
|
||||
|
||||
|
||||
/* Get the remaining tokens from the preprocessor. */
|
||||
while (pos->type != CPP_EOF)
|
||||
{
|
||||
|
@ -316,7 +316,7 @@ cp_lexer_new_from_tokens (cp_token_cache *cache)
|
|||
lexer->buffer_length = 0;
|
||||
lexer->next_token = first == last ? (cp_token *)&eof_token : first;
|
||||
lexer->last_token = last;
|
||||
|
||||
|
||||
lexer->saved_tokens = VEC_alloc (cp_token_position, heap,
|
||||
CP_SAVED_TOKEN_STACK);
|
||||
|
||||
|
@ -356,7 +356,7 @@ static inline cp_token_position
|
|||
cp_lexer_token_position (cp_lexer *lexer, bool previous_p)
|
||||
{
|
||||
gcc_assert (!previous_p || lexer->next_token != &eof_token);
|
||||
|
||||
|
||||
return lexer->next_token - previous_p;
|
||||
}
|
||||
|
||||
|
@ -388,7 +388,7 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer ATTRIBUTE_UNUSED ,
|
|||
= c_lex_with_flags (&token->value, &token->location, &token->flags);
|
||||
token->in_system_header = in_system_header;
|
||||
|
||||
/* On some systems, some header files are surrounded by an
|
||||
/* On some systems, some header files are surrounded by an
|
||||
implicit extern "C" block. Set a flag in the token if it
|
||||
comes from such a header. */
|
||||
is_extern_c += pending_lang_change;
|
||||
|
@ -513,7 +513,7 @@ cp_lexer_peek_nth_token (cp_lexer* lexer, size_t n)
|
|||
token = (cp_token *)&eof_token;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (token->type != CPP_PURGED)
|
||||
--n;
|
||||
}
|
||||
|
@ -536,7 +536,7 @@ cp_lexer_consume_token (cp_lexer* lexer)
|
|||
cp_token *token = lexer->next_token;
|
||||
|
||||
gcc_assert (token != &eof_token);
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
lexer->next_token++;
|
||||
|
@ -545,12 +545,12 @@ cp_lexer_consume_token (cp_lexer* lexer)
|
|||
lexer->next_token = (cp_token *)&eof_token;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
while (lexer->next_token->type == CPP_PURGED);
|
||||
|
||||
|
||||
cp_lexer_set_source_position_from_token (token);
|
||||
|
||||
|
||||
/* Provide debugging output. */
|
||||
if (cp_lexer_debugging_p (lexer))
|
||||
{
|
||||
|
@ -558,7 +558,7 @@ cp_lexer_consume_token (cp_lexer* lexer)
|
|||
cp_lexer_print_token (cp_lexer_debug_stream, token);
|
||||
putc ('\n', cp_lexer_debug_stream);
|
||||
}
|
||||
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
|
@ -570,7 +570,7 @@ static void
|
|||
cp_lexer_purge_token (cp_lexer *lexer)
|
||||
{
|
||||
cp_token *tok = lexer->next_token;
|
||||
|
||||
|
||||
gcc_assert (tok != &eof_token);
|
||||
tok->type = CPP_PURGED;
|
||||
tok->location = UNKNOWN_LOCATION;
|
||||
|
@ -601,7 +601,7 @@ cp_lexer_purge_tokens_after (cp_lexer *lexer, cp_token *tok)
|
|||
|
||||
if (peek == &eof_token)
|
||||
peek = lexer->last_token;
|
||||
|
||||
|
||||
gcc_assert (tok < peek);
|
||||
|
||||
for ( tok += 1; tok != peek; tok += 1)
|
||||
|
@ -693,7 +693,7 @@ cp_lexer_print_token (FILE * stream, cp_token *token)
|
|||
"NESTED_NAME_SPECIFIER",
|
||||
"PURGED"
|
||||
};
|
||||
|
||||
|
||||
/* If we have a name for the token, print it out. Otherwise, we
|
||||
simply give the numeric code. */
|
||||
gcc_assert (token->type < ARRAY_SIZE(token_names));
|
||||
|
@ -1671,7 +1671,7 @@ static tree cp_parser_objc_message_expression
|
|||
(cp_parser *);
|
||||
static tree cp_parser_objc_encode_expression
|
||||
(cp_parser *);
|
||||
static tree cp_parser_objc_defs_expression
|
||||
static tree cp_parser_objc_defs_expression
|
||||
(cp_parser *);
|
||||
static tree cp_parser_objc_protocol_expression
|
||||
(cp_parser *);
|
||||
|
@ -1866,7 +1866,7 @@ cp_parser_error (cp_parser* parser, const char* message)
|
|||
cp_lexer_set_source_position_from_token (token);
|
||||
if (token->type == CPP_PRAGMA)
|
||||
{
|
||||
error ("%<#pragma%> is not allowed here");
|
||||
error ("%<#pragma%> is not allowed here");
|
||||
cp_lexer_purge_token (parser->lexer);
|
||||
return;
|
||||
}
|
||||
|
@ -1899,12 +1899,12 @@ cp_parser_name_lookup_error (cp_parser* parser,
|
|||
parser->scope, name);
|
||||
else if (parser->scope == global_namespace)
|
||||
error ("%<::%D%> has not been declared", name);
|
||||
else if (parser->object_scope
|
||||
else if (parser->object_scope
|
||||
&& !CLASS_TYPE_P (parser->object_scope))
|
||||
error ("request for member %qD in non-class type %qT",
|
||||
name, parser->object_scope);
|
||||
else if (parser->object_scope)
|
||||
error ("%<%T::%D%> has not been declared",
|
||||
error ("%<%T::%D%> has not been declared",
|
||||
parser->object_scope, name);
|
||||
else
|
||||
error ("%qD has not been declared", name);
|
||||
|
@ -2008,7 +2008,7 @@ cp_parser_check_for_invalid_template_id (cp_parser* parser,
|
|||
/* If parsing an integral constant-expression, issue an error message
|
||||
about the fact that THING appeared and return true. Otherwise,
|
||||
return false. In either case, set
|
||||
PARSER->NON_INTEGRAL_CONSTANT_EXPRESSION_P. */
|
||||
PARSER->NON_INTEGRAL_CONSTANT_EXPRESSION_P. */
|
||||
|
||||
static bool
|
||||
cp_parser_non_integral_constant_expression (cp_parser *parser,
|
||||
|
@ -2319,7 +2319,7 @@ cp_parser_skip_to_end_of_block_or_statement (cp_parser* parser)
|
|||
while (nesting_depth >= 0)
|
||||
{
|
||||
cp_token *token = cp_lexer_peek_token (parser->lexer);
|
||||
|
||||
|
||||
if (token->type == CPP_EOF)
|
||||
break;
|
||||
|
||||
|
@ -2343,7 +2343,7 @@ cp_parser_skip_to_end_of_block_or_statement (cp_parser* parser)
|
|||
if (!nesting_depth)
|
||||
nesting_depth = -1;
|
||||
break;
|
||||
|
||||
|
||||
case CPP_OPEN_BRACE:
|
||||
/* Nest. */
|
||||
nesting_depth++;
|
||||
|
@ -2352,10 +2352,10 @@ cp_parser_skip_to_end_of_block_or_statement (cp_parser* parser)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* Consume the token. */
|
||||
cp_lexer_consume_token (parser->lexer);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2792,7 +2792,7 @@ cp_parser_primary_expression (cp_parser *parser,
|
|||
checked at that point. If we are not within a cast, then
|
||||
this code is invalid. */
|
||||
if (!cast_p)
|
||||
cp_parser_non_integral_constant_expression
|
||||
cp_parser_non_integral_constant_expression
|
||||
(parser, "floating-point literal");
|
||||
}
|
||||
return token->value;
|
||||
|
@ -3053,7 +3053,7 @@ cp_parser_primary_expression (cp_parser *parser,
|
|||
/* Anything else is an error. */
|
||||
default:
|
||||
/* ...unless we have an Objective-C++ message or string literal, that is. */
|
||||
if (c_dialect_objc ()
|
||||
if (c_dialect_objc ()
|
||||
&& (token->type == CPP_OPEN_SQUARE || token->type == CPP_OBJC_STRING))
|
||||
return cp_parser_objc_expression (parser);
|
||||
|
||||
|
@ -3563,11 +3563,11 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
|
|||
look up names in "X<T>::I" in order to determine that "Y" is
|
||||
a template. So, if we have a typename at this point, we make
|
||||
an effort to look through it. */
|
||||
if (is_declaration
|
||||
if (is_declaration
|
||||
&& !typename_keyword_p
|
||||
&& parser->scope
|
||||
&& parser->scope
|
||||
&& TREE_CODE (parser->scope) == TYPENAME_TYPE)
|
||||
parser->scope = resolve_typename_type (parser->scope,
|
||||
parser->scope = resolve_typename_type (parser->scope,
|
||||
/*only_current_p=*/false);
|
||||
/* Parse the qualifying entity. */
|
||||
new_scope
|
||||
|
@ -3659,13 +3659,13 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
|
|||
if (success && start)
|
||||
{
|
||||
cp_token *token = cp_lexer_token_at (parser->lexer, start);
|
||||
|
||||
|
||||
/* Reset the contents of the START token. */
|
||||
token->type = CPP_NESTED_NAME_SPECIFIER;
|
||||
token->value = build_tree_list (access_check, parser->scope);
|
||||
TREE_TYPE (token->value) = parser->qualifying_scope;
|
||||
token->keyword = RID_MAX;
|
||||
|
||||
|
||||
/* Purge all subsequent tokens. */
|
||||
cp_lexer_purge_tokens_after (parser->lexer, start);
|
||||
}
|
||||
|
@ -3808,7 +3808,7 @@ cp_parser_class_or_namespace_name (cp_parser *parser,
|
|||
|
||||
If ADDRESS_P is true, the postfix expression is the operand of the
|
||||
`&' operator. CAST_P is true if this expression is the target of a
|
||||
cast.
|
||||
cast.
|
||||
|
||||
Returns a representation of the expression. */
|
||||
|
||||
|
@ -4136,7 +4136,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p)
|
|||
bool saved_non_integral_constant_expression_p = false;
|
||||
tree args;
|
||||
|
||||
is_builtin_constant_p
|
||||
is_builtin_constant_p
|
||||
= DECL_IS_BUILTIN_CONSTANT_P (postfix_expression);
|
||||
if (is_builtin_constant_p)
|
||||
{
|
||||
|
@ -4149,7 +4149,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p)
|
|||
parser->integral_constant_expression_p = false;
|
||||
}
|
||||
args = (cp_parser_parenthesized_expression_list
|
||||
(parser, /*is_attribute_list=*/false,
|
||||
(parser, /*is_attribute_list=*/false,
|
||||
/*cast_p=*/false,
|
||||
/*non_constant_p=*/NULL));
|
||||
if (is_builtin_constant_p)
|
||||
|
@ -4884,7 +4884,7 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p)
|
|||
token = cp_lexer_consume_token (parser->lexer);
|
||||
/* Parse the cast-expression. */
|
||||
cast_expression
|
||||
= cp_parser_cast_expression (parser,
|
||||
= cp_parser_cast_expression (parser,
|
||||
unary_operator == ADDR_EXPR,
|
||||
/*cast_p=*/false);
|
||||
/* Now, build an appropriate representation. */
|
||||
|
@ -5112,7 +5112,7 @@ cp_parser_new_type_id (cp_parser* parser, tree *nelts)
|
|||
*nelts = declarator->u.array.bounds;
|
||||
if (*nelts == error_mark_node)
|
||||
*nelts = integer_one_node;
|
||||
|
||||
|
||||
if (outer_declarator)
|
||||
outer_declarator->declarator = declarator->declarator;
|
||||
else
|
||||
|
@ -5388,7 +5388,7 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p)
|
|||
ctor of T, but looks like a cast to function returning T
|
||||
without a dependent expression. */
|
||||
if (!cp_parser_error_occurred (parser))
|
||||
expr = cp_parser_cast_expression (parser,
|
||||
expr = cp_parser_cast_expression (parser,
|
||||
/*address_p=*/false,
|
||||
/*cast_p=*/true);
|
||||
|
||||
|
@ -5454,7 +5454,7 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p)
|
|||
relational-expression >= shift-expression
|
||||
|
||||
GNU Extension:
|
||||
|
||||
|
||||
relational-expression:
|
||||
relational-expression <? shift-expression
|
||||
relational-expression >? shift-expression
|
||||
|
@ -5527,7 +5527,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p)
|
|||
- either we found a token which is not an operator (`>' where it is not
|
||||
an operator, or prec == PREC_NOT_OPERATOR), in which case popping
|
||||
will happen repeatedly;
|
||||
- or, we found an operator which has lower priority. This is the case
|
||||
- or, we found an operator which has lower priority. This is the case
|
||||
where the recursive descent *ascends*, as in `3 * 4 + 5' after
|
||||
parsing `3 * 4'. */
|
||||
if (new_prec <= prec)
|
||||
|
@ -5571,7 +5571,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p)
|
|||
pop:
|
||||
/* If the stack is not empty, we have parsed into LHS the right side
|
||||
(`4' in the example above) of an expression we had suspended.
|
||||
We can use the information on the stack to recover the LHS (`3')
|
||||
We can use the information on the stack to recover the LHS (`3')
|
||||
from the stack together with the tree code (`MULT_EXPR'), and
|
||||
the precedence of the higher level subexpression
|
||||
(`PREC_ADDITIVE_EXPRESSION'). TOKEN is the CPP_PLUS token,
|
||||
|
@ -5593,7 +5593,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p)
|
|||
least one of the operands is of enumeration type. */
|
||||
|
||||
if (overloaded_p
|
||||
&& (cp_parser_non_integral_constant_expression
|
||||
&& (cp_parser_non_integral_constant_expression
|
||||
(parser, "calls to overloaded operators")))
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -5897,7 +5897,7 @@ cp_parser_constant_expression (cp_parser* parser,
|
|||
constant. */
|
||||
expression = cp_parser_assignment_expression (parser, /*cast_p=*/false);
|
||||
/* Restore the old settings. */
|
||||
parser->integral_constant_expression_p
|
||||
parser->integral_constant_expression_p
|
||||
= saved_integral_constant_expression_p;
|
||||
parser->allow_non_integral_constant_expression_p
|
||||
= saved_allow_non_integral_constant_expression_p;
|
||||
|
@ -5905,7 +5905,7 @@ cp_parser_constant_expression (cp_parser* parser,
|
|||
*non_constant_p = parser->non_integral_constant_expression_p;
|
||||
else if (parser->non_integral_constant_expression_p)
|
||||
expression = error_mark_node;
|
||||
parser->non_integral_constant_expression_p
|
||||
parser->non_integral_constant_expression_p
|
||||
= saved_non_integral_constant_expression_p;
|
||||
|
||||
return expression;
|
||||
|
@ -6455,7 +6455,7 @@ cp_parser_condition (cp_parser* parser)
|
|||
for sure. */
|
||||
if (cp_parser_parse_definitely (parser))
|
||||
{
|
||||
tree pushed_scope;
|
||||
tree pushed_scope;
|
||||
|
||||
/* Create the declaration. */
|
||||
decl = start_decl (declarator, &type_specifiers,
|
||||
|
@ -7128,11 +7128,11 @@ cp_parser_simple_declaration (cp_parser* parser,
|
|||
/* Give up. */
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
/* If we have seen at least one decl-specifier, and the next token
|
||||
is not a parenthesis, then we must be looking at a declaration.
|
||||
(After "int (" we might be looking at a functional cast.) */
|
||||
if (decl_specifiers.any_specifiers_p
|
||||
if (decl_specifiers.any_specifiers_p
|
||||
&& cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_PAREN))
|
||||
cp_parser_commit_to_tentative_parse (parser);
|
||||
|
||||
|
@ -8673,12 +8673,12 @@ cp_parser_template_id (cp_parser *parser,
|
|||
if (start_of_id)
|
||||
{
|
||||
cp_token *token = cp_lexer_token_at (parser->lexer, start_of_id);
|
||||
|
||||
|
||||
/* Reset the contents of the START_OF_ID token. */
|
||||
token->type = CPP_TEMPLATE_ID;
|
||||
token->value = build_tree_list (access_check, template_id);
|
||||
token->keyword = RID_MAX;
|
||||
|
||||
|
||||
/* Purge all subsequent tokens. */
|
||||
cp_lexer_purge_tokens_after (parser->lexer, start_of_id);
|
||||
|
||||
|
@ -8798,7 +8798,7 @@ cp_parser_template_name (cp_parser* parser,
|
|||
&& !constructor_name_p (identifier, parser->scope))
|
||||
{
|
||||
cp_token_position start = 0;
|
||||
|
||||
|
||||
/* Explain what went wrong. */
|
||||
error ("non-template %qD used as template", identifier);
|
||||
inform ("use %<%T::template %D%> to indicate that it is a template",
|
||||
|
@ -9097,7 +9097,7 @@ cp_parser_template_argument (cp_parser* parser)
|
|||
gcc_assert (REFERENCE_REF_P (argument));
|
||||
argument = TREE_OPERAND (argument, 0);
|
||||
}
|
||||
|
||||
|
||||
if (qualifying_class)
|
||||
argument = finish_qualified_id_expr (qualifying_class,
|
||||
argument,
|
||||
|
@ -9729,7 +9729,7 @@ cp_parser_simple_type_specifier (cp_parser* parser,
|
|||
}
|
||||
|
||||
cp_parser_check_for_invalid_template_id (parser, TREE_TYPE (type));
|
||||
}
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
@ -9782,7 +9782,7 @@ cp_parser_type_name (cp_parser* parser)
|
|||
/* See if this is an Objective-C type. */
|
||||
tree protos = cp_parser_objc_protocol_refs_opt (parser);
|
||||
tree type = objc_get_protocol_qualified_type (identifier, protos);
|
||||
if (type)
|
||||
if (type)
|
||||
type_decl = TYPE_NAME (type);
|
||||
}
|
||||
|
||||
|
@ -9941,7 +9941,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
|
|||
}
|
||||
|
||||
/* For a `typename', we needn't call xref_tag. */
|
||||
if (tag_type == typename_type
|
||||
if (tag_type == typename_type
|
||||
&& TREE_CODE (parser->scope) != NAMESPACE_DECL)
|
||||
return cp_parser_make_typename_type (parser, parser->scope,
|
||||
identifier);
|
||||
|
@ -9984,7 +9984,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
|
|||
|
||||
if (TREE_CODE (decl) != TYPE_DECL)
|
||||
{
|
||||
cp_parser_diagnose_invalid_type_name (parser,
|
||||
cp_parser_diagnose_invalid_type_name (parser,
|
||||
parser->scope,
|
||||
identifier);
|
||||
return error_mark_node;
|
||||
|
@ -10632,7 +10632,7 @@ cp_parser_asm_definition (cp_parser* parser)
|
|||
tree temp = asm_stmt;
|
||||
if (TREE_CODE (temp) == CLEANUP_POINT_EXPR)
|
||||
temp = TREE_OPERAND (temp, 0);
|
||||
|
||||
|
||||
ASM_INPUT_P (temp) = 1;
|
||||
}
|
||||
}
|
||||
|
@ -10983,7 +10983,7 @@ cp_parser_init_declarator (cp_parser* parser,
|
|||
expression, not a declaration.)
|
||||
|
||||
If PARENTHESIZED_P is non-NULL, *PARENTHESIZED_P is set to true iff
|
||||
the declarator is a direct-declarator of the form "(...)".
|
||||
the declarator is a direct-declarator of the form "(...)".
|
||||
|
||||
MEMBER_P is true iff this declarator is a member-declarator. */
|
||||
|
||||
|
@ -11286,7 +11286,7 @@ cp_parser_direct_declarator (cp_parser* parser,
|
|||
bounds = fold_non_dependent_expr (bounds);
|
||||
/* Normally, the array bound must be an integral constant
|
||||
expression. However, as an extension, we allow VLAs
|
||||
in function scopes. */
|
||||
in function scopes. */
|
||||
else if (!at_function_scope_p ())
|
||||
{
|
||||
error ("array bound is not an integer constant");
|
||||
|
@ -11319,7 +11319,7 @@ cp_parser_direct_declarator (cp_parser* parser,
|
|||
if (!cp_parser_parse_definitely (parser))
|
||||
unqualified_name = error_mark_node;
|
||||
else if (qualifying_scope
|
||||
|| (TREE_CODE (unqualified_name)
|
||||
|| (TREE_CODE (unqualified_name)
|
||||
!= IDENTIFIER_NODE))
|
||||
{
|
||||
cp_parser_error (parser, "expected unqualified-id");
|
||||
|
@ -11353,7 +11353,7 @@ cp_parser_direct_declarator (cp_parser* parser,
|
|||
specialized, then this `i' will not be used, so there
|
||||
is no harm in resolving the types here. */
|
||||
tree type;
|
||||
|
||||
|
||||
/* Resolve the TYPENAME_TYPE. */
|
||||
type = resolve_typename_type (qualifying_scope,
|
||||
/*only_current_p=*/false);
|
||||
|
@ -11365,7 +11365,7 @@ cp_parser_direct_declarator (cp_parser* parser,
|
|||
qualifying_scope = type;
|
||||
}
|
||||
|
||||
declarator = make_id_declarator (qualifying_scope,
|
||||
declarator = make_id_declarator (qualifying_scope,
|
||||
unqualified_name);
|
||||
declarator->id_loc = token->location;
|
||||
if (unqualified_name)
|
||||
|
@ -11391,7 +11391,7 @@ cp_parser_direct_declarator (cp_parser* parser,
|
|||
&& (constructor_name_p (unqualified_name,
|
||||
class_type)
|
||||
|| (TREE_CODE (unqualified_name) == TYPE_DECL
|
||||
&& (same_type_p
|
||||
&& (same_type_p
|
||||
(TREE_TYPE (unqualified_name),
|
||||
class_type)))))
|
||||
declarator->u.id.sfk = sfk_constructor;
|
||||
|
@ -11741,7 +11741,7 @@ cp_parser_type_specifier_seq (cp_parser* parser,
|
|||
/* The standard says that a condition can be:
|
||||
|
||||
type-specifier-seq declarator = assignment-expression
|
||||
|
||||
|
||||
However, given:
|
||||
|
||||
struct S {};
|
||||
|
@ -11755,7 +11755,7 @@ cp_parser_type_specifier_seq (cp_parser* parser,
|
|||
then add a semantic restriction that if any decl-specifiers
|
||||
that are not type-specifiers appear, the program is invalid. */
|
||||
if (is_condition && !is_cv_qualifier)
|
||||
flags |= CP_PARSER_FLAGS_NO_USER_DEFINED_TYPES;
|
||||
flags |= CP_PARSER_FLAGS_NO_USER_DEFINED_TYPES;
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -12174,7 +12174,7 @@ cp_parser_parameter_declaration (cp_parser *parser,
|
|||
= parser->local_variables_forbidden_p;
|
||||
parser->local_variables_forbidden_p = true;
|
||||
/* Parse the assignment-expression. */
|
||||
default_argument
|
||||
default_argument
|
||||
= cp_parser_assignment_expression (parser, /*cast_p=*/false);
|
||||
/* Restore saved state. */
|
||||
parser->greater_than_is_operator_p
|
||||
|
@ -12753,7 +12753,7 @@ cp_parser_class_specifier (cp_parser* parser)
|
|||
involving a nested-name-specifier was used, and FALSE otherwise.
|
||||
|
||||
Returns error_mark_node if this is not a class-head.
|
||||
|
||||
|
||||
Returns NULL_TREE if the class-head is syntactically valid, but
|
||||
semantically invalid in a way that means we should skip the entire
|
||||
body of the class. */
|
||||
|
@ -13034,7 +13034,7 @@ cp_parser_class_head (cp_parser* parser,
|
|||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
type = TREE_TYPE (type);
|
||||
*nested_name_specifier_p = true;
|
||||
}
|
||||
|
@ -14316,7 +14316,7 @@ cp_parser_attribute_list (cp_parser* parser)
|
|||
token = cp_lexer_consume_token (parser->lexer);
|
||||
|
||||
/* Save away the identifier that indicates which attribute
|
||||
this is. */
|
||||
this is. */
|
||||
identifier = token->value;
|
||||
attribute = build_tree_list (identifier, NULL_TREE);
|
||||
|
||||
|
@ -14328,7 +14328,7 @@ cp_parser_attribute_list (cp_parser* parser)
|
|||
tree arguments;
|
||||
|
||||
arguments = (cp_parser_parenthesized_expression_list
|
||||
(parser, true, /*cast_p=*/false,
|
||||
(parser, true, /*cast_p=*/false,
|
||||
/*non_constant_p=*/NULL));
|
||||
/* Save the identifier and arguments away. */
|
||||
TREE_VALUE (attribute) = arguments;
|
||||
|
@ -14448,7 +14448,7 @@ cp_parser_label_declaration (cp_parser* parser)
|
|||
are ignored.
|
||||
|
||||
If CHECK_DEPENDENCY is TRUE, names are not looked up in dependent
|
||||
types.
|
||||
types.
|
||||
|
||||
If AMBIGUOUS_P is non-NULL, it is set to true if name-lookup
|
||||
results in an ambiguity, and false otherwise. */
|
||||
|
@ -14569,8 +14569,8 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
|
|||
may be instantiated during name lookup. In that case,
|
||||
errors may be issued. Even if we rollback the current
|
||||
tentative parse, those errors are valid. */
|
||||
decl = lookup_qualified_name (parser->scope, name,
|
||||
tag_type != none_type,
|
||||
decl = lookup_qualified_name (parser->scope, name,
|
||||
tag_type != none_type,
|
||||
/*complain=*/true);
|
||||
if (pushed_scope)
|
||||
pop_scope (pushed_scope);
|
||||
|
@ -14590,10 +14590,10 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
|
|||
parse, those errors are valid. */
|
||||
object_decl = lookup_member (object_type,
|
||||
name,
|
||||
/*protect=*/0,
|
||||
/*protect=*/0,
|
||||
tag_type != none_type);
|
||||
/* Look it up in the enclosing context, too. */
|
||||
decl = lookup_name_real (name, tag_type != none_type,
|
||||
decl = lookup_name_real (name, tag_type != none_type,
|
||||
/*nonclass=*/0,
|
||||
/*block_p=*/true, is_namespace,
|
||||
/*flags=*/0);
|
||||
|
@ -14604,7 +14604,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
|
|||
}
|
||||
else
|
||||
{
|
||||
decl = lookup_name_real (name, tag_type != none_type,
|
||||
decl = lookup_name_real (name, tag_type != none_type,
|
||||
/*nonclass=*/0,
|
||||
/*block_p=*/true, is_namespace,
|
||||
/*flags=*/0);
|
||||
|
@ -14754,7 +14754,7 @@ cp_parser_check_declarator_template_parameters (cp_parser* parser,
|
|||
scope = TYPE_CONTEXT (scope);
|
||||
}
|
||||
}
|
||||
else if (TREE_CODE (declarator->u.id.unqualified_name)
|
||||
else if (TREE_CODE (declarator->u.id.unqualified_name)
|
||||
== TEMPLATE_ID_EXPR)
|
||||
/* If the DECLARATOR has the form `X<y>' then it uses one
|
||||
additional level of template parameters. */
|
||||
|
@ -15516,14 +15516,14 @@ cp_parser_late_parsing_for_member (cp_parser* parser, tree member_function)
|
|||
tokens = DECL_PENDING_INLINE_INFO (member_function);
|
||||
DECL_PENDING_INLINE_INFO (member_function) = NULL;
|
||||
DECL_PENDING_INLINE_P (member_function) = 0;
|
||||
|
||||
|
||||
/* If this is a local class, enter the scope of the containing
|
||||
function. */
|
||||
function_scope = current_function_decl;
|
||||
if (function_scope)
|
||||
push_function_context_to (function_scope);
|
||||
|
||||
|
||||
|
||||
/* Push the body of the function onto the lexer stack. */
|
||||
cp_parser_push_lexer_for_tokens (parser, tokens);
|
||||
|
||||
|
@ -15535,14 +15535,14 @@ cp_parser_late_parsing_for_member (cp_parser* parser, tree member_function)
|
|||
/* Don't do access checking if it is a templated function. */
|
||||
if (processing_template_decl)
|
||||
push_deferring_access_checks (dk_no_check);
|
||||
|
||||
|
||||
/* Now, parse the body of the function. */
|
||||
cp_parser_function_definition_after_declarator (parser,
|
||||
/*inline_p=*/true);
|
||||
|
||||
if (processing_template_decl)
|
||||
pop_deferring_access_checks ();
|
||||
|
||||
|
||||
/* Leave the scope of the containing function. */
|
||||
if (function_scope)
|
||||
pop_function_context_from (function_scope);
|
||||
|
@ -15611,7 +15611,7 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
|
|||
VEC(tree,gc) *insts;
|
||||
tree copy;
|
||||
unsigned ix;
|
||||
|
||||
|
||||
if (!default_arg)
|
||||
continue;
|
||||
|
||||
|
@ -15684,7 +15684,7 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword)
|
|||
|
||||
/* The restrictions on constant-expressions do not apply inside
|
||||
sizeof expressions. */
|
||||
saved_integral_constant_expression_p
|
||||
saved_integral_constant_expression_p
|
||||
= parser->integral_constant_expression_p;
|
||||
saved_non_integral_constant_expression_p
|
||||
= parser->non_integral_constant_expression_p;
|
||||
|
@ -15741,7 +15741,7 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword)
|
|||
free ((char *) parser->type_definition_forbidden_message);
|
||||
/* And restore the old one. */
|
||||
parser->type_definition_forbidden_message = saved_message;
|
||||
parser->integral_constant_expression_p
|
||||
parser->integral_constant_expression_p
|
||||
= saved_integral_constant_expression_p;
|
||||
parser->non_integral_constant_expression_p
|
||||
= saved_non_integral_constant_expression_p;
|
||||
|
@ -16416,7 +16416,7 @@ cp_parser_objc_message_args (cp_parser* parser)
|
|||
|
||||
objc-encode-expression:
|
||||
@encode objc-typename
|
||||
|
||||
|
||||
Returns an encoded representation of the type argument. */
|
||||
|
||||
static tree
|
||||
|
@ -16547,12 +16547,12 @@ cp_parser_objc_identifier_list (cp_parser* parser)
|
|||
while (sep->type == CPP_COMMA)
|
||||
{
|
||||
cp_lexer_consume_token (parser->lexer); /* Eat ','. */
|
||||
list = chainon (list,
|
||||
list = chainon (list,
|
||||
build_tree_list (NULL_TREE,
|
||||
cp_parser_identifier (parser)));
|
||||
sep = cp_lexer_peek_token (parser->lexer);
|
||||
}
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
@ -16725,7 +16725,7 @@ static tree
|
|||
cp_parser_objc_selector (cp_parser* parser)
|
||||
{
|
||||
cp_token *token = cp_lexer_consume_token (parser->lexer);
|
||||
|
||||
|
||||
if (!cp_parser_objc_selector_p (token->type))
|
||||
{
|
||||
error ("invalid Objective-C++ selector name");
|
||||
|
@ -16778,7 +16778,7 @@ cp_parser_objc_method_keyword_params (cp_parser* parser)
|
|||
|
||||
params
|
||||
= chainon (params,
|
||||
objc_build_keyword_decl (selector,
|
||||
objc_build_keyword_decl (selector,
|
||||
typename,
|
||||
identifier));
|
||||
|
||||
|
@ -16815,7 +16815,7 @@ cp_parser_objc_method_tail_params_opt (cp_parser* parser, bool *ellipsisp)
|
|||
parmdecl = cp_parser_parameter_declaration (parser, false, NULL);
|
||||
parm = grokdeclarator (parmdecl->declarator,
|
||||
&parmdecl->decl_specifiers,
|
||||
PARM, /*initialized=*/0,
|
||||
PARM, /*initialized=*/0,
|
||||
/*attrlist=*/NULL);
|
||||
|
||||
chainon (params, build_tree_list (NULL_TREE, parm));
|
||||
|
@ -16992,7 +16992,7 @@ cp_parser_objc_class_ivars (cp_parser* parser)
|
|||
else
|
||||
{
|
||||
/* Parse the declarator. */
|
||||
declarator
|
||||
declarator
|
||||
= cp_parser_declarator (parser, CP_PARSER_DECLARATOR_NAMED,
|
||||
&ctor_dtor_or_conv_p,
|
||||
/*parenthesized_p=*/NULL,
|
||||
|
@ -17016,7 +17016,7 @@ cp_parser_objc_class_ivars (cp_parser* parser)
|
|||
else
|
||||
decl = grokfield (declarator, &declspecs, NULL_TREE,
|
||||
NULL_TREE, attributes);
|
||||
|
||||
|
||||
/* Add the instance variable. */
|
||||
objc_add_instance_variable (decl);
|
||||
|
||||
|
@ -17063,14 +17063,14 @@ cp_parser_objc_protocol_declaration (cp_parser* parser)
|
|||
|
||||
/* See if we have a forward declaration or a definition. */
|
||||
tok = cp_lexer_peek_nth_token (parser->lexer, 2);
|
||||
|
||||
|
||||
/* Try a forward declaration first. */
|
||||
if (tok->type == CPP_COMMA || tok->type == CPP_SEMICOLON)
|
||||
{
|
||||
objc_declare_protocols (cp_parser_objc_identifier_list (parser));
|
||||
finish:
|
||||
finish:
|
||||
cp_parser_consume_semicolon_at_end_of_statement (parser);
|
||||
}
|
||||
}
|
||||
|
||||
/* Ok, we got a full-fledged definition (or at least should). */
|
||||
else
|
||||
|
@ -17227,7 +17227,7 @@ cp_parser_objc_try_catch_finally_statement (cp_parser *parser) {
|
|||
stmt = push_stmt_list ();
|
||||
cp_parser_compound_statement (parser, NULL, false);
|
||||
objc_begin_try_stmt (location, pop_stmt_list (stmt));
|
||||
|
||||
|
||||
while (cp_lexer_next_token_is_keyword (parser->lexer, RID_AT_CATCH))
|
||||
{
|
||||
cp_parameter_declarator *parmdecl;
|
||||
|
@ -17238,7 +17238,7 @@ cp_parser_objc_try_catch_finally_statement (cp_parser *parser) {
|
|||
parmdecl = cp_parser_parameter_declaration (parser, false, NULL);
|
||||
parm = grokdeclarator (parmdecl->declarator,
|
||||
&parmdecl->decl_specifiers,
|
||||
PARM, /*initialized=*/0,
|
||||
PARM, /*initialized=*/0,
|
||||
/*attrlist=*/NULL);
|
||||
cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
|
||||
objc_begin_catch_clause (parm);
|
||||
|
|
1342
gcc/cp/pt.c
1342
gcc/cp/pt.c
File diff suppressed because it is too large
Load Diff
|
@ -129,7 +129,7 @@ cxx_print_type (FILE *file, tree node, int indent)
|
|||
BINFO_N_BASE_BINFOS (TYPE_BINFO (node)));
|
||||
else
|
||||
fprintf (file, " no-binfo");
|
||||
|
||||
|
||||
fprintf (file, " use_template=%d", CLASSTYPE_USE_TEMPLATE (node));
|
||||
if (CLASSTYPE_INTERFACE_ONLY (node))
|
||||
fprintf (file, " interface-only");
|
||||
|
|
|
@ -115,7 +115,7 @@ get_base_filename (const char *filename)
|
|||
}
|
||||
|
||||
return lbasename (filename);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
open_repo_file (const char *filename)
|
||||
|
@ -332,7 +332,7 @@ repo_export_class_p (tree class_type)
|
|||
return false;
|
||||
/* If the virtual table has been assigned to this translation unit,
|
||||
export the class. */
|
||||
return (IDENTIFIER_REPO_CHOSEN
|
||||
return (IDENTIFIER_REPO_CHOSEN
|
||||
(DECL_ASSEMBLER_NAME (CLASSTYPE_VTABLES (class_type))));
|
||||
}
|
||||
|
||||
|
|
156
gcc/cp/rtti.c
156
gcc/cp/rtti.c
|
@ -110,7 +110,7 @@ void
|
|||
init_rtti_processing (void)
|
||||
{
|
||||
tree type_info_type;
|
||||
|
||||
|
||||
push_namespace (std_identifier);
|
||||
type_info_type = xref_tag (class_type, get_identifier ("type_info"),
|
||||
/*tag_scope=*/ts_current, false);
|
||||
|
@ -120,7 +120,7 @@ init_rtti_processing (void)
|
|||
type_info_ptr_type = build_pointer_type (const_type_info_type_node);
|
||||
|
||||
unemitted_tinfo_decls = VEC_alloc (tree, gc, 124);
|
||||
|
||||
|
||||
create_tinfo_types ();
|
||||
}
|
||||
|
||||
|
@ -151,9 +151,9 @@ build_headof (tree exp)
|
|||
|
||||
offset = build_vtbl_ref (build_indirect_ref (exp, NULL), index);
|
||||
|
||||
type = build_qualified_type (ptr_type_node,
|
||||
type = build_qualified_type (ptr_type_node,
|
||||
cp_type_quals (TREE_TYPE (exp)));
|
||||
return build2 (PLUS_EXPR, type, exp,
|
||||
return build2 (PLUS_EXPR, type, exp,
|
||||
convert_to_integer (ptrdiff_type_node, offset));
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@ throw_bad_cast (void)
|
|||
if (!get_global_value_if_present (fn, &fn))
|
||||
fn = push_throw_library_fn (fn, build_function_type (ptr_type_node,
|
||||
void_list_node));
|
||||
|
||||
|
||||
return build_cxx_call (fn, NULL_TREE);
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ get_tinfo_decl_dynamic (tree exp)
|
|||
{
|
||||
tree type;
|
||||
tree t;
|
||||
|
||||
|
||||
if (exp == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
|
@ -210,10 +210,10 @@ get_tinfo_decl_dynamic (tree exp)
|
|||
|
||||
/* Peel off cv qualifiers. */
|
||||
type = TYPE_MAIN_VARIANT (type);
|
||||
|
||||
|
||||
if (!VOID_TYPE_P (type))
|
||||
type = complete_type_or_else (type, exp);
|
||||
|
||||
|
||||
if (!type)
|
||||
return error_mark_node;
|
||||
|
||||
|
@ -244,13 +244,13 @@ typeid_ok_p (void)
|
|||
error ("cannot use typeid with -fno-rtti");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!COMPLETE_TYPE_P (const_type_info_type_node))
|
||||
{
|
||||
error ("must #include <typeinfo> before using typeid");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -308,7 +308,7 @@ tinfo_name (tree type)
|
|||
|
||||
/* Return a VAR_DECL for the internal ABI defined type_info object for
|
||||
TYPE. You must arrange that the decl is mark_used, if actually use
|
||||
it --- decls in vtables are only used if the vtable is output. */
|
||||
it --- decls in vtables are only used if the vtable is output. */
|
||||
|
||||
tree
|
||||
get_tinfo_decl (tree type)
|
||||
|
@ -316,11 +316,11 @@ get_tinfo_decl (tree type)
|
|||
tree name;
|
||||
tree d;
|
||||
|
||||
if (COMPLETE_TYPE_P (type)
|
||||
if (COMPLETE_TYPE_P (type)
|
||||
&& TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
|
||||
{
|
||||
error ("cannot create type information for type %qT because "
|
||||
"its size is variable",
|
||||
"its size is variable",
|
||||
type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -337,7 +337,7 @@ get_tinfo_decl (tree type)
|
|||
if (d)
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
name = mangle_typeinfo_for_type (type);
|
||||
|
||||
d = IDENTIFIER_GLOBAL_VALUE (name);
|
||||
|
@ -379,7 +379,7 @@ get_tinfo_ptr (tree type)
|
|||
tree decl = get_tinfo_decl (type);
|
||||
|
||||
mark_used (decl);
|
||||
return build_nop (type_info_ptr_type,
|
||||
return build_nop (type_info_ptr_type,
|
||||
build_address (decl));
|
||||
}
|
||||
|
||||
|
@ -390,7 +390,7 @@ get_typeid (tree type)
|
|||
{
|
||||
if (type == error_mark_node || !typeid_ok_p ())
|
||||
return error_mark_node;
|
||||
|
||||
|
||||
if (processing_template_decl)
|
||||
return build_min (TYPEID_EXPR, const_type_info_type_node, type);
|
||||
|
||||
|
@ -405,7 +405,7 @@ get_typeid (tree type)
|
|||
|
||||
if (!VOID_TYPE_P (type))
|
||||
type = complete_type_or_else (type, NULL_TREE);
|
||||
|
||||
|
||||
if (!type)
|
||||
return error_mark_node;
|
||||
|
||||
|
@ -419,7 +419,7 @@ static tree
|
|||
ifnonnull (tree test, tree result)
|
||||
{
|
||||
return build3 (COND_EXPR, TREE_TYPE (result),
|
||||
build2 (EQ_EXPR, boolean_type_node, test,
|
||||
build2 (EQ_EXPR, boolean_type_node, test,
|
||||
cp_convert (TREE_TYPE (test), integer_zero_node)),
|
||||
cp_convert (TREE_TYPE (result), integer_zero_node),
|
||||
result);
|
||||
|
@ -504,7 +504,7 @@ build_dynamic_cast_1 (tree type, tree expr)
|
|||
errstr = "source is of incomplete class type";
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* The dynamic_cast operator shall not cast away constness. */
|
||||
|
@ -584,7 +584,7 @@ build_dynamic_cast_1 (tree type, tree expr)
|
|||
{
|
||||
warning (0, "dynamic_cast of %q#D to %q#T can never succeed",
|
||||
op, type);
|
||||
retval = build_int_cst (type, 0);
|
||||
retval = build_int_cst (type, 0);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
@ -600,7 +600,7 @@ build_dynamic_cast_1 (tree type, tree expr)
|
|||
|
||||
/* Determine how T and V are related. */
|
||||
boff = dcast_base_hint (static_type, target_type);
|
||||
|
||||
|
||||
/* Since expr is used twice below, save it. */
|
||||
expr = save_expr (expr);
|
||||
|
||||
|
@ -621,12 +621,12 @@ build_dynamic_cast_1 (tree type, tree expr)
|
|||
tree tinfo_ptr;
|
||||
tree ns = abi_node;
|
||||
const char *name;
|
||||
|
||||
|
||||
push_nested_namespace (ns);
|
||||
tinfo_ptr = xref_tag (class_type,
|
||||
get_identifier ("__class_type_info"),
|
||||
/*tag_scope=*/ts_current, false);
|
||||
|
||||
|
||||
tinfo_ptr = build_pointer_type
|
||||
(build_qualified_type
|
||||
(tinfo_ptr, TYPE_QUAL_CONST));
|
||||
|
@ -647,7 +647,7 @@ build_dynamic_cast_1 (tree type, tree expr)
|
|||
if (tc == REFERENCE_TYPE)
|
||||
{
|
||||
tree bad = throw_bad_cast ();
|
||||
|
||||
|
||||
result = save_expr (result);
|
||||
return build3 (COND_EXPR, type, result, result, bad);
|
||||
}
|
||||
|
@ -671,12 +671,12 @@ build_dynamic_cast (tree type, tree expr)
|
|||
{
|
||||
if (type == error_mark_node || expr == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
|
||||
if (processing_template_decl)
|
||||
{
|
||||
expr = build_min (DYNAMIC_CAST_EXPR, type, expr);
|
||||
TREE_SIDE_EFFECTS (expr) = 1;
|
||||
|
||||
|
||||
return expr;
|
||||
}
|
||||
|
||||
|
@ -690,7 +690,7 @@ qualifier_flags (tree type)
|
|||
{
|
||||
int flags = 0;
|
||||
int quals = cp_type_quals (type);
|
||||
|
||||
|
||||
if (quals & TYPE_QUAL_CONST)
|
||||
flags |= 1;
|
||||
if (quals & TYPE_QUAL_VOLATILE)
|
||||
|
@ -733,7 +733,7 @@ involves_incomplete_p (tree type)
|
|||
|
||||
case OFFSET_TYPE:
|
||||
ptrmem:
|
||||
return
|
||||
return
|
||||
(target_incomplete_p (TYPE_PTRMEM_POINTED_TO_TYPE (type))
|
||||
|| !COMPLETE_TYPE_P (TYPE_PTRMEM_CLASS_TYPE (type)));
|
||||
|
||||
|
@ -763,10 +763,10 @@ tinfo_base_init (tree desc, tree target)
|
|||
tree init = NULL_TREE;
|
||||
tree name_decl;
|
||||
tree vtable_ptr;
|
||||
|
||||
|
||||
{
|
||||
tree name_name;
|
||||
|
||||
|
||||
/* Generate the NTBS array variable. */
|
||||
tree name_type = build_cplus_array_type
|
||||
(build_qualified_type (char_type_node, TYPE_QUAL_CONST),
|
||||
|
@ -803,12 +803,12 @@ tinfo_base_init (tree desc, tree target)
|
|||
if (!vtable_ptr)
|
||||
{
|
||||
tree real_type;
|
||||
|
||||
|
||||
push_nested_namespace (abi_node);
|
||||
real_type = xref_tag (class_type, TINFO_REAL_NAME (desc),
|
||||
/*tag_scope=*/ts_current, false);
|
||||
pop_nested_namespace (abi_node);
|
||||
|
||||
|
||||
if (!COMPLETE_TYPE_P (real_type))
|
||||
{
|
||||
/* We never saw a definition of this type, so we need to
|
||||
|
@ -832,15 +832,15 @@ tinfo_base_init (tree desc, tree target)
|
|||
}
|
||||
|
||||
init = tree_cons (NULL_TREE, vtable_ptr, init);
|
||||
|
||||
|
||||
init = tree_cons (NULL_TREE, decay_conversion (name_decl), init);
|
||||
|
||||
|
||||
init = build_constructor (NULL_TREE, nreverse (init));
|
||||
TREE_CONSTANT (init) = 1;
|
||||
TREE_INVARIANT (init) = 1;
|
||||
TREE_STATIC (init) = 1;
|
||||
init = tree_cons (NULL_TREE, init, NULL_TREE);
|
||||
|
||||
|
||||
return init;
|
||||
}
|
||||
|
||||
|
@ -852,7 +852,7 @@ static tree
|
|||
generic_initializer (tree desc, tree target)
|
||||
{
|
||||
tree init = tinfo_base_init (desc, target);
|
||||
|
||||
|
||||
init = build_constructor (NULL_TREE, init);
|
||||
TREE_CONSTANT (init) = 1;
|
||||
TREE_INVARIANT (init) = 1;
|
||||
|
@ -871,14 +871,14 @@ ptr_initializer (tree desc, tree target)
|
|||
tree to = TREE_TYPE (target);
|
||||
int flags = qualifier_flags (to);
|
||||
bool incomplete = target_incomplete_p (to);
|
||||
|
||||
|
||||
if (incomplete)
|
||||
flags |= 8;
|
||||
init = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, flags), init);
|
||||
init = tree_cons (NULL_TREE,
|
||||
get_tinfo_ptr (TYPE_MAIN_VARIANT (to)),
|
||||
init);
|
||||
|
||||
|
||||
init = build_constructor (NULL_TREE, nreverse (init));
|
||||
TREE_CONSTANT (init) = 1;
|
||||
TREE_INVARIANT (init) = 1;
|
||||
|
@ -899,7 +899,7 @@ ptm_initializer (tree desc, tree target)
|
|||
tree klass = TYPE_PTRMEM_CLASS_TYPE (target);
|
||||
int flags = qualifier_flags (to);
|
||||
bool incomplete = target_incomplete_p (to);
|
||||
|
||||
|
||||
if (incomplete)
|
||||
flags |= 0x8;
|
||||
if (!COMPLETE_TYPE_P (klass))
|
||||
|
@ -910,13 +910,13 @@ ptm_initializer (tree desc, tree target)
|
|||
init);
|
||||
init = tree_cons (NULL_TREE,
|
||||
get_tinfo_ptr (klass),
|
||||
init);
|
||||
|
||||
init);
|
||||
|
||||
init = build_constructor (NULL_TREE, nreverse (init));
|
||||
TREE_CONSTANT (init) = 1;
|
||||
TREE_INVARIANT (init) = 1;
|
||||
TREE_STATIC (init) = 1;
|
||||
return init;
|
||||
return init;
|
||||
}
|
||||
|
||||
/* Return the CONSTRUCTOR expr for a type_info of class TYPE.
|
||||
|
@ -927,13 +927,13 @@ static tree
|
|||
class_initializer (tree desc, tree target, tree trail)
|
||||
{
|
||||
tree init = tinfo_base_init (desc, target);
|
||||
|
||||
|
||||
TREE_CHAIN (init) = trail;
|
||||
init = build_constructor (NULL_TREE, init);
|
||||
TREE_CONSTANT (init) = 1;
|
||||
TREE_INVARIANT (init) = 1;
|
||||
TREE_STATIC (init) = 1;
|
||||
return init;
|
||||
return init;
|
||||
}
|
||||
|
||||
/* Returns true if the typeinfo for type should be placed in
|
||||
|
@ -957,7 +957,7 @@ typeinfo_in_lib_p (tree type)
|
|||
case REAL_TYPE:
|
||||
case VOID_TYPE:
|
||||
return true;
|
||||
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -995,7 +995,7 @@ get_pseudo_ti_init (tree type, tree var_desc)
|
|||
tree base_binfo = BINFO_BASE_BINFO (TYPE_BINFO (type), 0);
|
||||
tree tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
|
||||
tree base_inits = tree_cons (NULL_TREE, tinfo, NULL_TREE);
|
||||
|
||||
|
||||
return class_initializer (var_desc, type, base_inits);
|
||||
}
|
||||
else
|
||||
|
@ -1007,7 +1007,7 @@ get_pseudo_ti_init (tree type, tree var_desc)
|
|||
VEC(tree,gc) *base_accesses = BINFO_BASE_ACCESSES (binfo);
|
||||
tree base_inits = NULL_TREE;
|
||||
int ix;
|
||||
|
||||
|
||||
/* Generate the base information initializer. */
|
||||
for (ix = nbases; ix--;)
|
||||
{
|
||||
|
@ -1016,7 +1016,7 @@ get_pseudo_ti_init (tree type, tree var_desc)
|
|||
int flags = 0;
|
||||
tree tinfo;
|
||||
tree offset;
|
||||
|
||||
|
||||
if (VEC_index (tree, base_accesses, ix) == access_public_node)
|
||||
flags |= 2;
|
||||
tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
|
||||
|
@ -1030,7 +1030,7 @@ get_pseudo_ti_init (tree type, tree var_desc)
|
|||
}
|
||||
else
|
||||
offset = BINFO_OFFSET (base_binfo);
|
||||
|
||||
|
||||
/* Combine offset and flags into one field. */
|
||||
offset = cp_build_binary_op (LSHIFT_EXPR, offset,
|
||||
build_int_cst (NULL_TREE, 8));
|
||||
|
@ -1071,7 +1071,7 @@ get_pseudo_ti_init (tree type, tree var_desc)
|
|||
vtable. We have to delay generating the VAR_DECL of the vtable
|
||||
until the end of the translation, when we'll have seen the library
|
||||
definition, if there was one.
|
||||
|
||||
|
||||
REAL_NAME is the runtime's name of the type. Trailing arguments are
|
||||
additional FIELD_DECL's for the structure. The final argument must be
|
||||
NULL. */
|
||||
|
@ -1094,17 +1094,17 @@ create_pseudo_type_info (const char *real_name, int ident, ...)
|
|||
strcat (pseudo_name, "_pseudo");
|
||||
if (ident)
|
||||
sprintf (pseudo_name + strlen (pseudo_name), "%d", ident);
|
||||
|
||||
|
||||
/* First field is the pseudo type_info base class. */
|
||||
fields = build_decl (FIELD_DECL, NULL_TREE, ti_desc_type_node);
|
||||
|
||||
|
||||
/* Now add the derived fields. */
|
||||
while ((field_decl = va_arg (ap, tree)))
|
||||
{
|
||||
TREE_CHAIN (field_decl) = fields;
|
||||
fields = field_decl;
|
||||
}
|
||||
|
||||
|
||||
/* Create the pseudo type. */
|
||||
pseudo_type = make_aggr_type (RECORD_TYPE);
|
||||
finish_builtin_struct (pseudo_type, pseudo_name, fields, NULL_TREE);
|
||||
|
@ -1114,7 +1114,7 @@ create_pseudo_type_info (const char *real_name, int ident, ...)
|
|||
TINFO_REAL_NAME (result) = get_identifier (real_name);
|
||||
TINFO_PSEUDO_TYPE (result) =
|
||||
cp_build_qualified_type (pseudo_type, TYPE_QUAL_CONST);
|
||||
|
||||
|
||||
va_end (ap);
|
||||
return result;
|
||||
}
|
||||
|
@ -1156,7 +1156,7 @@ get_pseudo_ti_desc (tree type)
|
|||
VEC(tree,gc) *base_accesses = BINFO_BASE_ACCESSES (binfo);
|
||||
tree base_binfo = BINFO_BASE_BINFO (binfo, 0);
|
||||
int num_bases = BINFO_N_BASE_BINFOS (binfo);
|
||||
|
||||
|
||||
if (num_bases == 1
|
||||
&& VEC_index (tree, base_accesses, 0) == access_public_node
|
||||
&& !BINFO_VIRTUAL_P (base_binfo)
|
||||
|
@ -1167,12 +1167,12 @@ get_pseudo_ti_desc (tree type)
|
|||
{
|
||||
tree var_desc;
|
||||
tree array_domain, base_array;
|
||||
|
||||
|
||||
if (TREE_VEC_LENGTH (vmi_class_desc_type_node) <= num_bases)
|
||||
{
|
||||
int ix;
|
||||
tree extend = make_tree_vec (num_bases + 5);
|
||||
|
||||
|
||||
for (ix = TREE_VEC_LENGTH (vmi_class_desc_type_node); ix--;)
|
||||
TREE_VEC_ELT (extend, ix)
|
||||
= TREE_VEC_ELT (vmi_class_desc_type_node, ix);
|
||||
|
@ -1181,7 +1181,7 @@ get_pseudo_ti_desc (tree type)
|
|||
var_desc = TREE_VEC_ELT (vmi_class_desc_type_node, num_bases);
|
||||
if (var_desc)
|
||||
return var_desc;
|
||||
|
||||
|
||||
/* Create the array of __base_class_type_info entries.
|
||||
G++ 3.2 allocated an array that had one too many
|
||||
entries, and then filled that extra entries with
|
||||
|
@ -1220,7 +1220,7 @@ create_tinfo_types (void)
|
|||
gcc_assert (!ti_desc_type_node);
|
||||
|
||||
push_nested_namespace (abi_node);
|
||||
|
||||
|
||||
/* Create the internal type_info structure. This is used as a base for
|
||||
the other structures. */
|
||||
{
|
||||
|
@ -1229,16 +1229,16 @@ create_tinfo_types (void)
|
|||
ti_desc_type_node = make_aggr_type (RECORD_TYPE);
|
||||
field = build_decl (FIELD_DECL, NULL_TREE, const_ptr_type_node);
|
||||
fields = field;
|
||||
|
||||
|
||||
field = build_decl (FIELD_DECL, NULL_TREE, const_string_type_node);
|
||||
TREE_CHAIN (field) = fields;
|
||||
fields = field;
|
||||
|
||||
|
||||
finish_builtin_struct (ti_desc_type_node, "__type_info_pseudo",
|
||||
fields, NULL_TREE);
|
||||
TYPE_HAS_CONSTRUCTOR (ti_desc_type_node) = 1;
|
||||
}
|
||||
|
||||
|
||||
/* Fundamental type_info */
|
||||
bltn_desc_type_node = create_pseudo_type_info
|
||||
("__fundamental_type_info", 0,
|
||||
|
@ -1254,40 +1254,40 @@ create_tinfo_types (void)
|
|||
enum_desc_type_node = create_pseudo_type_info
|
||||
("__enum_type_info", 0,
|
||||
NULL);
|
||||
|
||||
|
||||
/* Class type_info. Add a flags field. */
|
||||
class_desc_type_node = create_pseudo_type_info
|
||||
("__class_type_info", 0,
|
||||
NULL);
|
||||
|
||||
/* Single public non-virtual base class. Add pointer to base class.
|
||||
|
||||
/* Single public non-virtual base class. Add pointer to base class.
|
||||
This is really a descendant of __class_type_info. */
|
||||
si_class_desc_type_node = create_pseudo_type_info
|
||||
("__si_class_type_info", 0,
|
||||
build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type),
|
||||
NULL);
|
||||
|
||||
|
||||
/* Base class internal helper. Pointer to base type, offset to base,
|
||||
flags. */
|
||||
{
|
||||
tree field, fields;
|
||||
|
||||
|
||||
field = build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type);
|
||||
fields = field;
|
||||
|
||||
|
||||
field = build_decl (FIELD_DECL, NULL_TREE, integer_types[itk_long]);
|
||||
TREE_CHAIN (field) = fields;
|
||||
fields = field;
|
||||
|
||||
|
||||
base_desc_type_node = make_aggr_type (RECORD_TYPE);
|
||||
finish_builtin_struct (base_desc_type_node, "__base_class_type_info_pseudo",
|
||||
fields, NULL_TREE);
|
||||
TYPE_HAS_CONSTRUCTOR (base_desc_type_node) = 1;
|
||||
}
|
||||
|
||||
|
||||
/* General hierarchy is created as necessary in this vector. */
|
||||
vmi_class_desc_type_node = make_tree_vec (10);
|
||||
|
||||
|
||||
/* Pointer type_info. Adds two fields, qualification mask
|
||||
and pointer to the pointed to type. This is really a descendant of
|
||||
__pbase_type_info. */
|
||||
|
@ -1334,10 +1334,10 @@ emit_support_tinfos (void)
|
|||
};
|
||||
int ix;
|
||||
tree bltn_type, dtor;
|
||||
|
||||
|
||||
push_nested_namespace (abi_node);
|
||||
bltn_type = xref_tag (class_type,
|
||||
get_identifier ("__fundamental_type_info"),
|
||||
get_identifier ("__fundamental_type_info"),
|
||||
/*tag_scope=*/ts_current, false);
|
||||
pop_nested_namespace (abi_node);
|
||||
if (!COMPLETE_TYPE_P (bltn_type))
|
||||
|
@ -1354,9 +1354,9 @@ emit_support_tinfos (void)
|
|||
|
||||
types[0] = bltn;
|
||||
types[1] = build_pointer_type (bltn);
|
||||
types[2] = build_pointer_type (build_qualified_type (bltn,
|
||||
types[2] = build_pointer_type (build_qualified_type (bltn,
|
||||
TYPE_QUAL_CONST));
|
||||
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
tree tinfo;
|
||||
|
@ -1365,7 +1365,7 @@ emit_support_tinfos (void)
|
|||
TREE_USED (tinfo) = 1;
|
||||
mark_needed (tinfo);
|
||||
/* The C++ ABI requires that these objects be COMDAT. But,
|
||||
On systems without weak symbols, initialized COMDAT
|
||||
On systems without weak symbols, initialized COMDAT
|
||||
objects are emitted with internal linkage. (See
|
||||
comdat_linkage for details.) Since we want these objects
|
||||
to have external linkage so that copies do not have to be
|
||||
|
@ -1391,8 +1391,8 @@ emit_tinfo_decl (tree decl)
|
|||
int in_library = typeinfo_in_lib_p (type);
|
||||
tree var_desc, var_init;
|
||||
|
||||
gcc_assert (DECL_TINFO_P (decl));
|
||||
|
||||
gcc_assert (DECL_TINFO_P (decl));
|
||||
|
||||
if (in_library)
|
||||
{
|
||||
if (doing_runtime)
|
||||
|
|
212
gcc/cp/search.c
212
gcc/cp/search.c
|
@ -106,22 +106,22 @@ dfs_lookup_base (tree binfo, void *data_)
|
|||
data->binfo = binfo;
|
||||
data->via_virtual
|
||||
= binfo_via_virtual (data->binfo, data->t) != NULL_TREE;
|
||||
|
||||
|
||||
if (!data->repeated_base)
|
||||
/* If there are no repeated bases, we can stop now. */
|
||||
return binfo;
|
||||
|
||||
|
||||
if (data->want_any && !data->via_virtual)
|
||||
/* If this is a non-virtual base, then we can't do
|
||||
better. */
|
||||
return binfo;
|
||||
|
||||
|
||||
return dfs_skip_bases;
|
||||
}
|
||||
else
|
||||
{
|
||||
gcc_assert (binfo != data->binfo);
|
||||
|
||||
|
||||
/* We've found more than one matching binfo. */
|
||||
if (!data->want_any)
|
||||
{
|
||||
|
@ -144,7 +144,7 @@ dfs_lookup_base (tree binfo, void *data_)
|
|||
return dfs_skip_bases;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ accessible_base_p (tree t, tree base, bool consider_local_p)
|
|||
/* [class.access.base]
|
||||
|
||||
A base class is said to be accessible if an invented public
|
||||
member of the base class is accessible.
|
||||
member of the base class is accessible.
|
||||
|
||||
If BASE is a non-proper base, this condition is trivially
|
||||
true. */
|
||||
|
@ -193,7 +193,7 @@ lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr)
|
|||
tree binfo;
|
||||
tree t_binfo;
|
||||
base_kind bk;
|
||||
|
||||
|
||||
if (t == error_mark_node || base == error_mark_node)
|
||||
{
|
||||
if (kind_ptr)
|
||||
|
@ -201,7 +201,7 @@ lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr)
|
|||
return error_mark_node;
|
||||
}
|
||||
gcc_assert (TYPE_P (base));
|
||||
|
||||
|
||||
if (!TYPE_P (t))
|
||||
{
|
||||
t_binfo = t;
|
||||
|
@ -212,7 +212,7 @@ lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr)
|
|||
t = complete_type (TYPE_MAIN_VARIANT (t));
|
||||
t_binfo = TYPE_BINFO (t);
|
||||
}
|
||||
|
||||
|
||||
base = complete_type (TYPE_MAIN_VARIANT (base));
|
||||
|
||||
if (t_binfo)
|
||||
|
@ -228,7 +228,7 @@ lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr)
|
|||
|
||||
dfs_walk_once (t_binfo, dfs_lookup_base, NULL, &data);
|
||||
binfo = data.binfo;
|
||||
|
||||
|
||||
if (!binfo)
|
||||
bk = data.ambiguous ? bk_ambig : bk_not_base;
|
||||
else if (binfo == t_binfo)
|
||||
|
@ -284,7 +284,7 @@ lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr)
|
|||
|
||||
if (kind_ptr)
|
||||
*kind_ptr = bk;
|
||||
|
||||
|
||||
return binfo;
|
||||
}
|
||||
|
||||
|
@ -310,7 +310,7 @@ dfs_dcast_hint_pre (tree binfo, void *data_)
|
|||
|
||||
if (BINFO_VIRTUAL_P (binfo))
|
||||
data->virt_depth++;
|
||||
|
||||
|
||||
if (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), data->subtype))
|
||||
{
|
||||
if (data->virt_depth)
|
||||
|
@ -362,7 +362,7 @@ dcast_base_hint (tree subtype, tree target)
|
|||
data.virt_depth = 0;
|
||||
data.offset = NULL_TREE;
|
||||
data.repeated_base = CLASSTYPE_REPEATED_BASE_P (target);
|
||||
|
||||
|
||||
dfs_walk_once_accessible (TYPE_BINFO (target), /*friends=*/false,
|
||||
dfs_dcast_hint_pre, dfs_dcast_hint_post, &data);
|
||||
return data.offset ? data.offset : ssize_int (-2);
|
||||
|
@ -386,7 +386,7 @@ lookup_field_1 (tree type, tree name, bool want_type)
|
|||
if (TREE_CODE (type) == TEMPLATE_TYPE_PARM
|
||||
|| TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM
|
||||
|| TREE_CODE (type) == TYPENAME_TYPE)
|
||||
/* The TYPE_FIELDS of a TEMPLATE_TYPE_PARM and
|
||||
/* The TYPE_FIELDS of a TEMPLATE_TYPE_PARM and
|
||||
BOUND_TEMPLATE_TEMPLATE_PARM are not fields at all;
|
||||
instead TYPE_FIELDS is the TEMPLATE_PARM_INDEX. (Miraculously,
|
||||
the code often worked even when we treated the index as a list
|
||||
|
@ -477,7 +477,7 @@ lookup_field_1 (tree type, tree name, bool want_type)
|
|||
}
|
||||
|
||||
if (DECL_NAME (field) == name
|
||||
&& (!want_type
|
||||
&& (!want_type
|
||||
|| TREE_CODE (field) == TYPE_DECL
|
||||
|| DECL_CLASS_TEMPLATE_P (field)))
|
||||
return field;
|
||||
|
@ -493,7 +493,7 @@ lookup_field_1 (tree type, tree name, bool want_type)
|
|||
}
|
||||
|
||||
/* Return the FUNCTION_DECL, RECORD_TYPE, UNION_TYPE, or
|
||||
NAMESPACE_DECL corresponding to the innermost non-block scope. */
|
||||
NAMESPACE_DECL corresponding to the innermost non-block scope. */
|
||||
|
||||
tree
|
||||
current_scope (void)
|
||||
|
@ -563,11 +563,11 @@ tree
|
|||
context_for_name_lookup (tree decl)
|
||||
{
|
||||
/* [class.union]
|
||||
|
||||
|
||||
For the purposes of name lookup, after the anonymous union
|
||||
definition, the members of the anonymous union are considered to
|
||||
have been defined in the scope in which the anonymous union is
|
||||
declared. */
|
||||
declared. */
|
||||
tree context = DECL_CONTEXT (decl);
|
||||
|
||||
while (context && TYPE_P (context) && ANON_AGGR_TYPE_P (context))
|
||||
|
@ -611,7 +611,7 @@ dfs_access_in_type (tree binfo, void *data)
|
|||
else
|
||||
access = ak_public;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
/* First, check for an access-declaration that gives us more
|
||||
access to the DECL. The CONST_DECL for an enumeration
|
||||
|
@ -620,11 +620,11 @@ dfs_access_in_type (tree binfo, void *data)
|
|||
if (DECL_LANG_SPECIFIC (decl) && !DECL_DISCRIMINATOR_P (decl))
|
||||
{
|
||||
tree decl_access = purpose_member (type, DECL_ACCESS (decl));
|
||||
|
||||
|
||||
if (decl_access)
|
||||
{
|
||||
decl_access = TREE_VALUE (decl_access);
|
||||
|
||||
|
||||
if (decl_access == access_public_node)
|
||||
access = ak_public;
|
||||
else if (decl_access == access_protected_node)
|
||||
|
@ -641,7 +641,7 @@ dfs_access_in_type (tree binfo, void *data)
|
|||
int i;
|
||||
tree base_binfo;
|
||||
VEC(tree,gc) *accesses;
|
||||
|
||||
|
||||
/* Otherwise, scan our baseclasses, and pick the most favorable
|
||||
access. */
|
||||
accesses = BINFO_BASE_ACCESSES (binfo);
|
||||
|
@ -698,7 +698,7 @@ access_in_type (tree type, tree decl)
|
|||
|
||||
If a name can be reached by several paths through a multiple
|
||||
inheritance graph, the access is that of the path that gives
|
||||
most access.
|
||||
most access.
|
||||
|
||||
The algorithm we use is to make a post-order depth-first traversal
|
||||
of the base-class hierarchy. As we come up the tree, we annotate
|
||||
|
@ -721,7 +721,7 @@ protected_accessible_p (tree decl, tree derived, tree binfo)
|
|||
m as a member of N is protected, and the reference occurs in a
|
||||
member or friend of class N, or in a member or friend of a
|
||||
class P derived from N, where m as a member of P is private or
|
||||
protected.
|
||||
protected.
|
||||
|
||||
Here DERIVED is a possible P and DECL is m. accessible_p will
|
||||
iterate over various values of N, but the access to m in DERIVED
|
||||
|
@ -741,7 +741,7 @@ protected_accessible_p (tree decl, tree derived, tree binfo)
|
|||
/* If m is inaccessible in DERIVED, then it's not a P. */
|
||||
if (access == ak_none)
|
||||
return 0;
|
||||
|
||||
|
||||
/* [class.protected]
|
||||
|
||||
When a friend or a member function of a derived class references
|
||||
|
@ -760,7 +760,7 @@ protected_accessible_p (tree decl, tree derived, tree binfo)
|
|||
tree t = binfo;
|
||||
while (BINFO_INHERITANCE_CHAIN (t))
|
||||
t = BINFO_INHERITANCE_CHAIN (t);
|
||||
|
||||
|
||||
if (!DERIVED_FROM_P (derived, BINFO_TYPE (t)))
|
||||
return 0;
|
||||
}
|
||||
|
@ -802,8 +802,8 @@ friend_accessible_p (tree scope, tree decl, tree binfo)
|
|||
if (TREE_CODE (scope) == FUNCTION_DECL
|
||||
|| DECL_FUNCTION_TEMPLATE_P (scope))
|
||||
{
|
||||
/* Perhaps this SCOPE is a member of a class which is a
|
||||
friend. */
|
||||
/* Perhaps this SCOPE is a member of a class which is a
|
||||
friend. */
|
||||
if (DECL_CLASS_SCOPE_P (scope)
|
||||
&& friend_accessible_p (DECL_CONTEXT (scope), decl, binfo))
|
||||
return 1;
|
||||
|
@ -836,7 +836,7 @@ dfs_accessible_post (tree binfo, void *data ATTRIBUTE_UNUSED)
|
|||
&& is_friend (BINFO_TYPE (binfo), scope))
|
||||
return binfo;
|
||||
}
|
||||
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
|
@ -848,7 +848,7 @@ dfs_accessible_post (tree binfo, void *data ATTRIBUTE_UNUSED)
|
|||
CONSIDER_LOCAL is true, do consider special access the current
|
||||
scope or friendship thereof we might have. */
|
||||
|
||||
int
|
||||
int
|
||||
accessible_p (tree type, tree decl, bool consider_local_p)
|
||||
{
|
||||
tree binfo;
|
||||
|
@ -899,7 +899,7 @@ accessible_p (tree type, tree decl, bool consider_local_p)
|
|||
protected, or
|
||||
|
||||
--there exists a base class B of N that is accessible at the point
|
||||
of reference, and m is accessible when named in class B.
|
||||
of reference, and m is accessible when named in class B.
|
||||
|
||||
We walk the base class hierarchy, checking these conditions. */
|
||||
|
||||
|
@ -927,10 +927,10 @@ accessible_p (tree type, tree decl, bool consider_local_p)
|
|||
if (access == ak_public
|
||||
|| (access == ak_protected && protected_ok))
|
||||
return 1;
|
||||
|
||||
|
||||
if (!consider_local_p)
|
||||
return 0;
|
||||
|
||||
|
||||
/* Walk the hierarchy again, looking for a base class that allows
|
||||
access. */
|
||||
return dfs_walk_once_accessible (binfo, /*friends=*/true,
|
||||
|
@ -959,7 +959,7 @@ struct lookup_field_info {
|
|||
/* Within the scope of a template class, you can refer to the to the
|
||||
current specialization with the name of the template itself. For
|
||||
example:
|
||||
|
||||
|
||||
template <typename T> struct S { S* sp; }
|
||||
|
||||
Returns nonzero if DECL is such a declaration in a class TYPE. */
|
||||
|
@ -1011,7 +1011,7 @@ static int
|
|||
is_subobject_of_p (tree parent, tree binfo)
|
||||
{
|
||||
tree probe;
|
||||
|
||||
|
||||
for (probe = parent; probe; probe = BINFO_INHERITANCE_CHAIN (probe))
|
||||
{
|
||||
if (probe == binfo)
|
||||
|
@ -1038,7 +1038,7 @@ lookup_field_r (tree binfo, void *data)
|
|||
/* If this is a dependent base, don't look in it. */
|
||||
if (BINFO_DEPENDENT_BASE_P (binfo))
|
||||
return NULL_TREE;
|
||||
|
||||
|
||||
/* If this base class is hidden by the best-known value so far, we
|
||||
don't need to look. */
|
||||
if (lfi->rval_binfo && BINFO_INHERITANCE_CHAIN (binfo) == lfi->rval_binfo
|
||||
|
@ -1088,13 +1088,13 @@ lookup_field_r (tree binfo, void *data)
|
|||
lfi->name);
|
||||
if (e != NULL)
|
||||
nval = TYPE_MAIN_DECL (e->type);
|
||||
else
|
||||
else
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
/* You must name a template base class with a template-id. */
|
||||
if (!same_type_p (type, lfi->type)
|
||||
if (!same_type_p (type, lfi->type)
|
||||
&& template_self_reference_p (type, nval))
|
||||
goto done;
|
||||
|
||||
|
@ -1102,7 +1102,7 @@ lookup_field_r (tree binfo, void *data)
|
|||
hide the old one, we might have an ambiguity. */
|
||||
if (lfi->rval_binfo
|
||||
&& !is_subobject_of_p (lfi->rval_binfo, binfo))
|
||||
|
||||
|
||||
{
|
||||
if (nval == lfi->rval && shared_member_p (nval))
|
||||
/* The two things are really the same. */
|
||||
|
@ -1236,8 +1236,8 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type)
|
|||
just return NULL_TREE. */
|
||||
if (!protect && lfi.ambiguous)
|
||||
return NULL_TREE;
|
||||
|
||||
if (protect == 2)
|
||||
|
||||
if (protect == 2)
|
||||
{
|
||||
if (lfi.ambiguous)
|
||||
return lfi.ambiguous;
|
||||
|
@ -1260,7 +1260,7 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type)
|
|||
rval = error_mark_node;
|
||||
}
|
||||
|
||||
if (rval && is_overloaded_fn (rval))
|
||||
if (rval && is_overloaded_fn (rval))
|
||||
rval = build_baselink (rval_binfo, basetype_path, rval,
|
||||
(IDENTIFIER_TYPENAME_P (name)
|
||||
? TREE_TYPE (name): NULL_TREE));
|
||||
|
@ -1274,7 +1274,7 @@ tree
|
|||
lookup_field (tree xbasetype, tree name, int protect, bool want_type)
|
||||
{
|
||||
tree rval = lookup_member (xbasetype, name, protect, want_type);
|
||||
|
||||
|
||||
/* Ignore functions, but propagate the ambiguity list. */
|
||||
if (!error_operand_p (rval)
|
||||
&& (rval && BASELINK_P (rval)))
|
||||
|
@ -1314,7 +1314,7 @@ lookup_conversion_operator (tree class_type, tree type)
|
|||
int i;
|
||||
tree fn;
|
||||
VEC(tree,gc) *methods = CLASSTYPE_METHOD_VEC (class_type);
|
||||
|
||||
|
||||
for (i = CLASSTYPE_FIRST_CONVERSION_SLOT;
|
||||
VEC_iterate (tree, methods, i, fn); ++i)
|
||||
{
|
||||
|
@ -1325,7 +1325,7 @@ lookup_conversion_operator (tree class_type, tree type)
|
|||
fn = OVL_CURRENT (fn);
|
||||
if (!DECL_CONV_FN_P (fn))
|
||||
break;
|
||||
|
||||
|
||||
if (TREE_CODE (fn) == TEMPLATE_DECL)
|
||||
/* All the templated conversion functions are on the same
|
||||
slot, so remember it. */
|
||||
|
@ -1348,7 +1348,7 @@ lookup_fnfields_1 (tree type, tree name)
|
|||
tree fn;
|
||||
tree tmp;
|
||||
size_t i;
|
||||
|
||||
|
||||
if (!CLASS_TYPE_P (type))
|
||||
return -1;
|
||||
|
||||
|
@ -1471,11 +1471,11 @@ class_method_index_for_fn (tree class_type, tree function)
|
|||
`B', not `D'. This function makes that adjustment. */
|
||||
|
||||
tree
|
||||
adjust_result_of_qualified_name_lookup (tree decl,
|
||||
adjust_result_of_qualified_name_lookup (tree decl,
|
||||
tree qualifying_scope,
|
||||
tree context_class)
|
||||
{
|
||||
if (context_class && CLASS_TYPE_P (qualifying_scope)
|
||||
if (context_class && CLASS_TYPE_P (qualifying_scope)
|
||||
&& DERIVED_FROM_P (qualifying_scope, context_class)
|
||||
&& BASELINK_P (decl))
|
||||
{
|
||||
|
@ -1493,7 +1493,7 @@ adjust_result_of_qualified_name_lookup (tree decl,
|
|||
if (base)
|
||||
{
|
||||
BASELINK_ACCESS_BINFO (decl) = base;
|
||||
BASELINK_BINFO (decl)
|
||||
BASELINK_BINFO (decl)
|
||||
= lookup_base (base, BINFO_TYPE (BASELINK_BINFO (decl)),
|
||||
ba_unique | ba_quiet,
|
||||
NULL);
|
||||
|
@ -1521,7 +1521,7 @@ dfs_walk_all (tree binfo, tree (*pre_fn) (tree, void *),
|
|||
tree rval;
|
||||
unsigned ix;
|
||||
tree base_binfo;
|
||||
|
||||
|
||||
/* Call the pre-order walking function. */
|
||||
if (pre_fn)
|
||||
{
|
||||
|
@ -1550,7 +1550,7 @@ dfs_walk_all (tree binfo, tree (*pre_fn) (tree, void *),
|
|||
gcc_assert (rval != dfs_skip_bases);
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
|
@ -1564,7 +1564,7 @@ dfs_walk_once_r (tree binfo, tree (*pre_fn) (tree, void *),
|
|||
tree rval;
|
||||
unsigned ix;
|
||||
tree base_binfo;
|
||||
|
||||
|
||||
/* Call the pre-order walking function. */
|
||||
if (pre_fn)
|
||||
{
|
||||
|
@ -1573,7 +1573,7 @@ dfs_walk_once_r (tree binfo, tree (*pre_fn) (tree, void *),
|
|||
{
|
||||
if (rval == dfs_skip_bases)
|
||||
goto skip_bases;
|
||||
|
||||
|
||||
return rval;
|
||||
}
|
||||
}
|
||||
|
@ -1587,12 +1587,12 @@ dfs_walk_once_r (tree binfo, tree (*pre_fn) (tree, void *),
|
|||
continue;
|
||||
BINFO_MARKED (base_binfo) = 1;
|
||||
}
|
||||
|
||||
|
||||
rval = dfs_walk_once_r (base_binfo, pre_fn, post_fn, data);
|
||||
if (rval)
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
||||
skip_bases:
|
||||
/* Call the post-order walking function. */
|
||||
if (post_fn)
|
||||
|
@ -1601,19 +1601,19 @@ dfs_walk_once_r (tree binfo, tree (*pre_fn) (tree, void *),
|
|||
gcc_assert (rval != dfs_skip_bases);
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Worker for dfs_walk_once. Recursively unmark the virtual base binfos of
|
||||
BINFO. */
|
||||
|
||||
|
||||
static void
|
||||
dfs_unmark_r (tree binfo)
|
||||
{
|
||||
unsigned ix;
|
||||
tree base_binfo;
|
||||
|
||||
|
||||
/* Process the basetypes. */
|
||||
for (ix = 0; BINFO_BASE_ITERATE (binfo, ix, base_binfo); ix++)
|
||||
{
|
||||
|
@ -1644,7 +1644,7 @@ dfs_walk_once (tree binfo, tree (*pre_fn) (tree, void *),
|
|||
gcc_assert (pre_fn || post_fn);
|
||||
gcc_assert (!active);
|
||||
active++;
|
||||
|
||||
|
||||
if (!CLASSTYPE_DIAMOND_SHAPED_P (BINFO_TYPE (binfo)))
|
||||
/* We are not diamond shaped, and therefore cannot encounter the
|
||||
same binfo twice. */
|
||||
|
@ -1660,7 +1660,7 @@ dfs_walk_once (tree binfo, tree (*pre_fn) (tree, void *),
|
|||
VEC(tree,gc) *vbases;
|
||||
unsigned ix;
|
||||
tree base_binfo;
|
||||
|
||||
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (BINFO_TYPE (binfo)), ix = 0;
|
||||
VEC_iterate (tree, vbases, ix, base_binfo); ix++)
|
||||
BINFO_MARKED (base_binfo) = 0;
|
||||
|
@ -1670,7 +1670,7 @@ dfs_walk_once (tree binfo, tree (*pre_fn) (tree, void *),
|
|||
}
|
||||
|
||||
active--;
|
||||
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
@ -1696,7 +1696,7 @@ dfs_walk_once_accessible_r (tree binfo, bool friends_p, bool once,
|
|||
{
|
||||
if (rval == dfs_skip_bases)
|
||||
goto skip_bases;
|
||||
|
||||
|
||||
return rval;
|
||||
}
|
||||
}
|
||||
|
@ -1708,7 +1708,7 @@ dfs_walk_once_accessible_r (tree binfo, bool friends_p, bool once,
|
|||
|
||||
if (mark && BINFO_MARKED (base_binfo))
|
||||
continue;
|
||||
|
||||
|
||||
/* If the base is inherited via private or protected
|
||||
inheritance, then we can't see it, unless we are a friend of
|
||||
the current binfo. */
|
||||
|
@ -1718,7 +1718,7 @@ dfs_walk_once_accessible_r (tree binfo, bool friends_p, bool once,
|
|||
if (!friends_p)
|
||||
continue;
|
||||
scope = current_scope ();
|
||||
if (!scope
|
||||
if (!scope
|
||||
|| TREE_CODE (scope) == NAMESPACE_DECL
|
||||
|| !is_friend (BINFO_TYPE (binfo), scope))
|
||||
continue;
|
||||
|
@ -1732,7 +1732,7 @@ dfs_walk_once_accessible_r (tree binfo, bool friends_p, bool once,
|
|||
if (rval)
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
||||
skip_bases:
|
||||
/* Call the post-order walking function. */
|
||||
if (post_fn)
|
||||
|
@ -1741,7 +1741,7 @@ dfs_walk_once_accessible_r (tree binfo, bool friends_p, bool once,
|
|||
gcc_assert (rval != dfs_skip_bases);
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
|
@ -1757,7 +1757,7 @@ dfs_walk_once_accessible (tree binfo, bool friends_p,
|
|||
bool diamond_shaped = CLASSTYPE_DIAMOND_SHAPED_P (BINFO_TYPE (binfo));
|
||||
tree rval = dfs_walk_once_accessible_r (binfo, friends_p, diamond_shaped,
|
||||
pre_fn, post_fn, data);
|
||||
|
||||
|
||||
if (diamond_shaped)
|
||||
{
|
||||
if (!BINFO_INHERITANCE_CHAIN (binfo))
|
||||
|
@ -1768,7 +1768,7 @@ dfs_walk_once_accessible (tree binfo, bool friends_p,
|
|||
VEC(tree,gc) *vbases;
|
||||
unsigned ix;
|
||||
tree base_binfo;
|
||||
|
||||
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (BINFO_TYPE (binfo)), ix = 0;
|
||||
VEC_iterate (tree, vbases, ix, base_binfo); ix++)
|
||||
BINFO_MARKED (base_binfo) = 0;
|
||||
|
@ -1804,12 +1804,12 @@ check_final_overrider (tree overrider, tree basefn)
|
|||
{
|
||||
/* Potentially covariant. */
|
||||
unsigned base_quals, over_quals;
|
||||
|
||||
|
||||
fail = !POINTER_TYPE_P (base_return);
|
||||
if (!fail)
|
||||
{
|
||||
fail = cp_type_quals (base_return) != cp_type_quals (over_return);
|
||||
|
||||
|
||||
base_return = TREE_TYPE (base_return);
|
||||
over_return = TREE_TYPE (over_return);
|
||||
}
|
||||
|
@ -1818,7 +1818,7 @@ check_final_overrider (tree overrider, tree basefn)
|
|||
|
||||
if ((base_quals & over_quals) != over_quals)
|
||||
fail = 1;
|
||||
|
||||
|
||||
if (CLASS_TYPE_P (base_return) && CLASS_TYPE_P (over_return))
|
||||
{
|
||||
tree binfo = lookup_base (over_return, base_return,
|
||||
|
@ -1867,7 +1867,7 @@ check_final_overrider (tree overrider, tree basefn)
|
|||
DECL_INVALID_OVERRIDER_P (overrider) = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Check throw specifier is at least as strict. */
|
||||
if (!comp_except_specs (base_throw, over_throw, 0))
|
||||
{
|
||||
|
@ -1876,17 +1876,17 @@ check_final_overrider (tree overrider, tree basefn)
|
|||
DECL_INVALID_OVERRIDER_P (overrider) = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Given a class TYPE, and a function decl FNDECL, look for
|
||||
virtual functions in TYPE's hierarchy which FNDECL overrides.
|
||||
We do not look in TYPE itself, only its bases.
|
||||
|
||||
|
||||
Returns nonzero, if we find any. Set FNDECL's DECL_VIRTUAL_P, if we
|
||||
find that it overrides anything.
|
||||
|
||||
|
||||
We check that every function which is overridden, is correctly
|
||||
overridden. */
|
||||
|
||||
|
@ -1901,7 +1901,7 @@ look_for_overrides (tree type, tree fndecl)
|
|||
for (ix = 0; BINFO_BASE_ITERATE (binfo, ix, base_binfo); ix++)
|
||||
{
|
||||
tree basetype = BINFO_TYPE (base_binfo);
|
||||
|
||||
|
||||
if (TYPE_POLYMORPHIC_P (basetype))
|
||||
found += look_for_overrides_r (basetype, fndecl);
|
||||
}
|
||||
|
@ -1929,7 +1929,7 @@ look_for_overrides_here (tree type, tree fndecl)
|
|||
if (ix >= 0)
|
||||
{
|
||||
tree fns = VEC_index (tree, CLASSTYPE_METHOD_VEC (type), ix);
|
||||
|
||||
|
||||
for (; fns; fns = OVL_NEXT (fns))
|
||||
{
|
||||
tree fn = OVL_CURRENT (fns);
|
||||
|
@ -1994,7 +1994,7 @@ dfs_get_pure_virtuals (tree binfo, void *data)
|
|||
if (!BINFO_PRIMARY_P (binfo))
|
||||
{
|
||||
tree virtuals;
|
||||
|
||||
|
||||
for (virtuals = BINFO_VIRTUALS (binfo);
|
||||
virtuals;
|
||||
virtuals = TREE_CHAIN (virtuals))
|
||||
|
@ -2155,11 +2155,11 @@ check_hidden_convs (tree binfo, int virtual_depth, int virtualness,
|
|||
int we_hide_them;
|
||||
int they_hide_us;
|
||||
tree *prev, other;
|
||||
|
||||
|
||||
if (!(virtual_depth || TREE_STATIC (level)))
|
||||
/* Neither is morally virtual, so cannot hide each other. */
|
||||
continue;
|
||||
|
||||
|
||||
if (!TREE_VALUE (level))
|
||||
/* They evaporated away already. */
|
||||
continue;
|
||||
|
@ -2172,7 +2172,7 @@ check_hidden_convs (tree binfo, int virtual_depth, int virtualness,
|
|||
if (!(we_hide_them || they_hide_us))
|
||||
/* Neither is within the other, so no hiding can occur. */
|
||||
continue;
|
||||
|
||||
|
||||
for (prev = &TREE_VALUE (level), other = *prev; other;)
|
||||
{
|
||||
if (same_type_p (to_type, TREE_TYPE (other)))
|
||||
|
@ -2212,12 +2212,12 @@ split_conversions (tree my_convs, tree parent_convs,
|
|||
{
|
||||
tree t;
|
||||
tree prev;
|
||||
|
||||
|
||||
/* Remove the original other_convs portion from child_convs. */
|
||||
for (prev = NULL, t = child_convs;
|
||||
t != other_convs; prev = t, t = TREE_CHAIN (t))
|
||||
continue;
|
||||
|
||||
|
||||
if (prev)
|
||||
TREE_CHAIN (prev) = NULL_TREE;
|
||||
else
|
||||
|
@ -2231,7 +2231,7 @@ split_conversions (tree my_convs, tree parent_convs,
|
|||
}
|
||||
else
|
||||
my_convs = child_convs;
|
||||
|
||||
|
||||
return my_convs;
|
||||
}
|
||||
|
||||
|
@ -2276,15 +2276,15 @@ lookup_conversions_r (tree binfo,
|
|||
if (!TYPE_HAS_CONVERSION (BINFO_TYPE (binfo)))
|
||||
{
|
||||
*convs = *tpl_convs = NULL_TREE;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (BINFO_VIRTUAL_P (binfo))
|
||||
virtual_depth++;
|
||||
|
||||
|
||||
/* First, locate the unhidden ones at this level. */
|
||||
for (i = CLASSTYPE_FIRST_CONVERSION_SLOT;
|
||||
for (i = CLASSTYPE_FIRST_CONVERSION_SLOT;
|
||||
VEC_iterate (tree, method_vec, i, conv);
|
||||
++i)
|
||||
{
|
||||
|
@ -2303,7 +2303,7 @@ lookup_conversions_r (tree binfo,
|
|||
{
|
||||
tree tpl = OVL_CURRENT (tpls);
|
||||
tree type = DECL_CONV_FN_TYPE (tpl);
|
||||
|
||||
|
||||
if (check_hidden_convs (binfo, virtual_depth, virtualness,
|
||||
type, parent_tpl_convs, other_tpl_convs))
|
||||
{
|
||||
|
@ -2324,7 +2324,7 @@ lookup_conversions_r (tree binfo,
|
|||
if (!IDENTIFIER_MARKED (name))
|
||||
{
|
||||
tree type = DECL_CONV_FN_TYPE (cur);
|
||||
|
||||
|
||||
if (check_hidden_convs (binfo, virtual_depth, virtualness,
|
||||
type, parent_convs, other_convs))
|
||||
{
|
||||
|
@ -2347,7 +2347,7 @@ lookup_conversions_r (tree binfo,
|
|||
if (virtual_depth)
|
||||
TREE_STATIC (parent_convs) = 1;
|
||||
}
|
||||
|
||||
|
||||
if (my_tpl_convs)
|
||||
{
|
||||
parent_tpl_convs = tree_cons (binfo, my_tpl_convs, parent_tpl_convs);
|
||||
|
@ -2357,7 +2357,7 @@ lookup_conversions_r (tree binfo,
|
|||
|
||||
child_convs = other_convs;
|
||||
child_tpl_convs = other_tpl_convs;
|
||||
|
||||
|
||||
/* Now iterate over each base, looking for more conversions. */
|
||||
for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++)
|
||||
{
|
||||
|
@ -2383,7 +2383,7 @@ lookup_conversions_r (tree binfo,
|
|||
child_convs, other_convs);
|
||||
*tpl_convs = split_conversions (my_tpl_convs, parent_tpl_convs,
|
||||
child_tpl_convs, other_tpl_convs);
|
||||
|
||||
|
||||
return my_virtualness;
|
||||
}
|
||||
|
||||
|
@ -2401,15 +2401,15 @@ lookup_conversions (tree type)
|
|||
{
|
||||
tree convs, tpl_convs;
|
||||
tree list = NULL_TREE;
|
||||
|
||||
|
||||
complete_type (type);
|
||||
if (!TYPE_BINFO (type))
|
||||
return NULL_TREE;
|
||||
|
||||
|
||||
lookup_conversions_r (TYPE_BINFO (type), 0, 0,
|
||||
NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE,
|
||||
&convs, &tpl_convs);
|
||||
|
||||
|
||||
/* Flatten the list-of-lists */
|
||||
for (; convs; convs = TREE_CHAIN (convs))
|
||||
{
|
||||
|
@ -2423,7 +2423,7 @@ lookup_conversions (tree type)
|
|||
list = probe;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (; tpl_convs; tpl_convs = TREE_CHAIN (tpl_convs))
|
||||
{
|
||||
tree probe, next;
|
||||
|
@ -2436,7 +2436,7 @@ lookup_conversions (tree type)
|
|||
list = probe;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
@ -2464,7 +2464,7 @@ binfo_via_virtual (tree binfo, tree limit)
|
|||
if (limit && !CLASSTYPE_VBASECLASSES (limit))
|
||||
/* LIMIT has no virtual bases, so BINFO cannot be via one. */
|
||||
return NULL_TREE;
|
||||
|
||||
|
||||
for (; binfo && !SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), limit);
|
||||
binfo = BINFO_INHERITANCE_CHAIN (binfo))
|
||||
{
|
||||
|
@ -2482,7 +2482,7 @@ tree
|
|||
copied_binfo (tree binfo, tree here)
|
||||
{
|
||||
tree result = NULL_TREE;
|
||||
|
||||
|
||||
if (BINFO_VIRTUAL_P (binfo))
|
||||
{
|
||||
tree t;
|
||||
|
@ -2498,7 +2498,7 @@ copied_binfo (tree binfo, tree here)
|
|||
tree cbinfo;
|
||||
tree base_binfo;
|
||||
int ix;
|
||||
|
||||
|
||||
cbinfo = copied_binfo (BINFO_INHERITANCE_CHAIN (binfo), here);
|
||||
for (ix = 0; BINFO_BASE_ITERATE (cbinfo, ix, base_binfo); ix++)
|
||||
if (SAME_BINFO_TYPE_P (BINFO_TYPE (base_binfo), BINFO_TYPE (binfo)))
|
||||
|
@ -2523,7 +2523,7 @@ binfo_for_vbase (tree base, tree t)
|
|||
unsigned ix;
|
||||
tree binfo;
|
||||
VEC(tree,gc) *vbases;
|
||||
|
||||
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (t), ix = 0;
|
||||
VEC_iterate (tree, vbases, ix, binfo); ix++)
|
||||
if (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), base))
|
||||
|
@ -2540,7 +2540,7 @@ tree
|
|||
original_binfo (tree binfo, tree here)
|
||||
{
|
||||
tree result = NULL;
|
||||
|
||||
|
||||
if (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), BINFO_TYPE (here)))
|
||||
result = here;
|
||||
else if (BINFO_VIRTUAL_P (binfo))
|
||||
|
@ -2550,13 +2550,13 @@ original_binfo (tree binfo, tree here)
|
|||
else if (BINFO_INHERITANCE_CHAIN (binfo))
|
||||
{
|
||||
tree base_binfos;
|
||||
|
||||
|
||||
base_binfos = original_binfo (BINFO_INHERITANCE_CHAIN (binfo), here);
|
||||
if (base_binfos)
|
||||
{
|
||||
int ix;
|
||||
tree base_binfo;
|
||||
|
||||
|
||||
for (ix = 0; (base_binfo = BINFO_BASE_BINFO (base_binfos, ix)); ix++)
|
||||
if (SAME_BINFO_TYPE_P (BINFO_TYPE (base_binfo),
|
||||
BINFO_TYPE (binfo)))
|
||||
|
@ -2566,7 +2566,7 @@ original_binfo (tree binfo, tree here)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/* Perform the semantic phase of parsing, i.e., the process of
|
||||
building tree structure, checking semantic consistency, and
|
||||
building RTL. These routines are used both during actual parsing
|
||||
and during the instantiation of template functions.
|
||||
and during the instantiation of template functions.
|
||||
|
||||
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
Written by Mark Mitchell (mmitchell@usa.net) based on code found
|
||||
formerly in parse.y and pt.c.
|
||||
formerly in parse.y and pt.c.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -14,12 +14,12 @@
|
|||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
|
@ -91,7 +91,7 @@ static tree finalize_nrv_r (tree *, int *, void *);
|
|||
instantiations.
|
||||
|
||||
Typical use of access checking functions is described here:
|
||||
|
||||
|
||||
1. When we enter a context that requires certain access checking
|
||||
mode, the function `push_deferring_access_checks' is called with
|
||||
DEFERRING argument specifying the desired mode. Access checking
|
||||
|
@ -121,23 +121,23 @@ typedef struct deferred_access GTY(())
|
|||
names used in a decl-specifier-seq until we know what is being
|
||||
declared because code like:
|
||||
|
||||
class A {
|
||||
class A {
|
||||
class B {};
|
||||
B* f();
|
||||
}
|
||||
|
||||
A::B* A::f() { return 0; }
|
||||
|
||||
is valid, even though `A::B' is not generally accessible.
|
||||
is valid, even though `A::B' is not generally accessible.
|
||||
|
||||
The TREE_PURPOSE of each node is the scope used to qualify the
|
||||
name being looked up; the TREE_VALUE is the DECL to which the
|
||||
name was resolved. */
|
||||
tree deferred_access_checks;
|
||||
|
||||
|
||||
/* The current mode of access checks. */
|
||||
enum deferring_kind deferring_access_checks_kind;
|
||||
|
||||
|
||||
} deferred_access;
|
||||
DEF_VEC_O (deferred_access);
|
||||
DEF_VEC_ALLOC_O (deferred_access,gc);
|
||||
|
@ -199,8 +199,8 @@ pop_deferring_access_checks (void)
|
|||
VEC_pop (deferred_access, deferred_access_stack);
|
||||
}
|
||||
|
||||
/* Returns a TREE_LIST representing the deferred checks.
|
||||
The TREE_PURPOSE of each node is the type through which the
|
||||
/* Returns a TREE_LIST representing the deferred checks.
|
||||
The TREE_PURPOSE of each node is the type through which the
|
||||
access occurred; the TREE_VALUE is the declaration named.
|
||||
*/
|
||||
|
||||
|
@ -236,8 +236,8 @@ pop_to_parent_deferring_access_checks (void)
|
|||
if (ptr->deferring_access_checks_kind == dk_no_deferred)
|
||||
{
|
||||
/* Check access. */
|
||||
for (; checks; checks = TREE_CHAIN (checks))
|
||||
enforce_access (TREE_PURPOSE (checks),
|
||||
for (; checks; checks = TREE_CHAIN (checks))
|
||||
enforce_access (TREE_PURPOSE (checks),
|
||||
TREE_VALUE (checks));
|
||||
}
|
||||
else
|
||||
|
@ -245,11 +245,11 @@ pop_to_parent_deferring_access_checks (void)
|
|||
/* Merge with parent. */
|
||||
tree next;
|
||||
tree original = ptr->deferred_access_checks;
|
||||
|
||||
|
||||
for (; checks; checks = next)
|
||||
{
|
||||
tree probe;
|
||||
|
||||
|
||||
next = TREE_CHAIN (checks);
|
||||
|
||||
for (probe = original; probe; probe = TREE_CHAIN (probe))
|
||||
|
@ -290,7 +290,7 @@ perform_deferred_access_checks (void)
|
|||
deferred_check;
|
||||
deferred_check = TREE_CHAIN (deferred_check))
|
||||
/* Check access. */
|
||||
enforce_access (TREE_PURPOSE (deferred_check),
|
||||
enforce_access (TREE_PURPOSE (deferred_check),
|
||||
TREE_VALUE (deferred_check));
|
||||
}
|
||||
|
||||
|
@ -307,18 +307,18 @@ perform_or_defer_access_check (tree binfo, tree decl)
|
|||
*/
|
||||
if (deferred_access_no_check)
|
||||
return;
|
||||
|
||||
|
||||
gcc_assert (TREE_CODE (binfo) == TREE_BINFO);
|
||||
|
||||
ptr = VEC_last (deferred_access, deferred_access_stack);
|
||||
|
||||
|
||||
/* If we are not supposed to defer access checks, just check now. */
|
||||
if (ptr->deferring_access_checks_kind == dk_no_deferred)
|
||||
{
|
||||
enforce_access (binfo, decl);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* See if we are already going to perform this check. */
|
||||
for (check = ptr->deferred_access_checks;
|
||||
check;
|
||||
|
@ -373,8 +373,8 @@ add_stmt (tree t)
|
|||
stmt_tree
|
||||
current_stmt_tree (void)
|
||||
{
|
||||
return (cfun
|
||||
? &cfun->language->base.x_stmt_tree
|
||||
return (cfun
|
||||
? &cfun->language->base.x_stmt_tree
|
||||
: &scope_chain->x_stmt_tree);
|
||||
}
|
||||
|
||||
|
@ -436,7 +436,7 @@ do_poplevel (tree stmt_list)
|
|||
block = poplevel (kept_level_p (), 1, 0);
|
||||
|
||||
stmt_list = pop_stmt_list (stmt_list);
|
||||
|
||||
|
||||
if (!processing_template_decl)
|
||||
{
|
||||
stmt_list = c_build_bind_expr (block, stmt_list);
|
||||
|
@ -446,7 +446,7 @@ do_poplevel (tree stmt_list)
|
|||
return stmt_list;
|
||||
}
|
||||
|
||||
/* Begin a new scope. */
|
||||
/* Begin a new scope. */
|
||||
|
||||
static tree
|
||||
do_pushlevel (scope_kind sk)
|
||||
|
@ -505,7 +505,7 @@ finish_cond (tree *cond_p, tree expr)
|
|||
for (;;) { A x = 42; if (!x) break; }
|
||||
The statement list for BODY will be empty if the conditional did
|
||||
not declare anything. */
|
||||
|
||||
|
||||
static void
|
||||
simplify_loop_decl_cond (tree *cond_p, tree body)
|
||||
{
|
||||
|
@ -516,7 +516,7 @@ simplify_loop_decl_cond (tree *cond_p, tree body)
|
|||
|
||||
cond = *cond_p;
|
||||
*cond_p = boolean_true_node;
|
||||
|
||||
|
||||
if_stmt = begin_if_stmt ();
|
||||
cond = build_unary_op (TRUTH_NOT_EXPR, cond, 0);
|
||||
finish_if_stmt_cond (cond, if_stmt);
|
||||
|
@ -548,7 +548,7 @@ finish_goto_stmt (tree destination)
|
|||
addresses, or some such. */
|
||||
DECL_UNINLINABLE (current_function_decl) = 1;
|
||||
}
|
||||
|
||||
|
||||
check_goto (destination);
|
||||
|
||||
return add_stmt (build_stmt (GOTO_EXPR, destination));
|
||||
|
@ -626,7 +626,7 @@ begin_if_stmt (void)
|
|||
/* Process the COND of an if-statement, which may be given by
|
||||
IF_STMT. */
|
||||
|
||||
void
|
||||
void
|
||||
finish_if_stmt_cond (tree cond, tree if_stmt)
|
||||
{
|
||||
finish_cond (&IF_COND (if_stmt), maybe_convert_cond (cond));
|
||||
|
@ -663,7 +663,7 @@ finish_else_clause (tree if_stmt)
|
|||
|
||||
/* Finish an if-statement. */
|
||||
|
||||
void
|
||||
void
|
||||
finish_if_stmt (tree if_stmt)
|
||||
{
|
||||
tree scope = TREE_CHAIN (if_stmt);
|
||||
|
@ -689,7 +689,7 @@ begin_while_stmt (void)
|
|||
/* Process the COND of a while-statement, which may be given by
|
||||
WHILE_STMT. */
|
||||
|
||||
void
|
||||
void
|
||||
finish_while_stmt_cond (tree cond, tree while_stmt)
|
||||
{
|
||||
finish_cond (&WHILE_COND (while_stmt), maybe_convert_cond (cond));
|
||||
|
@ -698,7 +698,7 @@ finish_while_stmt_cond (tree cond, tree while_stmt)
|
|||
|
||||
/* Finish a while-statement, which may be given by WHILE_STMT. */
|
||||
|
||||
void
|
||||
void
|
||||
finish_while_stmt (tree while_stmt)
|
||||
{
|
||||
WHILE_BODY (while_stmt) = do_poplevel (WHILE_BODY (while_stmt));
|
||||
|
@ -748,7 +748,7 @@ finish_return_stmt (tree expr)
|
|||
if (!processing_template_decl)
|
||||
{
|
||||
if (DECL_DESTRUCTOR_P (current_function_decl)
|
||||
|| (DECL_CONSTRUCTOR_P (current_function_decl)
|
||||
|| (DECL_CONSTRUCTOR_P (current_function_decl)
|
||||
&& targetm.cxx.cdtor_returns_this ()))
|
||||
{
|
||||
/* Similarly, all destructors must run destructors for
|
||||
|
@ -774,7 +774,7 @@ begin_for_stmt (void)
|
|||
{
|
||||
tree r;
|
||||
|
||||
r = build_stmt (FOR_STMT, NULL_TREE, NULL_TREE,
|
||||
r = build_stmt (FOR_STMT, NULL_TREE, NULL_TREE,
|
||||
NULL_TREE, NULL_TREE);
|
||||
|
||||
if (flag_new_for_scope > 0)
|
||||
|
@ -853,7 +853,7 @@ finish_for_stmt (tree for_stmt)
|
|||
add_stmt (do_poplevel (scope));
|
||||
}
|
||||
|
||||
finish_stmt ();
|
||||
finish_stmt ();
|
||||
}
|
||||
|
||||
/* Finish a break-statement. */
|
||||
|
@ -945,7 +945,7 @@ finish_switch_stmt (tree switch_stmt)
|
|||
|
||||
SWITCH_STMT_BODY (switch_stmt) =
|
||||
pop_stmt_list (SWITCH_STMT_BODY (switch_stmt));
|
||||
pop_switch ();
|
||||
pop_switch ();
|
||||
finish_stmt ();
|
||||
|
||||
scope = TREE_CHAIN (switch_stmt);
|
||||
|
@ -1090,7 +1090,7 @@ finish_handler (tree handler)
|
|||
/* Begin a compound statement. FLAGS contains some bits that control the
|
||||
behavior and context. If BCS_NO_SCOPE is set, the compound statement
|
||||
does not define a scope. If BCS_FN_BODY is set, this is the outermost
|
||||
block of a function. If BCS_TRY_BLOCK is set, this is the block
|
||||
block of a function. If BCS_TRY_BLOCK is set, this is the block
|
||||
created on behalf of a TRY statement. Returns a token to be passed to
|
||||
finish_compound_stmt. */
|
||||
|
||||
|
@ -1107,7 +1107,7 @@ begin_compound_stmt (unsigned int flags)
|
|||
/* Normally, we try hard to keep the BLOCK for a statement-expression.
|
||||
But, if it's a statement-expression with a scopeless block, there's
|
||||
nothing to keep, and we don't want to accidentally keep a block
|
||||
*inside* the scopeless block. */
|
||||
*inside* the scopeless block. */
|
||||
keep_next_level (false);
|
||||
}
|
||||
else
|
||||
|
@ -1215,7 +1215,7 @@ finish_asm_stmt (int volatile_p, tree string, tree output_operands,
|
|||
for (i = 0, t = input_operands; t; ++i, t = TREE_CHAIN (t))
|
||||
{
|
||||
constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (t)));
|
||||
operand = decay_conversion (TREE_VALUE (t));
|
||||
operand = decay_conversion (TREE_VALUE (t));
|
||||
|
||||
/* If the type of the operand hasn't been determined (e.g.,
|
||||
because it involves an overloaded function), then issue
|
||||
|
@ -1223,7 +1223,7 @@ finish_asm_stmt (int volatile_p, tree string, tree output_operands,
|
|||
resolve the overloading. */
|
||||
if (TREE_TYPE (operand) == unknown_type_node)
|
||||
{
|
||||
error ("type of asm operand %qE could not be determined",
|
||||
error ("type of asm operand %qE could not be determined",
|
||||
TREE_VALUE (t));
|
||||
operand = error_mark_node;
|
||||
}
|
||||
|
@ -1279,7 +1279,7 @@ finish_label_decl (tree name)
|
|||
|
||||
/* When DECL goes out of scope, make sure that CLEANUP is executed. */
|
||||
|
||||
void
|
||||
void
|
||||
finish_decl_cleanup (tree decl, tree cleanup)
|
||||
{
|
||||
push_cleanup (decl, cleanup, false);
|
||||
|
@ -1323,10 +1323,10 @@ finish_parenthesized_expr (tree expr)
|
|||
/* [expr.unary.op]/3 The qualified id of a pointer-to-member must not be
|
||||
enclosed in parentheses. */
|
||||
PTRMEM_OK_P (expr) = 0;
|
||||
|
||||
|
||||
if (TREE_CODE (expr) == STRING_CST)
|
||||
PAREN_STRING_LITERAL_P (expr) = 1;
|
||||
|
||||
|
||||
return expr;
|
||||
}
|
||||
|
||||
|
@ -1340,7 +1340,7 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
|
|||
|
||||
if (!object)
|
||||
{
|
||||
if (current_function_decl
|
||||
if (current_function_decl
|
||||
&& DECL_STATIC_FUNCTION_P (current_function_decl))
|
||||
cp_error_at ("invalid use of member %qD in static member function",
|
||||
decl);
|
||||
|
@ -1361,21 +1361,21 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
|
|||
{
|
||||
/* Set the cv qualifiers. */
|
||||
int quals = cp_type_quals (TREE_TYPE (current_class_ref));
|
||||
|
||||
|
||||
if (DECL_MUTABLE_P (decl))
|
||||
quals &= ~TYPE_QUAL_CONST;
|
||||
|
||||
quals |= cp_type_quals (TREE_TYPE (decl));
|
||||
type = cp_build_qualified_type (type, quals);
|
||||
}
|
||||
|
||||
|
||||
return build_min (COMPONENT_REF, type, object, decl, NULL_TREE);
|
||||
}
|
||||
else
|
||||
{
|
||||
tree access_type = TREE_TYPE (object);
|
||||
tree lookup_context = context_for_name_lookup (decl);
|
||||
|
||||
|
||||
while (!DERIVED_FROM_P (lookup_context, access_type))
|
||||
{
|
||||
access_type = TYPE_CONTEXT (access_type);
|
||||
|
@ -1421,8 +1421,8 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
|
|||
`A::B' then NESTED_NAME_SPECIFIER is `A'. */
|
||||
|
||||
void
|
||||
check_accessibility_of_qualified_id (tree decl,
|
||||
tree object_type,
|
||||
check_accessibility_of_qualified_id (tree decl,
|
||||
tree object_type,
|
||||
tree nested_name_specifier)
|
||||
{
|
||||
tree scope;
|
||||
|
@ -1431,14 +1431,14 @@ check_accessibility_of_qualified_id (tree decl,
|
|||
/* If we're not checking, return immediately. */
|
||||
if (deferred_access_no_check)
|
||||
return;
|
||||
|
||||
|
||||
/* Determine the SCOPE of DECL. */
|
||||
scope = context_for_name_lookup (decl);
|
||||
/* If the SCOPE is not a type, then DECL is not a member. */
|
||||
if (!TYPE_P (scope))
|
||||
return;
|
||||
/* Compute the scope through which DECL is being accessed. */
|
||||
if (object_type
|
||||
if (object_type
|
||||
/* OBJECT_TYPE might not be a class type; consider:
|
||||
|
||||
class A { typedef int I; };
|
||||
|
@ -1496,7 +1496,7 @@ finish_qualified_id_expr (tree qualifying_class, tree expr, bool done,
|
|||
{
|
||||
if (TREE_CODE (expr) == SCOPE_REF)
|
||||
expr = TREE_OPERAND (expr, 1);
|
||||
expr = build_offset_ref (qualifying_class, expr,
|
||||
expr = build_offset_ref (qualifying_class, expr,
|
||||
/*address_p=*/true);
|
||||
return expr;
|
||||
}
|
||||
|
@ -1515,9 +1515,9 @@ finish_qualified_id_expr (tree qualifying_class, tree expr, bool done,
|
|||
/* If so, the expression may be relative to the current
|
||||
class. */
|
||||
if (!shared_member_p (fns)
|
||||
&& current_class_type
|
||||
&& current_class_type
|
||||
&& DERIVED_FROM_P (qualifying_class, current_class_type))
|
||||
expr = (build_class_member_access_expr
|
||||
expr = (build_class_member_access_expr
|
||||
(maybe_dummy_object (qualifying_class, NULL),
|
||||
expr,
|
||||
BASELINK_ACCESS_BINFO (expr),
|
||||
|
@ -1534,7 +1534,7 @@ finish_qualified_id_expr (tree qualifying_class, tree expr, bool done,
|
|||
/* Begin a statement-expression. The value returned must be passed to
|
||||
finish_stmt_expr. */
|
||||
|
||||
tree
|
||||
tree
|
||||
begin_stmt_expr (void)
|
||||
{
|
||||
return push_stmt_list ();
|
||||
|
@ -1552,7 +1552,7 @@ finish_stmt_expr_expr (tree expr, tree stmt_expr)
|
|||
|
||||
if (error_operand_p (expr))
|
||||
return error_mark_node;
|
||||
|
||||
|
||||
if (expr)
|
||||
{
|
||||
if (!processing_template_decl && !VOID_TYPE_P (TREE_TYPE (expr)))
|
||||
|
@ -1594,13 +1594,13 @@ finish_stmt_expr_expr (tree expr, tree stmt_expr)
|
|||
add_stmt (result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
finish_stmt ();
|
||||
|
||||
/* Remember the last expression so that finish_stmt_expr
|
||||
can pull it apart. */
|
||||
TREE_TYPE (stmt_expr) = result;
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1608,7 +1608,7 @@ finish_stmt_expr_expr (tree expr, tree stmt_expr)
|
|||
by the previous begin_stmt_expr. Returns an expression
|
||||
representing the statement-expression. */
|
||||
|
||||
tree
|
||||
tree
|
||||
finish_stmt_expr (tree stmt_expr, bool has_no_scope)
|
||||
{
|
||||
tree result, result_stmt, type;
|
||||
|
@ -1755,7 +1755,7 @@ perform_koenig_lookup (tree fn, tree args)
|
|||
|
||||
Returns code for the call. */
|
||||
|
||||
tree
|
||||
tree
|
||||
finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p)
|
||||
{
|
||||
tree result;
|
||||
|
@ -1820,7 +1820,7 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p)
|
|||
function call is transformed into a qualified function call
|
||||
using (*this) as the postfix-expression to the left of the
|
||||
. operator.... [Otherwise] a contrived object of type T
|
||||
becomes the implied object argument.
|
||||
becomes the implied object argument.
|
||||
|
||||
This paragraph is unclear about this situation:
|
||||
|
||||
|
@ -1829,9 +1829,9 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p)
|
|||
struct C : public A { void g() { B::f(); }};
|
||||
|
||||
In particular, for `B::f', this paragraph does not make clear
|
||||
whether "the class of that member function" refers to `A' or
|
||||
whether "the class of that member function" refers to `A' or
|
||||
to `B'. We believe it refers to `B'. */
|
||||
if (current_class_type
|
||||
if (current_class_type
|
||||
&& DERIVED_FROM_P (BINFO_TYPE (BASELINK_ACCESS_BINFO (fn)),
|
||||
current_class_type)
|
||||
&& current_class_ref)
|
||||
|
@ -1856,7 +1856,7 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p)
|
|||
}
|
||||
|
||||
result = build_new_method_call (object, fn, args, NULL_TREE,
|
||||
(disallow_virtual
|
||||
(disallow_virtual
|
||||
? LOOKUP_NONVIRTUAL : 0));
|
||||
}
|
||||
else if (is_overloaded_fn (fn))
|
||||
|
@ -1905,15 +1905,15 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p)
|
|||
is indicated by CODE, which should be POSTINCREMENT_EXPR or
|
||||
POSTDECREMENT_EXPR.) */
|
||||
|
||||
tree
|
||||
tree
|
||||
finish_increment_expr (tree expr, enum tree_code code)
|
||||
{
|
||||
return build_x_unary_op (code, expr);
|
||||
return build_x_unary_op (code, expr);
|
||||
}
|
||||
|
||||
/* Finish a use of `this'. Returns an expression for `this'. */
|
||||
|
||||
tree
|
||||
tree
|
||||
finish_this_expr (void)
|
||||
{
|
||||
tree result;
|
||||
|
@ -1945,7 +1945,7 @@ finish_this_expr (void)
|
|||
the TYPE for the type given. If SCOPE is non-NULL, the expression
|
||||
was of the form `OBJECT.SCOPE::~DESTRUCTOR'. */
|
||||
|
||||
tree
|
||||
tree
|
||||
finish_pseudo_destructor_expr (tree object, tree scope, tree destructor)
|
||||
{
|
||||
if (destructor == error_mark_node)
|
||||
|
@ -1960,7 +1960,7 @@ finish_pseudo_destructor_expr (tree object, tree scope, tree destructor)
|
|||
error ("invalid qualifying scope in pseudo-destructor name");
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
||||
/* [expr.pseudo] says both:
|
||||
|
||||
The type designated by the pseudo-destructor-name shall be
|
||||
|
@ -1974,7 +1974,7 @@ finish_pseudo_destructor_expr (tree object, tree scope, tree destructor)
|
|||
|
||||
We implement the more generous second sentence, since that is
|
||||
what most other compilers do. */
|
||||
if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (object),
|
||||
if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (object),
|
||||
destructor))
|
||||
{
|
||||
error ("%qE is not of type %qT", object, destructor);
|
||||
|
@ -2047,7 +2047,7 @@ tree
|
|||
finish_fname (tree id)
|
||||
{
|
||||
tree decl;
|
||||
|
||||
|
||||
decl = fname_decl (C_RID_CODE (id), id);
|
||||
if (processing_template_decl)
|
||||
decl = DECL_NAME (decl);
|
||||
|
@ -2056,7 +2056,7 @@ finish_fname (tree id)
|
|||
|
||||
/* Finish a translation unit. */
|
||||
|
||||
void
|
||||
void
|
||||
finish_translation_unit (void)
|
||||
{
|
||||
/* In case there were missing closebraces,
|
||||
|
@ -2072,7 +2072,7 @@ finish_translation_unit (void)
|
|||
/* Finish a template type parameter, specified as AGGR IDENTIFIER.
|
||||
Returns the parameter. */
|
||||
|
||||
tree
|
||||
tree
|
||||
finish_template_type_parm (tree aggr, tree identifier)
|
||||
{
|
||||
if (aggr != class_type_node)
|
||||
|
@ -2087,7 +2087,7 @@ finish_template_type_parm (tree aggr, tree identifier)
|
|||
/* Finish a template template parameter, specified as AGGR IDENTIFIER.
|
||||
Returns the parameter. */
|
||||
|
||||
tree
|
||||
tree
|
||||
finish_template_template_parm (tree aggr, tree identifier)
|
||||
{
|
||||
tree decl = build_decl (TYPE_DECL, identifier, NULL_TREE);
|
||||
|
@ -2119,7 +2119,7 @@ check_template_template_default_arg (tree argument)
|
|||
|
||||
/* Try to emit a slightly smarter error message if we detect
|
||||
that the user is using a template instantiation. */
|
||||
if (CLASSTYPE_TEMPLATE_INFO (t)
|
||||
if (CLASSTYPE_TEMPLATE_INFO (t)
|
||||
&& CLASSTYPE_TEMPLATE_INSTANTIATION (t))
|
||||
error ("invalid use of type %qT as a default value for a "
|
||||
"template template-parameter", t);
|
||||
|
@ -2168,7 +2168,7 @@ begin_class_definition (tree t)
|
|||
|
||||
/* Update the location of the decl. */
|
||||
DECL_SOURCE_LOCATION (TYPE_NAME (t)) = input_location;
|
||||
|
||||
|
||||
if (TYPE_BEING_DEFINED (t))
|
||||
{
|
||||
t = make_aggr_type (TREE_CODE (t));
|
||||
|
@ -2198,7 +2198,7 @@ begin_class_definition (tree t)
|
|||
(t, finfo->interface_unknown);
|
||||
}
|
||||
reset_specialization();
|
||||
|
||||
|
||||
/* Make a declaration for this class in its own scope. */
|
||||
build_self_reference ();
|
||||
|
||||
|
@ -2222,9 +2222,9 @@ finish_member_declaration (tree decl)
|
|||
gcc_assert (TREE_CHAIN (decl) == NULL_TREE);
|
||||
|
||||
/* Set up access control for DECL. */
|
||||
TREE_PRIVATE (decl)
|
||||
TREE_PRIVATE (decl)
|
||||
= (current_access_specifier == access_private_node);
|
||||
TREE_PROTECTED (decl)
|
||||
TREE_PROTECTED (decl)
|
||||
= (current_access_specifier == access_protected_node);
|
||||
if (TREE_CODE (decl) == TEMPLATE_DECL)
|
||||
{
|
||||
|
@ -2245,7 +2245,7 @@ finish_member_declaration (tree decl)
|
|||
/* Put functions on the TYPE_METHODS list and everything else on the
|
||||
TYPE_FIELDS list. Note that these are built up in reverse order.
|
||||
We reverse them (to obtain declaration order) in finish_struct. */
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL
|
||||
|| DECL_FUNCTION_TEMPLATE_P (decl))
|
||||
{
|
||||
/* We also need to add this function to the
|
||||
|
@ -2255,7 +2255,7 @@ finish_member_declaration (tree decl)
|
|||
TREE_CHAIN (decl) = TYPE_METHODS (current_class_type);
|
||||
TYPE_METHODS (current_class_type) = decl;
|
||||
|
||||
maybe_add_class_template_decl_list (current_class_type, decl,
|
||||
maybe_add_class_template_decl_list (current_class_type, decl,
|
||||
/*friend_p=*/0);
|
||||
}
|
||||
/* Enter the DECL into the scope of the class. */
|
||||
|
@ -2280,7 +2280,7 @@ finish_member_declaration (tree decl)
|
|||
list.) */
|
||||
|
||||
if (TREE_CODE (decl) == TYPE_DECL)
|
||||
TYPE_FIELDS (current_class_type)
|
||||
TYPE_FIELDS (current_class_type)
|
||||
= chainon (TYPE_FIELDS (current_class_type), decl);
|
||||
else
|
||||
{
|
||||
|
@ -2288,7 +2288,7 @@ finish_member_declaration (tree decl)
|
|||
TYPE_FIELDS (current_class_type) = decl;
|
||||
}
|
||||
|
||||
maybe_add_class_template_decl_list (current_class_type, decl,
|
||||
maybe_add_class_template_decl_list (current_class_type, decl,
|
||||
/*friend_p=*/0);
|
||||
}
|
||||
|
||||
|
@ -2319,7 +2319,7 @@ note_decl_for_pch (tree decl)
|
|||
comdat_linkage (decl);
|
||||
DECL_INTERFACE_KNOWN (decl) = 1;
|
||||
}
|
||||
|
||||
|
||||
/* There's a good chance that we'll have to mangle names at some
|
||||
point, even if only for emission in debugging information. */
|
||||
if (TREE_CODE (decl) == VAR_DECL
|
||||
|
@ -2365,7 +2365,7 @@ finish_template_type (tree name, tree args, int entering_scope)
|
|||
access_{default,public,protected_private}_node. For a virtual base
|
||||
we set TREE_TYPE. */
|
||||
|
||||
tree
|
||||
tree
|
||||
finish_base_specifier (tree base, tree access, bool virtual_p)
|
||||
{
|
||||
tree result;
|
||||
|
@ -2415,12 +2415,12 @@ qualified_name_lookup_error (tree scope, tree name, tree decl)
|
|||
else
|
||||
error ("%<::%D%> has not been declared", name);
|
||||
}
|
||||
|
||||
|
||||
/* ID_EXPRESSION is a representation of parsed, but unprocessed,
|
||||
id-expression. (See cp_parser_id_expression for details.) SCOPE,
|
||||
if non-NULL, is the type or namespace used to explicitly qualify
|
||||
ID_EXPRESSION. DECL is the entity to which that name has been
|
||||
resolved.
|
||||
resolved.
|
||||
|
||||
*CONSTANT_EXPRESSION_P is true if we are presently parsing a
|
||||
constant-expression. In that case, *NON_CONSTANT_EXPRESSION_P will
|
||||
|
@ -2439,12 +2439,12 @@ qualified_name_lookup_error (tree scope, tree name, tree decl)
|
|||
Return an expression for the entity, after issuing appropriate
|
||||
diagnostics. This function is also responsible for transforming a
|
||||
reference to a non-static member into a COMPONENT_REF that makes
|
||||
the use of "this" explicit.
|
||||
the use of "this" explicit.
|
||||
|
||||
Upon return, *IDK will be filled in appropriately. */
|
||||
|
||||
tree
|
||||
finish_id_expression (tree id_expression,
|
||||
finish_id_expression (tree id_expression,
|
||||
tree decl,
|
||||
tree scope,
|
||||
cp_id_kind *idk,
|
||||
|
@ -2467,13 +2467,13 @@ finish_id_expression (tree id_expression,
|
|||
|| TREE_CODE (decl) == TYPE_DECL)
|
||||
;
|
||||
/* Look up the name. */
|
||||
else
|
||||
else
|
||||
{
|
||||
if (decl == error_mark_node)
|
||||
{
|
||||
/* Name lookup failed. */
|
||||
if (scope
|
||||
&& (!TYPE_P (scope)
|
||||
if (scope
|
||||
&& (!TYPE_P (scope)
|
||||
|| (!dependent_type_p (scope)
|
||||
&& !(TREE_CODE (id_expression) == IDENTIFIER_NODE
|
||||
&& IDENTIFIER_TYPENAME_P (id_expression)
|
||||
|
@ -2529,13 +2529,13 @@ finish_id_expression (tree id_expression,
|
|||
|| TREE_CODE (decl) == TEMPLATE_PARM_INDEX)
|
||||
{
|
||||
tree r;
|
||||
|
||||
|
||||
*idk = CP_ID_KIND_NONE;
|
||||
if (TREE_CODE (decl) == TEMPLATE_PARM_INDEX)
|
||||
decl = TEMPLATE_PARM_DECL (decl);
|
||||
r = convert_from_reference (DECL_INITIAL (decl));
|
||||
|
||||
if (integral_constant_expression_p
|
||||
|
||||
if (integral_constant_expression_p
|
||||
&& !dependent_type_p (TREE_TYPE (decl))
|
||||
&& !(INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (r))))
|
||||
{
|
||||
|
@ -2547,7 +2547,7 @@ finish_id_expression (tree id_expression,
|
|||
}
|
||||
return r;
|
||||
}
|
||||
/* Similarly, we resolve enumeration constants to their
|
||||
/* Similarly, we resolve enumeration constants to their
|
||||
underlying values. */
|
||||
else if (TREE_CODE (decl) == CONST_DECL)
|
||||
{
|
||||
|
@ -2563,7 +2563,7 @@ finish_id_expression (tree id_expression,
|
|||
/* If the declaration was explicitly qualified indicate
|
||||
that. The semantics of `A::f(3)' are different than
|
||||
`f(3)' if `f' is virtual. */
|
||||
*idk = (scope
|
||||
*idk = (scope
|
||||
? CP_ID_KIND_QUALIFIED
|
||||
: (TREE_CODE (decl) == TEMPLATE_ID_EXPR
|
||||
? CP_ID_KIND_TEMPLATE_ID
|
||||
|
@ -2587,13 +2587,13 @@ finish_id_expression (tree id_expression,
|
|||
/* A template-id where the name of the template was not resolved
|
||||
is definitely dependent. */
|
||||
else if (TREE_CODE (decl) == TEMPLATE_ID_EXPR
|
||||
&& (TREE_CODE (TREE_OPERAND (decl, 0))
|
||||
&& (TREE_CODE (TREE_OPERAND (decl, 0))
|
||||
== IDENTIFIER_NODE))
|
||||
dependent_p = true;
|
||||
/* For anything except an overloaded function, just check its
|
||||
type. */
|
||||
else if (!is_overloaded_fn (decl))
|
||||
dependent_p
|
||||
dependent_p
|
||||
= dependent_type_p (TREE_TYPE (decl));
|
||||
/* For a set of overloaded functions, check each of the
|
||||
functions. */
|
||||
|
@ -2699,7 +2699,7 @@ finish_id_expression (tree id_expression,
|
|||
}
|
||||
*non_integral_constant_expression_p = true;
|
||||
}
|
||||
|
||||
|
||||
if (TREE_CODE (decl) == NAMESPACE_DECL)
|
||||
{
|
||||
error ("use of namespace %qD as expression", decl);
|
||||
|
@ -2728,7 +2728,7 @@ finish_id_expression (tree id_expression,
|
|||
|
||||
if (scope)
|
||||
{
|
||||
decl = (adjust_result_of_qualified_name_lookup
|
||||
decl = (adjust_result_of_qualified_name_lookup
|
||||
(decl, scope, current_class_type));
|
||||
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL)
|
||||
|
@ -2739,7 +2739,7 @@ finish_id_expression (tree id_expression,
|
|||
else
|
||||
{
|
||||
tree r = convert_from_reference (decl);
|
||||
|
||||
|
||||
if (processing_template_decl
|
||||
&& TYPE_P (scope))
|
||||
r = build2 (SCOPE_REF, TREE_TYPE (r), scope, decl);
|
||||
|
@ -2782,7 +2782,7 @@ finish_id_expression (tree id_expression,
|
|||
|| TREE_CODE (decl) == RESULT_DECL)
|
||||
{
|
||||
tree context = decl_function_context (decl);
|
||||
|
||||
|
||||
if (context != NULL_TREE && context != current_function_decl
|
||||
&& ! TREE_STATIC (decl))
|
||||
{
|
||||
|
@ -2793,20 +2793,20 @@ finish_id_expression (tree id_expression,
|
|||
return error_mark_node;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (DECL_P (decl) && DECL_NONLOCAL (decl)
|
||||
&& DECL_CLASS_SCOPE_P (decl)
|
||||
&& DECL_CONTEXT (decl) != current_class_type)
|
||||
{
|
||||
tree path;
|
||||
|
||||
|
||||
path = currently_open_derived_class (DECL_CONTEXT (decl));
|
||||
perform_or_defer_access_check (TYPE_BINFO (path), decl);
|
||||
}
|
||||
|
||||
|
||||
decl = convert_from_reference (decl);
|
||||
}
|
||||
|
||||
|
||||
/* Resolve references to variables of anonymous unions
|
||||
into COMPONENT_REFs. */
|
||||
if (TREE_CODE (decl) == ALIAS_DECL)
|
||||
|
@ -2850,7 +2850,7 @@ finish_typeof (tree expr)
|
|||
with equivalent CALL_EXPRs. */
|
||||
|
||||
static tree
|
||||
simplify_aggr_init_exprs_r (tree* tp,
|
||||
simplify_aggr_init_exprs_r (tree* tp,
|
||||
int* walk_subtrees,
|
||||
void* data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
|
@ -2919,7 +2919,7 @@ simplify_aggr_init_expr (tree *tp)
|
|||
{
|
||||
/* The return type might have different cv-quals from the slot. */
|
||||
tree fntype = TREE_TYPE (TREE_TYPE (fn));
|
||||
|
||||
|
||||
gcc_assert (TREE_CODE (fntype) == FUNCTION_TYPE
|
||||
|| TREE_CODE (fntype) == METHOD_TYPE);
|
||||
addr = convert (build_pointer_type (TREE_TYPE (fntype)), addr);
|
||||
|
@ -2928,7 +2928,7 @@ simplify_aggr_init_expr (tree *tp)
|
|||
args = tree_cons (NULL_TREE, addr, args);
|
||||
}
|
||||
|
||||
call_expr = build3 (CALL_EXPR,
|
||||
call_expr = build3 (CALL_EXPR,
|
||||
TREE_TYPE (TREE_TYPE (TREE_TYPE (fn))),
|
||||
fn, args, NULL_TREE);
|
||||
|
||||
|
@ -2963,7 +2963,7 @@ emit_associated_thunks (tree fn)
|
|||
if (DECL_VIRTUAL_P (fn))
|
||||
{
|
||||
tree thunk;
|
||||
|
||||
|
||||
for (thunk = DECL_THUNKS (fn); thunk; thunk = TREE_CHAIN (thunk))
|
||||
{
|
||||
if (!THUNK_ALIAS (thunk))
|
||||
|
@ -2972,7 +2972,7 @@ emit_associated_thunks (tree fn)
|
|||
if (DECL_RESULT_THUNK_P (thunk))
|
||||
{
|
||||
tree probe;
|
||||
|
||||
|
||||
for (probe = DECL_THUNKS (thunk);
|
||||
probe; probe = TREE_CHAIN (probe))
|
||||
use_thunk (probe, /*emit_p=*/1);
|
||||
|
@ -3024,7 +3024,7 @@ expand_body (tree fn)
|
|||
/* If this is a clone, go through the other clones now and mark
|
||||
their parameters used. We have to do that here, as we don't
|
||||
know whether any particular clone will be expanded, and
|
||||
therefore cannot pick one arbitrarily. */
|
||||
therefore cannot pick one arbitrarily. */
|
||||
tree probe;
|
||||
|
||||
for (probe = TREE_CHAIN (DECL_CLONED_FUNCTION (fn));
|
||||
|
|
380
gcc/cp/typeck.c
380
gcc/cp/typeck.c
File diff suppressed because it is too large
Load Diff
|
@ -236,7 +236,7 @@ int
|
|||
abstract_virtuals_error (tree decl, tree type)
|
||||
{
|
||||
VEC(tree,gc) *pure;
|
||||
|
||||
|
||||
/* This function applies only to classes. Any other entity can never
|
||||
be abstract. */
|
||||
if (!CLASS_TYPE_P (type))
|
||||
|
@ -251,11 +251,11 @@ abstract_virtuals_error (tree decl, tree type)
|
|||
void **slot;
|
||||
struct pending_abstract_type *pat;
|
||||
|
||||
gcc_assert (!decl || DECL_P (decl)
|
||||
gcc_assert (!decl || DECL_P (decl)
|
||||
|| TREE_CODE (decl) == IDENTIFIER_NODE);
|
||||
|
||||
if (!abstract_pending_vars)
|
||||
abstract_pending_vars = htab_create_ggc (31, &pat_calc_hash,
|
||||
abstract_pending_vars = htab_create_ggc (31, &pat_calc_hash,
|
||||
&pat_compare, NULL);
|
||||
|
||||
slot = htab_find_slot_with_hash (abstract_pending_vars, type,
|
||||
|
@ -302,7 +302,7 @@ abstract_virtuals_error (tree decl, tree type)
|
|||
cp_error_at ("invalid abstract return type for member function %q+#D",
|
||||
decl);
|
||||
else if (TREE_CODE (decl) == FUNCTION_DECL)
|
||||
cp_error_at ("invalid abstract return type for function %q+#D",
|
||||
cp_error_at ("invalid abstract return type for function %q+#D",
|
||||
decl);
|
||||
else if (TREE_CODE (decl) == IDENTIFIER_NODE)
|
||||
/* Here we do not have location information, so use error instead
|
||||
|
@ -319,7 +319,7 @@ abstract_virtuals_error (tree decl, tree type)
|
|||
{
|
||||
unsigned ix;
|
||||
tree fn;
|
||||
|
||||
|
||||
inform ("%J because the following virtual functions are pure "
|
||||
"within %qT:", TYPE_MAIN_DECL (type), type);
|
||||
|
||||
|
@ -331,7 +331,7 @@ abstract_virtuals_error (tree decl, tree type)
|
|||
VEC_truncate (tree, pure, 0);
|
||||
}
|
||||
else
|
||||
inform ("%J since type %qT has pure virtual functions",
|
||||
inform ("%J since type %qT has pure virtual functions",
|
||||
TYPE_MAIN_DECL (type), type);
|
||||
|
||||
return 1;
|
||||
|
@ -365,7 +365,7 @@ cxx_incomplete_type_diagnostic (tree value, tree type, int diag_type)
|
|||
p_msg = error;
|
||||
p_msg_at = cp_error_at;
|
||||
}
|
||||
|
||||
|
||||
/* Avoid duplicate error message. */
|
||||
if (TREE_CODE (type) == ERROR_MARK)
|
||||
return;
|
||||
|
@ -426,7 +426,7 @@ cxx_incomplete_type_diagnostic (tree value, tree type, int diag_type)
|
|||
else
|
||||
(*p_msg) ("insufficient contextual information to determine type");
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
@ -519,7 +519,7 @@ split_nonconstant_init_1 (tree dest, tree init)
|
|||
}
|
||||
}
|
||||
|
||||
/* A subroutine of store_init_value. Splits non-constant static
|
||||
/* A subroutine of store_init_value. Splits non-constant static
|
||||
initializer INIT into a constant part and generates code to
|
||||
perform the non-constant part of the initialization to DEST.
|
||||
Returns the code for the runtime init. */
|
||||
|
@ -659,7 +659,7 @@ digest_init (tree type, tree init, tree* tail)
|
|||
if (!complete_type_or_else (TREE_CODE (type) == ARRAY_TYPE
|
||||
? TREE_TYPE (type) : type, NULL_TREE))
|
||||
return error_mark_node;
|
||||
|
||||
|
||||
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
|
||||
if (TREE_CODE (init) == NON_LVALUE_EXPR)
|
||||
init = TREE_OPERAND (init, 0);
|
||||
|
@ -1233,7 +1233,7 @@ build_x_arrow (tree expr)
|
|||
types_memoized);
|
||||
}
|
||||
last_rval = expr;
|
||||
}
|
||||
}
|
||||
|
||||
if (last_rval == NULL_TREE)
|
||||
{
|
||||
|
@ -1288,12 +1288,12 @@ build_m_component_ref (tree datum, tree component)
|
|||
if (!TYPE_PTR_TO_MEMBER_P (ptrmem_type))
|
||||
{
|
||||
error ("%qE cannot be used as a member pointer, since it is of "
|
||||
"type %qT",
|
||||
"type %qT",
|
||||
component, ptrmem_type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
objtype = TYPE_MAIN_VARIANT (TREE_TYPE (datum));
|
||||
|
||||
objtype = TYPE_MAIN_VARIANT (TREE_TYPE (datum));
|
||||
if (! IS_AGGR_TYPE (objtype))
|
||||
{
|
||||
error ("cannot apply member pointer %qE to %qE, which is of "
|
||||
|
@ -1314,7 +1314,7 @@ build_m_component_ref (tree datum, tree component)
|
|||
else
|
||||
{
|
||||
binfo = lookup_base (objtype, ctype, ba_check, NULL);
|
||||
|
||||
|
||||
if (!binfo)
|
||||
{
|
||||
mismatch:
|
||||
|
@ -1334,15 +1334,15 @@ build_m_component_ref (tree datum, tree component)
|
|||
things are not as complex as they are for references to
|
||||
non-static data members. */
|
||||
type = cp_build_qualified_type (type,
|
||||
(cp_type_quals (type)
|
||||
(cp_type_quals (type)
|
||||
| cp_type_quals (TREE_TYPE (datum))));
|
||||
|
||||
datum = build_address (datum);
|
||||
|
||||
|
||||
/* Convert object to the correct base. */
|
||||
if (binfo)
|
||||
datum = build_base_path (PLUS_EXPR, datum, binfo, 1);
|
||||
|
||||
|
||||
/* Build an expression for "object + offset" where offset is the
|
||||
value stored in the pointer-to-data-member. */
|
||||
datum = build2 (PLUS_EXPR, build_pointer_type (type),
|
||||
|
@ -1391,9 +1391,9 @@ build_functional_cast (tree exp, tree parms)
|
|||
|
||||
/* Prepare to evaluate as a call to a constructor. If this expression
|
||||
is actually used, for example,
|
||||
|
||||
|
||||
return X (arg1, arg2, ...);
|
||||
|
||||
|
||||
then the slot being initialized will be filled in. */
|
||||
|
||||
if (!complete_type_or_else (type, NULL_TREE))
|
||||
|
@ -1435,12 +1435,12 @@ add_exception_specifier (tree list, tree spec, int complain)
|
|||
tree core = spec;
|
||||
bool is_ptr;
|
||||
int diag_type = -1; /* none */
|
||||
|
||||
|
||||
if (spec == error_mark_node)
|
||||
return list;
|
||||
|
||||
|
||||
gcc_assert (spec && (!list || TREE_VALUE (list)));
|
||||
|
||||
|
||||
/* [except.spec] 1, type in an exception specifier shall not be
|
||||
incomplete, or pointer or ref to incomplete other than pointer
|
||||
to cv void. */
|
||||
|
@ -1469,7 +1469,7 @@ add_exception_specifier (tree list, tree spec, int complain)
|
|||
if (ok)
|
||||
{
|
||||
tree probe;
|
||||
|
||||
|
||||
for (probe = list; probe; probe = TREE_CHAIN (probe))
|
||||
if (same_type_p (TREE_VALUE (probe), spec))
|
||||
break;
|
||||
|
@ -1478,7 +1478,7 @@ add_exception_specifier (tree list, tree spec, int complain)
|
|||
}
|
||||
else
|
||||
diag_type = 0; /* error */
|
||||
|
||||
|
||||
if (diag_type >= 0 && complain)
|
||||
cxx_incomplete_type_diagnostic (NULL_TREE, core, diag_type);
|
||||
|
||||
|
@ -1500,12 +1500,12 @@ merge_exception_specifiers (tree list, tree add)
|
|||
else
|
||||
{
|
||||
tree orig_list = list;
|
||||
|
||||
|
||||
for (; add; add = TREE_CHAIN (add))
|
||||
{
|
||||
tree spec = TREE_VALUE (add);
|
||||
tree probe;
|
||||
|
||||
|
||||
for (probe = orig_list; probe; probe = TREE_CHAIN (probe))
|
||||
if (same_type_p (TREE_VALUE (probe), spec))
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue