1 2007-08-31 Jakub Jelinek <jakub@redhat.com>
3 * decl.c (duplicate_decls): Remove duplicated line.
5 2007-08-31 Paolo Carlini <pcarlini@suse.de>
8 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
9 BOUND_TEMPLATE_TEMPLATE_PARM.
11 2007-08-31 Paolo Carlini <pcarlini@suse.de>
14 * search.c (lookup_member): Check the name argument for
17 2007-08-31 Paolo Carlini <pcarlini@suse.de>
20 * parser.c (cp_parser_trait_expr): Check rerurn value of
23 2007-08-30 Ollie Wild <aaw@google.com>
25 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
26 convert_ptrmem for pointer to member conversions.
27 (convert_to_pointer_force): Update cp_convert_to_pointer call.
28 (ocp_convert): Update cp_convert_to_pointer call.
29 * typeck.c (convert_ptrmem): Add conditional for null pointers to
31 (build_static_cast_1): Check can_convert for conversions in either
33 (get_delta_difference_1): New function.
34 (get_delta_difference): Refactor to call get_delta_difference_1.
36 2007-08-28 Paolo Carlini <pcarlini@suse.de>
39 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
40 BOUND_TEMPLATE_TEMPLATE_PARM.
42 2007-08-28 Jakub Jelinek <jakub@redhat.com>
46 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
47 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
49 2007-08-27 Jason Merrill <jason@redhat.com>
52 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
53 Look inside STMT_EXPR.
54 * semantics.c (stmt_expr_value_expr): New fn.
55 * cp-tree.h: Declare it.
58 * decl.c (groktypename): Ignore attributes applied to class type.
60 2007-08-28 Richard Guenther <rguenther@suse.de>
62 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
64 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
66 * error.c (dump_expr): Handle COMPLEX_CST.
67 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
68 (pp_cxx_expression): Likewise.
70 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
72 * decl.c (GNU_INLINE_P): New.
73 (duplicate_decls): Handle gnu_inline. Merge attributes and
74 some flags in overriding definitions.
75 (redeclaration_error_message): Handle gnu_inline.
76 (start_preparsed_function): Likewise.
78 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
80 * call.c (sufficient_parms_p): Constify.
81 * class.c (same_signature_p): Likewise.
82 * cp-gimplify.c (is_invisiref_parm,
83 cxx_omp_privatize_by_reference): Likewise.
84 * cp-objcp-common.c (has_c_linkage): Likewise.
85 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
86 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
87 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
88 num_artificial_parms_for, comp_template_parms,
89 template_parameter_pack_p, any_dependent_template_arguments_p,
90 any_type_dependent_arguments_p, any_value_dependent_elements_p,
91 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
92 zero_init_p, member_p, cp_lvalue_kind,
93 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
94 varargs_function_p, is_dummy_object, special_function_kind,
95 string_conv_p, type_unknown_p, comp_except_specs, compparms,
96 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
97 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
98 cp_has_mutable_p, at_least_as_qualified_p,
99 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
100 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
101 * except.c (nothrow_libfn_p): Likewise.
102 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
104 * pt.c (comp_template_parms, template_parameter_pack_p,
105 any_type_dependent_arguments_p, any_value_dependent_elements_p,
106 any_dependent_template_arguments_p): Likewise.
107 * repo.c (repo_export_class_p): Likewise.
108 * semantics.c (anon_aggr_type_p): Likewise.
109 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
110 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
111 varargs_function_p, member_p, is_dummy_object, pod_type_p,
112 zero_init_p, special_function_p): Likewise.
113 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
114 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
115 compparms, invalid_nonstatic_memfn_p,
116 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
117 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
118 cp_has_mutable_p, lvalue_or_else): Likewise.
120 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
122 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
123 * cp-objcp-common.c (cp_tree_size): Ditto.
124 * tree.c (cp_walk_subtrees): Ditto
125 * cp-tree.def (TINST_LEVEL): Go away.
126 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
127 move together with other non-tree structs.
128 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
129 (union lang_tree_node): Eliminate tinst_level field.
130 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
131 (current_instantiation, outermost_tinst_level): Return
132 a "struct tinst_level *".
134 * error.c (print_instantiation_partial_context): Change second
135 parameter to a "struct tinst_level *". Replace accessor macros
137 (print_instantiation_full_context): Likewise.
138 * lex.c (in_main_input_context): Likewise.
140 * pt.c (struct pending_templates): New.
141 (pending_templates, last_pending_template): Use it as a type.
142 (current_tinst_level): Change typo to "struct tinst_level *"
143 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
144 (add_pending_template): Construct a "struct pending_template".
145 Replace TINST_LEVEL accessor macros with field access.
146 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
147 (pop_tinst_level): Likewise.
148 (instantiate_pending_templates): Likewise. Factor common code used
149 when an instantiation has been done.
150 (outermost_tinst_level): Replace tree_last with loop.
151 (current_instantiation): Return a "struct tinst_level *".
153 2007-08-24 Ollie Wild <aaw@google.com>
155 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
156 * name-lookup.h (cp_binding_level): Remove vtables member.
158 2007-08-24 Richard Guenther <rguenther@suse.de>
160 * tree.c (cp_cannot_inline_tree_fn): Remove.
161 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
162 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
165 2007-08-24 Jakub Jelinek <jakub@redhat.com>
168 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
169 error_mark_node right away if build_expr_type_conversion
173 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
174 is error_mark_node rather than NULL_TREE.
175 * pt.c (check_explicit_specialization): Likewise.
178 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
179 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
181 2007-08-22 Jason Merrill <jason@redhat.com>
184 * pt.c (outermost_tinst_level): New function.
185 * lex.c (in_main_input_context): New function.
186 * cp-tree.h: Declare it.
187 * decl2.c (constrain_class_visibility): Use it to avoid warning
188 about uses of the anonymous namespace in the main input file.
190 2007-08-21 Jakub Jelinek <jakub@redhat.com>
192 * init.c (build_new_1): Use get_target_expr instead of save_expr.
194 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
197 * class.c (finish_struct_1): Warn when a class has virtual
198 functions and accessible non-virtual destructor.
200 2007-08-20 Richard Guenther <rguenther@suse.de>
204 * call.c (build_new_method_call): Convert initializer to
206 * init.c (build_aggr_init): Do not fiddle with types.
207 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
208 * except.c (build_throw): Do not drop qualifiers for the
210 * typeck.c (get_member_function_from_ptrfunc): Do not
211 fiddle with types, instead convert.
212 (build_ptrmemfunc1): Convert to the target type for
214 (gfc_trans_allocate): Convert result to target type.
215 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
216 pointer-to-member structures shall have alias set zero as well.
218 2007-08-20 Richard Guenther <rguenther@suse.de>
220 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
222 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
223 (nonstatic_local_decl_p): Likewise.
224 * tree.c (cp_auto_var_in_fn_p): Remove.
225 * decl.c (nonstatic_local_decl_p): Remove.
227 2007-08-20 Richard Guenther <rguenther@suse.de>
229 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
231 * tree.h (cp_walk_tree): New define to walk_tree_1 with
232 cp_walk_subtrees lh parameter.
233 (cp_walk_tree_without_duplicates): New define to
234 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
235 * tree.c (count_trees): Call
236 cp_walk_tree_without_duplicates.
237 (verify_stmt_tree): Call cp_walk_tree.
238 (break_out_target_exprs): Likewise.
239 (WALK_SUBTREE): Likewise.
240 * cp-gimplify.c (cp_genericize): Likewise.
241 * cp-pt.c (find_parameter_packs_r): Likewise.
242 (uses_parameter_packs): Likewise.
243 (make_pack_expansion): Likewise.
244 (check_for_bare_parameter_packs): Likewise.
245 (for_each_template_parm): Likewise.
246 * decl.c (check_default_argument): Call
247 cp_walk_tree_without_duplicates.
248 * except.c (build_throw): Likewise.
249 * decl2.c (type_visibility): Likewise.
250 * semantics.c (expand_or_defer_fn): Likewise.
251 (finalize_nrv): Call cp_walk_tree.
253 2007-08-20 Jakub Jelinek <jakub@redhat.com>
256 * init.c (build_new_1): Rename placement_var variable to placement_expr.
257 Initialize it with save_expr rather than get_temp_regvar.
259 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
262 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
265 2007-08-17 Ollie Wild <aaw@google.com>
268 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
269 declarations into appropriate slots for comparison. Fix type
272 2007-08-17 Paolo Carlini <pcarlini@suse.de>
275 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
276 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
278 2007-08-17 Paolo Carlini <pcarlini@suse.de>
281 * parser.c (cp_parser_class_head): Improve error message.
283 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
285 * pt.c (instantiate_decl): Set input_location
286 for the function end.
288 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
290 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
292 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
293 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
294 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
295 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
296 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
297 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
298 * typeck.c (cp_type_quals): Likewise.
299 * typeck2.c (cxx_incomplete_type_diagnostic,
300 cxx_incomplete_type_error): Likewise.
302 2007-08-16 Paolo Carlini <pcarlini@suse.de>
305 * pt.c (tsubst_friend_function): When check_classfn
306 returns error_mark_node likewise return it.
308 2007-08-15 Jakub Jelinek <jakub@redhat.com>
311 * typeck.c (check_return_expr): Don't NRV optimize vars in
313 * decl.c (finish_function): Comment fix.
315 2007-08-15 Paolo Carlini <pcarlini@suse.de>
318 * pt.c (push_template_decl_real): Depending on TYPE_P
319 use either TYPE_CONTEXT or DECL_CONTEXT.
321 2007-08-14 Mark Mitchell <mark@codesourcery.com>
323 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
324 constructors and destructors return this.
326 2007-08-14 Paolo Carlini <pcarlini@suse.de>
329 * decl2.c (check_classfn): Return error_mark_node in case of error;
330 in that case, do not call add_method.
331 * decl.c (start_decl): Deal with check_classfn returning
333 (grokfndecl): Likewise.
334 * pt.c (tsubst_friend_function): Likewise.
336 2007-08-14 Andrew Pinski <pinskia@gmail.com>
339 * typeck.c (build_binary_op): Disallow vector float types with
340 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
342 2007-08-11 Ian Lance Taylor <iant@google.com>
344 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
346 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
348 2007-08-10 Ollie Wild <aaw@google.com>
350 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
352 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
354 (unqualified_namespace_lookup): Fix ambiguous_decl call.
355 (lookup_using_namespace): Fix ambiguous_decl call.
356 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
358 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
360 * call.c (name_as_c_string): Use CONST_CAST.
361 * decl.c (build_decl): Likewise.
362 * parser.c (cp_parser_string_literal): Likewise.
364 2007-08-10 Paolo Carlini <pcarlini@suse.de>
367 * error.c (dump_expr): Consistently use the *_cxx_*
368 variants of the pretty-print functions.
370 2007-08-10 Paolo Carlini <pcarlini@suse.de>
373 * decl.c (check_special_function_return_type): Just error
374 on return type specified for conversion operator.
376 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
378 * typeck2.c (readonly_error): Handle general expressions.
379 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
381 2007-08-06 Dan Hipschman <dsh@google.com>
383 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
384 access function name.
386 2007-08-04 Alfred Minarik <a.minarik@aon.at>
389 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
390 * g++spec.c (lang_specific_driver): Check them.
392 2007-08-06 Paolo Carlini <pcarlini@suse.de>
395 * pt.c (template_class_depth): Fix comment; change return type
398 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
401 2007-03-26 Dirk Mueller <dmueller@suse.de>
403 * parser.c (cp_parser_member_declaration): Pedwarn
404 about stray semicolons after member declarations.
406 2007-08-02 Lee Millward <lee.millward@gmail.com>
411 * parser.c (cp_parser_asm_definition): Detect and discard asm
412 statements with invalid inputs or outputs.
413 (cp_parser_asm_operand_list): Return error mark node if any
414 of the operands are invalid. Adjust documentation.
416 2007-08-02 Nick Clifton <nickc@redhat.com>
418 * typeck.c: Change copyright header to refer to version 3 of the
419 GNU General Public License and to point readers at the COPYING3
420 file and the FSF's license web page.
421 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
422 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
423 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
424 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
425 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
426 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
427 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
428 name-lookup.h, parser.c: Likewise.
430 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
433 * call.c (magic_varargs_p): Honor the "type generic" attribute.
435 2007-07-30 Paolo Carlini <pcarlini@suse.de>
438 * semantics.c (finish_label_stmt): Reject the __label__
439 extension outside function scopes.
441 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
443 * parser.c (eof_token): Un-constify.
444 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
445 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
448 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
450 * pt.c, tree.c, typeck2.c: Fix comment typos.
452 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
453 Mark Mitchell <mark@codesourcery.com>
456 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
457 hidden due to friend declarations in local classes.
459 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
461 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
462 * cp-tree.def (DECLTYPE_TYPE): New.
463 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
464 (dump_type_prefix): Ditto.
465 (dump_type_suffix): Ditto.
466 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
467 * mangle.c (write_type): Handle DECLTYPE_TYPE.
468 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
470 (DECLTYPE_TYPE_EXPR): New.
471 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
472 (finish_declared_type): Declare.
473 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
475 (pp_cxx_type_id): Ditto.
476 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
477 (tsubst): Substitute into a DECLTYPE_TYPE node.
478 (tsubst_copy): Ditto.
479 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
481 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
482 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
483 structural equality (because we can't hash the expressions).
484 (finish_declared_type): New.
485 * lex.c (reswords): Add "decltype" keyword.
486 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
487 (cp_parser_postfix_expression): Add member_access_only_p to
488 restrict postfix expression to member access expressions.
489 (cp_parser_unary_expression): Update call to
490 cp_parser_postfix_expression to reflect new parameter.
491 (cp_parser_declared_type): New.
492 (cp_parser_simple_type_specifier): Parse decltype types.
494 2007-07-27 Mark Mitchell <mark@codesourcery.com>
497 * call.c (convert_for_arg_passing): Only widen bitfields to their
498 declared types if necessary.
500 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
502 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
505 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
507 * decl.c (typename_hash, typename_compare): Constify.
508 * mangle.c (hash_type, compare_type): Likewise.
509 * pt.c (eq_local_specializations, hash_local_specialization):
511 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
512 list_hash): Likewise.
513 * typeck2.c (pat_compare): Likewise.
515 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
517 * method.c (implicitly_declare_fn): Increase alignment if member
518 function pointer format requires it.
520 2007-07-24 Paolo Carlini <pcarlini@suse.de>
523 * typeck.c (check_return_expr): Do not pass a null argument
526 2007-07-24 Paolo Carlini <pcarlini@suse.de>
529 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
532 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
535 * typeck.c (convert_arguments): Only use default args if we have
539 * typeck.c (structural_comptypes): No need to check
540 resolve_typename_type return value here.
541 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
542 * pt.c (resolve_typename_type): Follow typename typedefs. Return
543 original type rather than error_mark_node in case of failure.
544 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
545 resolve_typename_type result check.
546 (cp_parser_direct_declarator, cp_parser_head,
547 cp_parser_constructor_declarator_p): Likewise.
549 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
551 * pt.c (template_parms_variadic_p): Remove.
552 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
554 2007-07-12 Jakub Jelinek <jakub@redhat.com>
557 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
558 argument to dump_aggr_init_expr_args instead of false.
560 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
562 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
563 canonical types; otherwise, fall back to structural type
564 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
565 internal compiler error if the canonical types are wrong.
567 2007-07-11 Paolo Carlini <pcarlini@suse.de>
570 * parser.c (cp_parser_make_indirect_declarator): When the
571 the code argument is ERROR_MARK return cp_error_declarator.
573 2007-07-09 Geoffrey Keating <geoffk@apple.com>
576 * decl.c (cxx_init_decl_processing): Don't set
577 force_align_functions_log.
578 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
579 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
580 FUNCTION_DECL, return its alignment.
582 2007-07-09 Richard Guenther <rguenther@suse.de>
584 * decl.c (start_preparsed_function): Do not promote return type.
586 2007-07-08 Paolo Carlini <pcarlini@suse.de>
589 * pt.c (unify): Never pass error_mark_node to template_decl_level.
591 2007-07-07 Mark Mitchell <mark@codesourcery.com>
594 * pt.c (resolve_overloaded_unification): Robustify. Return a
596 (type_unification_real): Adjust accordingly.
598 2007-07-06 Richard Guenther <rguenther@suse.de>
600 * init.c (build_new_1): Use the correct pointer type.
601 * typeck2.c (build_m_component_ref): Likewise.
603 2007-07-05 Mark Mitchell <mark@codesourcery.com>
606 * init.c (build_zero_init): Always build an initializer for
608 * typeck2.c (build_functional_cast): Use build_zero_init.
611 * init.c (build_new_1): Always pass the allocation function to
612 build_op_delete_call.
613 * call.c (build_op_delete_call): Handle operator delete with a
614 variable-argument list. Do not issue an error when no matching
615 deallocation function is available for a new operator.
618 * cp-tree.h (any_value_dependent_elements_p): Declare it.
619 * decl.c (value_dependent_init_p): New function.
620 (cp_finish_decl): Use it.
621 * pt.c (value_dependent_expression_p): Use
622 any_value_dependent_elements_p.
623 * parser.c (cp_parser_primary_expression): Add comment about
624 treating dependent qualified names as integral
625 constant-expressions.
627 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
629 * decl.c (build_ptrmemfunc_type): Always use structural equality
630 tests when comparing pointer-to-member-function types, because the
631 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
634 2007-07-03 Mark Mitchell <mark@codesourcery.com>
636 * init.c (build_new): Tweak comment.
638 2007-06-29 Dave Brolley <brolley@redhat.com>
641 * parser.c (cp_parser_new_type_id): Don't reduce a named array
642 type to its base type and number of elements here.
643 * init.c (build_new): Call complete_type_or_else to ensure that the
644 type is complete and to issue a diagnostic if it is not.
645 (build_new_1): Don't call complete_type_or_else here.
647 2007-07-03 Richard Guenther <rguenther@suse.de>
650 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
653 2007-07-02 Simon Baldwin <simonb@google.com>
655 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
656 for inner-style nested forward declarations that don't declare
659 2007-07-02 Jakub Jelinek <jakub@redhat.com>
662 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
663 DECL_P in not a variable and appears more than once error messages.
665 2007-07-01 Ollie Wild <aaw@google.com>
667 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
668 (select_decl): Remove function.
669 (unqualified_namespace_lookup): Populate binding by calling
670 ambiguous_decl. Remove select_decl call.
671 (lookup_qualified_name): Remove select_decl call.
672 * decl.c (lookup_and_check_tag): Check for ambiguous references.
673 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
674 generation when name lookup is ambiguous.
676 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
679 * init.c (build_new_1): Use structural equality on the copy of the
682 2007-06-28 Geoffrey Keating <geoffk@apple.com>
684 * decl2.c (determine_visibility): Implement
685 flag_visibility_ms_compat effect on type info.
686 * decl.c (cxx_init_decl_processing): Implement
687 global effect of flag_visibility_ms_compat.
689 2007-06-28 Geoffrey Keating <geoffk@apple.com>
691 * decl2.c (start_objects): Mark constructor-running function
694 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
697 * decl.c (grokdeclarator): Reset friendp for member functions declared
698 friend of their own class.
700 2007-06-23 Mark Mitchell <mark@codesourcery.com>
702 * decl2.c (determine_visibility): Don't look for dllexport here.
703 (determine_visibility_from_class): Tidy.
705 2007-06-18 Simon Baldwin <simonb@google.com>
708 * parser.c (cp_parser_single_declaration): Added check for storage
709 class other than sc_none in parsed declaration, and a flag to indicate
710 if the call is part of an explicit template specialization parse.
711 * (cp_parser_explicit_specialization): Specialization check flag added
712 to call to cp_parser_single_declaration(), set true.
713 * (cp_parser_template_declaration_after_export): Specialization check
714 flag added to call to cp_parser_single_declaration(), set false.
715 * pt.c (check_explicit_specialization): Added code to copy visiblity
716 and linkage from the templated function to the explicit specialization.
718 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
720 * typeck.c (build_binary_op): For templates build the
721 expression in pieces to avoid the assert in build2_stat.
722 (get_member_function_from_ptrfunc):
723 Change over to using POINTER_PLUS_EXPR and convert
724 the second operand to sizetype.
725 * typeck2.c (build_m_component_ref): Likewise.
726 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
727 instead of PLUS_EXPR for pointers.
728 (build_new_1): Likewise.
729 (build_vec_delete_1): Likewise.
730 (build_vec_delete): Likewise.
731 * class.c (build_base_path): Likewise.
732 (build_base_path): Likewise.
733 (convert_to_base_statically): Likewise.
734 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
735 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
736 instead of PLUS_EXPR.
737 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
738 instead of PLUS_EXPR for pointers.
739 * call.c (build_special_member_call): Likewise.
740 * rtti.c (build_headof): Likewise.
741 Use sizetype instead of ptrdiff_type_node.
742 (tinfo_base_init): Create a POINTER_PLUS_EXPR
743 instead of PLUS_EXPR for pointers.
744 * except.c (expand_start_catch_block): Do a
745 NEGATIVE and then a POINTER_PLUS_EXPR instead
747 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
748 PLUS_EXPR on pointer types over to use
749 POINTER_PLUS_EXPR and remove the conversion
750 to the pointer types.
751 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
752 adding to a pointer type. Use size_int instead of
753 ssize_int. Convert the index to sizetype before
754 adding it to the pointer.
756 2007-06-15 Mark Mitchell <mark@codesourcery.com>
758 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
759 (DECL_ANON_UNION_VAR_P): New macro.
760 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
761 than DECL_VAR_MARKED_P, to keep track of which variables we have
763 * decl.c (redeclaration_error_message): Complain about redeclaring
764 anonymous union members at namespace scope.
765 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
767 2007-06-14 Geoff Keating <geoffk@apple.com>
769 * decl2.c (determine_visibility): Ensure that functions with
770 hidden types as parameters are hidden.
773 * decl2.c (determine_visibility): Remove duplicate code for
776 2007-06-12 Ian Lance Taylor <iant@google.com>
779 * init.c (avoid_placement_new_aliasing): New static function.
780 (build_new_1): Call it.
782 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
784 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
785 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
787 2007-06-08 Jakub Jelinek <jakub@redhat.com>
790 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
791 on init, the non-decl cond operand and increment value.
793 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
796 * decl.c (check_initializer): Report an error when a brace enclosed
797 initializer is used for a non-aggregate type in C++98.
798 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
800 (grokdeclarator): Likewise.
801 (move_fn_p): Likewise.
802 * typeck.c (check_return_expr): Likewise.
803 * call.c (reference_binding): Likewise.
804 * error.c (cp_cpp_error): Likewise.
805 * pt.c (check_default_tmpl_args): Likewise.
807 * lex.c (init_reswords): Likewise.
808 * parser.c (p_parser_primary_expression): Likewise.
809 (TOKEN_PRECEDENCE): Likewise.
810 (cp_parser_init_declarator): Likewise.
811 (cp_parser_ptr_operator): Likewise.
812 (cp_parser_parameter_declaration): Likewise.
813 (cp_parser_enclosed_template_argument_list): Likewise.
814 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
815 (cp_parser_next_token_ends_template_argument_p): Likewise.
817 2007-06-04 Simon Baldwin <simonb@google.com>
819 * decl.c (grokdeclarator): Readability change. Moved case labels
820 into direct switch statement scope.
822 2007-06-04 Paolo Carlini <pcarlini@suse.de>
824 * call.c (convert_like_real): Remove pointless code.
826 2007-05-31 Mark Mitchell <mark@codesourcery.com>
828 * decl.c (get_atexit_fn_ptr_type): New function.
829 (get_atexit_node): Use it.
830 (start_cleanup_fn): Likewise.
831 (register_dtor_fn): Use the object's destructor, instead of a
832 separate cleanup function, where possible.
833 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
834 (atexit_fn_ptr_type_node): New macro.
835 * decl2.c (build_cleanup): Use build_address.
837 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
839 * typeck.c (build_binary_op): Include types in error.
841 2007-05-31 Jakub Jelinek <jakub@redhat.com>
844 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
845 needs runtime initialization.
847 2007-05-31 Paolo Carlini <pcarlini@suse.de>
850 * semantics.c (finish_trait_expr): Complete the types.
852 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
853 Douglas Gregor <doug.gregor@gmail.com>
854 Pedro Lamarao <pedro.lamarao@mndfck.org>
855 Howard Hinnant <howard.hinnant@gmail.com>
859 * typeck.c (comptypes): Don't consider rvalue and lvalue
860 reference types to be equivalent.
861 (check_return_expr): Move from certain lvalues when returning
863 * decl.c (grokdeclarator): Implement reference collapsing.
864 (copy_fn_p): Don't consider constructors taking rvalue references
865 to be copy constructors.
867 * call.c (conversion): New "rvaluedness_matches_p" member.
868 (convert_class_to_reference): Require reference type as first
869 parameter instead of base type.
870 (reference_binding): Add logic to handle rvalue references.
871 (implicit_conversion): Update inaccurate comment.
872 (convert_like_real): Disable creation of temporaries that are
873 impossible to initialize for types with move constructors.
874 (build_over_call): Elide move constructors when possible.
875 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
876 (maybe_handle_ref_bind): Return conversion instead of type node.
877 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
878 determine preferred conversion sequences.
879 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
880 (LOOKUP_PREFER_RVALUE): New.
881 (DECL_MOVE_CONSTRUCTOR_P): New.
882 (struct cp_declarator): Add "reference" member for reference
883 types, with new "rvalue_ref" flag.
884 (cp_build_reference_type): Declare.
885 (move_fn_p): Declare.
886 * error.c (dump_type_prefix): Format rvalue reference types
887 correctly in error messages.
888 * except.c (build_throw): Move from certain lvalues when
890 * mangle.c (write_type): Mangle rvalue references differently
891 than regular references.
892 * parser.c (make_reference_declarator): Add boolean parameter for
894 (cp_parser_make_indirect_declarator): New.
895 (cp_parser_new_declarator_opt): Call
896 cp_parser_make_indirect_declarator.
897 (cp_parser_conversion_declarator_opt): Ditto.
898 (cp_parser_declarator): Ditto.
899 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
901 * pt.c (tsubst): Implement reference collapsing.
902 (maybe_adjust_types_for_deduction): Implement special template
903 parameter deduction rule for rvalue references.
904 (type_unification_real): Update calls to
905 maybe_adjust_types_for_deduction.
906 (try_one_overload): Ditto.
907 (unify_pack_expansion): Ditto.
908 * tree.c (lvalue_p_1): Handle rvalue reference types.
909 (cp_build_reference_type): New.
911 2007-05-30 Jakub Jelinek <jakub@redhat.com>
914 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
915 variables that need runtime initialization.
917 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
920 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
921 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
922 case POSTDECREMENT_EXPR>): Return the error_mark_node
923 if either the real or imaginary parts would an
926 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
927 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
930 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
931 token is a closing brace, false if there are no tokens left.
932 (cp_parser_namespace_alias_definition): Only consume the next token if
933 it is a closing brace.
935 * parser.c (cp_parser_class_specifier): Likewise.
937 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
939 * semantics.c (finish_member_declaration): Fix a typo in the
942 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
954 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
955 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
956 * pt.c (check_for_bare_parameter_packs): Return bool indicated
957 whether everything was okay. Fix indentation.
958 (push_template_decl_real): Check for bare parameter packs in
959 function parameters; where errors occur, mark the parameter types
960 with ERROR_MARK_NODEs to avert ICEs.
961 (coerce_template_parameter_pack): New.
962 (coerce_template_parms): Moved parameter pack coercion into
963 coerce_template_parameter_pack, and permit it anywhere in the
964 template parameter list (not just at the end). Parameter and
965 argument indices can vary (somewhat) separately now, so add
966 PARM_IDX and ARG_IDX.
967 (fn_type_unification): Don't set an argument pack as incomplete if
968 no argument pack was deduced.
969 (type_unification_real): If a type parameter is a parameter pack
970 and has not otherwise been deduced, it will be deduced to an empty
972 (more_specialized_fn): Use the actual lengths of the argument
973 lists when comparing against expansions.
974 * semantics.c (finish_member_declaration): If a field's type has
975 bare parameter packs, error and set its type to ERROR_MARK_NODE.
977 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
980 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
982 2007-05-22 Ollie Wild <aaw@google.com>
984 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
985 (unqualified_namespace_lookup): Adds check for hidden types.
987 2007-05-22 Ollie Wild <aaw@google.com>
989 * decl.c (duplicate_decls): Verify namespace names are unique.
991 2007-05-21 Mark Mitchell <mark@codesourcery.com>
993 * decl.c (cxx_maybe_build_cleanup): Handle
994 __attribute__((cleanup)).
996 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
998 * cvt.c (cp_convert_and_check): Don't check warnings if the
1001 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1003 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1005 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1008 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1009 type only if is a class type (5.2.8/4).
1011 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1013 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1014 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1015 c_common_unsigned_type.
1017 2007-05-11 Silvius Rus <rus@google.com>
1019 * cp/typeck.c (build_indirect_ref): Add call to
1020 strict_aliasing_warning.
1021 (build_reinterpret_cast_1): Condition call to
1022 strict_aliasing_warning.
1024 2007-05-11 Jan Hubicka <jh@suse.cz>
1026 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1027 * decl2.c (start_objects): ctors and dtors are no longer public.
1028 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1030 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1032 * typeck.c (build_unary_op): Remove code that used to
1033 handle non lvalue increments/decrements.
1035 2007-05-07 Mike Stump <mrs@apple.com>
1037 * parser.c (check_empty_body): Add.
1038 (cp_parser_iteration_statement): Add call to check_empty_body.
1040 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1043 * mangle.c (write_mangled_name): Mangle static variable names.
1044 (write_unqualified_name): Use local-source-name for
1045 namespace-scope static variables.
1047 2007-05-04 Dirk Mueller <dmueller@suse.de>
1049 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1052 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1055 * decl2.c (constrain_class_visibility):
1056 Use strip_pointer_or_array_types instead of strip_array_types.
1058 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1061 * decl.c (reshape_init_r): Don't reshape the first element if it
1062 is a pointer to member function.
1064 2007-04-27 Simon Baldwin <simonb@google.com>
1066 * decl.c (grokparms): Changed message format from %qD to %qE.
1068 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1070 * error.c (maybe_warn_variadic_templates): Variadic templates are
1071 now in C++0x, so only warn about them in C++98 mode.
1073 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1076 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1077 integeral types from vectors types.
1079 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1082 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1083 for type dependent OMP_CLAUSE_DECLs.
1085 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1088 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1089 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1090 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1091 * init.c (build_zero_init): Adjust, as
1092 COMPLEX_TYPE is now a SCALAR_TYPE.
1093 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1094 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1096 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1098 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1099 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1100 (trait_expr_value): Adjust.
1102 2007-04-23 Simon Baldwin <simonb@google.com>
1104 * decl.c (grokparms): Added new error for duplicate function
1105 parameters names in function prototypes, to match gcc behavior.
1107 2007-04-23 Jan Hubicka <jh@suse.cz>
1109 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1112 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1114 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1115 instead of checking GIMPLE_STMT_P in chain_next.
1117 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1120 * call.c (convert_for_arg_passing): Convert bitfields to their
1123 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1126 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1128 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1131 * cp/decl2.c (constrain_class_visibility):
1132 Do not warn about the use of anonymous namespace in the main input file.
1134 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1136 * cp-tree.h (current_template_parms): Fix typo in comment.
1138 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1140 * cp-tree.h, error.c: Fix comment typos.
1142 2007-04-13 Jason Merrill <jason@redhat.com>
1145 * call.c (reference_binding): Add c_cast_p parm. If true,
1146 add quals to TO as needed to make it reference-compatible.
1148 2007-04-11 Jan Hubicka <jh@suse.cz>
1150 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1151 that we are not processing template_decl.
1153 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1156 * class.c (build_base_path): Ensure that the converted pointer has
1157 the same cv-qualification as the input.
1159 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1161 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1163 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1165 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1167 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1168 * tree.c (cp_add_pending_fn_decls): Remove.
1169 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1171 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1173 Revert change removing staticp.
1175 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1177 * cp-objcp-common.c (cxx_staticp): Remove.
1178 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1179 * cp-tree.h (cxx_staticp):
1181 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1183 * class.c (check_for_override): Don't remove dllmport attribute
1186 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1189 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1190 type issue error and return early.
1192 2007-03-30 Jason Merrill <jason@redhat.com>
1195 * typeck.c (cp_type_readonly): New fn.
1196 * cp-tree.h: Declare it.
1197 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1198 (cp_finish_decl): Not here.
1200 2007-03-31 Richard Guenther <rguenther@suse.de>
1202 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1205 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1210 * parser.c (declarator_can_be_parameter_pack): New.
1211 (cp_parser_template_parameter): Only parse the `...' if the
1212 declarator can be a parameter pack.
1213 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1215 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1216 types (they could be used as array bounds).
1217 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1218 (tsubst_pack_expansion): Handle failure to expand parameter
1221 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1224 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1225 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1226 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1227 (CLASS_TYPE_NON_UNION_P): Add.
1228 (struct lang_type_class): Add has_complex_dflt.
1229 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1230 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1231 * cp-tree.def: Add TRAIT_EXPR.
1232 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1233 * lex.c (struct resword): Add __has_nothrow_assign,
1234 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1235 __has_trivial_constructor, __has_trivial_copy,
1236 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1237 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1238 __is_pod, __is_polymorphic, __is_union.
1239 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1240 (cp_parser_trait_expr): New.
1241 * semantics.c (finish_trait_expr, trait_expr_value
1242 classtype_has_nothrow_copy_or_assign_p): New.
1243 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1245 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1246 * class.c (check_bases, check_field_decl, check_bases_and_members):
1247 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1248 * pt.c (uses_template_parms, tsubst_copy_and_build,
1249 value_dependent_expression_p, type_dependent_expression_p): Deal with
1251 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1253 2007-03-29 Richard Guenther <rguenther@suse.de>
1255 * tree.c (cp_walk_subtrees): Do not set input_location.
1257 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1260 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1263 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1265 * parser.c (struct cp_parser): Update comment for
1266 greater_than_is_operator_p.
1267 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1268 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1269 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1270 !GREATER_THAN_IS_OPERATOR_P.
1271 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1272 `>>' operators that will become two `>' tokens in C++0x.
1273 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1274 mode, allowing it to terminate default arguments.
1275 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1276 `>>' like two consecutive `>' tokens.
1277 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1278 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1279 ends a template argument.
1281 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1283 * decl.c (redeclaration_error_message): Complain when redeclaring
1284 a friend function with default template arguments (C++0x mode only).
1285 * cp-tree.h (check_default_tmpl_args): Declare.
1286 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1287 template arguments in function templates. Add support for checking
1288 the default template arguments of friend templates.
1289 (push_template_decl_real): Fix call to check_default_tmpl_args.
1290 (type_unification_real): If a template parameter has not been
1291 deduced but provides a default template argument, substitute into
1292 that default template argument.
1293 * parser.c (cp_parser_init_declarator): When declaring (but not
1294 defining!) a function template in C++0x mode, check for default
1297 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1300 * decl.c (grokdeclarator): Deal with cv-qualified function type
1301 typedefs in the same way for member and non-member functions.
1303 2007-03-26 Dirk Mueller <dmueller@suse.de>
1305 * parser.c (cp_parser_member_declaration): Pedwarn
1306 about stray semicolons after member declarations.
1308 2007-03-26 Paolo Carlini <pcarlini@suse.de>
1311 * pt.c (instantiate_decl): Set in_system_header.
1313 2007-03-22 Mark Mitchell <mark@codesourcery.com>
1315 * cp-tree.h (current_tempalte_parms): Improve documentation.
1316 * pt.c (current_template_args): Likewise.
1319 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1320 not consume tokens when failing.
1322 2007-03-22 Jim Wilson <wilson@specifix.com>
1323 Mark Mitchell <mark@codesourcery.com>
1326 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
1327 consistent with FROM.
1329 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1331 * error.c (dump_expr): Handle dependent names that designate types.
1332 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1334 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
1336 * cp-tree.def, parser.c, pt.c: Fix comment typos.
1338 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1340 * cvt.c (cp_convert_and_check) : Define.
1341 * cp-tree.h (cp_convert_and_check): Declare.
1342 * call.c (convert_conversion_warnings): Rename to
1343 conversion_null_warnings. The warning for floating-point to
1344 integer is handled by convert_and_check in convert_like_real.
1345 (convert_like_real): convert_conversion_warnings was renamed as
1346 conversion_null_warnings.
1347 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1348 overflow and changes of value during conversion.
1350 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1353 * parser.c (cp_parser_statement): If 'namespace' is found, this
1354 only can be a namespace alias definition, so parse it now.
1355 (cp_parser_namespace_alias_definition): if we find an open brace
1356 instead of '=', then this is actually a misplaced namespace
1359 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1362 * decl.c (cxx_init_decl_processing): Move command-line options
1363 processing to c-opts.c.
1365 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
1367 * ptree.c (cxx_print_type): Use formatting markup for integers
1368 when printing template parameter index/level/orig level.
1369 (cxx_print_xnode): Ditto.
1370 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1371 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1372 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1374 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1375 rather than a HOST_WIDE_INT.
1376 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1377 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1379 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1380 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1381 IN_BASE_INITIALIZER bool bitfields.
1382 (struct cp_declarator): Make KIND a 4-bit field. Make
1383 PARAMETER_PACK_P a bool bitfield just after KIND.
1384 * pt.c (uses_parameter_packs): Destroy the pointer set.
1385 (make_pack_expansion): Ditto.
1386 (check_for_bare_parameter_packs): Ditto.
1387 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1389 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
1392 * call.c (convert_default_arg): Instead of copying the node,
1395 2007-03-15 Dirk Mueller <dmueller@suse.de>
1398 * call.c (convert_conversion_warnings): New..
1399 (convert_like_real): .. factored out from here.
1400 (convert_conversion_warnings): Add warning about
1401 false being converted to NULL in argument passing.
1403 2007-03-14 Dirk Mueller <dmueller@suse.de>
1405 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1406 (finish_do_body): Warn about empty body in do/while statement.
1408 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1410 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1412 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1415 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1418 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
1420 * cp/repo.c (init_repo): Initialize random_seed saved options.
1421 (finish_repo): Adjust.
1423 2007-03-13 Mark Mitchell <mark@codesourcery.com>
1426 * Make-lang.in (doc/g++.1): Use $< to specify the location from
1429 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
1431 * decl.c (compute_array_index_type): New warning flag warn_vla.
1433 2007-03-12 Mark Mitchell <mark@codesourcery.com>
1436 * call.c (convert_default_arg): Copy non-constant arguments.
1438 2007-03-11 Mark Mitchell <mark@codesourcery.com>
1441 * parser.c (cp_parser_postfix_expression): Disallow compound
1442 literals in constant expressions.
1445 * semantics.c (finish_typeof): Use unlowered_expr_type.
1447 2007-03-10 Mark Mitchell <mark@codesourcery.com>
1450 * cp-tree.h (unlowered_expr_type): New function.
1451 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1452 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1453 (unlowered_expr_type): New function.
1454 (build_unary_op): Disallow predecrements of bool bitfields.
1455 * call.c (build_conditional_expr): Use unlowered_expr_type.
1456 * pt.c (type_unification_real): Likewise.
1458 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
1461 * typeck.c (check_return_expr): Check for bare parameter packs.
1462 (comptypes): Compare template parameter packs and
1463 type pack expansions.
1464 * decl.c (grokdeclarator): Deal with the declaration of function
1466 (grokparms): Verify that the (optional) function parameter pack is
1467 at the end of the parameter list.
1468 (xref_basetypes): Handle pack expansions in the base class.
1469 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1470 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1471 (NONTYPE_ARGUMENT_PACK): New.
1472 (TYPE_PACK_EXPANSION): New.
1473 (EXPR_PACK_EXPANSION): New.
1474 (ARGUMENT_PACK_SELECT): New.
1475 * cp-objcp-common.c (cp_tree_size): Compute size of
1476 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1477 ARGUMENT_PACK_SELECT.
1478 * error.c (dump_template_argument): Print template argument packs.
1479 (dump_template_argument_list): Ditto.
1480 (dump_template_parameter): Dump `...' for template type parameter
1482 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1483 (dump_parameters): Print function parameter packs.
1484 (dump_template_parms): Print template argument packs.
1485 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1486 (maybe_warn_variadic_templates): New.
1487 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1488 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1489 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1491 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1492 (write_template_arg): Write argument packs as separate arguments.
1493 * cp-tree.h (struct template_parm_index_s): Add flag that
1494 indicates that the template parameter is actually a parameter
1496 (struct tree_argument_pack_select): New.
1497 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1498 (union lang_tree_node): Add argument_pack_select.
1499 (FUNCTION_PARAMETER_PACK_P): New.
1500 (PACK_EXPANSION_P): New.
1501 (PACK_EXPANSION_PATTERN): New.
1502 (SET_PACK_EXPANSION_PATTERN): New.
1503 (PACK_EXPANSION_PARAMETER_PACKS): New.
1504 (ARGUMENT_PACK_P): New.
1505 (ARGUMENT_PACK_ARGS): New.
1506 (SET_ARGUMENT_PACK_ARGS): New.
1507 (ARGUMENT_PACK_INCOMPLETE_P): New.
1508 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1509 (TEMPLATE_PARM_PARAMETER_PACK): New.
1510 (TEMPLATE_TYPE_PARAMETER_PACK): New.
1511 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1512 (ARGUMENT_PACK_SELECT_INDEX): New.
1513 (ARGUMENT_PACK_SELECT_ARG): New.
1514 (struct cp_declarator): Add parameter_pack_p flag.
1515 (maybe_warn_variadic_templates): Declare.
1516 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1517 indicate a template parameter pack.
1518 (uses_parameter_packs): Declare.
1519 (template_parameter_pack_p): Declare.
1520 (template_parms_variadic_p): Declare.
1521 (make_pack_expansion): Declare.
1522 (check_for_bare_parameter_packs): Declare.
1523 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1524 sizeof... expressions.
1525 (pp_cxx_expression): Print pack expansions and non-type argument
1527 (pp_cxx_exception_specification): Print pack expansions.
1528 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1529 (pp_cxx_ctor_initializer): Print pack expansions.
1530 (pp_cxx_type_id): Print pack expansions.
1531 (pp_cxx_template_argument_list): Print argument packs.
1532 (pp_cxx_template_parameter): Print ellipsis for template parameter
1534 * pt.c (comp_template_parms): Compare template parameter packs.
1535 (template_parameter_pack_p): New.
1536 (template_parms_variadic_p): New.
1537 (template_args_variadic_p): New.
1538 (make_ith_pack_parameter_name): New.
1539 (struct find_parameter_pack_data): New.
1540 (find_parameter_packs_r): New.
1541 (uses_parameter_packs): New.
1542 (make_pack_expansion): New.
1543 (check_for_bare_parameter_packs): New.
1544 (expand_template_argument_pack): New.
1545 (reduce_template_parm_level): Propagate parameter pack flag.
1546 (process_template_parm): Add is_parameter_pack parameter to state
1547 when the parameter is actually a parameter pack. Create template
1548 parameter packs when is_parameter_pack is true.
1549 (current_template_args): The argument for a template parameter
1550 pack is an argument pack containing a single pack expansion.
1551 (process_partial_specialization): When checking that non-type
1552 argument expressions do not involve template parameters, loop over
1553 the arguments in argument packs separately.
1554 (push_template_decl_real): Check that the type of the declaration
1555 does not have any bare parameter packs. Check that primary
1556 templates have no more than one parameter pack, and that it comes
1557 at the end of the template parameter list.
1558 (convert_template_argument): Handle coercions for pack expansion
1559 expressions by coercing the pattern then rebuilding the expansion.
1560 (coerce_template_parms): When coercing the arguments for a
1561 variadic template, pack "extra" arguments into an argument pack.
1562 (coerce_template_template_parms): Cannot coerce between parameter
1563 packs and non-pack parameters.
1564 (template_args_equal): Compare PACK_EXPANSION_P expressions.
1565 (comp_template_args): Expand all template arguments packs before
1566 comparing template argument lists.
1567 (mangle_class_name_for_template): Make argument packs as separate
1569 (for_each_template_parm_r): No need to handle BASELINK.
1570 (instantiate_class_template): Handle pack expansions in the base
1572 (tsubst_pack_expansion): New.
1573 (tsubst_template_args): Handle substitutions of argument packs and
1574 pack expansion into template argument lists.
1575 (tsubst_decl): Expand function parameter packs into separate
1576 function parameters.
1577 (tsubst_arg_types): Expand a type pack expansion into separate
1579 (tsubst_exception_specification): Handle pack expansions in
1580 exception specifiers.
1581 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1582 replacing a template parameter with its argument. If we encounter
1583 a substitution for an argument pack, just return the parameter
1585 (tsubst_copy): sizeof(X...) returns the number of elements in
1586 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1587 PARM_DECL is a parameter pack.
1588 (tsubst_expr): Expression pack expansions and argument packs
1589 cannot show up here; they will all be handled through function
1590 calls, sizeof, and template argument lists.
1591 (tsubst_copy_and_build): sizeof(X...) returns the number of
1592 elements in parameter pack X. Handle pack expansions in TREE_LIST
1593 and CONSTRUCTOR nodes.
1594 (fn_type_unification): Handle "incomplete" explicit template
1595 argument lists that specify some of the arguments for a template
1597 (type_unification_real): Unify arguments against pack expansions.
1598 (template_parm_level_and_index): New, helper function.
1599 (unify_pack_expansion): New.
1600 (unify): Unify argument packs on an argument-by-argument basis,
1601 handling variadic argument packs as well.
1602 (more_specialized_fn): Handle unification of function parameter
1603 packs. All things being equal, prefer non-variadic function
1604 templates to variadic function templates.
1605 (more_specialized_class): Prefer the variadic class template
1606 partial specialization that binds fewer arguments to a parameter
1608 (regenerate_decl_from_template): Expand function parameter packs
1609 into separate parameters.
1610 (instantiate_decl): Ditto.
1611 (tsubst_initializer_list): Handle pack expansions for base-class
1613 (dependent_type_p_r): Determine dependent types in argument packs
1614 and pack expansions.
1615 (value_dependent_expression_p): Determine value-dependence of
1616 non-type argument packs.
1617 (dependent_template_arg_p): Handle argument packs.
1618 * semantics.c (finish_cond): Check for bare parameter packs.
1619 (finish_expr_stmt): Ditto.
1620 (finish_for_expr): Ditto.
1621 (finish_switch_cond): Ditto.
1622 (finish_mem_initializers): Ditto.
1623 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1625 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1626 * parser.c (make_declarator): Declarator is not an expansion.
1627 (make_pointer_declarator): Transfer parameter pack flag to outer
1629 (make_reference_declarator): Ditto.
1630 (make_ptrmem_declarator): Ditto.
1631 (make_call_declarator): Ditto.
1632 (make_array_declarator): Ditto.
1633 (cp_parser_postfix_expression): Allow pack expansion expressions
1634 in the argument list for a call expression.
1635 (cp_parser_parenthesized_expression_list): Add new parameter
1636 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1637 into separate arguments."
1638 (cp_parser_new_placement): Allow pack expansion expressions.
1639 (cp_parser_new_initializer): Ditto.
1640 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1641 base-class initializer expansion.
1642 (cp_parser_mem_initializer): Ditto.
1643 (cp_parser_template_parameter_list): Keep track of whether the
1644 template parameter is a template parameter pack.
1645 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1646 template parameter pack.
1647 (cp_parser_type_parameter): Ditto.
1648 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1650 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1651 this declarator is a parameter pack.
1652 (cp_parser_parameter_declaration): The ellipsis does not end the
1653 parameter declaration, because it might be a parameter pack. Parse
1654 the ellipsis to indicate a parameter pack.
1655 (cp_parser_initializer): Allow pack expansions.
1656 (cp_parser_initializer_list): Allow ellipsis to create an
1657 initializer expansion.
1658 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1660 (cp_parser_type_id_list): Allow ellipsis to create an exception
1661 specifier expansion.
1662 (cp_parser_attribute_list): Don't allow pack expansions.
1663 (cp_parser_functional_cast): Allow pack expansions.
1664 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1665 compute the length of a parameter pack.
1666 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1667 end a template argument.
1668 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1669 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1672 2007-03-09 Dirk Mueller <dmueller@suse.de>
1674 * cp/call.c (build_new_op): Call warn_logical_operator.
1676 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1679 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1682 * pt.c (any_template_arguments_need_structural_equality_p):
1685 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1687 * decl.c (grokdeclarator): Disable warnings for anonymous
1690 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1692 * typeck2.c (readonly_error): Always emit a hard error.
1693 Remove last argument.
1694 * cp-tree.h (readonly_error): Adjust prototype.
1695 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1696 * typeck.c (build_unary_op): Likewise.
1697 (build_modify_expr): Likewise.
1699 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1702 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1704 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1707 * parser.c (struct cp_parser): New IN_IF_STMT.
1708 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1709 returning if parsing the body of an 'if' statement or issuing an
1710 error and continuing.
1711 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1713 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1715 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1718 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1721 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1723 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1724 Objective-C++. Don't exit early if -shared-libgcc needs to be
1727 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1729 * typeck.c (common_base_type): Delete unused function.
1731 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1733 * Make-lang.in: Add dummy lang.install-pdf target.
1735 2007-03-01 Simon Baldwin <simonb@google.com>
1738 * decl.c (check_tag_decl): Added new warning for typedef ignored
1739 when it precedes an otherwise valid non-typedef declaration.
1741 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1743 * typeck.c (build_function_call): Store converted arguments
1744 in a stack-allocated array instead of building a list.
1745 (convert_arguments): Store arguments in the array passed in as an
1746 argument, and return the actual number of arguments.
1747 * call.c (build_call): Delete, and replace with...
1748 (build_call_n, build_call_a): New.
1749 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1750 (build_over_call): Store converted arguments in a stack-allocated
1751 array instead of building a list.
1752 (build_cxx_call): Pass arguments in an array instead of as a list.
1753 (build_java_interface_fn_ref): Rewrite to avoid constructing
1755 * tree.h: Update declarations to reflect above changes.
1756 * method.c (use_thunk): Use a stack-allocated array to hold
1757 the arguments instead of a list.
1758 * rtti.c (throw_bad_cast): Update call to cxx_call.
1759 (throw_bad_typeid): Likewise.
1760 (build_dynamic_cast_1): Likewise.
1761 * init.c (build_builtin_delete_call): Use build_call_n.
1762 * decl.c (expand_static_init): Likewise.
1763 * except.c (cp_protect_cleanup_actions): Likewise.
1764 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1765 (gimplify_must_not_throw_expr): Likewise.
1766 (cxx_omp_apply_fn): Use build_call_a.
1768 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1770 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1771 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1773 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1775 * cp-tree.h (static_ctors): Remove.
1776 * cp-tree.h (static_dtors): Likewise.
1777 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1778 refactoring of tree_map hierarchy.
1779 (decl_shadowed_for_var_insert): Likewise.
1780 * semantics.c (expand_body): Use c_expand_body.
1781 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1782 * decl2.c (static_ctors): Remove.
1783 (static_dtors): Likewise.
1784 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1785 objc_generate_static_init_call. Do not call static_[cd]tors.
1786 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1788 (cp_write_global_declarations): Likewise.
1790 2007-02-23 Richard Guenther <rguenther@suse.de>
1792 * class.c (note_name_declared_in_class): Make declaration
1793 changes meaning a pedwarn.
1795 2007-02-22 Michael Matz <matz@suse.de>
1798 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1799 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1800 dump_function_decl): Guard emitting outer scopes by new flag.
1801 * cp-lang.c (cxx_dwarf_name): New function.
1802 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1803 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1805 (push_template_decl_real, lookup_template_class): Remove calls
1808 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1810 * call.c (build_new_method_call): Ensure that explicit calls of
1811 destructors have type "void".
1813 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1815 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1816 and -Walways-true with -Waddress.
1817 * cvt.c (convert_to_void): Replace unconditional warning with
1820 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1822 * decl.c, tree.c: Fix comment typos.
1824 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1827 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1828 statement expression if we had an error mark node.
1830 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1831 Brooks Moses <brooks.moses@codesourcery.com>
1832 Lee Millward <lee.millward@codesourcery.com>
1834 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1835 Change class to tcc_vl_exp.
1837 * call.c (build_call): Use build_call_list instead
1839 (build_over_call): Likewise.
1840 (build_new_method_call): Use build_min_non_dep_call_list
1841 instead of build_min_non_dep.
1843 * error.c (dump_call_expr_args): New function.
1844 (dump_aggr_init_expr_args): New function.
1845 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1846 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1848 * cvt.c (convert_to_void): Use build_call_array instead
1849 of build3; use new AGGR_INIT_EXPR accessor macros.
1851 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1852 instead of TREE_CODE_LENGTH.
1854 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1855 AGGR_INIT_EXPR accessor macros.
1857 * cp-gimplify.c (cp_gimplify_init_expr): Use
1858 AGGR_INIT_EXPR_SLOT to set the slot operand.
1860 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1861 (AGGR_INIT_EXPR_SLOT): New macro.
1862 (AGGR_INIT_EXPR_ARG): New macro.
1863 (aggr_init_expr_nargs): New macro.
1864 (AGGR_INIT_EXPR_ARGP): New macro.
1865 (aggr_init_expr_arg_iterator): New.
1866 (init_aggr_init_expr_arg_iterator): New.
1867 (next_aggr_init_expr_arg): New.
1868 (first_aggr_init_expr_arg): New.
1869 (more_aggr_init_expr_args_p): New.
1870 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1871 (stabilize_aggr_init): New declaration.
1872 (build_min_non_dep_call_list): Likewise.
1874 * tree.c (process_aggr_init_operands): New function.
1875 (build_aggr_init_array) New function.
1876 (build_cplus_new): Update to use new CALL_EXPR and
1877 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1878 build_aggr_init_array.
1879 (build_min_non_dep_call_list) New function.
1880 (build_min_nt): Assert input code parameter is not a variable
1881 length expression class.
1882 (build_min, build_min_non_dep): Likewise.
1883 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1884 to check for equality instead of recursing. Handle tcc_vl_exp
1886 (stabilize_call): Update to only handle CALL_EXPRs, not
1887 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1888 (stabilize_aggr_init): New function.
1889 (stabilize_init): Use it.
1891 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1892 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1893 AGGR_INIT_EXPR accessor macros and argument iterators.
1895 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1896 build_vl_exp. Iterate through the operands, recursively
1897 processing each one.
1898 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1899 CALL_EXPR accessor macros.
1900 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1901 tree code classes. Use TREE_OPERAND_LENGTH instead of
1904 * semantics.c (finish_call_expr): Use build_nt_call_list
1905 instead of build_nt.
1906 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1907 accessor macros. Use build_call_array to construct the
1908 CALL_EXPR node instead of build3
1910 * decl2.c (build_offset_ref_call_from_tree): Use
1911 build_nt_call_list and build_min_non_dep_call_list instead
1912 of build_min_nt and build_min_non_dep.
1914 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1915 Use build_nt_call_list instead of build_min_nt.
1917 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1920 * call.c (build_conditional_expr): Improve error message.
1922 2007-02-13 Dirk Mueller <dmueller@suse.de>
1924 * friend.c (do_friend): Annotate warning about friend
1925 declarations in templates with OPT_Wnon_template_friend.
1926 Convert informal message from warning() to inform().
1928 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
1929 Mark Mitchell <mark@codesourcery.com>
1932 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1933 instantiations for variables.
1935 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1938 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1939 Check warn_unused_value just once.
1941 2007-02-11 Mark Mitchell <mark@codesourcery.com>
1944 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1945 (fn_type_unificiation): Likewise.
1946 (get_bindings): Likewise.
1948 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
1951 * decl.c (finish_function): Use DECL_REPLACEABLE.
1952 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1954 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1956 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1958 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1960 * decl.c (grokvardecl): Don't error if !have_tls.
1961 (grokdeclarator): Likewise.
1962 * parser.c (cp_parser_omp_threadprivate): Likewise.
1964 2007-02-07 Jakub Jelinek <jakub@redhat.com>
1967 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1968 parameters and result decls in omp clauses.
1969 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1972 2007-02-05 Dirk Mueller <dmueller@suse.de>
1975 * parser.c (cp_parser_class_specifier): Always initialize bases.
1977 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1979 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1980 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1981 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1983 * semantics.c (finish_omp_atomic): Store a whole expression node
1984 in operand 1, and integer_zero_node in operand 0, for dependent
1985 OMP_ATOMIC. Rewrite to make flow easier to understand.
1987 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1989 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1991 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
1993 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
1994 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
1996 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
1998 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
1999 keyword warning to -Wc++0x-compat.
2001 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2003 * decl.c (grokdeclarator): Update documentation.
2005 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2008 * decl.c (grokdeclarator): If __thread is used together with
2009 a storage class other than extern and static, clear thread_p
2010 after issuing diagnostics and fall through to checking the
2013 2007-01-30 Roger Sayle <roger@eyesopen.com>
2015 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2016 calculating the size of an array (to avoid recursive errors).
2018 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2021 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2023 * call.c (convert_like_real): Don't warn when converting to
2026 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2028 * decl.c (pop_label): Replace warning with call to
2029 warn_for_unused_label.
2031 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2034 * semantics.c (finish_pseudo_destructor_expr): Check the
2035 destrutor name by calling check_dtor_name.
2037 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2039 * lex.c (D_CPP0X): Rename.
2041 (reswords): D_CPP0X -> D_CXX0X.
2042 (init_reswords): Ditto.
2043 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2044 of C++0x keywords as identifiers.
2046 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2049 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2052 2007-01-23 Ian Lance Taylor <iant@google.com>
2054 * typeck.c (convert_for_assignment): Only warn about a = b = c
2055 when converting to bool.
2057 2007-01-23 Roger Sayle <roger@eyesopen.com>
2059 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2061 * typeck.c (ignore_overflows): Remove the remaining uses of
2062 TREE_CONSTANT_OVERFLOW.
2064 2007-01-20 Jan Hubicka <jh@suse.cz>
2066 * decl2.c (start_objects, start_static_storage_duration_function):
2067 Do not make the functions uninlinable.
2069 2007-01-17 Ian Lance Taylor <iant@google.com>
2071 * class.c (add_method): Call VEC_reserve_exact rather than passing
2072 a negative size to VEC_reserve.
2074 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2077 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2079 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2082 * decl.c (make_typename_type): If the qualified name is not a
2083 type, issue an error.
2084 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2087 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2089 * rtti.c: Include target.h.
2090 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2091 don't emit typeinfo for fundamental types as weak.
2092 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2094 2007-01-08 Richard Guenther <rguenther@suse.de>
2096 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2098 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2100 * call.c (standard_conversion): Pass flag to
2101 vector_types_convertible_p to disallow emission of note.
2102 * typeck.c (convert_for_assignment): Pass flag to
2103 vector_types_convertible_p to allow emission of note.
2104 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2105 to disallow emission of note.
2107 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2110 * typeck.c (build_binary_op): Call overflow_warning if
2111 TREE_OVERFLOW_P is true for the result and not for any of the
2114 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2117 * class.c (add_method): Don't wait until template
2118 instantiation time to complain about duplicate methods.
2120 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2123 * semantics.c (finish_unary_op_expr): Warn only if result
2124 overflowed and operands did not.
2126 2007-01-05 Ian Lance Taylor <iant@google.com>
2128 * typeck.c (build_binary_op): Warn about comparing a non-weak
2131 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2133 * pt.c (tsubst): Propagate the need for structural equality checks
2134 when reducing the level of template parameters.
2136 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2138 * pt.c: Fix a comment typo.
2140 2007-01-02 Ian Lance Taylor <iant@google.com>
2142 * semantics.c (maybe_convert_cond): Optionally warn when using an
2143 assignment as a condition.
2144 * typeck.c (convert_for_assignment): Optionally warn about
2145 assigning the result of an assignment to a bool.
2147 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2149 * pt.c (canonical_template_parms): Correct typo in comment.
2151 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2153 * typeck.c (structural_comptypes): Renamed from "comptypes".
2154 (comptypes): Use canonical type information to perform fast type
2155 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2156 canonical type comparison returns the same results as we would see
2157 from the current, structural check. Support COMPARE_STRUCTURAL
2158 when we need structural checks.
2159 * decl.c (typename_compare): Fix comment.
2160 (build_typename_type): TYPENAME_TYPE nodes require structural
2161 equality checks, because they resolve different based on the
2163 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2164 require structural equality checks (for now).
2165 (build_ptrmemfunc_type): Build the canonical pointer to member
2167 (compute_array_index_type): Whenever we build a new index type
2168 to represent the size of an array in a template, we need to mark
2169 this index type as requiring structural equality. This goes for
2170 arrays with value-dependent sizes with the current ABI, or all
2172 * tree.c (cplus_array_hash): New.
2173 (struct cplus_array_info): New.
2174 (cplus_array_compare): New.
2175 (cplus_array_htab): New.
2176 (build_cplus_array_type_1): Use a hash table to cache the array
2177 types we build. Build the canonical array type for each array
2179 (cp_build_qualified_type_real): When building a cv-qualified array
2180 type, use the hash table of array types and build canonical array
2182 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2183 use structural equality (for now).
2184 * cp-tree.h (COMPARE_STRUCTURAL): New.
2185 * pt.c (canonical_template_parms): New.
2186 (canonical_type_parameter): New.
2187 (process_template_parm): Find the canonical type parameter.
2188 (lookup_template_class): When we have named the primary template
2189 type, set the canonical type for our template class to the primary
2190 template type. If any of the template arguments need structural
2191 equality checks, the template class needs structural equality
2193 (tsubst): When reducing the level of a template template
2194 parameter, we require structural equality tests for the resulting
2195 parameter because its template parameters have not had their types
2196 canonicalized. When reducing a template type parameter, find the
2197 canonical reduced type parameter.
2198 (any_template_arguments_need_structural_equality_p): New.