* parser.c (cp_parser_ctor_initializer_opt_and_function_body):
Make sure a constexpr ctor has an empty body.
* class.c (type_has_constexpr_default_constructor): New.
* cp-tree.h: Declare it.
* init.c (perform_member_init): Complain about uninitialized
member in constexpr ctor.
(emit_mem_initializers): And uninitialized base.
* decl.c (check_tag_decl): Fix typo.
* semantics.c (valid_type_in_constexpr_fundecl_p): New fn.
(is_valid_constexpr_fn): New fn.
(validate_constexpr_fundecl): Use it.
* decl.c (validate_constexpr_redeclaration): New.
(duplicate_decls): Use it.
(cp_finish_decl): Call validate_constexpr_fundecl and
ensure_literal_type_for_constexpr_object here.
(start_decl): Not here. Don't ICE on constexpr reference.
(check_for_uninitialized_const_var): Don't handle constexpr specially.
(grokfndecl): Set DECL_DECLARED_CONSTEXPR_P.
(check_static_variable_definition): Give friendly message about
missing constexpr.
(grokdeclarator): Complain about typedef and volatile with constexpr.
Reorganize. Give sorry about non-static data members in C++0x mode.
(start_preparsed_function): Check validate_constexpr_fundecl here.
(check_function_type): Not here.
* decl2.c (finish_static_data_member_decl): Don't complain about
in-class init.
* parser.c (CP_PARSER_FLAGS_ONLY_TYPE_OR_CONSTEXPR): New.
(cp_parser_condition): Pass it to cp_parser_decl_specifier_seq.
(cp_parser_decl_specifier_seq): Handle it.
(cp_parser_explicit_instantiation): Diagnose inline and constexpr.
Co-Authored-By: Jason Merrill <jason@redhat.com>
From-SVN: r166013
* config/i386/w32-unwind.h (i386_w32_fallback_frame_state): Fix regnum
of EBP. Do not restore reg #9. Remove +1 adjustment to EIP and set
fs->signal_frame instead.
Co-Authored-By: Olivier Hainque <hainque@adacore.com>
From-SVN: r165998
In gcc/:
2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
* c-parser.c (c_parser_objc_at_property_declaration): Recognize
RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
Do not use objc_set_property_attr, but use local variables
instead. Detect repeated usage of setter, getter and ivar
attributes. Improved error processing when a setter name does not
end in ':'. Do not check for CPP_CLOSE_PAREN after we determined
that the token is a keyword. Updated call to
objc_add_property_declaration.
In gcc/cp/:
2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
* parser.c (cp_parser_objc_at_property_declaration): Recognize
RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
Do not use objc_set_property_attr, but use local variables
instead. Detect repeated usage of setter, getter and ivar
attributes. Improved error processing when a setter name does not
end in ':'. Do not check for CPP_CLOSE_PAREN after we determined
that the token is a keyword. Updated call to
objc_add_property_declaration.
In gcc/c-family/:
2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
* c-common.h (enum rid): Added RID_READWRITE, RID_ASSIGN,
RID_RETAIN, RID_COPY and RID_NONATOMIC. Updated RID_FIRST_PATTR
and RID_LAST_PATTR.
(objc_add_property_declaration): Added additional arguments.
(objc_property_attribute_kind): Removed.
(objc_set_property_attr): Removed.
* c-common.c (c_common_reswords): Added readwrite, assign, retain,
copy and nonatomic.
* stub-objc.c (objc_add_property_declaration): Added additional
arguments.
(objc_set_property_attr): Removed.
In gcc/objc/:
2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
* objc-act.c (objc_add_property_declaration): Added arguments to
pass the various property attributes that were parsed with the
property declaration. Process arguments to determine the final
property attributes and produce error messages as appropriate.
Added temporary code to keep the compiler silent about variables
set but not used - for new attributes that are only checked but
have no effect yet.
(property_readonly): Removed.
(property_setter): Removed.
(property_getter): Removed.
(property_ivar): Removed.
(property_copies): Removed.
(objc_set_property_attr): Removed.
* objc-act.h (enum property_assign_semantics): New.
In gcc/testsuite/:
2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
* obj-c.dg/property/at-property-4.m: New.
* obj-c++.dg/property/at-property-4.mm: New.
* obj-c++.dg/property/property-neg-5.m: Updated testcase for
updates in warning.
* obj-c++.dg/property/property-neg-5.mm: Updated testcase for
updates in warning.
From-SVN: r165997
In gcc/:
2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
* c-parser.c (c_parser_objc_at_property): Renamed to
c_parser_objc_at_property_declaration. Updated calls to
objc_add_property_variable, now objc_add_property_declaration.
Code rewritten to be much more robust in recovering from syntax
errors. Added comments.
(c_parser_objc_property_attrlist): Removed.
(c_parser_external_declaration): Updated calls to
c_parser_objc_at_property, now
c_parser_objc_at_property_declaration.
(c_parser_objc_methodprotolist): Same change.
In gcc/c-family/:
2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
* c-common.h (objc_add_property_variable): Renamed to
objc_add_property_declaration. Added location argument.
* stub-objc.c (objc_add_property_variable): Same change.
In gcc/cp/:
2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
* parser.c (cp_parser_objc_property_decl): Renamed to
cp_parser_objc_struct_declaration. Return the parsed trees
instead of calling objc_add_property_variable directly. Detect
missing or invalid declspecs. Implemented attributes. Do not eat
the ';' at the end. Exit loop whenever a non-comma is parsed, not
just EOF.
(cp_parser_objc_at_property): Renamed to
cp_parser_objc_at_property_declaration. Updated calls to
objc_add_property_variable, now objc_add_property_declaration, and
to cp_parser_objc_property_decl, now
cp_parser_objc_struct_declaration. Rewritten all code to be more
robust in dealing with syntax errors, and almost identical to the
one in c_parser_objc_at_property_declaration.
(cp_parser_objc_property_attrlist): Removed.
(cp_parser_objc_method_prototype_list): Updated call to
cp_parser_objc_at_property.
(cp_parser_objc_method_definition_list): Same change.
(cp_parser_objc_class_ivars): Detect a number of invalid
declarations of instance variables and produce errors when they
are found.
In gcc/objc/:
2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
* objc-act.c (objc_add_property_variable): Renamed to
objc_add_property_declaration. Added location argument. Updated
warnings and errors to use it. Use error, not fatal_error, if a
property declaration is found outside an interface or
implementation context.
In gcc/testsuite/:
2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/property/at-property-1.m: New.
* objc.dg/property/at-property-2.m: New.
* objc.dg/property/at-property-3.m: New.
* objc.dg/ivar-invalid-type-1.m: New.
* obj-c++.dg/property/at-property-1.mm: New.
* obj-c++.dg/property/at-property-2.mm: New.
* obj-c++.dg/property/at-property-3.mm: New.
* obj-c++.dg/ivar-invalid-type-1.mm: New.
* objc.dg/property/property-neg-6.m: Updated testcase for updates
in error reporting.
From-SVN: r165996
* ipa.c (process_references): Enqueue all referenced nodes;
mark as reachable only non-external nodes.
(cgraph_remove_unreachable_nodes): All referenced nodes should
be enqueued; remove bogues node->needed check.
From-SVN: r165990
* ipa.c (process_references): Enqueue all referenced nodes;
mark as reachable only non-external nodes.
(cgraph_remove_unreachable_nodes): All referenced nodes should
be enqueued; remove bogues node->needed check.
From-SVN: r165988
* lto.c (add_cgraph_node_to_partition,
add_varpool_node_to_partition): Add debug info.
(lto_1_to_1_map, lto_balanced_map): Do not re-add already
partitioned nodes.
(do_whole_program_analysis): Set function flags before dumping.
From-SVN: r165984
2010-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/46010
* io/list_read.c (nml_parse_qualifier): Add additional conditions for
setting the end index for loop specification. Fix some whitespace.
* io/write.c (write_default_char4): Const-ify the source argument.
From-SVN: r165979
* tree.c (build_vec_init_expr): Split out from...
(build_array_copy): ...here.
* init.c (perform_member_init): Use it.
* cp-tree.h: Declare it.
* cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for
VEC_INIT_EXPR and AGGR_INIT_EXPR here. Drop pre/post parameters.
(cp_gimplify_expr): Handle array default-initialization via
VEC_INIT_EXPR.
From-SVN: r165976
* varasm.c (constructor_static_from_elts_p): Don't require a
CONSTRUCTOR to have elements to be suitable for static
initialization. Allow ARRAY_TYPE as well.
From-SVN: r165975
PR middle-end/45736
* cgraph.c (cgraph_set_readonly_flag): Rename to...
(cgraph_set_const_flags) ... this one; get also looping argument;
clear constructor/destructor flags.
(cgraph_set_pure_flag): Likewise.
(cgraph_set_looping_const_or_pure_flag): Remove.
(cgraph_can_remove_if_no_direct_calls_and_refs): Do not try
to optimize away static ctors/dtors; it does not work on inline clones;
external functions can always be rmeoved.
(cgraph_will_be_removed_from_program_if_no_direct_calls): Assert on inline
clones; in LTO external functions always can go.
(cgraph_used_from_object_file_p): Handle EXTERNAL functions correctly.
(cgraph_mark_address_taken_node): Assert that we are not taking address of
inline clone.
(cgraph_can_remove_if_no_direct_calls_p): We always eventually remove
external functions.
* ipa-cp.c (ipcp_cloning_candidate_p): Do not clone functions with address taken.
(ipcp_initialize_node_lattices): Only local functions can be handled without cloning.
* cgraph.h (cgraph_set_readonly_flag,
cgraph_set_looping_const_or_pure_flag): Remove.
(cgraph_set_const_flag): Declare.
(cgraph_set_pure_flag): Update.
* ipa-pure-const (propagate_pure_const, local_pure_const): Update
flags setting code.
* ipa.c (cgraph_remove_unreachable_nodes): Fix formating; do not look at inline
clones; fix handling of external definitions.
(cgraph_postorder): Do not look at inline clones in the first pass.
(function_and_variable_visibility): Drop constructors/destructor
flags at pure and const functions.
* tree-profile.c (tree_profiling): Update.
* ipa-inline.c (cgraph_clone_inlined_nodes): Always clone functions with
address taken; external functions do not account to whole program size.
(cgraph_decide_inlining): Likewise; do not try to inline functions already
inlined.
* testsuite/gcc.dg/lto/pr45736_0.c: New function.
From-SVN: r165972