OSDN Git Service

/cp
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
index 4ce77d4..8b15ca6 100644 (file)
@@ -1,3 +1,446 @@
+2011-09-14  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/50391
+       * pt.c (regenerate_decl_from_template): Don't pass an error_mark_node
+       to build_exception_variant.
+
+2011-09-13  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/48320
+       * pt.c (template_parameter_pack_p): Support TEMPLATE_PARM_INDEX
+       nodes.  Add a comment.
+       (arg_from_parm_pack_p):  New static function, factorized out from
+       tsubst_pack_expansion and extended to support non-type parameter
+       packs represented with TEMPLATE_PARM_INDEX nodes.
+       (tsubst_pack_expansion): Use arg_from_parm_pack_p.
+
+2011-09-12  Jason Merrill  <jason@redhat.com>
+
+       * pt.c (type_unification_real): Fix handling of DEDUCE_CONV
+       with no deducible template parameters.
+       * call.c (rejection_reason_code): Add rr_template_conversion.
+       (print_z_candidate): Handle it.
+       (template_conversion_rejection): New.
+       (build_user_type_conversion_1): Use it.
+
+       * call.c (merge_conversion_sequences): Set bad_p and user_conv_p
+       on all of the second conversion sequence.
+       (build_user_type_conversion_1): Set bad_p on the ck_user conv.
+       (convert_like_real): Handle bad ck_ref_bind with user_conv_p in the
+       first section.  Fix loop logic.
+       (initialize_reference): Call convert_like for diagnostics when
+       we have a (bad) conversion.
+
+       * call.c (convert_class_to_reference)
+       (convert_class_to_reference_1): Remove.
+       (reference_binding): Use build_user_type_conversion_1 instead.
+
+       * call.c (initialize_reference): Add flags parm.
+       * decl.c (grok_reference_init): Likewise.
+       (check_initializer): Pass it.
+       * typeck.c (convert_for_initialization): Likewise.
+       * cp-tree.h: Adjust.
+
+       * cp-tree.h (LOOKUP_NO_RVAL_BIND): New.
+       * call.c (conditional_conversion): Use it.
+       (reference_binding): Fix handling of xvalues.
+
+2011-09-09  Jason Merrill  <jason@redhat.com>
+
+       * call.c (implicit_conversion): Check BRACE_ENCLOSED_INITIALIZER_P
+       before forcing instantiation.
+
+2011-09-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/50324
+       * typeck2.c (digest_init_r): Call complete_type_or_maybe_complain
+       instead of complete_type_or_else.
+
+2011-09-08  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/33255 - Support -Wunused-local-typedefs warning
+       * name-lookup.c (pushdecl_maybe_friend_1): Use the new
+       record_locally_defined_typedef.
+       * decl.c (finish_function): Use the new
+       maybe_warn_unused_local_typedefs.
+       (grokfield): Use the new record_locally_defined_typedef.
+       * parser.c (lookup_name): Use the new maybe_record_typedef_use.
+
+2011-09-07  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/50309
+       * decl.c (grokdeclarator): Check u.function.exception_specification
+       for error_mark_node.
+
+2011-09-07  Jason Merrill  <jason@redhat.com>
+
+       PR c++/50298
+       * parser.c (cp_parser_member_declaration): Don't require a constant
+       rvalue here in C++0x.
+
+       * pt.c (type_unification_real): Correct complain arg for tsubsting
+       default template args.
+
+       * pt.c (tsubst_aggr_type): Check TYPE_P before tsubsting.
+
+2011-09-06  Jason Merrill  <jason@redhat.com>
+
+       PR c++/50296
+       * semantics.c (register_constexpr_fundef): Call is_valid_constexpr_fn.
+       (cx_check_missing_mem_inits): Handle bases and empty trivial members.
+       (validate_constexpr_fundecl): Remove.
+       * decl.c (start_preparsed_function): Don't call it.
+       * cp-tree.h: Don't declare it.
+
+2011-09-04  Jason Merrill  <jason@redhat.com>
+
+       PR c++/49267
+       * call.c (reference_binding): Don't set is_lvalue for an rvalue
+       reference rfrom.
+
+       PR c++/49267
+       PR c++/49458
+       DR 1328
+       * call.c (reference_binding): Set rvaluedness_matches_p properly
+       for reference to function conversion ops.
+       (compare_ics): Adjust.
+
+       * class.c (trivial_default_constructor_is_constexpr): Rename from
+       synthesized_default_constructor_is_constexpr.
+       (type_has_constexpr_default_constructor): Adjust.
+       (add_implicitly_declared_members): Call it instead.
+       (explain_non_literal_class): Explain about non-constexpr default ctor.
+       * cp-tree.h: Adjust.
+       * method.c (synthesized_method_walk): Adjust.
+       * semantics.c (explain_invalid_constexpr_fn): Handle defaulted
+       functions, too.
+
+       PR c++/50248
+       Core 1358
+       * init.c (perform_member_init): Don't diagnose missing inits here.
+       (emit_mem_initializers): Or here.
+       * method.c (process_subob_fn): Don't instantiate constexpr ctors.
+       * semantics.c (cx_check_missing_mem_inits): New.
+       (explain_invalid_constexpr_fn): Call it.
+       (register_constexpr_fundef): Likewise.  Leave
+       DECL_DECLARED_CONSTEXPR_P set when the body is unsuitable.
+       (cxx_eval_call_expression): Adjust diagnostics.
+       (cxx_eval_constant_expression): Catch use of 'this' in a constructor.
+
+2011-08-30  Jason Merrill  <jason@redhat.com>
+
+       PR c++/50084
+       * cp-tree.h (cp_decl_specifier_seq): Rename user_defined_type_p
+       to type_definition_p.
+       * parser.c (cp_parser_set_decl_spec_type): Likewise.
+       * decl.c (grokdeclarator): Check it.
+
+       PR c++/50089
+       * semantics.c (finish_id_expression): Use
+       current_nonlambda_class_type for qualified-ids.
+
+       PR c++/50114
+       * decl.c (poplevel): Disable for scope compatibility hack
+       in C++11 mode.
+
+       PR c++/50220
+       * semantics.c (add_capture): Call complete_type for copy.
+
+       PR c++/50234
+       * semantics.c (cxx_eval_component_reference): Handle
+       value-initialization for omitted initializers.
+
+2011-08-29  Jason Merrill  <jason@redhat.com>
+
+       PR c++/50224
+       * semantics.c (finish_id_expression): Mark captured variables used.
+
+2011-08-29  Jakub Jelinek  <jakub@redhat.com>
+           Jason Merrill  <jason@redhat.com>
+
+       PR c++/50207
+       * class.c (finish_struct_1): Complain if the first field is
+       artificial.
+
+2011-08-29  Jason Merrill  <jason@redhat.com>
+
+       PR c++/50209
+       Core DR 994
+       * parser.c (cp_parser_default_argument): Use
+       cp_parser_initializer_clause.
+       (cp_parser_late_parsing_default_args): Likewise.
+
+2011-08-26  Jason Merrill  <jason@redhat.com>
+
+       Core DR 342
+       PR c++/48582
+       * pt.c (check_valid_ptrmem_cst_expr): A null member pointer value
+       is valid in C++11.
+       (convert_nontype_argument): Likewise.  Implicitly convert nullptr
+       and do constant folding.
+       * mangle.c (write_template_arg_literal): Mangle null member
+       pointer values as 0.
+       * call.c (null_member_pointer_value_p): New.
+       * cp-tree.h: Declare it.
+
+2011-08-25  Jason Merrill  <jason@redhat.com>
+
+       * call.c (convert_like_real): Remove redundant complain checks.
+
+       PR c++/50157
+       * call.c (convert_like_real): Exit early if bad and !tf_error.
+
+2011-08-23  Jason Merrill  <jason@redhat.com>
+
+       * typeck2.c (build_functional_cast): Don't try to avoid calling
+       build_value_init.
+       * pt.c (instantiate_class_template_1): Don't copy TYPE_HAS_* flags.
+
+2011-08-23  Jason Merrill  <jason@redhat.com>
+
+       PR c++/49045
+       Core 1321
+       * tree.c (dependent_name): New.
+       (cp_tree_equal): Two calls with the same dependent name are
+       equivalent even if the overload sets are different.
+
+2011-08-23  Jason Merrill  <jason@redhat.com>
+
+       * tree.c (build_target_expr): Set TREE_CONSTANT on
+       literal TARGET_EXPR if the value is constant.
+       * typeck2.c (build_functional_cast): Don't set it here.
+
+2011-08-23  Jason Merrill  <jason@redhat.com>
+
+       Core 903 (partial)
+       * call.c (null_ptr_cst_p): Only 0 qualifies in C++11.
+
+2011-08-23  Jason Merrill  <jason@redhat.com>
+
+       Core 975
+       * decl.c (cxx_init_decl_processing): Initialize
+       dependent_lambda_return_type_node.
+       * cp-tree.h (cp_tree_index): Add CPTI_DEPENDENT_LAMBDA_RETURN_TYPE.
+       (dependent_lambda_return_type_node): Define.
+       (DECLTYPE_FOR_LAMBDA_RETURN): Remove.
+       * semantics.c (lambda_return_type): Handle overloaded function.
+       Use dependent_lambda_return_type_node instead of
+       DECLTYPE_FOR_LAMBDA_RETURN.
+       (apply_lambda_return_type): Don't check dependent_type_p.
+       * pt.c (tsubst_copy_and_build): Handle lambda return type deduction.
+       (instantiate_class_template_1): Likewise.
+       (tsubst): Don't use DECLTYPE_FOR_LAMBDA_RETURN.
+       * mangle.c (write_type): Likewise.
+       * typeck.c (structural_comptypes): Likewise.
+       (check_return_expr): Handle dependent_lambda_return_type_node.
+
+2011-08-23  Jason Merrill  <jason@redhat.com>
+
+       PR c++/50024
+       * semantics.c (maybe_constant_value): Don't try to fold { }.
+       * pt.c (build_non_dependent_expr): Don't wrap { }.
+       * init.c (build_value_init): Allow scalar value-init in templates.
+
+2011-08-23  Jason Merrill  <jason@redhat.com>
+
+       * semantics.c (potential_constant_expression_1): Allow 'this'.
+
+2011-08-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/50158
+       * typeck.c (cp_build_modify_expr): Call mark_rvalue_use on rhs
+       if it has side-effects and needs to be preevaluated.
+
+2011-08-23  Siddhesh Poyarekar  <siddhesh.poyarekar@gmail.com>
+
+       PR c++/50055
+       * except.c (begin_eh_spec_block): Build EH_SPEC block on the
+       same line as the function.
+
+2011-08-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/46862
+       * class.c (finish_struct_1): If TYPE_TRANSPARENT_AGGR is set on a type
+       which doesn't have any fields, clear it and diagnose.
+
+2011-08-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+           Marc Glisse  <marc.glisse@normalesup.org>
+
+       PR libstdc++-v3/1773
+       * mangle.c (decl_mangling_context): Call
+       targetm.cxx.decl_mangling_context.
+       (write_unscoped_name): Use decl_mangling_context.
+
+2011-08-18  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/45625
+       * pt.c (parameter_of_template_p): Handle comparison with DECLs of
+       template parameters as created by process_template_parm.
+
+2011-08-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/50086
+       * pt.c (unify_pack_expansion): Correct overloaded unification
+       logic.
+
+       * pt.c (instantiate_class_template_1): If DECL_PRESERVE_P is set
+       on a member function or static data member, call mark_used.
+
+       PR c++/50054
+       * typeck2.c (cxx_incomplete_type_diagnostic): Handle
+       init_list_type_node.
+
+2011-08-13  Jason Merrill  <jason@redhat.com>
+
+       PR c++/50075
+       * name-lookup.c (local_bindings_p): New.
+       * name-lookup.h: Declare it.
+       * lex.c (unqualified_name_lookup_error): Use it.
+
+       PR c++/50059
+       * error.c (dump_expr): Handle MODIFY_EXPR properly.
+
+       * decl.c (grok_reference_init): Handle constexpr here.
+       * call.c (initialize_reference): Not here.
+
+2011-08-12  David Li  <davidxl@google.com>
+
+       * class.c (update_vtable_entry_for_fn): Set
+       LOST_PRIMARY bit properly.
+
+2011-08-12  Jason Merrill  <jason@redhat.com>
+
+       PR c++/50034
+       * call.c (convert_arg_to_ellipsis): force_rvalue only in
+       potentially evaluated context.
+
+2011-08-12  Richard Guenther  <rguenther@suse.de>
+
+       * call.c (build_over_call): Instead of memcpy use an
+       assignment of two MEM_REFs.
+
+2011-08-11  Romain Geissler  <romain.geissler@gmail.com>
+            Brian Hackett  <bhackett1024@gmail.com>
+
+       * decl.c (cp_finish_decl): Invoke callbacks on finish_decl event.
+
+2011-08-10  Richard Guenther  <rguenther@suse.de>
+
+       * call.c (build_over_call): Call memcpy unconditionally.
+
+2011-08-08  Jason Merrill  <jason@redhat.com>
+
+       PR c++/50020
+       * semantics.c (finish_call_expr): Don't look at 'this' if we
+       had an explicit object argument.
+
+       PR c++/50011
+       * typeck2.c (check_narrowing): Fix integer logic.
+
+2011-08-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * Make-lang.in (g++$(exeext)): Add $(EXTRA_GCC_LIBS).
+
+2011-08-05  Jason Merrill  <jason@redhat.com>
+
+       PR c++/48993
+       * semantics.c (potential_constant_expression_1) [CALL_EXPR]: Sorry
+       on 'this' in a constructor.
+
+       PR c++/49921
+       * semantics.c (finish_decltype_type): Call invalid_nonstatic_memfn_p.
+
+       PR c++/49669
+       * init.c (perform_member_init): Handle invalid array initializer.
+
+       PR c++/49988
+       * semantics.c (cxx_eval_array_reference): Handle failure to
+       reduce the array operand to something we can work with.
+
+2011-08-05  Gabriel Charette  <gchare@google.com>
+
+       * decl.c (finish_function): Remove unecessary line 0 hack.
+
+2011-08-05  Jason Merrill  <jason@redhat.com>
+
+       PR c++/47453
+       * typeck.c (build_x_compound_expr_from_list): Also complain
+       about ({...}).
+
+       PR c++/49812
+       * typeck.c (cp_build_unary_op) [POSTINCREMENT_EXPR]: Strip cv-quals.
+
+       PR c++/49983
+       * parser.c (cp_parser_range_for): Only do auto deduction in
+       template if the range is non-dependent.
+
+       * init.c (perform_member_init): Always build_aggr_init
+       for a class member with an explicit mem-initializer.
+
+       * pt.c (unify) [TEMPLATE_TYPE_PARM]: Allow VLA for C++0x 'auto'.
+
+2011-08-04  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/49905
+       * decl.c (cxx_init_decl_processing): Add alloc_size (1) attribute
+       for operator new and operator new [].  Call init_attributes.
+
+2011-08-02  Jason Merrill  <jason@redhat.com>
+
+       PR c++/43886
+       * parser.c (cp_parser_lambda_body): Clear local_variables_forbidden_p.
+
+       PR c++/49577
+       * typeck2.c (check_narrowing): Check unsigned mismatch.
+       * semantics.c (finish_compound_literal): check_narrowing.
+
+       PR c++/49593
+       * pt.c (find_parameter_packs_r): Handle CONSTRUCTOR.
+
+       PR c++/49803
+       * init.c (sort_mem_initializers): Initialize uses_unions_p here.
+       (build_field_list): Not here.
+
+       PR c++/49834
+       * parser.c (build_range_temp): Split out from...
+       (cp_convert_range_for): ...here.
+       (do_range_for_auto_deduction): New.
+       (cp_parser_range_for): Use it.
+
+2011-08-02  Jakub Jelinek  <jakub@redhat.com>
+
+       * cp-tree.h (finish_omp_atomic): Adjust prototype.
+       (cxx_omp_const_qual_no_mutable): New prototype.
+       (finish_omp_taskyield): New prototype.
+       * parser.c (cp_parser_omp_atomic): (cp_parser_omp_atomic): Handle
+       parsing OpenMP 3.1 atomics.  Adjust finish_omp_atomic caller.
+       (cp_parser_omp_clause_name): Handle final and mergeable clauses.
+       (cp_parser_omp_clause_final, cp_parser_omp_clause_mergeable): New
+       functions.
+       (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FINAL
+       and PRAGMA_OMP_CLAUSE_MERGEABLE.
+       (OMP_TASK_CLAUSE_MASK): Allow final and mergeable clauses.
+       (cp_parser_omp_taskyield): New function.
+       (cp_parser_pragma): Handle PRAGMA_OMP_TASKYIELD.
+       (cp_parser_omp_clause_reduction): Handle min and max.
+       * pt.c (tsubst_expr) <case OMP_ATOMIC>: Handle OpenMP 3.1 atomics.
+       (tsubst_omp_clauses): Handle OMP_CLAUSE_FINAL and
+       OMP_CLAUSE_MERGEABLE.
+       * semantics.c (finish_omp_atomic): Add OPCODE, V, LHS1 and RHS1
+       arguments.  Handle OpenMP 3.1 atomics.  Adjust c_finish_omp_atomic
+       caller.
+       (finish_omp_clauses): Don't complain about const qualified
+       predetermined vars and static data members in firstprivate clause.
+       Handle OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE. Handle MIN_EXPR
+       and MAX_EXPR.
+       (finish_omp_taskyield): New function.
+       * cp-gimplify.c (cxx_omp_const_qual_no_mutable): New function.
+       (cxx_omp_predetermined_sharing): Use it.
+
+2011-08-02  Jason Merrill  <jason@redhat.com>
+
+       * call.c (build_call_a): Also check at_function_scope_p.
+
 2011-08-01  Jason Merrill  <jason@redhat.com>
 
        PR c++/49932