1 2007-09-05 Jan Hubicka <jh@suse.cz>
3 * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
4 call, DECL_EXTERNAL checks and current_function_decl saving.
6 2007-09-05 Paolo Carlini <pcarlini@suse.de>
9 * parser.c (cp_parser_primary_expression): Return error_mark_node
10 when a statement-expression is found in a template-argument list.
12 2007-09-04 Jason Merrill <jason@redhat.com>
15 * call.c (reference_binding): Don't look for user-defined conversions
19 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
20 the MUST_NOT_THROW_EXPR.
22 2007-09-04 Richard Sandiford <richard@codesourcery.com>
24 * decl.c (cp_finish_decl): Call determine_visibility before
25 make_rtl_for_nonlocal_decl.
27 2007-09-04 Jason Merrill <jason@redhat.com>
30 * pt.c (most_specialized_class): Substitute outer template
31 arguments into the arguments of a member template partial
33 (strip_innermost_template_args): New fn.
35 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
37 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
39 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
41 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
42 * decl.c (cp_make_fname_decl): Likewise,
43 * parser.c (cp_parser_string_literal): Likewise,
44 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
45 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
48 2007-09-02 Paolo Carlini <pcarlini@suse.de>
51 * typeck.c (build_unary_op): Fix error message for
52 Boolean expression as operand to operator--.
54 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
56 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
57 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
60 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
63 * init.c (build_default_init): Make extern.
64 * cp-tree.h (build_default_init): Declare here.
65 * pt.c (tsubst_expr): When the instantiation of the initializer of
66 a variable results in an empty list, default-initialize the
68 (tsubst_copy_and_build): When the instantiation of the initializer
69 in a new expression results in an empty initializer list,
70 default-initialize it.
72 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
74 * mangle.c (write_type): Change mangling of rvalue reference from
77 2007-08-31 Jakub Jelinek <jakub@redhat.com>
79 * decl.c (duplicate_decls): Remove duplicated line.
81 2007-08-31 Paolo Carlini <pcarlini@suse.de>
84 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
85 BOUND_TEMPLATE_TEMPLATE_PARM.
87 2007-08-31 Paolo Carlini <pcarlini@suse.de>
90 * search.c (lookup_member): Check the name argument for
93 2007-08-31 Paolo Carlini <pcarlini@suse.de>
96 * parser.c (cp_parser_trait_expr): Check rerurn value of
99 2007-08-30 Ollie Wild <aaw@google.com>
101 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
102 convert_ptrmem for pointer to member conversions.
103 (convert_to_pointer_force): Update cp_convert_to_pointer call.
104 (ocp_convert): Update cp_convert_to_pointer call.
105 * typeck.c (convert_ptrmem): Add conditional for null pointers to
107 (build_static_cast_1): Check can_convert for conversions in either
109 (get_delta_difference_1): New function.
110 (get_delta_difference): Refactor to call get_delta_difference_1.
112 2007-08-28 Paolo Carlini <pcarlini@suse.de>
115 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
116 BOUND_TEMPLATE_TEMPLATE_PARM.
118 2007-08-28 Jakub Jelinek <jakub@redhat.com>
122 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
123 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
125 2007-08-27 Jason Merrill <jason@redhat.com>
128 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
129 Look inside STMT_EXPR.
130 * semantics.c (stmt_expr_value_expr): New fn.
131 * cp-tree.h: Declare it.
134 * decl.c (groktypename): Ignore attributes applied to class type.
136 2007-08-28 Richard Guenther <rguenther@suse.de>
138 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
140 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
142 * error.c (dump_expr): Handle COMPLEX_CST.
143 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
144 (pp_cxx_expression): Likewise.
146 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
148 * decl.c (GNU_INLINE_P): New.
149 (duplicate_decls): Handle gnu_inline. Merge attributes and
150 some flags in overriding definitions.
151 (redeclaration_error_message): Handle gnu_inline.
152 (start_preparsed_function): Likewise.
154 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
156 * call.c (sufficient_parms_p): Constify.
157 * class.c (same_signature_p): Likewise.
158 * cp-gimplify.c (is_invisiref_parm,
159 cxx_omp_privatize_by_reference): Likewise.
160 * cp-objcp-common.c (has_c_linkage): Likewise.
161 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
162 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
163 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
164 num_artificial_parms_for, comp_template_parms,
165 template_parameter_pack_p, any_dependent_template_arguments_p,
166 any_type_dependent_arguments_p, any_value_dependent_elements_p,
167 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
168 zero_init_p, member_p, cp_lvalue_kind,
169 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
170 varargs_function_p, is_dummy_object, special_function_kind,
171 string_conv_p, type_unknown_p, comp_except_specs, compparms,
172 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
173 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
174 cp_has_mutable_p, at_least_as_qualified_p,
175 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
176 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
177 * except.c (nothrow_libfn_p): Likewise.
178 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
180 * pt.c (comp_template_parms, template_parameter_pack_p,
181 any_type_dependent_arguments_p, any_value_dependent_elements_p,
182 any_dependent_template_arguments_p): Likewise.
183 * repo.c (repo_export_class_p): Likewise.
184 * semantics.c (anon_aggr_type_p): Likewise.
185 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
186 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
187 varargs_function_p, member_p, is_dummy_object, pod_type_p,
188 zero_init_p, special_function_p): Likewise.
189 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
190 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
191 compparms, invalid_nonstatic_memfn_p,
192 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
193 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
194 cp_has_mutable_p, lvalue_or_else): Likewise.
196 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
198 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
199 * cp-objcp-common.c (cp_tree_size): Ditto.
200 * tree.c (cp_walk_subtrees): Ditto
201 * cp-tree.def (TINST_LEVEL): Go away.
202 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
203 move together with other non-tree structs.
204 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
205 (union lang_tree_node): Eliminate tinst_level field.
206 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
207 (current_instantiation, outermost_tinst_level): Return
208 a "struct tinst_level *".
210 * error.c (print_instantiation_partial_context): Change second
211 parameter to a "struct tinst_level *". Replace accessor macros
213 (print_instantiation_full_context): Likewise.
214 * lex.c (in_main_input_context): Likewise.
216 * pt.c (struct pending_templates): New.
217 (pending_templates, last_pending_template): Use it as a type.
218 (current_tinst_level): Change typo to "struct tinst_level *"
219 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
220 (add_pending_template): Construct a "struct pending_template".
221 Replace TINST_LEVEL accessor macros with field access.
222 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
223 (pop_tinst_level): Likewise.
224 (instantiate_pending_templates): Likewise. Factor common code used
225 when an instantiation has been done.
226 (outermost_tinst_level): Replace tree_last with loop.
227 (current_instantiation): Return a "struct tinst_level *".
229 2007-08-24 Ollie Wild <aaw@google.com>
231 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
232 * name-lookup.h (cp_binding_level): Remove vtables member.
234 2007-08-24 Richard Guenther <rguenther@suse.de>
236 * tree.c (cp_cannot_inline_tree_fn): Remove.
237 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
238 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
241 2007-08-24 Jakub Jelinek <jakub@redhat.com>
244 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
245 error_mark_node right away if build_expr_type_conversion
249 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
250 is error_mark_node rather than NULL_TREE.
251 * pt.c (check_explicit_specialization): Likewise.
254 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
255 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
257 2007-08-22 Jason Merrill <jason@redhat.com>
260 * pt.c (outermost_tinst_level): New function.
261 * lex.c (in_main_input_context): New function.
262 * cp-tree.h: Declare it.
263 * decl2.c (constrain_class_visibility): Use it to avoid warning
264 about uses of the anonymous namespace in the main input file.
266 2007-08-21 Jakub Jelinek <jakub@redhat.com>
268 * init.c (build_new_1): Use get_target_expr instead of save_expr.
270 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
273 * class.c (finish_struct_1): Warn when a class has virtual
274 functions and accessible non-virtual destructor.
276 2007-08-20 Richard Guenther <rguenther@suse.de>
280 * call.c (build_new_method_call): Convert initializer to
282 * init.c (build_aggr_init): Do not fiddle with types.
283 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
284 * except.c (build_throw): Do not drop qualifiers for the
286 * typeck.c (get_member_function_from_ptrfunc): Do not
287 fiddle with types, instead convert.
288 (build_ptrmemfunc1): Convert to the target type for
290 (gfc_trans_allocate): Convert result to target type.
291 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
292 pointer-to-member structures shall have alias set zero as well.
294 2007-08-20 Richard Guenther <rguenther@suse.de>
296 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
298 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
299 (nonstatic_local_decl_p): Likewise.
300 * tree.c (cp_auto_var_in_fn_p): Remove.
301 * decl.c (nonstatic_local_decl_p): Remove.
303 2007-08-20 Richard Guenther <rguenther@suse.de>
305 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
307 * tree.h (cp_walk_tree): New define to walk_tree_1 with
308 cp_walk_subtrees lh parameter.
309 (cp_walk_tree_without_duplicates): New define to
310 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
311 * tree.c (count_trees): Call
312 cp_walk_tree_without_duplicates.
313 (verify_stmt_tree): Call cp_walk_tree.
314 (break_out_target_exprs): Likewise.
315 (WALK_SUBTREE): Likewise.
316 * cp-gimplify.c (cp_genericize): Likewise.
317 * cp-pt.c (find_parameter_packs_r): Likewise.
318 (uses_parameter_packs): Likewise.
319 (make_pack_expansion): Likewise.
320 (check_for_bare_parameter_packs): Likewise.
321 (for_each_template_parm): Likewise.
322 * decl.c (check_default_argument): Call
323 cp_walk_tree_without_duplicates.
324 * except.c (build_throw): Likewise.
325 * decl2.c (type_visibility): Likewise.
326 * semantics.c (expand_or_defer_fn): Likewise.
327 (finalize_nrv): Call cp_walk_tree.
329 2007-08-20 Jakub Jelinek <jakub@redhat.com>
332 * init.c (build_new_1): Rename placement_var variable to placement_expr.
333 Initialize it with save_expr rather than get_temp_regvar.
335 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
338 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
341 2007-08-17 Ollie Wild <aaw@google.com>
344 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
345 declarations into appropriate slots for comparison. Fix type
348 2007-08-17 Paolo Carlini <pcarlini@suse.de>
351 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
352 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
354 2007-08-17 Paolo Carlini <pcarlini@suse.de>
357 * parser.c (cp_parser_class_head): Improve error message.
359 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
361 * pt.c (instantiate_decl): Set input_location
362 for the function end.
364 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
366 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
368 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
369 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
370 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
371 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
372 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
373 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
374 * typeck.c (cp_type_quals): Likewise.
375 * typeck2.c (cxx_incomplete_type_diagnostic,
376 cxx_incomplete_type_error): Likewise.
378 2007-08-16 Paolo Carlini <pcarlini@suse.de>
381 * pt.c (tsubst_friend_function): When check_classfn
382 returns error_mark_node likewise return it.
384 2007-08-15 Jakub Jelinek <jakub@redhat.com>
387 * typeck.c (check_return_expr): Don't NRV optimize vars in
389 * decl.c (finish_function): Comment fix.
391 2007-08-15 Paolo Carlini <pcarlini@suse.de>
394 * pt.c (push_template_decl_real): Depending on TYPE_P
395 use either TYPE_CONTEXT or DECL_CONTEXT.
397 2007-08-14 Mark Mitchell <mark@codesourcery.com>
399 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
400 constructors and destructors return this.
402 2007-08-14 Paolo Carlini <pcarlini@suse.de>
405 * decl2.c (check_classfn): Return error_mark_node in case of error;
406 in that case, do not call add_method.
407 * decl.c (start_decl): Deal with check_classfn returning
409 (grokfndecl): Likewise.
410 * pt.c (tsubst_friend_function): Likewise.
412 2007-08-14 Andrew Pinski <pinskia@gmail.com>
415 * typeck.c (build_binary_op): Disallow vector float types with
416 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
418 2007-08-11 Ian Lance Taylor <iant@google.com>
420 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
422 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
424 2007-08-10 Ollie Wild <aaw@google.com>
426 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
428 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
430 (unqualified_namespace_lookup): Fix ambiguous_decl call.
431 (lookup_using_namespace): Fix ambiguous_decl call.
432 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
434 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
436 * call.c (name_as_c_string): Use CONST_CAST.
437 * decl.c (build_decl): Likewise.
438 * parser.c (cp_parser_string_literal): Likewise.
440 2007-08-10 Paolo Carlini <pcarlini@suse.de>
443 * error.c (dump_expr): Consistently use the *_cxx_*
444 variants of the pretty-print functions.
446 2007-08-10 Paolo Carlini <pcarlini@suse.de>
449 * decl.c (check_special_function_return_type): Just error
450 on return type specified for conversion operator.
452 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
454 * typeck2.c (readonly_error): Handle general expressions.
455 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
457 2007-08-06 Dan Hipschman <dsh@google.com>
459 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
460 access function name.
462 2007-08-04 Alfred Minarik <a.minarik@aon.at>
465 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
466 * g++spec.c (lang_specific_driver): Check them.
468 2007-08-06 Paolo Carlini <pcarlini@suse.de>
471 * pt.c (template_class_depth): Fix comment; change return type
474 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
477 2007-03-26 Dirk Mueller <dmueller@suse.de>
479 * parser.c (cp_parser_member_declaration): Pedwarn
480 about stray semicolons after member declarations.
482 2007-08-02 Lee Millward <lee.millward@gmail.com>
487 * parser.c (cp_parser_asm_definition): Detect and discard asm
488 statements with invalid inputs or outputs.
489 (cp_parser_asm_operand_list): Return error mark node if any
490 of the operands are invalid. Adjust documentation.
492 2007-08-02 Nick Clifton <nickc@redhat.com>
494 * typeck.c: Change copyright header to refer to version 3 of the
495 GNU General Public License and to point readers at the COPYING3
496 file and the FSF's license web page.
497 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
498 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
499 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
500 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
501 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
502 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
503 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
504 name-lookup.h, parser.c: Likewise.
506 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
509 * call.c (magic_varargs_p): Honor the "type generic" attribute.
511 2007-07-30 Paolo Carlini <pcarlini@suse.de>
514 * semantics.c (finish_label_stmt): Reject the __label__
515 extension outside function scopes.
517 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
519 * parser.c (eof_token): Un-constify.
520 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
521 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
524 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
526 * pt.c, tree.c, typeck2.c: Fix comment typos.
528 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
529 Mark Mitchell <mark@codesourcery.com>
532 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
533 hidden due to friend declarations in local classes.
535 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
537 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
538 * cp-tree.def (DECLTYPE_TYPE): New.
539 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
540 (dump_type_prefix): Ditto.
541 (dump_type_suffix): Ditto.
542 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
543 * mangle.c (write_type): Handle DECLTYPE_TYPE.
544 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
546 (DECLTYPE_TYPE_EXPR): New.
547 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
548 (finish_declared_type): Declare.
549 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
551 (pp_cxx_type_id): Ditto.
552 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
553 (tsubst): Substitute into a DECLTYPE_TYPE node.
554 (tsubst_copy): Ditto.
555 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
557 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
558 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
559 structural equality (because we can't hash the expressions).
560 (finish_declared_type): New.
561 * lex.c (reswords): Add "decltype" keyword.
562 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
563 (cp_parser_postfix_expression): Add member_access_only_p to
564 restrict postfix expression to member access expressions.
565 (cp_parser_unary_expression): Update call to
566 cp_parser_postfix_expression to reflect new parameter.
567 (cp_parser_declared_type): New.
568 (cp_parser_simple_type_specifier): Parse decltype types.
570 2007-07-27 Mark Mitchell <mark@codesourcery.com>
573 * call.c (convert_for_arg_passing): Only widen bitfields to their
574 declared types if necessary.
576 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
578 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
581 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
583 * decl.c (typename_hash, typename_compare): Constify.
584 * mangle.c (hash_type, compare_type): Likewise.
585 * pt.c (eq_local_specializations, hash_local_specialization):
587 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
588 list_hash): Likewise.
589 * typeck2.c (pat_compare): Likewise.
591 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
593 * method.c (implicitly_declare_fn): Increase alignment if member
594 function pointer format requires it.
596 2007-07-24 Paolo Carlini <pcarlini@suse.de>
599 * typeck.c (check_return_expr): Do not pass a null argument
602 2007-07-24 Paolo Carlini <pcarlini@suse.de>
605 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
608 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
611 * typeck.c (convert_arguments): Only use default args if we have
615 * typeck.c (structural_comptypes): No need to check
616 resolve_typename_type return value here.
617 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
618 * pt.c (resolve_typename_type): Follow typename typedefs. Return
619 original type rather than error_mark_node in case of failure.
620 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
621 resolve_typename_type result check.
622 (cp_parser_direct_declarator, cp_parser_head,
623 cp_parser_constructor_declarator_p): Likewise.
625 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
627 * pt.c (template_parms_variadic_p): Remove.
628 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
630 2007-07-12 Jakub Jelinek <jakub@redhat.com>
633 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
634 argument to dump_aggr_init_expr_args instead of false.
636 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
638 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
639 canonical types; otherwise, fall back to structural type
640 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
641 internal compiler error if the canonical types are wrong.
643 2007-07-11 Paolo Carlini <pcarlini@suse.de>
646 * parser.c (cp_parser_make_indirect_declarator): When the
647 the code argument is ERROR_MARK return cp_error_declarator.
649 2007-07-09 Geoffrey Keating <geoffk@apple.com>
652 * decl.c (cxx_init_decl_processing): Don't set
653 force_align_functions_log.
654 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
655 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
656 FUNCTION_DECL, return its alignment.
658 2007-07-09 Richard Guenther <rguenther@suse.de>
660 * decl.c (start_preparsed_function): Do not promote return type.
662 2007-07-08 Paolo Carlini <pcarlini@suse.de>
665 * pt.c (unify): Never pass error_mark_node to template_decl_level.
667 2007-07-07 Mark Mitchell <mark@codesourcery.com>
670 * pt.c (resolve_overloaded_unification): Robustify. Return a
672 (type_unification_real): Adjust accordingly.
674 2007-07-06 Richard Guenther <rguenther@suse.de>
676 * init.c (build_new_1): Use the correct pointer type.
677 * typeck2.c (build_m_component_ref): Likewise.
679 2007-07-05 Mark Mitchell <mark@codesourcery.com>
682 * init.c (build_zero_init): Always build an initializer for
684 * typeck2.c (build_functional_cast): Use build_zero_init.
687 * init.c (build_new_1): Always pass the allocation function to
688 build_op_delete_call.
689 * call.c (build_op_delete_call): Handle operator delete with a
690 variable-argument list. Do not issue an error when no matching
691 deallocation function is available for a new operator.
694 * cp-tree.h (any_value_dependent_elements_p): Declare it.
695 * decl.c (value_dependent_init_p): New function.
696 (cp_finish_decl): Use it.
697 * pt.c (value_dependent_expression_p): Use
698 any_value_dependent_elements_p.
699 * parser.c (cp_parser_primary_expression): Add comment about
700 treating dependent qualified names as integral
701 constant-expressions.
703 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
705 * decl.c (build_ptrmemfunc_type): Always use structural equality
706 tests when comparing pointer-to-member-function types, because the
707 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
710 2007-07-03 Mark Mitchell <mark@codesourcery.com>
712 * init.c (build_new): Tweak comment.
714 2007-06-29 Dave Brolley <brolley@redhat.com>
717 * parser.c (cp_parser_new_type_id): Don't reduce a named array
718 type to its base type and number of elements here.
719 * init.c (build_new): Call complete_type_or_else to ensure that the
720 type is complete and to issue a diagnostic if it is not.
721 (build_new_1): Don't call complete_type_or_else here.
723 2007-07-03 Richard Guenther <rguenther@suse.de>
726 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
729 2007-07-02 Simon Baldwin <simonb@google.com>
731 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
732 for inner-style nested forward declarations that don't declare
735 2007-07-02 Jakub Jelinek <jakub@redhat.com>
738 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
739 DECL_P in not a variable and appears more than once error messages.
741 2007-07-01 Ollie Wild <aaw@google.com>
743 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
744 (select_decl): Remove function.
745 (unqualified_namespace_lookup): Populate binding by calling
746 ambiguous_decl. Remove select_decl call.
747 (lookup_qualified_name): Remove select_decl call.
748 * decl.c (lookup_and_check_tag): Check for ambiguous references.
749 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
750 generation when name lookup is ambiguous.
752 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
755 * init.c (build_new_1): Use structural equality on the copy of the
758 2007-06-28 Geoffrey Keating <geoffk@apple.com>
760 * decl2.c (determine_visibility): Implement
761 flag_visibility_ms_compat effect on type info.
762 * decl.c (cxx_init_decl_processing): Implement
763 global effect of flag_visibility_ms_compat.
765 2007-06-28 Geoffrey Keating <geoffk@apple.com>
767 * decl2.c (start_objects): Mark constructor-running function
770 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
773 * decl.c (grokdeclarator): Reset friendp for member functions declared
774 friend of their own class.
776 2007-06-23 Mark Mitchell <mark@codesourcery.com>
778 * decl2.c (determine_visibility): Don't look for dllexport here.
779 (determine_visibility_from_class): Tidy.
781 2007-06-18 Simon Baldwin <simonb@google.com>
784 * parser.c (cp_parser_single_declaration): Added check for storage
785 class other than sc_none in parsed declaration, and a flag to indicate
786 if the call is part of an explicit template specialization parse.
787 * (cp_parser_explicit_specialization): Specialization check flag added
788 to call to cp_parser_single_declaration(), set true.
789 * (cp_parser_template_declaration_after_export): Specialization check
790 flag added to call to cp_parser_single_declaration(), set false.
791 * pt.c (check_explicit_specialization): Added code to copy visiblity
792 and linkage from the templated function to the explicit specialization.
794 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
796 * typeck.c (build_binary_op): For templates build the
797 expression in pieces to avoid the assert in build2_stat.
798 (get_member_function_from_ptrfunc):
799 Change over to using POINTER_PLUS_EXPR and convert
800 the second operand to sizetype.
801 * typeck2.c (build_m_component_ref): Likewise.
802 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
803 instead of PLUS_EXPR for pointers.
804 (build_new_1): Likewise.
805 (build_vec_delete_1): Likewise.
806 (build_vec_delete): Likewise.
807 * class.c (build_base_path): Likewise.
808 (build_base_path): Likewise.
809 (convert_to_base_statically): Likewise.
810 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
811 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
812 instead of PLUS_EXPR.
813 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
814 instead of PLUS_EXPR for pointers.
815 * call.c (build_special_member_call): Likewise.
816 * rtti.c (build_headof): Likewise.
817 Use sizetype instead of ptrdiff_type_node.
818 (tinfo_base_init): Create a POINTER_PLUS_EXPR
819 instead of PLUS_EXPR for pointers.
820 * except.c (expand_start_catch_block): Do a
821 NEGATIVE and then a POINTER_PLUS_EXPR instead
823 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
824 PLUS_EXPR on pointer types over to use
825 POINTER_PLUS_EXPR and remove the conversion
826 to the pointer types.
827 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
828 adding to a pointer type. Use size_int instead of
829 ssize_int. Convert the index to sizetype before
830 adding it to the pointer.
832 2007-06-15 Mark Mitchell <mark@codesourcery.com>
834 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
835 (DECL_ANON_UNION_VAR_P): New macro.
836 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
837 than DECL_VAR_MARKED_P, to keep track of which variables we have
839 * decl.c (redeclaration_error_message): Complain about redeclaring
840 anonymous union members at namespace scope.
841 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
843 2007-06-14 Geoff Keating <geoffk@apple.com>
845 * decl2.c (determine_visibility): Ensure that functions with
846 hidden types as parameters are hidden.
849 * decl2.c (determine_visibility): Remove duplicate code for
852 2007-06-12 Ian Lance Taylor <iant@google.com>
855 * init.c (avoid_placement_new_aliasing): New static function.
856 (build_new_1): Call it.
858 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
860 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
861 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
863 2007-06-08 Jakub Jelinek <jakub@redhat.com>
866 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
867 on init, the non-decl cond operand and increment value.
869 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
872 * decl.c (check_initializer): Report an error when a brace enclosed
873 initializer is used for a non-aggregate type in C++98.
874 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
876 (grokdeclarator): Likewise.
877 (move_fn_p): Likewise.
878 * typeck.c (check_return_expr): Likewise.
879 * call.c (reference_binding): Likewise.
880 * error.c (cp_cpp_error): Likewise.
881 * pt.c (check_default_tmpl_args): Likewise.
883 * lex.c (init_reswords): Likewise.
884 * parser.c (p_parser_primary_expression): Likewise.
885 (TOKEN_PRECEDENCE): Likewise.
886 (cp_parser_init_declarator): Likewise.
887 (cp_parser_ptr_operator): Likewise.
888 (cp_parser_parameter_declaration): Likewise.
889 (cp_parser_enclosed_template_argument_list): Likewise.
890 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
891 (cp_parser_next_token_ends_template_argument_p): Likewise.
893 2007-06-04 Simon Baldwin <simonb@google.com>
895 * decl.c (grokdeclarator): Readability change. Moved case labels
896 into direct switch statement scope.
898 2007-06-04 Paolo Carlini <pcarlini@suse.de>
900 * call.c (convert_like_real): Remove pointless code.
902 2007-05-31 Mark Mitchell <mark@codesourcery.com>
904 * decl.c (get_atexit_fn_ptr_type): New function.
905 (get_atexit_node): Use it.
906 (start_cleanup_fn): Likewise.
907 (register_dtor_fn): Use the object's destructor, instead of a
908 separate cleanup function, where possible.
909 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
910 (atexit_fn_ptr_type_node): New macro.
911 * decl2.c (build_cleanup): Use build_address.
913 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
915 * typeck.c (build_binary_op): Include types in error.
917 2007-05-31 Jakub Jelinek <jakub@redhat.com>
920 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
921 needs runtime initialization.
923 2007-05-31 Paolo Carlini <pcarlini@suse.de>
926 * semantics.c (finish_trait_expr): Complete the types.
928 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
929 Douglas Gregor <doug.gregor@gmail.com>
930 Pedro Lamarao <pedro.lamarao@mndfck.org>
931 Howard Hinnant <howard.hinnant@gmail.com>
935 * typeck.c (comptypes): Don't consider rvalue and lvalue
936 reference types to be equivalent.
937 (check_return_expr): Move from certain lvalues when returning
939 * decl.c (grokdeclarator): Implement reference collapsing.
940 (copy_fn_p): Don't consider constructors taking rvalue references
941 to be copy constructors.
943 * call.c (conversion): New "rvaluedness_matches_p" member.
944 (convert_class_to_reference): Require reference type as first
945 parameter instead of base type.
946 (reference_binding): Add logic to handle rvalue references.
947 (implicit_conversion): Update inaccurate comment.
948 (convert_like_real): Disable creation of temporaries that are
949 impossible to initialize for types with move constructors.
950 (build_over_call): Elide move constructors when possible.
951 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
952 (maybe_handle_ref_bind): Return conversion instead of type node.
953 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
954 determine preferred conversion sequences.
955 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
956 (LOOKUP_PREFER_RVALUE): New.
957 (DECL_MOVE_CONSTRUCTOR_P): New.
958 (struct cp_declarator): Add "reference" member for reference
959 types, with new "rvalue_ref" flag.
960 (cp_build_reference_type): Declare.
961 (move_fn_p): Declare.
962 * error.c (dump_type_prefix): Format rvalue reference types
963 correctly in error messages.
964 * except.c (build_throw): Move from certain lvalues when
966 * mangle.c (write_type): Mangle rvalue references differently
967 than regular references.
968 * parser.c (make_reference_declarator): Add boolean parameter for
970 (cp_parser_make_indirect_declarator): New.
971 (cp_parser_new_declarator_opt): Call
972 cp_parser_make_indirect_declarator.
973 (cp_parser_conversion_declarator_opt): Ditto.
974 (cp_parser_declarator): Ditto.
975 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
977 * pt.c (tsubst): Implement reference collapsing.
978 (maybe_adjust_types_for_deduction): Implement special template
979 parameter deduction rule for rvalue references.
980 (type_unification_real): Update calls to
981 maybe_adjust_types_for_deduction.
982 (try_one_overload): Ditto.
983 (unify_pack_expansion): Ditto.
984 * tree.c (lvalue_p_1): Handle rvalue reference types.
985 (cp_build_reference_type): New.
987 2007-05-30 Jakub Jelinek <jakub@redhat.com>
990 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
991 variables that need runtime initialization.
993 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
996 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
997 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
998 case POSTDECREMENT_EXPR>): Return the error_mark_node
999 if either the real or imaginary parts would an
1002 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
1003 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1006 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1007 token is a closing brace, false if there are no tokens left.
1008 (cp_parser_namespace_alias_definition): Only consume the next token if
1009 it is a closing brace.
1011 * parser.c (cp_parser_class_specifier): Likewise.
1013 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
1015 * semantics.c (finish_member_declaration): Fix a typo in the
1018 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
1030 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1031 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1032 * pt.c (check_for_bare_parameter_packs): Return bool indicated
1033 whether everything was okay. Fix indentation.
1034 (push_template_decl_real): Check for bare parameter packs in
1035 function parameters; where errors occur, mark the parameter types
1036 with ERROR_MARK_NODEs to avert ICEs.
1037 (coerce_template_parameter_pack): New.
1038 (coerce_template_parms): Moved parameter pack coercion into
1039 coerce_template_parameter_pack, and permit it anywhere in the
1040 template parameter list (not just at the end). Parameter and
1041 argument indices can vary (somewhat) separately now, so add
1042 PARM_IDX and ARG_IDX.
1043 (fn_type_unification): Don't set an argument pack as incomplete if
1044 no argument pack was deduced.
1045 (type_unification_real): If a type parameter is a parameter pack
1046 and has not otherwise been deduced, it will be deduced to an empty
1048 (more_specialized_fn): Use the actual lengths of the argument
1049 lists when comparing against expansions.
1050 * semantics.c (finish_member_declaration): If a field's type has
1051 bare parameter packs, error and set its type to ERROR_MARK_NODE.
1053 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
1056 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1058 2007-05-22 Ollie Wild <aaw@google.com>
1060 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1061 (unqualified_namespace_lookup): Adds check for hidden types.
1063 2007-05-22 Ollie Wild <aaw@google.com>
1065 * decl.c (duplicate_decls): Verify namespace names are unique.
1067 2007-05-21 Mark Mitchell <mark@codesourcery.com>
1069 * decl.c (cxx_maybe_build_cleanup): Handle
1070 __attribute__((cleanup)).
1072 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1074 * cvt.c (cp_convert_and_check): Don't check warnings if the
1077 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1079 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1081 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1084 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1085 type only if is a class type (5.2.8/4).
1087 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1089 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1090 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1091 c_common_unsigned_type.
1093 2007-05-11 Silvius Rus <rus@google.com>
1095 * cp/typeck.c (build_indirect_ref): Add call to
1096 strict_aliasing_warning.
1097 (build_reinterpret_cast_1): Condition call to
1098 strict_aliasing_warning.
1100 2007-05-11 Jan Hubicka <jh@suse.cz>
1102 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1103 * decl2.c (start_objects): ctors and dtors are no longer public.
1104 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1106 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1108 * typeck.c (build_unary_op): Remove code that used to
1109 handle non lvalue increments/decrements.
1111 2007-05-07 Mike Stump <mrs@apple.com>
1113 * parser.c (check_empty_body): Add.
1114 (cp_parser_iteration_statement): Add call to check_empty_body.
1116 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1119 * mangle.c (write_mangled_name): Mangle static variable names.
1120 (write_unqualified_name): Use local-source-name for
1121 namespace-scope static variables.
1123 2007-05-04 Dirk Mueller <dmueller@suse.de>
1125 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1128 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1131 * decl2.c (constrain_class_visibility):
1132 Use strip_pointer_or_array_types instead of strip_array_types.
1134 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1137 * decl.c (reshape_init_r): Don't reshape the first element if it
1138 is a pointer to member function.
1140 2007-04-27 Simon Baldwin <simonb@google.com>
1142 * decl.c (grokparms): Changed message format from %qD to %qE.
1144 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1146 * error.c (maybe_warn_variadic_templates): Variadic templates are
1147 now in C++0x, so only warn about them in C++98 mode.
1149 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1152 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1153 integeral types from vectors types.
1155 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1158 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1159 for type dependent OMP_CLAUSE_DECLs.
1161 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1164 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1165 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1166 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1167 * init.c (build_zero_init): Adjust, as
1168 COMPLEX_TYPE is now a SCALAR_TYPE.
1169 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1170 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1172 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1174 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1175 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1176 (trait_expr_value): Adjust.
1178 2007-04-23 Simon Baldwin <simonb@google.com>
1180 * decl.c (grokparms): Added new error for duplicate function
1181 parameters names in function prototypes, to match gcc behavior.
1183 2007-04-23 Jan Hubicka <jh@suse.cz>
1185 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1188 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1190 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1191 instead of checking GIMPLE_STMT_P in chain_next.
1193 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1196 * call.c (convert_for_arg_passing): Convert bitfields to their
1199 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1202 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1204 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1207 * cp/decl2.c (constrain_class_visibility):
1208 Do not warn about the use of anonymous namespace in the main input file.
1210 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1212 * cp-tree.h (current_template_parms): Fix typo in comment.
1214 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1216 * cp-tree.h, error.c: Fix comment typos.
1218 2007-04-13 Jason Merrill <jason@redhat.com>
1221 * call.c (reference_binding): Add c_cast_p parm. If true,
1222 add quals to TO as needed to make it reference-compatible.
1224 2007-04-11 Jan Hubicka <jh@suse.cz>
1226 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1227 that we are not processing template_decl.
1229 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1232 * class.c (build_base_path): Ensure that the converted pointer has
1233 the same cv-qualification as the input.
1235 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1237 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1239 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1241 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1243 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1244 * tree.c (cp_add_pending_fn_decls): Remove.
1245 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1247 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1249 Revert change removing staticp.
1251 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1253 * cp-objcp-common.c (cxx_staticp): Remove.
1254 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1255 * cp-tree.h (cxx_staticp):
1257 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1259 * class.c (check_for_override): Don't remove dllmport attribute
1262 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1265 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1266 type issue error and return early.
1268 2007-03-30 Jason Merrill <jason@redhat.com>
1271 * typeck.c (cp_type_readonly): New fn.
1272 * cp-tree.h: Declare it.
1273 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1274 (cp_finish_decl): Not here.
1276 2007-03-31 Richard Guenther <rguenther@suse.de>
1278 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1281 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1286 * parser.c (declarator_can_be_parameter_pack): New.
1287 (cp_parser_template_parameter): Only parse the `...' if the
1288 declarator can be a parameter pack.
1289 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1291 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1292 types (they could be used as array bounds).
1293 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1294 (tsubst_pack_expansion): Handle failure to expand parameter
1297 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1300 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1301 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1302 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1303 (CLASS_TYPE_NON_UNION_P): Add.
1304 (struct lang_type_class): Add has_complex_dflt.
1305 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1306 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1307 * cp-tree.def: Add TRAIT_EXPR.
1308 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1309 * lex.c (struct resword): Add __has_nothrow_assign,
1310 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1311 __has_trivial_constructor, __has_trivial_copy,
1312 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1313 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1314 __is_pod, __is_polymorphic, __is_union.
1315 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1316 (cp_parser_trait_expr): New.
1317 * semantics.c (finish_trait_expr, trait_expr_value
1318 classtype_has_nothrow_copy_or_assign_p): New.
1319 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1321 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1322 * class.c (check_bases, check_field_decl, check_bases_and_members):
1323 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1324 * pt.c (uses_template_parms, tsubst_copy_and_build,
1325 value_dependent_expression_p, type_dependent_expression_p): Deal with
1327 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1329 2007-03-29 Richard Guenther <rguenther@suse.de>
1331 * tree.c (cp_walk_subtrees): Do not set input_location.
1333 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1336 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1339 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1341 * parser.c (struct cp_parser): Update comment for
1342 greater_than_is_operator_p.
1343 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1344 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1345 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1346 !GREATER_THAN_IS_OPERATOR_P.
1347 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1348 `>>' operators that will become two `>' tokens in C++0x.
1349 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1350 mode, allowing it to terminate default arguments.
1351 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1352 `>>' like two consecutive `>' tokens.
1353 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1354 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1355 ends a template argument.
1357 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1359 * decl.c (redeclaration_error_message): Complain when redeclaring
1360 a friend function with default template arguments (C++0x mode only).
1361 * cp-tree.h (check_default_tmpl_args): Declare.
1362 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1363 template arguments in function templates. Add support for checking
1364 the default template arguments of friend templates.
1365 (push_template_decl_real): Fix call to check_default_tmpl_args.
1366 (type_unification_real): If a template parameter has not been
1367 deduced but provides a default template argument, substitute into
1368 that default template argument.
1369 * parser.c (cp_parser_init_declarator): When declaring (but not
1370 defining!) a function template in C++0x mode, check for default
1373 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1376 * decl.c (grokdeclarator): Deal with cv-qualified function type
1377 typedefs in the same way for member and non-member functions.
1379 2007-03-26 Dirk Mueller <dmueller@suse.de>
1381 * parser.c (cp_parser_member_declaration): Pedwarn
1382 about stray semicolons after member declarations.
1384 2007-03-26 Paolo Carlini <pcarlini@suse.de>
1387 * pt.c (instantiate_decl): Set in_system_header.
1389 2007-03-22 Mark Mitchell <mark@codesourcery.com>
1391 * cp-tree.h (current_tempalte_parms): Improve documentation.
1392 * pt.c (current_template_args): Likewise.
1395 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1396 not consume tokens when failing.
1398 2007-03-22 Jim Wilson <wilson@specifix.com>
1399 Mark Mitchell <mark@codesourcery.com>
1402 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
1403 consistent with FROM.
1405 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1407 * error.c (dump_expr): Handle dependent names that designate types.
1408 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1410 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
1412 * cp-tree.def, parser.c, pt.c: Fix comment typos.
1414 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1416 * cvt.c (cp_convert_and_check) : Define.
1417 * cp-tree.h (cp_convert_and_check): Declare.
1418 * call.c (convert_conversion_warnings): Rename to
1419 conversion_null_warnings. The warning for floating-point to
1420 integer is handled by convert_and_check in convert_like_real.
1421 (convert_like_real): convert_conversion_warnings was renamed as
1422 conversion_null_warnings.
1423 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1424 overflow and changes of value during conversion.
1426 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1429 * parser.c (cp_parser_statement): If 'namespace' is found, this
1430 only can be a namespace alias definition, so parse it now.
1431 (cp_parser_namespace_alias_definition): if we find an open brace
1432 instead of '=', then this is actually a misplaced namespace
1435 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1438 * decl.c (cxx_init_decl_processing): Move command-line options
1439 processing to c-opts.c.
1441 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
1443 * ptree.c (cxx_print_type): Use formatting markup for integers
1444 when printing template parameter index/level/orig level.
1445 (cxx_print_xnode): Ditto.
1446 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1447 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1448 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1450 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1451 rather than a HOST_WIDE_INT.
1452 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1453 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1455 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1456 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1457 IN_BASE_INITIALIZER bool bitfields.
1458 (struct cp_declarator): Make KIND a 4-bit field. Make
1459 PARAMETER_PACK_P a bool bitfield just after KIND.
1460 * pt.c (uses_parameter_packs): Destroy the pointer set.
1461 (make_pack_expansion): Ditto.
1462 (check_for_bare_parameter_packs): Ditto.
1463 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1465 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
1468 * call.c (convert_default_arg): Instead of copying the node,
1471 2007-03-15 Dirk Mueller <dmueller@suse.de>
1474 * call.c (convert_conversion_warnings): New..
1475 (convert_like_real): .. factored out from here.
1476 (convert_conversion_warnings): Add warning about
1477 false being converted to NULL in argument passing.
1479 2007-03-14 Dirk Mueller <dmueller@suse.de>
1481 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1482 (finish_do_body): Warn about empty body in do/while statement.
1484 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1486 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1488 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1491 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1494 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
1496 * cp/repo.c (init_repo): Initialize random_seed saved options.
1497 (finish_repo): Adjust.
1499 2007-03-13 Mark Mitchell <mark@codesourcery.com>
1502 * Make-lang.in (doc/g++.1): Use $< to specify the location from
1505 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
1507 * decl.c (compute_array_index_type): New warning flag warn_vla.
1509 2007-03-12 Mark Mitchell <mark@codesourcery.com>
1512 * call.c (convert_default_arg): Copy non-constant arguments.
1514 2007-03-11 Mark Mitchell <mark@codesourcery.com>
1517 * parser.c (cp_parser_postfix_expression): Disallow compound
1518 literals in constant expressions.
1521 * semantics.c (finish_typeof): Use unlowered_expr_type.
1523 2007-03-10 Mark Mitchell <mark@codesourcery.com>
1526 * cp-tree.h (unlowered_expr_type): New function.
1527 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1528 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1529 (unlowered_expr_type): New function.
1530 (build_unary_op): Disallow predecrements of bool bitfields.
1531 * call.c (build_conditional_expr): Use unlowered_expr_type.
1532 * pt.c (type_unification_real): Likewise.
1534 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
1537 * typeck.c (check_return_expr): Check for bare parameter packs.
1538 (comptypes): Compare template parameter packs and
1539 type pack expansions.
1540 * decl.c (grokdeclarator): Deal with the declaration of function
1542 (grokparms): Verify that the (optional) function parameter pack is
1543 at the end of the parameter list.
1544 (xref_basetypes): Handle pack expansions in the base class.
1545 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1546 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1547 (NONTYPE_ARGUMENT_PACK): New.
1548 (TYPE_PACK_EXPANSION): New.
1549 (EXPR_PACK_EXPANSION): New.
1550 (ARGUMENT_PACK_SELECT): New.
1551 * cp-objcp-common.c (cp_tree_size): Compute size of
1552 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1553 ARGUMENT_PACK_SELECT.
1554 * error.c (dump_template_argument): Print template argument packs.
1555 (dump_template_argument_list): Ditto.
1556 (dump_template_parameter): Dump `...' for template type parameter
1558 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1559 (dump_parameters): Print function parameter packs.
1560 (dump_template_parms): Print template argument packs.
1561 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1562 (maybe_warn_variadic_templates): New.
1563 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1564 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1565 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1567 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1568 (write_template_arg): Write argument packs as separate arguments.
1569 * cp-tree.h (struct template_parm_index_s): Add flag that
1570 indicates that the template parameter is actually a parameter
1572 (struct tree_argument_pack_select): New.
1573 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1574 (union lang_tree_node): Add argument_pack_select.
1575 (FUNCTION_PARAMETER_PACK_P): New.
1576 (PACK_EXPANSION_P): New.
1577 (PACK_EXPANSION_PATTERN): New.
1578 (SET_PACK_EXPANSION_PATTERN): New.
1579 (PACK_EXPANSION_PARAMETER_PACKS): New.
1580 (ARGUMENT_PACK_P): New.
1581 (ARGUMENT_PACK_ARGS): New.
1582 (SET_ARGUMENT_PACK_ARGS): New.
1583 (ARGUMENT_PACK_INCOMPLETE_P): New.
1584 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1585 (TEMPLATE_PARM_PARAMETER_PACK): New.
1586 (TEMPLATE_TYPE_PARAMETER_PACK): New.
1587 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1588 (ARGUMENT_PACK_SELECT_INDEX): New.
1589 (ARGUMENT_PACK_SELECT_ARG): New.
1590 (struct cp_declarator): Add parameter_pack_p flag.
1591 (maybe_warn_variadic_templates): Declare.
1592 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1593 indicate a template parameter pack.
1594 (uses_parameter_packs): Declare.
1595 (template_parameter_pack_p): Declare.
1596 (template_parms_variadic_p): Declare.
1597 (make_pack_expansion): Declare.
1598 (check_for_bare_parameter_packs): Declare.
1599 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1600 sizeof... expressions.
1601 (pp_cxx_expression): Print pack expansions and non-type argument
1603 (pp_cxx_exception_specification): Print pack expansions.
1604 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1605 (pp_cxx_ctor_initializer): Print pack expansions.
1606 (pp_cxx_type_id): Print pack expansions.
1607 (pp_cxx_template_argument_list): Print argument packs.
1608 (pp_cxx_template_parameter): Print ellipsis for template parameter
1610 * pt.c (comp_template_parms): Compare template parameter packs.
1611 (template_parameter_pack_p): New.
1612 (template_parms_variadic_p): New.
1613 (template_args_variadic_p): New.
1614 (make_ith_pack_parameter_name): New.
1615 (struct find_parameter_pack_data): New.
1616 (find_parameter_packs_r): New.
1617 (uses_parameter_packs): New.
1618 (make_pack_expansion): New.
1619 (check_for_bare_parameter_packs): New.
1620 (expand_template_argument_pack): New.
1621 (reduce_template_parm_level): Propagate parameter pack flag.
1622 (process_template_parm): Add is_parameter_pack parameter to state
1623 when the parameter is actually a parameter pack. Create template
1624 parameter packs when is_parameter_pack is true.
1625 (current_template_args): The argument for a template parameter
1626 pack is an argument pack containing a single pack expansion.
1627 (process_partial_specialization): When checking that non-type
1628 argument expressions do not involve template parameters, loop over
1629 the arguments in argument packs separately.
1630 (push_template_decl_real): Check that the type of the declaration
1631 does not have any bare parameter packs. Check that primary
1632 templates have no more than one parameter pack, and that it comes
1633 at the end of the template parameter list.
1634 (convert_template_argument): Handle coercions for pack expansion
1635 expressions by coercing the pattern then rebuilding the expansion.
1636 (coerce_template_parms): When coercing the arguments for a
1637 variadic template, pack "extra" arguments into an argument pack.
1638 (coerce_template_template_parms): Cannot coerce between parameter
1639 packs and non-pack parameters.
1640 (template_args_equal): Compare PACK_EXPANSION_P expressions.
1641 (comp_template_args): Expand all template arguments packs before
1642 comparing template argument lists.
1643 (mangle_class_name_for_template): Make argument packs as separate
1645 (for_each_template_parm_r): No need to handle BASELINK.
1646 (instantiate_class_template): Handle pack expansions in the base
1648 (tsubst_pack_expansion): New.
1649 (tsubst_template_args): Handle substitutions of argument packs and
1650 pack expansion into template argument lists.
1651 (tsubst_decl): Expand function parameter packs into separate
1652 function parameters.
1653 (tsubst_arg_types): Expand a type pack expansion into separate
1655 (tsubst_exception_specification): Handle pack expansions in
1656 exception specifiers.
1657 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1658 replacing a template parameter with its argument. If we encounter
1659 a substitution for an argument pack, just return the parameter
1661 (tsubst_copy): sizeof(X...) returns the number of elements in
1662 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1663 PARM_DECL is a parameter pack.
1664 (tsubst_expr): Expression pack expansions and argument packs
1665 cannot show up here; they will all be handled through function
1666 calls, sizeof, and template argument lists.
1667 (tsubst_copy_and_build): sizeof(X...) returns the number of
1668 elements in parameter pack X. Handle pack expansions in TREE_LIST
1669 and CONSTRUCTOR nodes.
1670 (fn_type_unification): Handle "incomplete" explicit template
1671 argument lists that specify some of the arguments for a template
1673 (type_unification_real): Unify arguments against pack expansions.
1674 (template_parm_level_and_index): New, helper function.
1675 (unify_pack_expansion): New.
1676 (unify): Unify argument packs on an argument-by-argument basis,
1677 handling variadic argument packs as well.
1678 (more_specialized_fn): Handle unification of function parameter
1679 packs. All things being equal, prefer non-variadic function
1680 templates to variadic function templates.
1681 (more_specialized_class): Prefer the variadic class template
1682 partial specialization that binds fewer arguments to a parameter
1684 (regenerate_decl_from_template): Expand function parameter packs
1685 into separate parameters.
1686 (instantiate_decl): Ditto.
1687 (tsubst_initializer_list): Handle pack expansions for base-class
1689 (dependent_type_p_r): Determine dependent types in argument packs
1690 and pack expansions.
1691 (value_dependent_expression_p): Determine value-dependence of
1692 non-type argument packs.
1693 (dependent_template_arg_p): Handle argument packs.
1694 * semantics.c (finish_cond): Check for bare parameter packs.
1695 (finish_expr_stmt): Ditto.
1696 (finish_for_expr): Ditto.
1697 (finish_switch_cond): Ditto.
1698 (finish_mem_initializers): Ditto.
1699 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1701 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1702 * parser.c (make_declarator): Declarator is not an expansion.
1703 (make_pointer_declarator): Transfer parameter pack flag to outer
1705 (make_reference_declarator): Ditto.
1706 (make_ptrmem_declarator): Ditto.
1707 (make_call_declarator): Ditto.
1708 (make_array_declarator): Ditto.
1709 (cp_parser_postfix_expression): Allow pack expansion expressions
1710 in the argument list for a call expression.
1711 (cp_parser_parenthesized_expression_list): Add new parameter
1712 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1713 into separate arguments."
1714 (cp_parser_new_placement): Allow pack expansion expressions.
1715 (cp_parser_new_initializer): Ditto.
1716 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1717 base-class initializer expansion.
1718 (cp_parser_mem_initializer): Ditto.
1719 (cp_parser_template_parameter_list): Keep track of whether the
1720 template parameter is a template parameter pack.
1721 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1722 template parameter pack.
1723 (cp_parser_type_parameter): Ditto.
1724 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1726 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1727 this declarator is a parameter pack.
1728 (cp_parser_parameter_declaration): The ellipsis does not end the
1729 parameter declaration, because it might be a parameter pack. Parse
1730 the ellipsis to indicate a parameter pack.
1731 (cp_parser_initializer): Allow pack expansions.
1732 (cp_parser_initializer_list): Allow ellipsis to create an
1733 initializer expansion.
1734 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1736 (cp_parser_type_id_list): Allow ellipsis to create an exception
1737 specifier expansion.
1738 (cp_parser_attribute_list): Don't allow pack expansions.
1739 (cp_parser_functional_cast): Allow pack expansions.
1740 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1741 compute the length of a parameter pack.
1742 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1743 end a template argument.
1744 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1745 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1748 2007-03-09 Dirk Mueller <dmueller@suse.de>
1750 * cp/call.c (build_new_op): Call warn_logical_operator.
1752 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1755 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1758 * pt.c (any_template_arguments_need_structural_equality_p):
1761 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1763 * decl.c (grokdeclarator): Disable warnings for anonymous
1766 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1768 * typeck2.c (readonly_error): Always emit a hard error.
1769 Remove last argument.
1770 * cp-tree.h (readonly_error): Adjust prototype.
1771 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1772 * typeck.c (build_unary_op): Likewise.
1773 (build_modify_expr): Likewise.
1775 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1778 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1780 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1783 * parser.c (struct cp_parser): New IN_IF_STMT.
1784 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1785 returning if parsing the body of an 'if' statement or issuing an
1786 error and continuing.
1787 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1789 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1791 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1794 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1797 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1799 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1800 Objective-C++. Don't exit early if -shared-libgcc needs to be
1803 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1805 * typeck.c (common_base_type): Delete unused function.
1807 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1809 * Make-lang.in: Add dummy lang.install-pdf target.
1811 2007-03-01 Simon Baldwin <simonb@google.com>
1814 * decl.c (check_tag_decl): Added new warning for typedef ignored
1815 when it precedes an otherwise valid non-typedef declaration.
1817 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1819 * typeck.c (build_function_call): Store converted arguments
1820 in a stack-allocated array instead of building a list.
1821 (convert_arguments): Store arguments in the array passed in as an
1822 argument, and return the actual number of arguments.
1823 * call.c (build_call): Delete, and replace with...
1824 (build_call_n, build_call_a): New.
1825 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1826 (build_over_call): Store converted arguments in a stack-allocated
1827 array instead of building a list.
1828 (build_cxx_call): Pass arguments in an array instead of as a list.
1829 (build_java_interface_fn_ref): Rewrite to avoid constructing
1831 * tree.h: Update declarations to reflect above changes.
1832 * method.c (use_thunk): Use a stack-allocated array to hold
1833 the arguments instead of a list.
1834 * rtti.c (throw_bad_cast): Update call to cxx_call.
1835 (throw_bad_typeid): Likewise.
1836 (build_dynamic_cast_1): Likewise.
1837 * init.c (build_builtin_delete_call): Use build_call_n.
1838 * decl.c (expand_static_init): Likewise.
1839 * except.c (cp_protect_cleanup_actions): Likewise.
1840 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1841 (gimplify_must_not_throw_expr): Likewise.
1842 (cxx_omp_apply_fn): Use build_call_a.
1844 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1846 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1847 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1849 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1851 * cp-tree.h (static_ctors): Remove.
1852 * cp-tree.h (static_dtors): Likewise.
1853 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1854 refactoring of tree_map hierarchy.
1855 (decl_shadowed_for_var_insert): Likewise.
1856 * semantics.c (expand_body): Use c_expand_body.
1857 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1858 * decl2.c (static_ctors): Remove.
1859 (static_dtors): Likewise.
1860 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1861 objc_generate_static_init_call. Do not call static_[cd]tors.
1862 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1864 (cp_write_global_declarations): Likewise.
1866 2007-02-23 Richard Guenther <rguenther@suse.de>
1868 * class.c (note_name_declared_in_class): Make declaration
1869 changes meaning a pedwarn.
1871 2007-02-22 Michael Matz <matz@suse.de>
1874 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1875 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1876 dump_function_decl): Guard emitting outer scopes by new flag.
1877 * cp-lang.c (cxx_dwarf_name): New function.
1878 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1879 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1881 (push_template_decl_real, lookup_template_class): Remove calls
1884 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1886 * call.c (build_new_method_call): Ensure that explicit calls of
1887 destructors have type "void".
1889 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1891 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1892 and -Walways-true with -Waddress.
1893 * cvt.c (convert_to_void): Replace unconditional warning with
1896 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1898 * decl.c, tree.c: Fix comment typos.
1900 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1903 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1904 statement expression if we had an error mark node.
1906 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1907 Brooks Moses <brooks.moses@codesourcery.com>
1908 Lee Millward <lee.millward@codesourcery.com>
1910 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1911 Change class to tcc_vl_exp.
1913 * call.c (build_call): Use build_call_list instead
1915 (build_over_call): Likewise.
1916 (build_new_method_call): Use build_min_non_dep_call_list
1917 instead of build_min_non_dep.
1919 * error.c (dump_call_expr_args): New function.
1920 (dump_aggr_init_expr_args): New function.
1921 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1922 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1924 * cvt.c (convert_to_void): Use build_call_array instead
1925 of build3; use new AGGR_INIT_EXPR accessor macros.
1927 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1928 instead of TREE_CODE_LENGTH.
1930 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1931 AGGR_INIT_EXPR accessor macros.
1933 * cp-gimplify.c (cp_gimplify_init_expr): Use
1934 AGGR_INIT_EXPR_SLOT to set the slot operand.
1936 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1937 (AGGR_INIT_EXPR_SLOT): New macro.
1938 (AGGR_INIT_EXPR_ARG): New macro.
1939 (aggr_init_expr_nargs): New macro.
1940 (AGGR_INIT_EXPR_ARGP): New macro.
1941 (aggr_init_expr_arg_iterator): New.
1942 (init_aggr_init_expr_arg_iterator): New.
1943 (next_aggr_init_expr_arg): New.
1944 (first_aggr_init_expr_arg): New.
1945 (more_aggr_init_expr_args_p): New.
1946 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1947 (stabilize_aggr_init): New declaration.
1948 (build_min_non_dep_call_list): Likewise.
1950 * tree.c (process_aggr_init_operands): New function.
1951 (build_aggr_init_array) New function.
1952 (build_cplus_new): Update to use new CALL_EXPR and
1953 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1954 build_aggr_init_array.
1955 (build_min_non_dep_call_list) New function.
1956 (build_min_nt): Assert input code parameter is not a variable
1957 length expression class.
1958 (build_min, build_min_non_dep): Likewise.
1959 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1960 to check for equality instead of recursing. Handle tcc_vl_exp
1962 (stabilize_call): Update to only handle CALL_EXPRs, not
1963 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1964 (stabilize_aggr_init): New function.
1965 (stabilize_init): Use it.
1967 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1968 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1969 AGGR_INIT_EXPR accessor macros and argument iterators.
1971 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1972 build_vl_exp. Iterate through the operands, recursively
1973 processing each one.
1974 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1975 CALL_EXPR accessor macros.
1976 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1977 tree code classes. Use TREE_OPERAND_LENGTH instead of
1980 * semantics.c (finish_call_expr): Use build_nt_call_list
1981 instead of build_nt.
1982 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1983 accessor macros. Use build_call_array to construct the
1984 CALL_EXPR node instead of build3
1986 * decl2.c (build_offset_ref_call_from_tree): Use
1987 build_nt_call_list and build_min_non_dep_call_list instead
1988 of build_min_nt and build_min_non_dep.
1990 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1991 Use build_nt_call_list instead of build_min_nt.
1993 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1996 * call.c (build_conditional_expr): Improve error message.
1998 2007-02-13 Dirk Mueller <dmueller@suse.de>
2000 * friend.c (do_friend): Annotate warning about friend
2001 declarations in templates with OPT_Wnon_template_friend.
2002 Convert informal message from warning() to inform().
2004 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
2005 Mark Mitchell <mark@codesourcery.com>
2008 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2009 instantiations for variables.
2011 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2014 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2015 Check warn_unused_value just once.
2017 2007-02-11 Mark Mitchell <mark@codesourcery.com>
2020 * pt.c (determine_specialization): Use skip_artificial_parms_for.
2021 (fn_type_unificiation): Likewise.
2022 (get_bindings): Likewise.
2024 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
2027 * decl.c (finish_function): Use DECL_REPLACEABLE.
2028 * tree.c (cp_cannot_inline_tree_fn): Likewise.
2030 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
2032 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2034 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
2036 * decl.c (grokvardecl): Don't error if !have_tls.
2037 (grokdeclarator): Likewise.
2038 * parser.c (cp_parser_omp_threadprivate): Likewise.
2040 2007-02-07 Jakub Jelinek <jakub@redhat.com>
2043 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2044 parameters and result decls in omp clauses.
2045 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2048 2007-02-05 Dirk Mueller <dmueller@suse.de>
2051 * parser.c (cp_parser_class_specifier): Always initialize bases.
2053 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
2055 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2056 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2057 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2059 * semantics.c (finish_omp_atomic): Store a whole expression node
2060 in operand 1, and integer_zero_node in operand 0, for dependent
2061 OMP_ATOMIC. Rewrite to make flow easier to understand.
2063 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2065 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2067 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
2069 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2070 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2072 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2074 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2075 keyword warning to -Wc++0x-compat.
2077 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2079 * decl.c (grokdeclarator): Update documentation.
2081 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2084 * decl.c (grokdeclarator): If __thread is used together with
2085 a storage class other than extern and static, clear thread_p
2086 after issuing diagnostics and fall through to checking the
2089 2007-01-30 Roger Sayle <roger@eyesopen.com>
2091 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2092 calculating the size of an array (to avoid recursive errors).
2094 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2097 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2099 * call.c (convert_like_real): Don't warn when converting to
2102 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2104 * decl.c (pop_label): Replace warning with call to
2105 warn_for_unused_label.
2107 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2110 * semantics.c (finish_pseudo_destructor_expr): Check the
2111 destrutor name by calling check_dtor_name.
2113 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2115 * lex.c (D_CPP0X): Rename.
2117 (reswords): D_CPP0X -> D_CXX0X.
2118 (init_reswords): Ditto.
2119 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2120 of C++0x keywords as identifiers.
2122 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2125 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2128 2007-01-23 Ian Lance Taylor <iant@google.com>
2130 * typeck.c (convert_for_assignment): Only warn about a = b = c
2131 when converting to bool.
2133 2007-01-23 Roger Sayle <roger@eyesopen.com>
2135 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2137 * typeck.c (ignore_overflows): Remove the remaining uses of
2138 TREE_CONSTANT_OVERFLOW.
2140 2007-01-20 Jan Hubicka <jh@suse.cz>
2142 * decl2.c (start_objects, start_static_storage_duration_function):
2143 Do not make the functions uninlinable.
2145 2007-01-17 Ian Lance Taylor <iant@google.com>
2147 * class.c (add_method): Call VEC_reserve_exact rather than passing
2148 a negative size to VEC_reserve.
2150 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2153 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2155 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2158 * decl.c (make_typename_type): If the qualified name is not a
2159 type, issue an error.
2160 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2163 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2165 * rtti.c: Include target.h.
2166 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2167 don't emit typeinfo for fundamental types as weak.
2168 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2170 2007-01-08 Richard Guenther <rguenther@suse.de>
2172 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2174 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2176 * call.c (standard_conversion): Pass flag to
2177 vector_types_convertible_p to disallow emission of note.
2178 * typeck.c (convert_for_assignment): Pass flag to
2179 vector_types_convertible_p to allow emission of note.
2180 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2181 to disallow emission of note.
2183 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2186 * typeck.c (build_binary_op): Call overflow_warning if
2187 TREE_OVERFLOW_P is true for the result and not for any of the
2190 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2193 * class.c (add_method): Don't wait until template
2194 instantiation time to complain about duplicate methods.
2196 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2199 * semantics.c (finish_unary_op_expr): Warn only if result
2200 overflowed and operands did not.
2202 2007-01-05 Ian Lance Taylor <iant@google.com>
2204 * typeck.c (build_binary_op): Warn about comparing a non-weak
2207 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2209 * pt.c (tsubst): Propagate the need for structural equality checks
2210 when reducing the level of template parameters.
2212 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2214 * pt.c: Fix a comment typo.
2216 2007-01-02 Ian Lance Taylor <iant@google.com>
2218 * semantics.c (maybe_convert_cond): Optionally warn when using an
2219 assignment as a condition.
2220 * typeck.c (convert_for_assignment): Optionally warn about
2221 assigning the result of an assignment to a bool.
2223 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2225 * pt.c (canonical_template_parms): Correct typo in comment.
2227 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2229 * typeck.c (structural_comptypes): Renamed from "comptypes".
2230 (comptypes): Use canonical type information to perform fast type
2231 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2232 canonical type comparison returns the same results as we would see
2233 from the current, structural check. Support COMPARE_STRUCTURAL
2234 when we need structural checks.
2235 * decl.c (typename_compare): Fix comment.
2236 (build_typename_type): TYPENAME_TYPE nodes require structural
2237 equality checks, because they resolve different based on the
2239 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2240 require structural equality checks (for now).
2241 (build_ptrmemfunc_type): Build the canonical pointer to member
2243 (compute_array_index_type): Whenever we build a new index type
2244 to represent the size of an array in a template, we need to mark
2245 this index type as requiring structural equality. This goes for
2246 arrays with value-dependent sizes with the current ABI, or all
2248 * tree.c (cplus_array_hash): New.
2249 (struct cplus_array_info): New.
2250 (cplus_array_compare): New.
2251 (cplus_array_htab): New.
2252 (build_cplus_array_type_1): Use a hash table to cache the array
2253 types we build. Build the canonical array type for each array
2255 (cp_build_qualified_type_real): When building a cv-qualified array
2256 type, use the hash table of array types and build canonical array
2258 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2259 use structural equality (for now).
2260 * cp-tree.h (COMPARE_STRUCTURAL): New.
2261 * pt.c (canonical_template_parms): New.
2262 (canonical_type_parameter): New.
2263 (process_template_parm): Find the canonical type parameter.
2264 (lookup_template_class): When we have named the primary template
2265 type, set the canonical type for our template class to the primary
2266 template type. If any of the template arguments need structural
2267 equality checks, the template class needs structural equality
2269 (tsubst): When reducing the level of a template template
2270 parameter, we require structural equality tests for the resulting
2271 parameter because its template parameters have not had their types
2272 canonicalized. When reducing a template type parameter, find the
2273 canonical reduced type parameter.
2274 (any_template_arguments_need_structural_equality_p): New.