1 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
3 * mangle.c (write_type): Change mangling of rvalue reference from
6 2007-08-31 Jakub Jelinek <jakub@redhat.com>
8 * decl.c (duplicate_decls): Remove duplicated line.
10 2007-08-31 Paolo Carlini <pcarlini@suse.de>
13 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
14 BOUND_TEMPLATE_TEMPLATE_PARM.
16 2007-08-31 Paolo Carlini <pcarlini@suse.de>
19 * search.c (lookup_member): Check the name argument for
22 2007-08-31 Paolo Carlini <pcarlini@suse.de>
25 * parser.c (cp_parser_trait_expr): Check rerurn value of
28 2007-08-30 Ollie Wild <aaw@google.com>
30 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
31 convert_ptrmem for pointer to member conversions.
32 (convert_to_pointer_force): Update cp_convert_to_pointer call.
33 (ocp_convert): Update cp_convert_to_pointer call.
34 * typeck.c (convert_ptrmem): Add conditional for null pointers to
36 (build_static_cast_1): Check can_convert for conversions in either
38 (get_delta_difference_1): New function.
39 (get_delta_difference): Refactor to call get_delta_difference_1.
42 2007-08-28 Paolo Carlini <pcarlini@suse.de>
45 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
46 BOUND_TEMPLATE_TEMPLATE_PARM.
48 2007-08-28 Jakub Jelinek <jakub@redhat.com>
52 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
53 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
55 2007-08-27 Jason Merrill <jason@redhat.com>
58 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
59 Look inside STMT_EXPR.
60 * semantics.c (stmt_expr_value_expr): New fn.
61 * cp-tree.h: Declare it.
64 * decl.c (groktypename): Ignore attributes applied to class type.
66 2007-08-28 Richard Guenther <rguenther@suse.de>
68 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
70 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
72 * error.c (dump_expr): Handle COMPLEX_CST.
73 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
74 (pp_cxx_expression): Likewise.
76 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
78 * decl.c (GNU_INLINE_P): New.
79 (duplicate_decls): Handle gnu_inline. Merge attributes and
80 some flags in overriding definitions.
81 (redeclaration_error_message): Handle gnu_inline.
82 (start_preparsed_function): Likewise.
84 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
86 * call.c (sufficient_parms_p): Constify.
87 * class.c (same_signature_p): Likewise.
88 * cp-gimplify.c (is_invisiref_parm,
89 cxx_omp_privatize_by_reference): Likewise.
90 * cp-objcp-common.c (has_c_linkage): Likewise.
91 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
92 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
93 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
94 num_artificial_parms_for, comp_template_parms,
95 template_parameter_pack_p, any_dependent_template_arguments_p,
96 any_type_dependent_arguments_p, any_value_dependent_elements_p,
97 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
98 zero_init_p, member_p, cp_lvalue_kind,
99 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
100 varargs_function_p, is_dummy_object, special_function_kind,
101 string_conv_p, type_unknown_p, comp_except_specs, compparms,
102 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
103 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
104 cp_has_mutable_p, at_least_as_qualified_p,
105 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
106 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
107 * except.c (nothrow_libfn_p): Likewise.
108 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
110 * pt.c (comp_template_parms, template_parameter_pack_p,
111 any_type_dependent_arguments_p, any_value_dependent_elements_p,
112 any_dependent_template_arguments_p): Likewise.
113 * repo.c (repo_export_class_p): Likewise.
114 * semantics.c (anon_aggr_type_p): Likewise.
115 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
116 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
117 varargs_function_p, member_p, is_dummy_object, pod_type_p,
118 zero_init_p, special_function_p): Likewise.
119 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
120 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
121 compparms, invalid_nonstatic_memfn_p,
122 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
123 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
124 cp_has_mutable_p, lvalue_or_else): Likewise.
126 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
128 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
129 * cp-objcp-common.c (cp_tree_size): Ditto.
130 * tree.c (cp_walk_subtrees): Ditto
131 * cp-tree.def (TINST_LEVEL): Go away.
132 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
133 move together with other non-tree structs.
134 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
135 (union lang_tree_node): Eliminate tinst_level field.
136 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
137 (current_instantiation, outermost_tinst_level): Return
138 a "struct tinst_level *".
140 * error.c (print_instantiation_partial_context): Change second
141 parameter to a "struct tinst_level *". Replace accessor macros
143 (print_instantiation_full_context): Likewise.
144 * lex.c (in_main_input_context): Likewise.
146 * pt.c (struct pending_templates): New.
147 (pending_templates, last_pending_template): Use it as a type.
148 (current_tinst_level): Change typo to "struct tinst_level *"
149 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
150 (add_pending_template): Construct a "struct pending_template".
151 Replace TINST_LEVEL accessor macros with field access.
152 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
153 (pop_tinst_level): Likewise.
154 (instantiate_pending_templates): Likewise. Factor common code used
155 when an instantiation has been done.
156 (outermost_tinst_level): Replace tree_last with loop.
157 (current_instantiation): Return a "struct tinst_level *".
159 2007-08-24 Ollie Wild <aaw@google.com>
161 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
162 * name-lookup.h (cp_binding_level): Remove vtables member.
164 2007-08-24 Richard Guenther <rguenther@suse.de>
166 * tree.c (cp_cannot_inline_tree_fn): Remove.
167 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
168 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
171 2007-08-24 Jakub Jelinek <jakub@redhat.com>
174 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
175 error_mark_node right away if build_expr_type_conversion
179 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
180 is error_mark_node rather than NULL_TREE.
181 * pt.c (check_explicit_specialization): Likewise.
184 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
185 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
187 2007-08-22 Jason Merrill <jason@redhat.com>
190 * pt.c (outermost_tinst_level): New function.
191 * lex.c (in_main_input_context): New function.
192 * cp-tree.h: Declare it.
193 * decl2.c (constrain_class_visibility): Use it to avoid warning
194 about uses of the anonymous namespace in the main input file.
196 2007-08-21 Jakub Jelinek <jakub@redhat.com>
198 * init.c (build_new_1): Use get_target_expr instead of save_expr.
200 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
203 * class.c (finish_struct_1): Warn when a class has virtual
204 functions and accessible non-virtual destructor.
206 2007-08-20 Richard Guenther <rguenther@suse.de>
210 * call.c (build_new_method_call): Convert initializer to
212 * init.c (build_aggr_init): Do not fiddle with types.
213 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
214 * except.c (build_throw): Do not drop qualifiers for the
216 * typeck.c (get_member_function_from_ptrfunc): Do not
217 fiddle with types, instead convert.
218 (build_ptrmemfunc1): Convert to the target type for
220 (gfc_trans_allocate): Convert result to target type.
221 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
222 pointer-to-member structures shall have alias set zero as well.
224 2007-08-20 Richard Guenther <rguenther@suse.de>
226 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
228 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
229 (nonstatic_local_decl_p): Likewise.
230 * tree.c (cp_auto_var_in_fn_p): Remove.
231 * decl.c (nonstatic_local_decl_p): Remove.
233 2007-08-20 Richard Guenther <rguenther@suse.de>
235 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
237 * tree.h (cp_walk_tree): New define to walk_tree_1 with
238 cp_walk_subtrees lh parameter.
239 (cp_walk_tree_without_duplicates): New define to
240 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
241 * tree.c (count_trees): Call
242 cp_walk_tree_without_duplicates.
243 (verify_stmt_tree): Call cp_walk_tree.
244 (break_out_target_exprs): Likewise.
245 (WALK_SUBTREE): Likewise.
246 * cp-gimplify.c (cp_genericize): Likewise.
247 * cp-pt.c (find_parameter_packs_r): Likewise.
248 (uses_parameter_packs): Likewise.
249 (make_pack_expansion): Likewise.
250 (check_for_bare_parameter_packs): Likewise.
251 (for_each_template_parm): Likewise.
252 * decl.c (check_default_argument): Call
253 cp_walk_tree_without_duplicates.
254 * except.c (build_throw): Likewise.
255 * decl2.c (type_visibility): Likewise.
256 * semantics.c (expand_or_defer_fn): Likewise.
257 (finalize_nrv): Call cp_walk_tree.
259 2007-08-20 Jakub Jelinek <jakub@redhat.com>
262 * init.c (build_new_1): Rename placement_var variable to placement_expr.
263 Initialize it with save_expr rather than get_temp_regvar.
265 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
268 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
271 2007-08-17 Ollie Wild <aaw@google.com>
274 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
275 declarations into appropriate slots for comparison. Fix type
278 2007-08-17 Paolo Carlini <pcarlini@suse.de>
281 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
282 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
284 2007-08-17 Paolo Carlini <pcarlini@suse.de>
287 * parser.c (cp_parser_class_head): Improve error message.
289 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
291 * pt.c (instantiate_decl): Set input_location
292 for the function end.
294 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
296 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
298 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
299 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
300 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
301 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
302 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
303 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
304 * typeck.c (cp_type_quals): Likewise.
305 * typeck2.c (cxx_incomplete_type_diagnostic,
306 cxx_incomplete_type_error): Likewise.
308 2007-08-16 Paolo Carlini <pcarlini@suse.de>
311 * pt.c (tsubst_friend_function): When check_classfn
312 returns error_mark_node likewise return it.
314 2007-08-15 Jakub Jelinek <jakub@redhat.com>
317 * typeck.c (check_return_expr): Don't NRV optimize vars in
319 * decl.c (finish_function): Comment fix.
321 2007-08-15 Paolo Carlini <pcarlini@suse.de>
324 * pt.c (push_template_decl_real): Depending on TYPE_P
325 use either TYPE_CONTEXT or DECL_CONTEXT.
327 2007-08-14 Mark Mitchell <mark@codesourcery.com>
329 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
330 constructors and destructors return this.
332 2007-08-14 Paolo Carlini <pcarlini@suse.de>
335 * decl2.c (check_classfn): Return error_mark_node in case of error;
336 in that case, do not call add_method.
337 * decl.c (start_decl): Deal with check_classfn returning
339 (grokfndecl): Likewise.
340 * pt.c (tsubst_friend_function): Likewise.
342 2007-08-14 Andrew Pinski <pinskia@gmail.com>
345 * typeck.c (build_binary_op): Disallow vector float types with
346 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
348 2007-08-11 Ian Lance Taylor <iant@google.com>
350 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
352 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
354 2007-08-10 Ollie Wild <aaw@google.com>
356 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
358 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
360 (unqualified_namespace_lookup): Fix ambiguous_decl call.
361 (lookup_using_namespace): Fix ambiguous_decl call.
362 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
364 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
366 * call.c (name_as_c_string): Use CONST_CAST.
367 * decl.c (build_decl): Likewise.
368 * parser.c (cp_parser_string_literal): Likewise.
370 2007-08-10 Paolo Carlini <pcarlini@suse.de>
373 * error.c (dump_expr): Consistently use the *_cxx_*
374 variants of the pretty-print functions.
376 2007-08-10 Paolo Carlini <pcarlini@suse.de>
379 * decl.c (check_special_function_return_type): Just error
380 on return type specified for conversion operator.
382 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
384 * typeck2.c (readonly_error): Handle general expressions.
385 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
387 2007-08-06 Dan Hipschman <dsh@google.com>
389 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
390 access function name.
392 2007-08-04 Alfred Minarik <a.minarik@aon.at>
395 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
396 * g++spec.c (lang_specific_driver): Check them.
398 2007-08-06 Paolo Carlini <pcarlini@suse.de>
401 * pt.c (template_class_depth): Fix comment; change return type
404 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
407 2007-03-26 Dirk Mueller <dmueller@suse.de>
409 * parser.c (cp_parser_member_declaration): Pedwarn
410 about stray semicolons after member declarations.
412 2007-08-02 Lee Millward <lee.millward@gmail.com>
417 * parser.c (cp_parser_asm_definition): Detect and discard asm
418 statements with invalid inputs or outputs.
419 (cp_parser_asm_operand_list): Return error mark node if any
420 of the operands are invalid. Adjust documentation.
422 2007-08-02 Nick Clifton <nickc@redhat.com>
424 * typeck.c: Change copyright header to refer to version 3 of the
425 GNU General Public License and to point readers at the COPYING3
426 file and the FSF's license web page.
427 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
428 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
429 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
430 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
431 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
432 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
433 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
434 name-lookup.h, parser.c: Likewise.
436 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
439 * call.c (magic_varargs_p): Honor the "type generic" attribute.
441 2007-07-30 Paolo Carlini <pcarlini@suse.de>
444 * semantics.c (finish_label_stmt): Reject the __label__
445 extension outside function scopes.
447 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
449 * parser.c (eof_token): Un-constify.
450 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
451 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
454 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
456 * pt.c, tree.c, typeck2.c: Fix comment typos.
458 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
459 Mark Mitchell <mark@codesourcery.com>
462 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
463 hidden due to friend declarations in local classes.
465 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
467 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
468 * cp-tree.def (DECLTYPE_TYPE): New.
469 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
470 (dump_type_prefix): Ditto.
471 (dump_type_suffix): Ditto.
472 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
473 * mangle.c (write_type): Handle DECLTYPE_TYPE.
474 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
476 (DECLTYPE_TYPE_EXPR): New.
477 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
478 (finish_declared_type): Declare.
479 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
481 (pp_cxx_type_id): Ditto.
482 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
483 (tsubst): Substitute into a DECLTYPE_TYPE node.
484 (tsubst_copy): Ditto.
485 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
487 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
488 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
489 structural equality (because we can't hash the expressions).
490 (finish_declared_type): New.
491 * lex.c (reswords): Add "decltype" keyword.
492 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
493 (cp_parser_postfix_expression): Add member_access_only_p to
494 restrict postfix expression to member access expressions.
495 (cp_parser_unary_expression): Update call to
496 cp_parser_postfix_expression to reflect new parameter.
497 (cp_parser_declared_type): New.
498 (cp_parser_simple_type_specifier): Parse decltype types.
500 2007-07-27 Mark Mitchell <mark@codesourcery.com>
503 * call.c (convert_for_arg_passing): Only widen bitfields to their
504 declared types if necessary.
506 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
508 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
511 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
513 * decl.c (typename_hash, typename_compare): Constify.
514 * mangle.c (hash_type, compare_type): Likewise.
515 * pt.c (eq_local_specializations, hash_local_specialization):
517 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
518 list_hash): Likewise.
519 * typeck2.c (pat_compare): Likewise.
521 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
523 * method.c (implicitly_declare_fn): Increase alignment if member
524 function pointer format requires it.
526 2007-07-24 Paolo Carlini <pcarlini@suse.de>
529 * typeck.c (check_return_expr): Do not pass a null argument
532 2007-07-24 Paolo Carlini <pcarlini@suse.de>
535 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
538 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
541 * typeck.c (convert_arguments): Only use default args if we have
545 * typeck.c (structural_comptypes): No need to check
546 resolve_typename_type return value here.
547 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
548 * pt.c (resolve_typename_type): Follow typename typedefs. Return
549 original type rather than error_mark_node in case of failure.
550 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
551 resolve_typename_type result check.
552 (cp_parser_direct_declarator, cp_parser_head,
553 cp_parser_constructor_declarator_p): Likewise.
555 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
557 * pt.c (template_parms_variadic_p): Remove.
558 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
560 2007-07-12 Jakub Jelinek <jakub@redhat.com>
563 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
564 argument to dump_aggr_init_expr_args instead of false.
566 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
568 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
569 canonical types; otherwise, fall back to structural type
570 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
571 internal compiler error if the canonical types are wrong.
573 2007-07-11 Paolo Carlini <pcarlini@suse.de>
576 * parser.c (cp_parser_make_indirect_declarator): When the
577 the code argument is ERROR_MARK return cp_error_declarator.
579 2007-07-09 Geoffrey Keating <geoffk@apple.com>
582 * decl.c (cxx_init_decl_processing): Don't set
583 force_align_functions_log.
584 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
585 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
586 FUNCTION_DECL, return its alignment.
588 2007-07-09 Richard Guenther <rguenther@suse.de>
590 * decl.c (start_preparsed_function): Do not promote return type.
592 2007-07-08 Paolo Carlini <pcarlini@suse.de>
595 * pt.c (unify): Never pass error_mark_node to template_decl_level.
597 2007-07-07 Mark Mitchell <mark@codesourcery.com>
600 * pt.c (resolve_overloaded_unification): Robustify. Return a
602 (type_unification_real): Adjust accordingly.
604 2007-07-06 Richard Guenther <rguenther@suse.de>
606 * init.c (build_new_1): Use the correct pointer type.
607 * typeck2.c (build_m_component_ref): Likewise.
609 2007-07-05 Mark Mitchell <mark@codesourcery.com>
612 * init.c (build_zero_init): Always build an initializer for
614 * typeck2.c (build_functional_cast): Use build_zero_init.
617 * init.c (build_new_1): Always pass the allocation function to
618 build_op_delete_call.
619 * call.c (build_op_delete_call): Handle operator delete with a
620 variable-argument list. Do not issue an error when no matching
621 deallocation function is available for a new operator.
624 * cp-tree.h (any_value_dependent_elements_p): Declare it.
625 * decl.c (value_dependent_init_p): New function.
626 (cp_finish_decl): Use it.
627 * pt.c (value_dependent_expression_p): Use
628 any_value_dependent_elements_p.
629 * parser.c (cp_parser_primary_expression): Add comment about
630 treating dependent qualified names as integral
631 constant-expressions.
633 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
635 * decl.c (build_ptrmemfunc_type): Always use structural equality
636 tests when comparing pointer-to-member-function types, because the
637 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
640 2007-07-03 Mark Mitchell <mark@codesourcery.com>
642 * init.c (build_new): Tweak comment.
644 2007-06-29 Dave Brolley <brolley@redhat.com>
647 * parser.c (cp_parser_new_type_id): Don't reduce a named array
648 type to its base type and number of elements here.
649 * init.c (build_new): Call complete_type_or_else to ensure that the
650 type is complete and to issue a diagnostic if it is not.
651 (build_new_1): Don't call complete_type_or_else here.
653 2007-07-03 Richard Guenther <rguenther@suse.de>
656 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
659 2007-07-02 Simon Baldwin <simonb@google.com>
661 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
662 for inner-style nested forward declarations that don't declare
665 2007-07-02 Jakub Jelinek <jakub@redhat.com>
668 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
669 DECL_P in not a variable and appears more than once error messages.
671 2007-07-01 Ollie Wild <aaw@google.com>
673 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
674 (select_decl): Remove function.
675 (unqualified_namespace_lookup): Populate binding by calling
676 ambiguous_decl. Remove select_decl call.
677 (lookup_qualified_name): Remove select_decl call.
678 * decl.c (lookup_and_check_tag): Check for ambiguous references.
679 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
680 generation when name lookup is ambiguous.
682 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
685 * init.c (build_new_1): Use structural equality on the copy of the
688 2007-06-28 Geoffrey Keating <geoffk@apple.com>
690 * decl2.c (determine_visibility): Implement
691 flag_visibility_ms_compat effect on type info.
692 * decl.c (cxx_init_decl_processing): Implement
693 global effect of flag_visibility_ms_compat.
695 2007-06-28 Geoffrey Keating <geoffk@apple.com>
697 * decl2.c (start_objects): Mark constructor-running function
700 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
703 * decl.c (grokdeclarator): Reset friendp for member functions declared
704 friend of their own class.
706 2007-06-23 Mark Mitchell <mark@codesourcery.com>
708 * decl2.c (determine_visibility): Don't look for dllexport here.
709 (determine_visibility_from_class): Tidy.
711 2007-06-18 Simon Baldwin <simonb@google.com>
714 * parser.c (cp_parser_single_declaration): Added check for storage
715 class other than sc_none in parsed declaration, and a flag to indicate
716 if the call is part of an explicit template specialization parse.
717 * (cp_parser_explicit_specialization): Specialization check flag added
718 to call to cp_parser_single_declaration(), set true.
719 * (cp_parser_template_declaration_after_export): Specialization check
720 flag added to call to cp_parser_single_declaration(), set false.
721 * pt.c (check_explicit_specialization): Added code to copy visiblity
722 and linkage from the templated function to the explicit specialization.
724 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
726 * typeck.c (build_binary_op): For templates build the
727 expression in pieces to avoid the assert in build2_stat.
728 (get_member_function_from_ptrfunc):
729 Change over to using POINTER_PLUS_EXPR and convert
730 the second operand to sizetype.
731 * typeck2.c (build_m_component_ref): Likewise.
732 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
733 instead of PLUS_EXPR for pointers.
734 (build_new_1): Likewise.
735 (build_vec_delete_1): Likewise.
736 (build_vec_delete): Likewise.
737 * class.c (build_base_path): Likewise.
738 (build_base_path): Likewise.
739 (convert_to_base_statically): Likewise.
740 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
741 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
742 instead of PLUS_EXPR.
743 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
744 instead of PLUS_EXPR for pointers.
745 * call.c (build_special_member_call): Likewise.
746 * rtti.c (build_headof): Likewise.
747 Use sizetype instead of ptrdiff_type_node.
748 (tinfo_base_init): Create a POINTER_PLUS_EXPR
749 instead of PLUS_EXPR for pointers.
750 * except.c (expand_start_catch_block): Do a
751 NEGATIVE and then a POINTER_PLUS_EXPR instead
753 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
754 PLUS_EXPR on pointer types over to use
755 POINTER_PLUS_EXPR and remove the conversion
756 to the pointer types.
757 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
758 adding to a pointer type. Use size_int instead of
759 ssize_int. Convert the index to sizetype before
760 adding it to the pointer.
762 2007-06-15 Mark Mitchell <mark@codesourcery.com>
764 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
765 (DECL_ANON_UNION_VAR_P): New macro.
766 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
767 than DECL_VAR_MARKED_P, to keep track of which variables we have
769 * decl.c (redeclaration_error_message): Complain about redeclaring
770 anonymous union members at namespace scope.
771 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
773 2007-06-14 Geoff Keating <geoffk@apple.com>
775 * decl2.c (determine_visibility): Ensure that functions with
776 hidden types as parameters are hidden.
779 * decl2.c (determine_visibility): Remove duplicate code for
782 2007-06-12 Ian Lance Taylor <iant@google.com>
785 * init.c (avoid_placement_new_aliasing): New static function.
786 (build_new_1): Call it.
788 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
790 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
791 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
793 2007-06-08 Jakub Jelinek <jakub@redhat.com>
796 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
797 on init, the non-decl cond operand and increment value.
799 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
802 * decl.c (check_initializer): Report an error when a brace enclosed
803 initializer is used for a non-aggregate type in C++98.
804 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
806 (grokdeclarator): Likewise.
807 (move_fn_p): Likewise.
808 * typeck.c (check_return_expr): Likewise.
809 * call.c (reference_binding): Likewise.
810 * error.c (cp_cpp_error): Likewise.
811 * pt.c (check_default_tmpl_args): Likewise.
813 * lex.c (init_reswords): Likewise.
814 * parser.c (p_parser_primary_expression): Likewise.
815 (TOKEN_PRECEDENCE): Likewise.
816 (cp_parser_init_declarator): Likewise.
817 (cp_parser_ptr_operator): Likewise.
818 (cp_parser_parameter_declaration): Likewise.
819 (cp_parser_enclosed_template_argument_list): Likewise.
820 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
821 (cp_parser_next_token_ends_template_argument_p): Likewise.
823 2007-06-04 Simon Baldwin <simonb@google.com>
825 * decl.c (grokdeclarator): Readability change. Moved case labels
826 into direct switch statement scope.
828 2007-06-04 Paolo Carlini <pcarlini@suse.de>
830 * call.c (convert_like_real): Remove pointless code.
832 2007-05-31 Mark Mitchell <mark@codesourcery.com>
834 * decl.c (get_atexit_fn_ptr_type): New function.
835 (get_atexit_node): Use it.
836 (start_cleanup_fn): Likewise.
837 (register_dtor_fn): Use the object's destructor, instead of a
838 separate cleanup function, where possible.
839 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
840 (atexit_fn_ptr_type_node): New macro.
841 * decl2.c (build_cleanup): Use build_address.
843 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
845 * typeck.c (build_binary_op): Include types in error.
847 2007-05-31 Jakub Jelinek <jakub@redhat.com>
850 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
851 needs runtime initialization.
853 2007-05-31 Paolo Carlini <pcarlini@suse.de>
856 * semantics.c (finish_trait_expr): Complete the types.
858 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
859 Douglas Gregor <doug.gregor@gmail.com>
860 Pedro Lamarao <pedro.lamarao@mndfck.org>
861 Howard Hinnant <howard.hinnant@gmail.com>
865 * typeck.c (comptypes): Don't consider rvalue and lvalue
866 reference types to be equivalent.
867 (check_return_expr): Move from certain lvalues when returning
869 * decl.c (grokdeclarator): Implement reference collapsing.
870 (copy_fn_p): Don't consider constructors taking rvalue references
871 to be copy constructors.
873 * call.c (conversion): New "rvaluedness_matches_p" member.
874 (convert_class_to_reference): Require reference type as first
875 parameter instead of base type.
876 (reference_binding): Add logic to handle rvalue references.
877 (implicit_conversion): Update inaccurate comment.
878 (convert_like_real): Disable creation of temporaries that are
879 impossible to initialize for types with move constructors.
880 (build_over_call): Elide move constructors when possible.
881 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
882 (maybe_handle_ref_bind): Return conversion instead of type node.
883 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
884 determine preferred conversion sequences.
885 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
886 (LOOKUP_PREFER_RVALUE): New.
887 (DECL_MOVE_CONSTRUCTOR_P): New.
888 (struct cp_declarator): Add "reference" member for reference
889 types, with new "rvalue_ref" flag.
890 (cp_build_reference_type): Declare.
891 (move_fn_p): Declare.
892 * error.c (dump_type_prefix): Format rvalue reference types
893 correctly in error messages.
894 * except.c (build_throw): Move from certain lvalues when
896 * mangle.c (write_type): Mangle rvalue references differently
897 than regular references.
898 * parser.c (make_reference_declarator): Add boolean parameter for
900 (cp_parser_make_indirect_declarator): New.
901 (cp_parser_new_declarator_opt): Call
902 cp_parser_make_indirect_declarator.
903 (cp_parser_conversion_declarator_opt): Ditto.
904 (cp_parser_declarator): Ditto.
905 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
907 * pt.c (tsubst): Implement reference collapsing.
908 (maybe_adjust_types_for_deduction): Implement special template
909 parameter deduction rule for rvalue references.
910 (type_unification_real): Update calls to
911 maybe_adjust_types_for_deduction.
912 (try_one_overload): Ditto.
913 (unify_pack_expansion): Ditto.
914 * tree.c (lvalue_p_1): Handle rvalue reference types.
915 (cp_build_reference_type): New.
917 2007-05-30 Jakub Jelinek <jakub@redhat.com>
920 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
921 variables that need runtime initialization.
923 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
926 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
927 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
928 case POSTDECREMENT_EXPR>): Return the error_mark_node
929 if either the real or imaginary parts would an
932 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
933 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
936 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
937 token is a closing brace, false if there are no tokens left.
938 (cp_parser_namespace_alias_definition): Only consume the next token if
939 it is a closing brace.
941 * parser.c (cp_parser_class_specifier): Likewise.
943 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
945 * semantics.c (finish_member_declaration): Fix a typo in the
948 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
960 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
961 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
962 * pt.c (check_for_bare_parameter_packs): Return bool indicated
963 whether everything was okay. Fix indentation.
964 (push_template_decl_real): Check for bare parameter packs in
965 function parameters; where errors occur, mark the parameter types
966 with ERROR_MARK_NODEs to avert ICEs.
967 (coerce_template_parameter_pack): New.
968 (coerce_template_parms): Moved parameter pack coercion into
969 coerce_template_parameter_pack, and permit it anywhere in the
970 template parameter list (not just at the end). Parameter and
971 argument indices can vary (somewhat) separately now, so add
972 PARM_IDX and ARG_IDX.
973 (fn_type_unification): Don't set an argument pack as incomplete if
974 no argument pack was deduced.
975 (type_unification_real): If a type parameter is a parameter pack
976 and has not otherwise been deduced, it will be deduced to an empty
978 (more_specialized_fn): Use the actual lengths of the argument
979 lists when comparing against expansions.
980 * semantics.c (finish_member_declaration): If a field's type has
981 bare parameter packs, error and set its type to ERROR_MARK_NODE.
983 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
986 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
988 2007-05-22 Ollie Wild <aaw@google.com>
990 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
991 (unqualified_namespace_lookup): Adds check for hidden types.
993 2007-05-22 Ollie Wild <aaw@google.com>
995 * decl.c (duplicate_decls): Verify namespace names are unique.
997 2007-05-21 Mark Mitchell <mark@codesourcery.com>
999 * decl.c (cxx_maybe_build_cleanup): Handle
1000 __attribute__((cleanup)).
1002 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1004 * cvt.c (cp_convert_and_check): Don't check warnings if the
1007 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1009 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1011 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1014 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1015 type only if is a class type (5.2.8/4).
1017 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1019 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1020 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1021 c_common_unsigned_type.
1023 2007-05-11 Silvius Rus <rus@google.com>
1025 * cp/typeck.c (build_indirect_ref): Add call to
1026 strict_aliasing_warning.
1027 (build_reinterpret_cast_1): Condition call to
1028 strict_aliasing_warning.
1030 2007-05-11 Jan Hubicka <jh@suse.cz>
1032 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1033 * decl2.c (start_objects): ctors and dtors are no longer public.
1034 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1036 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1038 * typeck.c (build_unary_op): Remove code that used to
1039 handle non lvalue increments/decrements.
1041 2007-05-07 Mike Stump <mrs@apple.com>
1043 * parser.c (check_empty_body): Add.
1044 (cp_parser_iteration_statement): Add call to check_empty_body.
1046 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1049 * mangle.c (write_mangled_name): Mangle static variable names.
1050 (write_unqualified_name): Use local-source-name for
1051 namespace-scope static variables.
1053 2007-05-04 Dirk Mueller <dmueller@suse.de>
1055 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1058 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1061 * decl2.c (constrain_class_visibility):
1062 Use strip_pointer_or_array_types instead of strip_array_types.
1064 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1067 * decl.c (reshape_init_r): Don't reshape the first element if it
1068 is a pointer to member function.
1070 2007-04-27 Simon Baldwin <simonb@google.com>
1072 * decl.c (grokparms): Changed message format from %qD to %qE.
1074 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1076 * error.c (maybe_warn_variadic_templates): Variadic templates are
1077 now in C++0x, so only warn about them in C++98 mode.
1079 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1082 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1083 integeral types from vectors types.
1085 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1088 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1089 for type dependent OMP_CLAUSE_DECLs.
1091 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1094 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1095 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1096 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1097 * init.c (build_zero_init): Adjust, as
1098 COMPLEX_TYPE is now a SCALAR_TYPE.
1099 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1100 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1102 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1104 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1105 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1106 (trait_expr_value): Adjust.
1108 2007-04-23 Simon Baldwin <simonb@google.com>
1110 * decl.c (grokparms): Added new error for duplicate function
1111 parameters names in function prototypes, to match gcc behavior.
1113 2007-04-23 Jan Hubicka <jh@suse.cz>
1115 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1118 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1120 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1121 instead of checking GIMPLE_STMT_P in chain_next.
1123 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1126 * call.c (convert_for_arg_passing): Convert bitfields to their
1129 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1132 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1134 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1137 * cp/decl2.c (constrain_class_visibility):
1138 Do not warn about the use of anonymous namespace in the main input file.
1140 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1142 * cp-tree.h (current_template_parms): Fix typo in comment.
1144 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1146 * cp-tree.h, error.c: Fix comment typos.
1148 2007-04-13 Jason Merrill <jason@redhat.com>
1151 * call.c (reference_binding): Add c_cast_p parm. If true,
1152 add quals to TO as needed to make it reference-compatible.
1154 2007-04-11 Jan Hubicka <jh@suse.cz>
1156 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1157 that we are not processing template_decl.
1159 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1162 * class.c (build_base_path): Ensure that the converted pointer has
1163 the same cv-qualification as the input.
1165 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1167 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1169 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1171 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1173 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1174 * tree.c (cp_add_pending_fn_decls): Remove.
1175 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1177 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1179 Revert change removing staticp.
1181 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1183 * cp-objcp-common.c (cxx_staticp): Remove.
1184 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1185 * cp-tree.h (cxx_staticp):
1187 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1189 * class.c (check_for_override): Don't remove dllmport attribute
1192 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1195 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1196 type issue error and return early.
1198 2007-03-30 Jason Merrill <jason@redhat.com>
1201 * typeck.c (cp_type_readonly): New fn.
1202 * cp-tree.h: Declare it.
1203 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1204 (cp_finish_decl): Not here.
1206 2007-03-31 Richard Guenther <rguenther@suse.de>
1208 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1211 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1216 * parser.c (declarator_can_be_parameter_pack): New.
1217 (cp_parser_template_parameter): Only parse the `...' if the
1218 declarator can be a parameter pack.
1219 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1221 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1222 types (they could be used as array bounds).
1223 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1224 (tsubst_pack_expansion): Handle failure to expand parameter
1227 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1230 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1231 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1232 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1233 (CLASS_TYPE_NON_UNION_P): Add.
1234 (struct lang_type_class): Add has_complex_dflt.
1235 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1236 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1237 * cp-tree.def: Add TRAIT_EXPR.
1238 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1239 * lex.c (struct resword): Add __has_nothrow_assign,
1240 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1241 __has_trivial_constructor, __has_trivial_copy,
1242 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1243 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1244 __is_pod, __is_polymorphic, __is_union.
1245 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1246 (cp_parser_trait_expr): New.
1247 * semantics.c (finish_trait_expr, trait_expr_value
1248 classtype_has_nothrow_copy_or_assign_p): New.
1249 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1251 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1252 * class.c (check_bases, check_field_decl, check_bases_and_members):
1253 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1254 * pt.c (uses_template_parms, tsubst_copy_and_build,
1255 value_dependent_expression_p, type_dependent_expression_p): Deal with
1257 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1259 2007-03-29 Richard Guenther <rguenther@suse.de>
1261 * tree.c (cp_walk_subtrees): Do not set input_location.
1263 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1266 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1269 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1271 * parser.c (struct cp_parser): Update comment for
1272 greater_than_is_operator_p.
1273 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1274 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1275 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1276 !GREATER_THAN_IS_OPERATOR_P.
1277 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1278 `>>' operators that will become two `>' tokens in C++0x.
1279 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1280 mode, allowing it to terminate default arguments.
1281 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1282 `>>' like two consecutive `>' tokens.
1283 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1284 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1285 ends a template argument.
1287 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1289 * decl.c (redeclaration_error_message): Complain when redeclaring
1290 a friend function with default template arguments (C++0x mode only).
1291 * cp-tree.h (check_default_tmpl_args): Declare.
1292 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1293 template arguments in function templates. Add support for checking
1294 the default template arguments of friend templates.
1295 (push_template_decl_real): Fix call to check_default_tmpl_args.
1296 (type_unification_real): If a template parameter has not been
1297 deduced but provides a default template argument, substitute into
1298 that default template argument.
1299 * parser.c (cp_parser_init_declarator): When declaring (but not
1300 defining!) a function template in C++0x mode, check for default
1303 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1306 * decl.c (grokdeclarator): Deal with cv-qualified function type
1307 typedefs in the same way for member and non-member functions.
1309 2007-03-26 Dirk Mueller <dmueller@suse.de>
1311 * parser.c (cp_parser_member_declaration): Pedwarn
1312 about stray semicolons after member declarations.
1314 2007-03-26 Paolo Carlini <pcarlini@suse.de>
1317 * pt.c (instantiate_decl): Set in_system_header.
1319 2007-03-22 Mark Mitchell <mark@codesourcery.com>
1321 * cp-tree.h (current_tempalte_parms): Improve documentation.
1322 * pt.c (current_template_args): Likewise.
1325 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1326 not consume tokens when failing.
1328 2007-03-22 Jim Wilson <wilson@specifix.com>
1329 Mark Mitchell <mark@codesourcery.com>
1332 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
1333 consistent with FROM.
1335 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1337 * error.c (dump_expr): Handle dependent names that designate types.
1338 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1340 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
1342 * cp-tree.def, parser.c, pt.c: Fix comment typos.
1344 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1346 * cvt.c (cp_convert_and_check) : Define.
1347 * cp-tree.h (cp_convert_and_check): Declare.
1348 * call.c (convert_conversion_warnings): Rename to
1349 conversion_null_warnings. The warning for floating-point to
1350 integer is handled by convert_and_check in convert_like_real.
1351 (convert_like_real): convert_conversion_warnings was renamed as
1352 conversion_null_warnings.
1353 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1354 overflow and changes of value during conversion.
1356 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1359 * parser.c (cp_parser_statement): If 'namespace' is found, this
1360 only can be a namespace alias definition, so parse it now.
1361 (cp_parser_namespace_alias_definition): if we find an open brace
1362 instead of '=', then this is actually a misplaced namespace
1365 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1368 * decl.c (cxx_init_decl_processing): Move command-line options
1369 processing to c-opts.c.
1371 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
1373 * ptree.c (cxx_print_type): Use formatting markup for integers
1374 when printing template parameter index/level/orig level.
1375 (cxx_print_xnode): Ditto.
1376 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1377 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1378 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1380 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1381 rather than a HOST_WIDE_INT.
1382 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1383 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1385 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1386 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1387 IN_BASE_INITIALIZER bool bitfields.
1388 (struct cp_declarator): Make KIND a 4-bit field. Make
1389 PARAMETER_PACK_P a bool bitfield just after KIND.
1390 * pt.c (uses_parameter_packs): Destroy the pointer set.
1391 (make_pack_expansion): Ditto.
1392 (check_for_bare_parameter_packs): Ditto.
1393 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1395 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
1398 * call.c (convert_default_arg): Instead of copying the node,
1401 2007-03-15 Dirk Mueller <dmueller@suse.de>
1404 * call.c (convert_conversion_warnings): New..
1405 (convert_like_real): .. factored out from here.
1406 (convert_conversion_warnings): Add warning about
1407 false being converted to NULL in argument passing.
1409 2007-03-14 Dirk Mueller <dmueller@suse.de>
1411 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1412 (finish_do_body): Warn about empty body in do/while statement.
1414 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1416 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1418 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1421 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1424 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
1426 * cp/repo.c (init_repo): Initialize random_seed saved options.
1427 (finish_repo): Adjust.
1429 2007-03-13 Mark Mitchell <mark@codesourcery.com>
1432 * Make-lang.in (doc/g++.1): Use $< to specify the location from
1435 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
1437 * decl.c (compute_array_index_type): New warning flag warn_vla.
1439 2007-03-12 Mark Mitchell <mark@codesourcery.com>
1442 * call.c (convert_default_arg): Copy non-constant arguments.
1444 2007-03-11 Mark Mitchell <mark@codesourcery.com>
1447 * parser.c (cp_parser_postfix_expression): Disallow compound
1448 literals in constant expressions.
1451 * semantics.c (finish_typeof): Use unlowered_expr_type.
1453 2007-03-10 Mark Mitchell <mark@codesourcery.com>
1456 * cp-tree.h (unlowered_expr_type): New function.
1457 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1458 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1459 (unlowered_expr_type): New function.
1460 (build_unary_op): Disallow predecrements of bool bitfields.
1461 * call.c (build_conditional_expr): Use unlowered_expr_type.
1462 * pt.c (type_unification_real): Likewise.
1464 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
1467 * typeck.c (check_return_expr): Check for bare parameter packs.
1468 (comptypes): Compare template parameter packs and
1469 type pack expansions.
1470 * decl.c (grokdeclarator): Deal with the declaration of function
1472 (grokparms): Verify that the (optional) function parameter pack is
1473 at the end of the parameter list.
1474 (xref_basetypes): Handle pack expansions in the base class.
1475 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1476 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1477 (NONTYPE_ARGUMENT_PACK): New.
1478 (TYPE_PACK_EXPANSION): New.
1479 (EXPR_PACK_EXPANSION): New.
1480 (ARGUMENT_PACK_SELECT): New.
1481 * cp-objcp-common.c (cp_tree_size): Compute size of
1482 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1483 ARGUMENT_PACK_SELECT.
1484 * error.c (dump_template_argument): Print template argument packs.
1485 (dump_template_argument_list): Ditto.
1486 (dump_template_parameter): Dump `...' for template type parameter
1488 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1489 (dump_parameters): Print function parameter packs.
1490 (dump_template_parms): Print template argument packs.
1491 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1492 (maybe_warn_variadic_templates): New.
1493 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1494 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1495 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1497 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1498 (write_template_arg): Write argument packs as separate arguments.
1499 * cp-tree.h (struct template_parm_index_s): Add flag that
1500 indicates that the template parameter is actually a parameter
1502 (struct tree_argument_pack_select): New.
1503 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1504 (union lang_tree_node): Add argument_pack_select.
1505 (FUNCTION_PARAMETER_PACK_P): New.
1506 (PACK_EXPANSION_P): New.
1507 (PACK_EXPANSION_PATTERN): New.
1508 (SET_PACK_EXPANSION_PATTERN): New.
1509 (PACK_EXPANSION_PARAMETER_PACKS): New.
1510 (ARGUMENT_PACK_P): New.
1511 (ARGUMENT_PACK_ARGS): New.
1512 (SET_ARGUMENT_PACK_ARGS): New.
1513 (ARGUMENT_PACK_INCOMPLETE_P): New.
1514 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1515 (TEMPLATE_PARM_PARAMETER_PACK): New.
1516 (TEMPLATE_TYPE_PARAMETER_PACK): New.
1517 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1518 (ARGUMENT_PACK_SELECT_INDEX): New.
1519 (ARGUMENT_PACK_SELECT_ARG): New.
1520 (struct cp_declarator): Add parameter_pack_p flag.
1521 (maybe_warn_variadic_templates): Declare.
1522 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1523 indicate a template parameter pack.
1524 (uses_parameter_packs): Declare.
1525 (template_parameter_pack_p): Declare.
1526 (template_parms_variadic_p): Declare.
1527 (make_pack_expansion): Declare.
1528 (check_for_bare_parameter_packs): Declare.
1529 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1530 sizeof... expressions.
1531 (pp_cxx_expression): Print pack expansions and non-type argument
1533 (pp_cxx_exception_specification): Print pack expansions.
1534 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1535 (pp_cxx_ctor_initializer): Print pack expansions.
1536 (pp_cxx_type_id): Print pack expansions.
1537 (pp_cxx_template_argument_list): Print argument packs.
1538 (pp_cxx_template_parameter): Print ellipsis for template parameter
1540 * pt.c (comp_template_parms): Compare template parameter packs.
1541 (template_parameter_pack_p): New.
1542 (template_parms_variadic_p): New.
1543 (template_args_variadic_p): New.
1544 (make_ith_pack_parameter_name): New.
1545 (struct find_parameter_pack_data): New.
1546 (find_parameter_packs_r): New.
1547 (uses_parameter_packs): New.
1548 (make_pack_expansion): New.
1549 (check_for_bare_parameter_packs): New.
1550 (expand_template_argument_pack): New.
1551 (reduce_template_parm_level): Propagate parameter pack flag.
1552 (process_template_parm): Add is_parameter_pack parameter to state
1553 when the parameter is actually a parameter pack. Create template
1554 parameter packs when is_parameter_pack is true.
1555 (current_template_args): The argument for a template parameter
1556 pack is an argument pack containing a single pack expansion.
1557 (process_partial_specialization): When checking that non-type
1558 argument expressions do not involve template parameters, loop over
1559 the arguments in argument packs separately.
1560 (push_template_decl_real): Check that the type of the declaration
1561 does not have any bare parameter packs. Check that primary
1562 templates have no more than one parameter pack, and that it comes
1563 at the end of the template parameter list.
1564 (convert_template_argument): Handle coercions for pack expansion
1565 expressions by coercing the pattern then rebuilding the expansion.
1566 (coerce_template_parms): When coercing the arguments for a
1567 variadic template, pack "extra" arguments into an argument pack.
1568 (coerce_template_template_parms): Cannot coerce between parameter
1569 packs and non-pack parameters.
1570 (template_args_equal): Compare PACK_EXPANSION_P expressions.
1571 (comp_template_args): Expand all template arguments packs before
1572 comparing template argument lists.
1573 (mangle_class_name_for_template): Make argument packs as separate
1575 (for_each_template_parm_r): No need to handle BASELINK.
1576 (instantiate_class_template): Handle pack expansions in the base
1578 (tsubst_pack_expansion): New.
1579 (tsubst_template_args): Handle substitutions of argument packs and
1580 pack expansion into template argument lists.
1581 (tsubst_decl): Expand function parameter packs into separate
1582 function parameters.
1583 (tsubst_arg_types): Expand a type pack expansion into separate
1585 (tsubst_exception_specification): Handle pack expansions in
1586 exception specifiers.
1587 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1588 replacing a template parameter with its argument. If we encounter
1589 a substitution for an argument pack, just return the parameter
1591 (tsubst_copy): sizeof(X...) returns the number of elements in
1592 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1593 PARM_DECL is a parameter pack.
1594 (tsubst_expr): Expression pack expansions and argument packs
1595 cannot show up here; they will all be handled through function
1596 calls, sizeof, and template argument lists.
1597 (tsubst_copy_and_build): sizeof(X...) returns the number of
1598 elements in parameter pack X. Handle pack expansions in TREE_LIST
1599 and CONSTRUCTOR nodes.
1600 (fn_type_unification): Handle "incomplete" explicit template
1601 argument lists that specify some of the arguments for a template
1603 (type_unification_real): Unify arguments against pack expansions.
1604 (template_parm_level_and_index): New, helper function.
1605 (unify_pack_expansion): New.
1606 (unify): Unify argument packs on an argument-by-argument basis,
1607 handling variadic argument packs as well.
1608 (more_specialized_fn): Handle unification of function parameter
1609 packs. All things being equal, prefer non-variadic function
1610 templates to variadic function templates.
1611 (more_specialized_class): Prefer the variadic class template
1612 partial specialization that binds fewer arguments to a parameter
1614 (regenerate_decl_from_template): Expand function parameter packs
1615 into separate parameters.
1616 (instantiate_decl): Ditto.
1617 (tsubst_initializer_list): Handle pack expansions for base-class
1619 (dependent_type_p_r): Determine dependent types in argument packs
1620 and pack expansions.
1621 (value_dependent_expression_p): Determine value-dependence of
1622 non-type argument packs.
1623 (dependent_template_arg_p): Handle argument packs.
1624 * semantics.c (finish_cond): Check for bare parameter packs.
1625 (finish_expr_stmt): Ditto.
1626 (finish_for_expr): Ditto.
1627 (finish_switch_cond): Ditto.
1628 (finish_mem_initializers): Ditto.
1629 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1631 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1632 * parser.c (make_declarator): Declarator is not an expansion.
1633 (make_pointer_declarator): Transfer parameter pack flag to outer
1635 (make_reference_declarator): Ditto.
1636 (make_ptrmem_declarator): Ditto.
1637 (make_call_declarator): Ditto.
1638 (make_array_declarator): Ditto.
1639 (cp_parser_postfix_expression): Allow pack expansion expressions
1640 in the argument list for a call expression.
1641 (cp_parser_parenthesized_expression_list): Add new parameter
1642 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1643 into separate arguments."
1644 (cp_parser_new_placement): Allow pack expansion expressions.
1645 (cp_parser_new_initializer): Ditto.
1646 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1647 base-class initializer expansion.
1648 (cp_parser_mem_initializer): Ditto.
1649 (cp_parser_template_parameter_list): Keep track of whether the
1650 template parameter is a template parameter pack.
1651 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1652 template parameter pack.
1653 (cp_parser_type_parameter): Ditto.
1654 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1656 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1657 this declarator is a parameter pack.
1658 (cp_parser_parameter_declaration): The ellipsis does not end the
1659 parameter declaration, because it might be a parameter pack. Parse
1660 the ellipsis to indicate a parameter pack.
1661 (cp_parser_initializer): Allow pack expansions.
1662 (cp_parser_initializer_list): Allow ellipsis to create an
1663 initializer expansion.
1664 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1666 (cp_parser_type_id_list): Allow ellipsis to create an exception
1667 specifier expansion.
1668 (cp_parser_attribute_list): Don't allow pack expansions.
1669 (cp_parser_functional_cast): Allow pack expansions.
1670 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1671 compute the length of a parameter pack.
1672 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1673 end a template argument.
1674 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1675 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1678 2007-03-09 Dirk Mueller <dmueller@suse.de>
1680 * cp/call.c (build_new_op): Call warn_logical_operator.
1682 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1685 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1688 * pt.c (any_template_arguments_need_structural_equality_p):
1691 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1693 * decl.c (grokdeclarator): Disable warnings for anonymous
1696 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1698 * typeck2.c (readonly_error): Always emit a hard error.
1699 Remove last argument.
1700 * cp-tree.h (readonly_error): Adjust prototype.
1701 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1702 * typeck.c (build_unary_op): Likewise.
1703 (build_modify_expr): Likewise.
1705 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1708 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1710 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1713 * parser.c (struct cp_parser): New IN_IF_STMT.
1714 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1715 returning if parsing the body of an 'if' statement or issuing an
1716 error and continuing.
1717 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1719 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1721 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1724 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1727 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1729 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1730 Objective-C++. Don't exit early if -shared-libgcc needs to be
1733 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1735 * typeck.c (common_base_type): Delete unused function.
1737 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1739 * Make-lang.in: Add dummy lang.install-pdf target.
1741 2007-03-01 Simon Baldwin <simonb@google.com>
1744 * decl.c (check_tag_decl): Added new warning for typedef ignored
1745 when it precedes an otherwise valid non-typedef declaration.
1747 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1749 * typeck.c (build_function_call): Store converted arguments
1750 in a stack-allocated array instead of building a list.
1751 (convert_arguments): Store arguments in the array passed in as an
1752 argument, and return the actual number of arguments.
1753 * call.c (build_call): Delete, and replace with...
1754 (build_call_n, build_call_a): New.
1755 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1756 (build_over_call): Store converted arguments in a stack-allocated
1757 array instead of building a list.
1758 (build_cxx_call): Pass arguments in an array instead of as a list.
1759 (build_java_interface_fn_ref): Rewrite to avoid constructing
1761 * tree.h: Update declarations to reflect above changes.
1762 * method.c (use_thunk): Use a stack-allocated array to hold
1763 the arguments instead of a list.
1764 * rtti.c (throw_bad_cast): Update call to cxx_call.
1765 (throw_bad_typeid): Likewise.
1766 (build_dynamic_cast_1): Likewise.
1767 * init.c (build_builtin_delete_call): Use build_call_n.
1768 * decl.c (expand_static_init): Likewise.
1769 * except.c (cp_protect_cleanup_actions): Likewise.
1770 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1771 (gimplify_must_not_throw_expr): Likewise.
1772 (cxx_omp_apply_fn): Use build_call_a.
1774 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1776 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1777 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1779 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1781 * cp-tree.h (static_ctors): Remove.
1782 * cp-tree.h (static_dtors): Likewise.
1783 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1784 refactoring of tree_map hierarchy.
1785 (decl_shadowed_for_var_insert): Likewise.
1786 * semantics.c (expand_body): Use c_expand_body.
1787 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1788 * decl2.c (static_ctors): Remove.
1789 (static_dtors): Likewise.
1790 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1791 objc_generate_static_init_call. Do not call static_[cd]tors.
1792 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1794 (cp_write_global_declarations): Likewise.
1796 2007-02-23 Richard Guenther <rguenther@suse.de>
1798 * class.c (note_name_declared_in_class): Make declaration
1799 changes meaning a pedwarn.
1801 2007-02-22 Michael Matz <matz@suse.de>
1804 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1805 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1806 dump_function_decl): Guard emitting outer scopes by new flag.
1807 * cp-lang.c (cxx_dwarf_name): New function.
1808 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1809 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1811 (push_template_decl_real, lookup_template_class): Remove calls
1814 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1816 * call.c (build_new_method_call): Ensure that explicit calls of
1817 destructors have type "void".
1819 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1821 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1822 and -Walways-true with -Waddress.
1823 * cvt.c (convert_to_void): Replace unconditional warning with
1826 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1828 * decl.c, tree.c: Fix comment typos.
1830 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1833 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1834 statement expression if we had an error mark node.
1836 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1837 Brooks Moses <brooks.moses@codesourcery.com>
1838 Lee Millward <lee.millward@codesourcery.com>
1840 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1841 Change class to tcc_vl_exp.
1843 * call.c (build_call): Use build_call_list instead
1845 (build_over_call): Likewise.
1846 (build_new_method_call): Use build_min_non_dep_call_list
1847 instead of build_min_non_dep.
1849 * error.c (dump_call_expr_args): New function.
1850 (dump_aggr_init_expr_args): New function.
1851 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1852 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1854 * cvt.c (convert_to_void): Use build_call_array instead
1855 of build3; use new AGGR_INIT_EXPR accessor macros.
1857 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1858 instead of TREE_CODE_LENGTH.
1860 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1861 AGGR_INIT_EXPR accessor macros.
1863 * cp-gimplify.c (cp_gimplify_init_expr): Use
1864 AGGR_INIT_EXPR_SLOT to set the slot operand.
1866 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1867 (AGGR_INIT_EXPR_SLOT): New macro.
1868 (AGGR_INIT_EXPR_ARG): New macro.
1869 (aggr_init_expr_nargs): New macro.
1870 (AGGR_INIT_EXPR_ARGP): New macro.
1871 (aggr_init_expr_arg_iterator): New.
1872 (init_aggr_init_expr_arg_iterator): New.
1873 (next_aggr_init_expr_arg): New.
1874 (first_aggr_init_expr_arg): New.
1875 (more_aggr_init_expr_args_p): New.
1876 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1877 (stabilize_aggr_init): New declaration.
1878 (build_min_non_dep_call_list): Likewise.
1880 * tree.c (process_aggr_init_operands): New function.
1881 (build_aggr_init_array) New function.
1882 (build_cplus_new): Update to use new CALL_EXPR and
1883 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1884 build_aggr_init_array.
1885 (build_min_non_dep_call_list) New function.
1886 (build_min_nt): Assert input code parameter is not a variable
1887 length expression class.
1888 (build_min, build_min_non_dep): Likewise.
1889 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1890 to check for equality instead of recursing. Handle tcc_vl_exp
1892 (stabilize_call): Update to only handle CALL_EXPRs, not
1893 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1894 (stabilize_aggr_init): New function.
1895 (stabilize_init): Use it.
1897 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1898 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1899 AGGR_INIT_EXPR accessor macros and argument iterators.
1901 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1902 build_vl_exp. Iterate through the operands, recursively
1903 processing each one.
1904 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1905 CALL_EXPR accessor macros.
1906 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1907 tree code classes. Use TREE_OPERAND_LENGTH instead of
1910 * semantics.c (finish_call_expr): Use build_nt_call_list
1911 instead of build_nt.
1912 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1913 accessor macros. Use build_call_array to construct the
1914 CALL_EXPR node instead of build3
1916 * decl2.c (build_offset_ref_call_from_tree): Use
1917 build_nt_call_list and build_min_non_dep_call_list instead
1918 of build_min_nt and build_min_non_dep.
1920 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1921 Use build_nt_call_list instead of build_min_nt.
1923 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1926 * call.c (build_conditional_expr): Improve error message.
1928 2007-02-13 Dirk Mueller <dmueller@suse.de>
1930 * friend.c (do_friend): Annotate warning about friend
1931 declarations in templates with OPT_Wnon_template_friend.
1932 Convert informal message from warning() to inform().
1934 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
1935 Mark Mitchell <mark@codesourcery.com>
1938 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1939 instantiations for variables.
1941 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1944 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1945 Check warn_unused_value just once.
1947 2007-02-11 Mark Mitchell <mark@codesourcery.com>
1950 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1951 (fn_type_unificiation): Likewise.
1952 (get_bindings): Likewise.
1954 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
1957 * decl.c (finish_function): Use DECL_REPLACEABLE.
1958 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1960 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1962 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1964 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1966 * decl.c (grokvardecl): Don't error if !have_tls.
1967 (grokdeclarator): Likewise.
1968 * parser.c (cp_parser_omp_threadprivate): Likewise.
1970 2007-02-07 Jakub Jelinek <jakub@redhat.com>
1973 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1974 parameters and result decls in omp clauses.
1975 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1978 2007-02-05 Dirk Mueller <dmueller@suse.de>
1981 * parser.c (cp_parser_class_specifier): Always initialize bases.
1983 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1985 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1986 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1987 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1989 * semantics.c (finish_omp_atomic): Store a whole expression node
1990 in operand 1, and integer_zero_node in operand 0, for dependent
1991 OMP_ATOMIC. Rewrite to make flow easier to understand.
1993 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1995 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1997 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
1999 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2000 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2002 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2004 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2005 keyword warning to -Wc++0x-compat.
2007 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2009 * decl.c (grokdeclarator): Update documentation.
2011 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2014 * decl.c (grokdeclarator): If __thread is used together with
2015 a storage class other than extern and static, clear thread_p
2016 after issuing diagnostics and fall through to checking the
2019 2007-01-30 Roger Sayle <roger@eyesopen.com>
2021 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2022 calculating the size of an array (to avoid recursive errors).
2024 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2027 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2029 * call.c (convert_like_real): Don't warn when converting to
2032 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2034 * decl.c (pop_label): Replace warning with call to
2035 warn_for_unused_label.
2037 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2040 * semantics.c (finish_pseudo_destructor_expr): Check the
2041 destrutor name by calling check_dtor_name.
2043 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2045 * lex.c (D_CPP0X): Rename.
2047 (reswords): D_CPP0X -> D_CXX0X.
2048 (init_reswords): Ditto.
2049 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2050 of C++0x keywords as identifiers.
2052 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2055 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2058 2007-01-23 Ian Lance Taylor <iant@google.com>
2060 * typeck.c (convert_for_assignment): Only warn about a = b = c
2061 when converting to bool.
2063 2007-01-23 Roger Sayle <roger@eyesopen.com>
2065 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2067 * typeck.c (ignore_overflows): Remove the remaining uses of
2068 TREE_CONSTANT_OVERFLOW.
2070 2007-01-20 Jan Hubicka <jh@suse.cz>
2072 * decl2.c (start_objects, start_static_storage_duration_function):
2073 Do not make the functions uninlinable.
2075 2007-01-17 Ian Lance Taylor <iant@google.com>
2077 * class.c (add_method): Call VEC_reserve_exact rather than passing
2078 a negative size to VEC_reserve.
2080 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2083 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2085 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2088 * decl.c (make_typename_type): If the qualified name is not a
2089 type, issue an error.
2090 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2093 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2095 * rtti.c: Include target.h.
2096 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2097 don't emit typeinfo for fundamental types as weak.
2098 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2100 2007-01-08 Richard Guenther <rguenther@suse.de>
2102 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2104 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2106 * call.c (standard_conversion): Pass flag to
2107 vector_types_convertible_p to disallow emission of note.
2108 * typeck.c (convert_for_assignment): Pass flag to
2109 vector_types_convertible_p to allow emission of note.
2110 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2111 to disallow emission of note.
2113 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2116 * typeck.c (build_binary_op): Call overflow_warning if
2117 TREE_OVERFLOW_P is true for the result and not for any of the
2120 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2123 * class.c (add_method): Don't wait until template
2124 instantiation time to complain about duplicate methods.
2126 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2129 * semantics.c (finish_unary_op_expr): Warn only if result
2130 overflowed and operands did not.
2132 2007-01-05 Ian Lance Taylor <iant@google.com>
2134 * typeck.c (build_binary_op): Warn about comparing a non-weak
2137 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2139 * pt.c (tsubst): Propagate the need for structural equality checks
2140 when reducing the level of template parameters.
2142 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2144 * pt.c: Fix a comment typo.
2146 2007-01-02 Ian Lance Taylor <iant@google.com>
2148 * semantics.c (maybe_convert_cond): Optionally warn when using an
2149 assignment as a condition.
2150 * typeck.c (convert_for_assignment): Optionally warn about
2151 assigning the result of an assignment to a bool.
2153 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2155 * pt.c (canonical_template_parms): Correct typo in comment.
2157 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2159 * typeck.c (structural_comptypes): Renamed from "comptypes".
2160 (comptypes): Use canonical type information to perform fast type
2161 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2162 canonical type comparison returns the same results as we would see
2163 from the current, structural check. Support COMPARE_STRUCTURAL
2164 when we need structural checks.
2165 * decl.c (typename_compare): Fix comment.
2166 (build_typename_type): TYPENAME_TYPE nodes require structural
2167 equality checks, because they resolve different based on the
2169 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2170 require structural equality checks (for now).
2171 (build_ptrmemfunc_type): Build the canonical pointer to member
2173 (compute_array_index_type): Whenever we build a new index type
2174 to represent the size of an array in a template, we need to mark
2175 this index type as requiring structural equality. This goes for
2176 arrays with value-dependent sizes with the current ABI, or all
2178 * tree.c (cplus_array_hash): New.
2179 (struct cplus_array_info): New.
2180 (cplus_array_compare): New.
2181 (cplus_array_htab): New.
2182 (build_cplus_array_type_1): Use a hash table to cache the array
2183 types we build. Build the canonical array type for each array
2185 (cp_build_qualified_type_real): When building a cv-qualified array
2186 type, use the hash table of array types and build canonical array
2188 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2189 use structural equality (for now).
2190 * cp-tree.h (COMPARE_STRUCTURAL): New.
2191 * pt.c (canonical_template_parms): New.
2192 (canonical_type_parameter): New.
2193 (process_template_parm): Find the canonical type parameter.
2194 (lookup_template_class): When we have named the primary template
2195 type, set the canonical type for our template class to the primary
2196 template type. If any of the template arguments need structural
2197 equality checks, the template class needs structural equality
2199 (tsubst): When reducing the level of a template template
2200 parameter, we require structural equality tests for the resulting
2201 parameter because its template parameters have not had their types
2202 canonicalized. When reducing a template type parameter, find the
2203 canonical reduced type parameter.
2204 (any_template_arguments_need_structural_equality_p): New.