PR c++/54401 - Confusing diagnostics about type-alias at class scope
[gcc.git] / gcc / cp / ChangeLog
index 5d091838d928244ce246c878cb8b9a7d0b66abbd..81c20488a37dd6b237af869aef1fb9c0a53758e5 100644 (file)
@@ -1,3 +1,532 @@
+2012-12-07  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/54401
+       * parser.c (cp_parser_alias_declaration): Commit to tentative
+       parse when see the '=' token.  Get out if the type-id is invalid.
+       Update function comment.
+       (cp_parser_member_declaration): Don't try to parse a using
+       declaration if we know that we expected an alias declaration; that
+       is, if we see the '=' token after the identifier.
+
+2012-12-06  Jason Merrill  <jason@redhat.com>
+
+       PR c++/54325
+       * tree.c (build_aggr_init_expr): Don't check for abstract class.
+       (build_cplus_new): Check here instead.
+
+       PR c++/55058
+       * pt.c (tsubst): Keep the quals when looking through a typedef.
+
+       PR c++/55249
+       * tree.c (build_vec_init_elt): Use the type of the initializer.
+
+       PR c++/54744
+       * pt.c (resolve_typename_type): Check TYPENAME_IS_RESOLVING_P on scope.
+       * init.c (expand_member_init): Check for being in a template first.
+       * parser.c (cp_parser_mem_initializer_list): Only check class types
+       for equivalence to the current class.
+
+       PR c++/54913
+       * semantics.c (finish_qualified_id_expr): convert_from_reference
+       after building a SCOPE_REF.
+
+2012-12-06  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/54207
+       * except.c (build_noexcept_spec): Avoid direct comparison
+       with boolean_true_node or boolean_false_node, instead use
+       operand_equal_p and/or INTEGER_CST check.
+       * pt.c (tsubst_exception_specification): Likewise.
+       * typeck2.c (merge_exception_specifiers): Likewise.
+
+2012-12-06  Marc Glisse  <marc.glisse@inria.fr>
+
+       PR c++/55573
+       * semantics.c (adjust_temp_type): Handle VECTOR_CST.
+
+2012-12-06  Jason Merrill  <jason@redhat.com>
+
+       PR c++/54947
+       * parser.c (cp_parser_initializer_list): Don't require an
+       expression in [] to be constant until we know it's a C99
+       designator.
+
+       PR c++/55015
+       PR c++/53821
+       * semantics.c (maybe_add_lambda_conv_op): Revert earlier change.
+       * decl.c (start_preparsed_function): Make local class methods comdat
+       in templates, too.
+
+       PR c++/54653
+       * parser.c (cp_parser_class_head): A partial specialization scope
+       counts as a template.
+       * pt.c (tsubst_template_parms): Handle template template parm parms.
+       (tsubst_decl) [TEMPLATE_DECL]: Handle getting a template template
+       argument back.
+
+       PR c++/55564
+       * pt.c (unify) [ARRAY_TYPE]: Unify the element type before the bounds.
+
+2012-12-03  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/54170
+       * cvt.c (cp_convert_to_pointer): Don't discard side-effects from
+       expressions of nullptr_t.
+       * typeck.c (build_ptrmemfunc): Likewise.
+
+2012-12-01  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/55542
+       * pt.c (make_ith_pack_parameter_name): Return NULL if
+       name is NULL.
+       (tsubst_decl): Call make_ith_pack_parameter_name even if
+       DECL_NAME is NULL.
+
+2012-11-29  Jason Merrill  <jason@redhat.com>
+
+       PR c++/53137
+       * pt.c (tsubst_expr) [DECL_EXPR]: Set LAMBDA_EXPR_THIS_CAPTURE here.
+       (tsubst_copy_and_build) [LAMBDA_EXPR]: And clear it here.
+       (instantiate_class_template_1): Not here.
+
+2012-11-29  Marc Glisse  <marc.glisse@inria.fr>
+
+       PR c++/53094
+       * cvt.c (ocp_convert): Call convert_to_vector.
+
+2012-11-29  Kai Tietz  <ktietz@redhat.com>
+
+       PR target/53912
+       * class.c (dump_class_hierarchy_r): Cast from pointer via uintptr_t.
+       (dump_vtable): Likewise.
+
+2012-11-29  Ed Smith-Rowland  <3dw4rd@verizon.net>
+
+       PR c++/52654
+       * parser.c (cp_parser_string_literal): Add overflow_type arg.
+       (cp_parser_userdef_numeric_literal): Warn on numeric overflow.
+
+2012-11-28  Andrew Pinski  <apinski@cavium.com>
+
+       PR bootstrap/54279
+       * Make-lang.in (g++$(exeext)): Rename to
+       (xg++$(exeext)): This.
+       (g++-cross$(exeext)): Use xg++$(exeext) instead of g++$(exeext).
+       (c++.start.encap): Likewise.
+       (c++.install-common): Likewise.
+
+2012-11-24  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/55446
+       * init.c (build_vec_init): Do not early return error_mark_mode
+       when integer_all_onesp (maxindex).
+
+2012-11-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/54046
+       * cp-objcp-common.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Redefine.
+       * cp-objcp-common.c (cxx_block_may_fallthru): New function.
+       * cp-tree.h (cxx_block_may_fallthru): New prototype.
+
+2012-11-23  Markus Trippelsdorf  <markus@trippelsdorf.de>
+
+       PR c++/55418
+       * method.c (implicitly_declare_fn): Properly initialize trivial_p.
+
+2012-11-22  Jason Merrill  <jason@redhat.com>
+
+       PR c++/55137
+       * semantics.c (verify_constant): Track overflow separately.
+       (reduced_constant_expression_p): Don't check it here.
+       (cxx_eval_constant_expression): Check it on CSTs.
+       (cxx_eval_outermost_constant_expr): Treat overflows as non-constant
+       at this point, but still return the folded version.
+       (potential_constant_expression_1): Don't check overflow.
+
+       * call.c (extend_ref_init_temps_1): Recompute TREE_CONSTANT for
+       the ADDR_EXPR.
+
+2012-11-20  Diego Novillo  <dnovillo@google.com>
+           Jakub Jelinek  <jakub@redhat.com>
+
+       * name-lookup.c: Replace all vec<T, A>() initializers
+       with vNULL.
+       * semantics.c: Likewise.
+
+2012-11-19  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/55368
+       * parser.c (cp_parser_member_declaration): Emit an error in case
+       of stray comma at end of member declaration.
+
+2012-11-19  Jason Merrill  <jason@redhat.com>
+
+       * class.c (one_inheriting_sig): Don't inherit base copy ctors.
+
+       PR c++/55262
+       * method.c (implicitly_declare_fn): Set DECL_PARM_INDEX on
+       the parms of an inheriting ctor.
+
+       PR c++/55261
+       * class.c (add_implicitly_declared_members): Use
+       lookup_fnfields_slot to get the base constructors.
+
+2012-11-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/54630
+       * class.c (fixed_type_or_null_ref_ht): New variable.
+       (fixed_type_or_null): Use it instead of local static ht.
+
+2012-11-17  Diego Novillo  <dnovillo@google.com>
+
+       Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
+
+       * Make-lang.in: Remove dependencies on vecir.h and vecprim.h everywhere.
+       * call.c: Use new vec API in vec.h.
+       * class.c: Likewise.
+       * cp-gimplify.c: Likewise.
+       * cp-tree.h: Likewise.
+       * cvt.c: Likewise.
+       * decl.c: Likewise.
+       * decl2.c: Likewise.
+       * error.c: Likewise.
+       * except.c: Likewise.
+       * init.c: Likewise.
+       * mangle.c: Likewise.
+       * method.c: Likewise.
+       * name-lookup.c: Likewise.
+       * name-lookup.h: Likewise.
+       * parser.c: Likewise.
+       * parser.h: Likewise.
+       * pt.c: Likewise.
+       * repo.c: Likewise.
+       * rtti.c: Likewise.
+       * search.c: Likewise.
+       * semantics.c: Likewise.
+       * tree.c: Likewise.
+       * typeck.c: Likewise.
+       * typeck2.c: Likewise.
+
+2012-11-17  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+       * semantics.c (finish_id_expression): Tidy diagnostic message.
+
+2012-11-16  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/54875
+       * pt.c (lookup_template_class_1): Look at the type of the
+       potential member enum of class template to determine if we are
+       actually substituting into a member enum of class template.
+
+2012-11-16  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/55337
+       * tree.c (cp_tree_equal) <case ALIGNOF_EXPR>: Use SIZEOF_EXPR_TYPE_P
+       only on SIZEOF_EXPR.
+
+2012-11-14  Jason Merrill  <jason@redhat.com>
+
+       PR c++/54903
+       * decl2.c (mark_used): Don't complain about auto in templates.
+
+       PR c++/37276
+       * decl.c (decls_match): Remove #ifdef around earlier fix.
+
+2012-11-13  Jason Merrill  <jason@redhat.com>
+
+       * class.c (finish_struct_1): Check virtual functions
+       for missing ABI tags.
+
+       PR c++/55275
+       * pt.c (maybe_process_partial_specialization): Update
+       DECL_SOURCE_LOCATION for new specializations.
+
+2012-11-14  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/55323
+       * init.c (emit_mem_initializers): Skip arguments == error_mark_node.
+
+2012-11-14  Fabien ChĂȘne  <fabien@gcc.gnu.org>
+
+       PR c++/11750
+       * call.c (build_new_method_call_1): Check that the instance type
+       and the function context are the same before setting the flag
+       LOOKUP_NONVIRTUAL.
+
+2012-11-13  Sriraman Tallam  <tmsriram@google.com>
+
+       * class.c (mark_versions_used): Remove.
+       (resolve_address_of_overloaded_function): Call target hook
+       for versioned functions. Refactor to call
+       get_function_versions_dispatcher.
+       * decl.c (duplicate_decls): Add comments.
+       * cp/call.c (get_function_version_dispatcher): Expose function.
+       (mark_versions_used): Expose function.
+       * cp/cp-tree.h (mark_versions_used): New declaration.
+       (get_function_version_dispatcher): Ditto.
+
+2012-11-13  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/54466
+       * pt.c (lookup_template_class_1): TYPE_STUB_DECL should be
+       accessed on the main variant of the type.
+
+2012-11-12  Ed Smith-Rowland  <3dw4rd@verizon.net>
+
+       * parser.c (cp_parser_objc_class_ivars):
+       Index declspecs.locations by ds_typedef rather than ds_thread.
+
+2012-11-09  Ed Smith-Rowland  <3dw4rd@verizon.net>
+
+       PR c++/54413
+       * decl.c (grokfndecl): Adjust calls to interpret_x_suffix.
+
+2012-11-09  Jason Merrill  <jason@redhat.com>
+
+       PR c++/54859
+       * pt.c (check_instantiated_arg): Don't complain about dependent args.
+
+       * tree.c (cxx_attribute_table): Add abi_tag attribute.
+       (check_abi_tag_redeclaration, handle_abi_tag_attribute): New.
+       * class.c (find_abi_tags_r, check_abi_tags): New.
+       (check_bases, check_field_decl): Call check_abi_tags.
+       * decl.c (redeclaration_error_message): Call
+       check_abi_tag_redeclaration.
+       * mangle.c (tree_string_cmp, write_abi_tags): New.
+       (write_unqualified_name): Call write_abi_tags.
+
+2012-11-07  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/55226
+       Revert:
+       2012-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/54922
+       * semantics.c (cx_check_missing_mem_inits): Handle anonymous union
+       members.
+
+2012-11-07  Florian Weimer  <fweimer@redhat.com>
+
+       * init.c (build_new_1): Do not check for arithmetic overflow if
+       inner array size is 1.
+
+2012-11-05  Sriraman Tallam  <tmsriram@google.com>
+
+       * class.c (add_method): Change assembler names of function versions.
+       (mark_versions_used): New static function.
+       (resolve_address_of_overloaded_function): Create dispatcher decl and
+       return address of dispatcher instead.
+       * decl.c (decls_match): Make decls unmatched for versioned
+       functions.
+       (duplicate_decls): Remove ambiguity for versioned functions.
+       Delete versioned function data for merged decls.
+       * decl2.c (check_classfn): Check attributes of versioned functions
+       for match.
+       * call.c (get_function_version_dispatcher): New function.
+       (mark_versions_used): New static function.
+       (build_over_call): Make calls to multiversioned functions
+       to call the dispatcher.
+       (joust): For calls to multi-versioned functions, make the most
+       specialized function version win.
+
+2012-10-31  Lawrence Crowl  <crowl@google.com>
+
+       * decl2.c (var_finalized_p): Rename varpool_node to
+       varpool_node_for_decl.
+       (maybe_emit_vtables): Likewise.
+
+2012-10-31  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/54583
+       * tree.c (build_cplus_array_type): Set TREE_NO_WARNING on the
+       TYPE_SIZE of VLAs.
+
+2012-10-31  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/54955
+       * parser.c (cp_nth_tokens_can_be_std_attribute_p): Recognize the
+       'Alignas' keyword as the beginning of a c++11 attribute specifier.
+       Update the comment of the function.
+       (cp_next_tokens_can_be_gnu_attribute_p): Update the comment of the
+       function.
+
+2012-10-29  Jonathan Wakely  <jwakely.gcc@gmail.com>
+
+       PR c++/54930
+       * typeck.c (maybe_warn_about_returning_address_of_local): Use
+       OPT_Wreturn_local_addr.
+
+2012-10-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/55081
+       * typeck2.c (store_init_value): Call fold_non_dependent_expr
+       and maybe_constant_init even for C++98.
+
+2012-10-26  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/54984
+       * init.c (build_new): Don't turn a null *init into a pointer to
+       empty vector orig_init.
+
+2012-10-25  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/53761
+       * class.c (finish_struct_1): Reject aggregates decorated with
+       __transparent_union__ which cannot be made transparent because
+       the type of the first field has a different ABI from the class
+       overall.
+
+2012-10-25  Jason Merrill  <jason@redhat.com>
+
+       Core 1402
+       * call.c (joust): An implicitly deleted move function is
+       worse than any non-deleted function.
+       * method.c (process_subob_fn): No special rules for move.
+       (synthesized_method_walk, implicitly_declare_fn): Likewise.
+       Warn about virtual base with non-trivial move assignment.
+       * cp-tree.h (struct lang_decl_fn): Remove suppress_implicit_decl.
+       (FNDECL_SUPPRESS_IMPLICIT_DECL): Remove.
+
+       * semantics.c (finish_omp_threadprivate): Call complete_type.
+
+       * class.c (one_inherited_ctor): Warn about variadic inherited ctor.
+
+2012-10-25  Marc Glisse  <marc.glisse@inria.fr>
+
+       PR c++/54427
+       * typeck.c (build_x_conditional_expr): Handle VEC_COND_EXPR.
+       * call.c (build_conditional_expr_1): Likewise.
+
+2012-10-25  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/34892
+       * parser.c (cp_parser_template_parameter): When
+       cp_parser_parameter_declaration parsed a default argument don't
+       see if *is_parameter_pack needs setting.
+
+2012-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/54922
+       * semantics.c (cx_check_missing_mem_inits): Handle anonymous union
+       members.
+
+2012-10-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/54844
+       * pt.c (tsubst_copy, tsubst_copy_and_build) <case SIZEOF_EXPR>: Use
+       tsubst instead of tsubst_copy* on types.
+
+       PR c++/54988
+       * decl2.c (cplus_decl_attributes): Don't return early
+       if attributes is NULL.
+
+2012-10-18  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/54501
+       * decl.c (reshape_init_array_1): Avoid infinite loops.
+
+2012-10-15  Alexandre Oliva  <aoliva@redhat.com>
+           Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/17805
+       * call.c (build_new_op_1): Filter out operator functions that don't
+       satisfy enum-conversion match requirements.
+
+2012-10-15  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/50080 (again)
+       * parser.c (cp_parser_optional_template_keyword): When -pedantic
+       and C++98 mode restore pre-Core/468 behavior.
+
+2012-10-15  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/50080
+       * parser.c (cp_parser_optional_template_keyword): Implement
+       Core/468, allow outside template.
+
+2012-10-14  Jason Merrill  <jason@redhat.com>
+           Ville Voutilainen  <ville.voutilainen@gmail.com>
+
+       Implement C++11 inheriting constructors.
+       * cp-tree.h (cpp0x_warn_str): Add CPP0X_INHERITING_CTORS.
+       (DECL_INHERITED_CTOR_BASE, SET_DECL_INHERITED_CTOR_BASE): New.
+       (special_function_kind): Add sfk_inheriting_constructor.
+       * class.c (add_method): An inheriting ctor is hidden by a
+       user-declared one.
+       (one_inheriting_sig, one_inherited_ctor): New.
+       (add_implicitly_declared_members): Handle inheriting ctors.
+       * error.c (maybe_warn_cpp0x): Handle CPP0X_INHERITING_CTORS.
+       * init.c (emit_mem_initializers): Don't set LOOKUP_DEFAULTED
+       for an inheriting constructor.
+       * method.c (type_has_trivial_fn): Handle sfk_inheriting_constructor.
+       (type_set_nontrivial_flag): Likewise.
+       (add_one_base_init): Split out from...
+       (do_build_copy_constructor): ...here.  Handle inheriting constructors.
+       (locate_fn_flags): Handle a list of arg types.
+       (synthesized_method_walk): Handle inheriting constructors.
+       (maybe_explain_implicit_delete): Likewise.
+       (deduce_inheriting_ctor): New.
+       (implicitly_declare_fn): Handle inheriting constructors.
+       * name-lookup.c (push_class_level_binding_1): An inheriting constructor
+       does not declare the base's name.
+       (do_class_using_decl): Allow inheriting constructors.
+       * pt.c (template_parms_to_args): Split from current_template_args.
+       (add_inherited_template_parms): New.
+       (tsubst_decl): Handle inheriting constructors.
+       * tree.c (special_function_p): Handle inheriting constructors.
+
+2012-10-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/54381
+       * semantics.c (finish_call_expr): Pass array of 3 sizeof_arg
+       trees and locs (corresponding to first 3 arguments) to
+       sizeof_pointer_memaccess_warning.
+
+2012-10-12  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/24449
+       * decl.c (grokfndecl): When checking for ::main declarations
+       use PROCESSING_REAL_TEMPLATE_DECL_P().
+
+2012-10-12  Marc Glisse  <marc.glisse@inria.fr>
+
+       PR c++/53055
+       * call.c (build_new_op_1): Pass RO_ARROW_STAR to cp_build_indirect_ref.
+       * typeck.c (cp_build_indirect_ref): Handle RO_ARROW_STAR.
+
+2012-10-11  Jason Merrill  <jason@redhat.com>
+
+       * cp-tree.h (DECL_THUNKS): NULL_TREE for non-virtual functions.
+       (SET_DECL_THUNKS): New.
+       * decl.c (duplicate_decls): Adjust.
+       * method.c (make_thunk): Adjust.
+
+       * decl.c (grokdeclarator): Set DECL_GNU_TLS_P for static data
+       members, too.
+
+2012-10-09  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/53540 - using fails to be equivalent to typedef
+       * cp-tree.h (TYPE_TEMPLATE_INFO): For an alias that is not an
+       instance of alias template, don't look for its TEMPLATE_INFO in
+       its declaration.
+       (alias_template_specialization_p): Take const_tree.
+       * pt.c (alias_template_specialization_p): Take a const_tree.
+       Don't call primary_template_instantiation_p.
+       (primary_template_instantiation_p): Call
+       alias_template_specialization_p.
+
+2012-10-10  Dodji Seketeli  <dodji@redhat.com>
+
+       * parser (cp_parser_statement): Parse c++11 attributes
+       tentatively.
+       (cp_parser_std_attribute_spec_seq): Do not warn too early about
+       using c++11 attributes in non c++11 mode.
+
+2012-10-10  Dehao Chen  <dehao@google.com>
+
+       * cp-gimplify.c (cp_genericize_r): Set location for TRY expr.
+
 2012-10-09  Lawrence Crowl  <crowl@google.com>
 
        * Make-lang.in (class.o): Add dependence on hash-table.h.