1 2007-09-06 Jan Hubicka <jh@suse.cz>
3 * semantics.c (expand_body): Do not mark arguments of clones used.
5 2007-09-06 Paolo Carlini <pcarlini@suse.de>
8 * decl.c (cp_finish_decl): When processing_template_decl,
9 deal correctly with init as TREE_LIST.
11 2007-09-06 Tom Tromey <tromey@redhat.com>
13 * decl.c (finish_function): Put return's location on line zero of
16 2007-09-05 Jason Merrill <jason@redhat.com>
19 * except.c (prepare_eh_type): Use type_decays_to.
22 * init.c (build_delete): Use build_headof to get the address of the
23 complete object if we aren't using the deleting destructor.
24 * rtti.c (build_headof): No longer static.
25 * cp-tree.h: Declare it.
27 2007-09-06 Jakub Jelinek <jakub@redhat.com>
29 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
30 decl if a prototype for XX is provided with throw().
33 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
34 on __*_chk non-__builtin_* decls.
36 2007-09-05 Paolo Carlini <pcarlini@suse.de>
39 * semantics.c (finish_id_expression): Use context_for_name_lookup
40 insted of DECL_CONTEXT, to see through anonymous structs and unions.
41 * class.c (finish_struct_anon): Deal correctly with anonymous
42 structs (vs unions, as GNU extension) in error messages.
44 2007-09-05 Jan Hubicka <jh@suse.cz>
46 * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
47 call, DECL_EXTERNAL checks and current_function_decl saving.
49 2007-09-05 Paolo Carlini <pcarlini@suse.de>
52 * parser.c (cp_parser_primary_expression): Return error_mark_node
53 when a statement-expression is found in a template-argument list.
55 2007-09-04 Jason Merrill <jason@redhat.com>
57 * except.c (initialize_handler_parm): Use
58 fold_build_cleanup_point_expr.
61 * call.c (reference_binding): Don't look for user-defined conversions
65 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
66 the MUST_NOT_THROW_EXPR.
68 2007-09-04 Richard Sandiford <richard@codesourcery.com>
70 * decl.c (cp_finish_decl): Call determine_visibility before
71 make_rtl_for_nonlocal_decl.
73 2007-09-04 Jason Merrill <jason@redhat.com>
76 * pt.c (most_specialized_class): Substitute outer template
77 arguments into the arguments of a member template partial
79 (strip_innermost_template_args): New fn.
81 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
83 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
85 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
87 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
88 * decl.c (cp_make_fname_decl): Likewise,
89 * parser.c (cp_parser_string_literal): Likewise,
90 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
91 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
94 2007-09-02 Paolo Carlini <pcarlini@suse.de>
97 * typeck.c (build_unary_op): Fix error message for
98 Boolean expression as operand to operator--.
100 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
102 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
103 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
106 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
109 * init.c (build_default_init): Make extern.
110 * cp-tree.h (build_default_init): Declare here.
111 * pt.c (tsubst_expr): When the instantiation of the initializer of
112 a variable results in an empty list, default-initialize the
114 (tsubst_copy_and_build): When the instantiation of the initializer
115 in a new expression results in an empty initializer list,
116 default-initialize it.
118 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
120 * mangle.c (write_type): Change mangling of rvalue reference from
123 2007-08-31 Jakub Jelinek <jakub@redhat.com>
125 * decl.c (duplicate_decls): Remove duplicated line.
127 2007-08-31 Paolo Carlini <pcarlini@suse.de>
130 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
131 BOUND_TEMPLATE_TEMPLATE_PARM.
133 2007-08-31 Paolo Carlini <pcarlini@suse.de>
136 * search.c (lookup_member): Check the name argument for
139 2007-08-31 Paolo Carlini <pcarlini@suse.de>
142 * parser.c (cp_parser_trait_expr): Check rerurn value of
145 2007-08-30 Ollie Wild <aaw@google.com>
147 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
148 convert_ptrmem for pointer to member conversions.
149 (convert_to_pointer_force): Update cp_convert_to_pointer call.
150 (ocp_convert): Update cp_convert_to_pointer call.
151 * typeck.c (convert_ptrmem): Add conditional for null pointers to
153 (build_static_cast_1): Check can_convert for conversions in either
155 (get_delta_difference_1): New function.
156 (get_delta_difference): Refactor to call get_delta_difference_1.
158 2007-08-30 Jakub Jelinek <jakub@redhat.com>
160 * decl.c (start_preparsed_function): Set
161 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
163 2007-08-28 Paolo Carlini <pcarlini@suse.de>
166 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
167 BOUND_TEMPLATE_TEMPLATE_PARM.
169 2007-08-28 Jakub Jelinek <jakub@redhat.com>
173 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
174 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
176 2007-08-27 Jason Merrill <jason@redhat.com>
179 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
180 Look inside STMT_EXPR.
181 * semantics.c (stmt_expr_value_expr): New fn.
182 * cp-tree.h: Declare it.
185 * decl.c (groktypename): Ignore attributes applied to class type.
187 2007-08-28 Richard Guenther <rguenther@suse.de>
189 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
191 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
193 * error.c (dump_expr): Handle COMPLEX_CST.
194 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
195 (pp_cxx_expression): Likewise.
197 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
199 * decl.c (GNU_INLINE_P): New.
200 (duplicate_decls): Handle gnu_inline. Merge attributes and
201 some flags in overriding definitions.
202 (redeclaration_error_message): Handle gnu_inline.
203 (start_preparsed_function): Likewise.
205 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
207 * call.c (sufficient_parms_p): Constify.
208 * class.c (same_signature_p): Likewise.
209 * cp-gimplify.c (is_invisiref_parm,
210 cxx_omp_privatize_by_reference): Likewise.
211 * cp-objcp-common.c (has_c_linkage): Likewise.
212 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
213 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
214 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
215 num_artificial_parms_for, comp_template_parms,
216 template_parameter_pack_p, any_dependent_template_arguments_p,
217 any_type_dependent_arguments_p, any_value_dependent_elements_p,
218 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
219 zero_init_p, member_p, cp_lvalue_kind,
220 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
221 varargs_function_p, is_dummy_object, special_function_kind,
222 string_conv_p, type_unknown_p, comp_except_specs, compparms,
223 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
224 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
225 cp_has_mutable_p, at_least_as_qualified_p,
226 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
227 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
228 * except.c (nothrow_libfn_p): Likewise.
229 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
231 * pt.c (comp_template_parms, template_parameter_pack_p,
232 any_type_dependent_arguments_p, any_value_dependent_elements_p,
233 any_dependent_template_arguments_p): Likewise.
234 * repo.c (repo_export_class_p): Likewise.
235 * semantics.c (anon_aggr_type_p): Likewise.
236 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
237 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
238 varargs_function_p, member_p, is_dummy_object, pod_type_p,
239 zero_init_p, special_function_p): Likewise.
240 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
241 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
242 compparms, invalid_nonstatic_memfn_p,
243 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
244 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
245 cp_has_mutable_p, lvalue_or_else): Likewise.
247 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
249 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
250 * cp-objcp-common.c (cp_tree_size): Ditto.
251 * tree.c (cp_walk_subtrees): Ditto
252 * cp-tree.def (TINST_LEVEL): Go away.
253 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
254 move together with other non-tree structs.
255 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
256 (union lang_tree_node): Eliminate tinst_level field.
257 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
258 (current_instantiation, outermost_tinst_level): Return
259 a "struct tinst_level *".
261 * error.c (print_instantiation_partial_context): Change second
262 parameter to a "struct tinst_level *". Replace accessor macros
264 (print_instantiation_full_context): Likewise.
265 * lex.c (in_main_input_context): Likewise.
267 * pt.c (struct pending_templates): New.
268 (pending_templates, last_pending_template): Use it as a type.
269 (current_tinst_level): Change typo to "struct tinst_level *"
270 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
271 (add_pending_template): Construct a "struct pending_template".
272 Replace TINST_LEVEL accessor macros with field access.
273 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
274 (pop_tinst_level): Likewise.
275 (instantiate_pending_templates): Likewise. Factor common code used
276 when an instantiation has been done.
277 (outermost_tinst_level): Replace tree_last with loop.
278 (current_instantiation): Return a "struct tinst_level *".
280 2007-08-24 Ollie Wild <aaw@google.com>
282 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
283 * name-lookup.h (cp_binding_level): Remove vtables member.
285 2007-08-24 Richard Guenther <rguenther@suse.de>
287 * tree.c (cp_cannot_inline_tree_fn): Remove.
288 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
289 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
292 2007-08-24 Jakub Jelinek <jakub@redhat.com>
295 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
296 error_mark_node right away if build_expr_type_conversion
300 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
301 is error_mark_node rather than NULL_TREE.
302 * pt.c (check_explicit_specialization): Likewise.
305 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
306 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
308 2007-08-22 Jason Merrill <jason@redhat.com>
311 * pt.c (outermost_tinst_level): New function.
312 * lex.c (in_main_input_context): New function.
313 * cp-tree.h: Declare it.
314 * decl2.c (constrain_class_visibility): Use it to avoid warning
315 about uses of the anonymous namespace in the main input file.
317 2007-08-21 Jakub Jelinek <jakub@redhat.com>
319 * init.c (build_new_1): Use get_target_expr instead of save_expr.
321 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
324 * class.c (finish_struct_1): Warn when a class has virtual
325 functions and accessible non-virtual destructor.
327 2007-08-20 Richard Guenther <rguenther@suse.de>
331 * call.c (build_new_method_call): Convert initializer to
333 * init.c (build_aggr_init): Do not fiddle with types.
334 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
335 * except.c (build_throw): Do not drop qualifiers for the
337 * typeck.c (get_member_function_from_ptrfunc): Do not
338 fiddle with types, instead convert.
339 (build_ptrmemfunc1): Convert to the target type for
341 (gfc_trans_allocate): Convert result to target type.
342 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
343 pointer-to-member structures shall have alias set zero as well.
345 2007-08-20 Richard Guenther <rguenther@suse.de>
347 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
349 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
350 (nonstatic_local_decl_p): Likewise.
351 * tree.c (cp_auto_var_in_fn_p): Remove.
352 * decl.c (nonstatic_local_decl_p): Remove.
354 2007-08-20 Richard Guenther <rguenther@suse.de>
356 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
358 * tree.h (cp_walk_tree): New define to walk_tree_1 with
359 cp_walk_subtrees lh parameter.
360 (cp_walk_tree_without_duplicates): New define to
361 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
362 * tree.c (count_trees): Call
363 cp_walk_tree_without_duplicates.
364 (verify_stmt_tree): Call cp_walk_tree.
365 (break_out_target_exprs): Likewise.
366 (WALK_SUBTREE): Likewise.
367 * cp-gimplify.c (cp_genericize): Likewise.
368 * cp-pt.c (find_parameter_packs_r): Likewise.
369 (uses_parameter_packs): Likewise.
370 (make_pack_expansion): Likewise.
371 (check_for_bare_parameter_packs): Likewise.
372 (for_each_template_parm): Likewise.
373 * decl.c (check_default_argument): Call
374 cp_walk_tree_without_duplicates.
375 * except.c (build_throw): Likewise.
376 * decl2.c (type_visibility): Likewise.
377 * semantics.c (expand_or_defer_fn): Likewise.
378 (finalize_nrv): Call cp_walk_tree.
380 2007-08-20 Jakub Jelinek <jakub@redhat.com>
383 * init.c (build_new_1): Rename placement_var variable to placement_expr.
384 Initialize it with save_expr rather than get_temp_regvar.
386 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
389 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
392 2007-08-17 Ollie Wild <aaw@google.com>
395 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
396 declarations into appropriate slots for comparison. Fix type
399 2007-08-17 Paolo Carlini <pcarlini@suse.de>
402 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
403 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
405 2007-08-17 Paolo Carlini <pcarlini@suse.de>
408 * parser.c (cp_parser_class_head): Improve error message.
410 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
412 * pt.c (instantiate_decl): Set input_location
413 for the function end.
415 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
417 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
419 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
420 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
421 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
422 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
423 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
424 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
425 * typeck.c (cp_type_quals): Likewise.
426 * typeck2.c (cxx_incomplete_type_diagnostic,
427 cxx_incomplete_type_error): Likewise.
429 2007-08-16 Paolo Carlini <pcarlini@suse.de>
432 * pt.c (tsubst_friend_function): When check_classfn
433 returns error_mark_node likewise return it.
435 2007-08-15 Jakub Jelinek <jakub@redhat.com>
438 * typeck.c (check_return_expr): Don't NRV optimize vars in
440 * decl.c (finish_function): Comment fix.
442 2007-08-15 Paolo Carlini <pcarlini@suse.de>
445 * pt.c (push_template_decl_real): Depending on TYPE_P
446 use either TYPE_CONTEXT or DECL_CONTEXT.
448 2007-08-14 Mark Mitchell <mark@codesourcery.com>
450 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
451 constructors and destructors return this.
453 2007-08-14 Paolo Carlini <pcarlini@suse.de>
456 * decl2.c (check_classfn): Return error_mark_node in case of error;
457 in that case, do not call add_method.
458 * decl.c (start_decl): Deal with check_classfn returning
460 (grokfndecl): Likewise.
461 * pt.c (tsubst_friend_function): Likewise.
463 2007-08-14 Andrew Pinski <pinskia@gmail.com>
466 * typeck.c (build_binary_op): Disallow vector float types with
467 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
469 2007-08-11 Ian Lance Taylor <iant@google.com>
471 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
473 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
475 2007-08-10 Ollie Wild <aaw@google.com>
477 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
479 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
481 (unqualified_namespace_lookup): Fix ambiguous_decl call.
482 (lookup_using_namespace): Fix ambiguous_decl call.
483 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
485 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
487 * call.c (name_as_c_string): Use CONST_CAST.
488 * decl.c (build_decl): Likewise.
489 * parser.c (cp_parser_string_literal): Likewise.
491 2007-08-10 Paolo Carlini <pcarlini@suse.de>
494 * error.c (dump_expr): Consistently use the *_cxx_*
495 variants of the pretty-print functions.
497 2007-08-10 Paolo Carlini <pcarlini@suse.de>
500 * decl.c (check_special_function_return_type): Just error
501 on return type specified for conversion operator.
503 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
505 * typeck2.c (readonly_error): Handle general expressions.
506 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
508 2007-08-06 Dan Hipschman <dsh@google.com>
510 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
511 access function name.
513 2007-08-04 Alfred Minarik <a.minarik@aon.at>
516 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
517 * g++spec.c (lang_specific_driver): Check them.
519 2007-08-06 Paolo Carlini <pcarlini@suse.de>
522 * pt.c (inline_needs_template_parms): Fix comment; change return type
525 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
528 2007-03-26 Dirk Mueller <dmueller@suse.de>
530 * parser.c (cp_parser_member_declaration): Pedwarn
531 about stray semicolons after member declarations.
533 2007-08-02 Lee Millward <lee.millward@gmail.com>
538 * parser.c (cp_parser_asm_definition): Detect and discard asm
539 statements with invalid inputs or outputs.
540 (cp_parser_asm_operand_list): Return error mark node if any
541 of the operands are invalid. Adjust documentation.
543 2007-08-02 Nick Clifton <nickc@redhat.com>
545 * typeck.c: Change copyright header to refer to version 3 of the
546 GNU General Public License and to point readers at the COPYING3
547 file and the FSF's license web page.
548 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
549 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
550 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
551 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
552 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
553 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
554 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
555 name-lookup.h, parser.c: Likewise.
557 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
560 * call.c (magic_varargs_p): Honor the "type generic" attribute.
562 2007-07-30 Paolo Carlini <pcarlini@suse.de>
565 * semantics.c (finish_label_stmt): Reject the __label__
566 extension outside function scopes.
568 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
570 * parser.c (eof_token): Un-constify.
571 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
572 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
575 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
577 * pt.c, tree.c, typeck2.c: Fix comment typos.
579 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
580 Mark Mitchell <mark@codesourcery.com>
583 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
584 hidden due to friend declarations in local classes.
586 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
588 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
589 * cp-tree.def (DECLTYPE_TYPE): New.
590 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
591 (dump_type_prefix): Ditto.
592 (dump_type_suffix): Ditto.
593 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
594 * mangle.c (write_type): Handle DECLTYPE_TYPE.
595 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
597 (DECLTYPE_TYPE_EXPR): New.
598 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
599 (finish_declared_type): Declare.
600 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
602 (pp_cxx_type_id): Ditto.
603 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
604 (tsubst): Substitute into a DECLTYPE_TYPE node.
605 (tsubst_copy): Ditto.
606 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
608 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
609 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
610 structural equality (because we can't hash the expressions).
611 (finish_declared_type): New.
612 * lex.c (reswords): Add "decltype" keyword.
613 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
614 (cp_parser_postfix_expression): Add member_access_only_p to
615 restrict postfix expression to member access expressions.
616 (cp_parser_unary_expression): Update call to
617 cp_parser_postfix_expression to reflect new parameter.
618 (cp_parser_declared_type): New.
619 (cp_parser_simple_type_specifier): Parse decltype types.
621 2007-07-27 Mark Mitchell <mark@codesourcery.com>
624 * call.c (convert_for_arg_passing): Only widen bitfields to their
625 declared types if necessary.
627 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
629 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
632 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
634 * decl.c (typename_hash, typename_compare): Constify.
635 * mangle.c (hash_type, compare_type): Likewise.
636 * pt.c (eq_local_specializations, hash_local_specialization):
638 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
639 list_hash): Likewise.
640 * typeck2.c (pat_compare): Likewise.
642 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
644 * method.c (implicitly_declare_fn): Increase alignment if member
645 function pointer format requires it.
647 2007-07-24 Paolo Carlini <pcarlini@suse.de>
650 * typeck.c (check_return_expr): Do not pass a null argument
653 2007-07-24 Paolo Carlini <pcarlini@suse.de>
656 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
659 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
662 * typeck.c (convert_arguments): Only use default args if we have
666 * typeck.c (structural_comptypes): No need to check
667 resolve_typename_type return value here.
668 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
669 * pt.c (resolve_typename_type): Follow typename typedefs. Return
670 original type rather than error_mark_node in case of failure.
671 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
672 resolve_typename_type result check.
673 (cp_parser_direct_declarator, cp_parser_head,
674 cp_parser_constructor_declarator_p): Likewise.
676 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
678 * pt.c (template_parms_variadic_p): Remove.
679 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
681 2007-07-12 Jakub Jelinek <jakub@redhat.com>
684 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
685 argument to dump_aggr_init_expr_args instead of false.
687 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
689 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
690 canonical types; otherwise, fall back to structural type
691 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
692 internal compiler error if the canonical types are wrong.
694 2007-07-11 Paolo Carlini <pcarlini@suse.de>
697 * parser.c (cp_parser_make_indirect_declarator): When the
698 the code argument is ERROR_MARK return cp_error_declarator.
700 2007-07-09 Geoffrey Keating <geoffk@apple.com>
703 * decl.c (cxx_init_decl_processing): Don't set
704 force_align_functions_log.
705 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
706 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
707 FUNCTION_DECL, return its alignment.
709 2007-07-09 Richard Guenther <rguenther@suse.de>
711 * decl.c (start_preparsed_function): Do not promote return type.
713 2007-07-08 Paolo Carlini <pcarlini@suse.de>
716 * pt.c (unify): Never pass error_mark_node to template_decl_level.
718 2007-07-07 Mark Mitchell <mark@codesourcery.com>
721 * pt.c (resolve_overloaded_unification): Robustify. Return a
723 (type_unification_real): Adjust accordingly.
725 2007-07-06 Richard Guenther <rguenther@suse.de>
727 * init.c (build_new_1): Use the correct pointer type.
728 * typeck2.c (build_m_component_ref): Likewise.
730 2007-07-05 Mark Mitchell <mark@codesourcery.com>
733 * init.c (build_zero_init): Always build an initializer for
735 * typeck2.c (build_functional_cast): Use build_zero_init.
738 * init.c (build_new_1): Always pass the allocation function to
739 build_op_delete_call.
740 * call.c (build_op_delete_call): Handle operator delete with a
741 variable-argument list. Do not issue an error when no matching
742 deallocation function is available for a new operator.
745 * cp-tree.h (any_value_dependent_elements_p): Declare it.
746 * decl.c (value_dependent_init_p): New function.
747 (cp_finish_decl): Use it.
748 * pt.c (value_dependent_expression_p): Use
749 any_value_dependent_elements_p.
750 * parser.c (cp_parser_primary_expression): Add comment about
751 treating dependent qualified names as integral
752 constant-expressions.
754 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
756 * decl.c (build_ptrmemfunc_type): Always use structural equality
757 tests when comparing pointer-to-member-function types, because the
758 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
761 2007-07-03 Mark Mitchell <mark@codesourcery.com>
763 * init.c (build_new): Tweak comment.
765 2007-06-29 Dave Brolley <brolley@redhat.com>
768 * parser.c (cp_parser_new_type_id): Don't reduce a named array
769 type to its base type and number of elements here.
770 * init.c (build_new): Call complete_type_or_else to ensure that the
771 type is complete and to issue a diagnostic if it is not.
772 (build_new_1): Don't call complete_type_or_else here.
774 2007-07-03 Richard Guenther <rguenther@suse.de>
777 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
780 2007-07-02 Simon Baldwin <simonb@google.com>
782 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
783 for inner-style nested forward declarations that don't declare
786 2007-07-02 Jakub Jelinek <jakub@redhat.com>
789 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
790 DECL_P in not a variable and appears more than once error messages.
792 2007-07-01 Ollie Wild <aaw@google.com>
794 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
795 (select_decl): Remove function.
796 (unqualified_namespace_lookup): Populate binding by calling
797 ambiguous_decl. Remove select_decl call.
798 (lookup_qualified_name): Remove select_decl call.
799 * decl.c (lookup_and_check_tag): Check for ambiguous references.
800 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
801 generation when name lookup is ambiguous.
803 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
806 * init.c (build_new_1): Use structural equality on the copy of the
809 2007-06-28 Geoffrey Keating <geoffk@apple.com>
811 * decl2.c (determine_visibility): Implement
812 flag_visibility_ms_compat effect on type info.
813 * decl.c (cxx_init_decl_processing): Implement
814 global effect of flag_visibility_ms_compat.
816 2007-06-28 Geoffrey Keating <geoffk@apple.com>
818 * decl2.c (start_objects): Mark constructor-running function
821 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
824 * decl.c (grokdeclarator): Reset friendp for member functions declared
825 friend of their own class.
827 2007-06-23 Mark Mitchell <mark@codesourcery.com>
829 * decl2.c (determine_visibility): Don't look for dllexport here.
830 (determine_visibility_from_class): Tidy.
832 2007-06-18 Simon Baldwin <simonb@google.com>
835 * parser.c (cp_parser_single_declaration): Added check for storage
836 class other than sc_none in parsed declaration, and a flag to indicate
837 if the call is part of an explicit template specialization parse.
838 * (cp_parser_explicit_specialization): Specialization check flag added
839 to call to cp_parser_single_declaration(), set true.
840 * (cp_parser_template_declaration_after_export): Specialization check
841 flag added to call to cp_parser_single_declaration(), set false.
842 * pt.c (check_explicit_specialization): Added code to copy visiblity
843 and linkage from the templated function to the explicit specialization.
845 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
847 * typeck.c (build_binary_op): For templates build the
848 expression in pieces to avoid the assert in build2_stat.
849 (get_member_function_from_ptrfunc):
850 Change over to using POINTER_PLUS_EXPR and convert
851 the second operand to sizetype.
852 * typeck2.c (build_m_component_ref): Likewise.
853 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
854 instead of PLUS_EXPR for pointers.
855 (build_new_1): Likewise.
856 (build_vec_delete_1): Likewise.
857 (build_vec_delete): Likewise.
858 * class.c (build_base_path): Likewise.
859 (build_base_path): Likewise.
860 (convert_to_base_statically): Likewise.
861 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
862 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
863 instead of PLUS_EXPR.
864 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
865 instead of PLUS_EXPR for pointers.
866 * call.c (build_special_member_call): Likewise.
867 * rtti.c (build_headof): Likewise.
868 Use sizetype instead of ptrdiff_type_node.
869 (tinfo_base_init): Create a POINTER_PLUS_EXPR
870 instead of PLUS_EXPR for pointers.
871 * except.c (expand_start_catch_block): Do a
872 NEGATIVE and then a POINTER_PLUS_EXPR instead
874 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
875 PLUS_EXPR on pointer types over to use
876 POINTER_PLUS_EXPR and remove the conversion
877 to the pointer types.
878 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
879 adding to a pointer type. Use size_int instead of
880 ssize_int. Convert the index to sizetype before
881 adding it to the pointer.
883 2007-06-15 Mark Mitchell <mark@codesourcery.com>
885 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
886 (DECL_ANON_UNION_VAR_P): New macro.
887 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
888 than DECL_VAR_MARKED_P, to keep track of which variables we have
890 * decl.c (redeclaration_error_message): Complain about redeclaring
891 anonymous union members at namespace scope.
892 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
894 2007-06-14 Geoff Keating <geoffk@apple.com>
896 * decl2.c (determine_visibility): Ensure that functions with
897 hidden types as parameters are hidden.
900 * decl2.c (determine_visibility): Remove duplicate code for
903 2007-06-12 Ian Lance Taylor <iant@google.com>
906 * init.c (avoid_placement_new_aliasing): New static function.
907 (build_new_1): Call it.
909 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
911 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
912 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
914 2007-06-08 Jakub Jelinek <jakub@redhat.com>
917 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
918 on init, the non-decl cond operand and increment value.
920 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
923 * decl.c (check_initializer): Report an error when a brace enclosed
924 initializer is used for a non-aggregate type in C++98.
925 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
927 (grokdeclarator): Likewise.
928 (move_fn_p): Likewise.
929 * typeck.c (check_return_expr): Likewise.
930 * call.c (reference_binding): Likewise.
931 * error.c (cp_cpp_error): Likewise.
932 * pt.c (check_default_tmpl_args): Likewise.
934 * lex.c (init_reswords): Likewise.
935 * parser.c (p_parser_primary_expression): Likewise.
936 (TOKEN_PRECEDENCE): Likewise.
937 (cp_parser_init_declarator): Likewise.
938 (cp_parser_ptr_operator): Likewise.
939 (cp_parser_parameter_declaration): Likewise.
940 (cp_parser_enclosed_template_argument_list): Likewise.
941 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
942 (cp_parser_next_token_ends_template_argument_p): Likewise.
944 2007-06-04 Simon Baldwin <simonb@google.com>
946 * decl.c (grokdeclarator): Readability change. Moved case labels
947 into direct switch statement scope.
949 2007-06-04 Paolo Carlini <pcarlini@suse.de>
951 * call.c (convert_like_real): Remove pointless code.
953 2007-05-31 Mark Mitchell <mark@codesourcery.com>
955 * decl.c (get_atexit_fn_ptr_type): New function.
956 (get_atexit_node): Use it.
957 (start_cleanup_fn): Likewise.
958 (register_dtor_fn): Use the object's destructor, instead of a
959 separate cleanup function, where possible.
960 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
961 (atexit_fn_ptr_type_node): New macro.
962 * decl2.c (build_cleanup): Use build_address.
964 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
966 * typeck.c (build_binary_op): Include types in error.
968 2007-05-31 Jakub Jelinek <jakub@redhat.com>
971 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
972 needs runtime initialization.
974 2007-05-31 Paolo Carlini <pcarlini@suse.de>
977 * semantics.c (finish_trait_expr): Complete the types.
979 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
980 Douglas Gregor <doug.gregor@gmail.com>
981 Pedro Lamarao <pedro.lamarao@mndfck.org>
982 Howard Hinnant <howard.hinnant@gmail.com>
986 * typeck.c (comptypes): Don't consider rvalue and lvalue
987 reference types to be equivalent.
988 (check_return_expr): Move from certain lvalues when returning
990 * decl.c (grokdeclarator): Implement reference collapsing.
991 (copy_fn_p): Don't consider constructors taking rvalue references
992 to be copy constructors.
994 * call.c (conversion): New "rvaluedness_matches_p" member.
995 (convert_class_to_reference): Require reference type as first
996 parameter instead of base type.
997 (reference_binding): Add logic to handle rvalue references.
998 (implicit_conversion): Update inaccurate comment.
999 (convert_like_real): Disable creation of temporaries that are
1000 impossible to initialize for types with move constructors.
1001 (build_over_call): Elide move constructors when possible.
1002 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
1003 (maybe_handle_ref_bind): Return conversion instead of type node.
1004 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
1005 determine preferred conversion sequences.
1006 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
1007 (LOOKUP_PREFER_RVALUE): New.
1008 (DECL_MOVE_CONSTRUCTOR_P): New.
1009 (struct cp_declarator): Add "reference" member for reference
1010 types, with new "rvalue_ref" flag.
1011 (cp_build_reference_type): Declare.
1012 (move_fn_p): Declare.
1013 * error.c (dump_type_prefix): Format rvalue reference types
1014 correctly in error messages.
1015 * except.c (build_throw): Move from certain lvalues when
1017 * mangle.c (write_type): Mangle rvalue references differently
1018 than regular references.
1019 * parser.c (make_reference_declarator): Add boolean parameter for
1021 (cp_parser_make_indirect_declarator): New.
1022 (cp_parser_new_declarator_opt): Call
1023 cp_parser_make_indirect_declarator.
1024 (cp_parser_conversion_declarator_opt): Ditto.
1025 (cp_parser_declarator): Ditto.
1026 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
1028 * pt.c (tsubst): Implement reference collapsing.
1029 (maybe_adjust_types_for_deduction): Implement special template
1030 parameter deduction rule for rvalue references.
1031 (type_unification_real): Update calls to
1032 maybe_adjust_types_for_deduction.
1033 (try_one_overload): Ditto.
1034 (unify_pack_expansion): Ditto.
1035 * tree.c (lvalue_p_1): Handle rvalue reference types.
1036 (cp_build_reference_type): New.
1038 2007-05-30 Jakub Jelinek <jakub@redhat.com>
1041 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
1042 variables that need runtime initialization.
1044 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
1047 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
1048 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
1049 case POSTDECREMENT_EXPR>): Return the error_mark_node
1050 if either the real or imaginary parts would an
1053 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
1054 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1057 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1058 token is a closing brace, false if there are no tokens left.
1059 (cp_parser_namespace_alias_definition): Only consume the next token if
1060 it is a closing brace.
1062 * parser.c (cp_parser_class_specifier): Likewise.
1064 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
1066 * semantics.c (finish_member_declaration): Fix a typo in the
1069 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
1081 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1082 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1083 * pt.c (check_for_bare_parameter_packs): Return bool indicated
1084 whether everything was okay. Fix indentation.
1085 (push_template_decl_real): Check for bare parameter packs in
1086 function parameters; where errors occur, mark the parameter types
1087 with ERROR_MARK_NODEs to avert ICEs.
1088 (coerce_template_parameter_pack): New.
1089 (coerce_template_parms): Moved parameter pack coercion into
1090 coerce_template_parameter_pack, and permit it anywhere in the
1091 template parameter list (not just at the end). Parameter and
1092 argument indices can vary (somewhat) separately now, so add
1093 PARM_IDX and ARG_IDX.
1094 (fn_type_unification): Don't set an argument pack as incomplete if
1095 no argument pack was deduced.
1096 (type_unification_real): If a type parameter is a parameter pack
1097 and has not otherwise been deduced, it will be deduced to an empty
1099 (more_specialized_fn): Use the actual lengths of the argument
1100 lists when comparing against expansions.
1101 * semantics.c (finish_member_declaration): If a field's type has
1102 bare parameter packs, error and set its type to ERROR_MARK_NODE.
1104 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
1107 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1109 2007-05-22 Ollie Wild <aaw@google.com>
1111 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1112 (unqualified_namespace_lookup): Adds check for hidden types.
1114 2007-05-22 Ollie Wild <aaw@google.com>
1116 * decl.c (duplicate_decls): Verify namespace names are unique.
1118 2007-05-21 Mark Mitchell <mark@codesourcery.com>
1120 * decl.c (cxx_maybe_build_cleanup): Handle
1121 __attribute__((cleanup)).
1123 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1125 * cvt.c (cp_convert_and_check): Don't check warnings if the
1128 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1130 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1132 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1135 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1136 type only if is a class type (5.2.8/4).
1138 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1140 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1141 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1142 c_common_unsigned_type.
1144 2007-05-11 Silvius Rus <rus@google.com>
1146 * cp/typeck.c (build_indirect_ref): Add call to
1147 strict_aliasing_warning.
1148 (build_reinterpret_cast_1): Condition call to
1149 strict_aliasing_warning.
1151 2007-05-11 Jan Hubicka <jh@suse.cz>
1153 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1154 * decl2.c (start_objects): ctors and dtors are no longer public.
1155 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1157 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1159 * typeck.c (build_unary_op): Remove code that used to
1160 handle non lvalue increments/decrements.
1162 2007-05-07 Mike Stump <mrs@apple.com>
1164 * parser.c (check_empty_body): Add.
1165 (cp_parser_iteration_statement): Add call to check_empty_body.
1167 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1170 * mangle.c (write_mangled_name): Mangle static variable names.
1171 (write_unqualified_name): Use local-source-name for
1172 namespace-scope static variables.
1174 2007-05-04 Dirk Mueller <dmueller@suse.de>
1176 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1179 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1182 * decl2.c (constrain_class_visibility):
1183 Use strip_pointer_or_array_types instead of strip_array_types.
1185 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1188 * decl.c (reshape_init_r): Don't reshape the first element if it
1189 is a pointer to member function.
1191 2007-04-27 Simon Baldwin <simonb@google.com>
1193 * decl.c (grokparms): Changed message format from %qD to %qE.
1195 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1197 * error.c (maybe_warn_variadic_templates): Variadic templates are
1198 now in C++0x, so only warn about them in C++98 mode.
1200 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1203 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1204 integeral types from vectors types.
1206 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1209 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1210 for type dependent OMP_CLAUSE_DECLs.
1212 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1215 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1216 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1217 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1218 * init.c (build_zero_init): Adjust, as
1219 COMPLEX_TYPE is now a SCALAR_TYPE.
1220 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1221 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1223 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1225 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1226 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1227 (trait_expr_value): Adjust.
1229 2007-04-23 Simon Baldwin <simonb@google.com>
1231 * decl.c (grokparms): Added new error for duplicate function
1232 parameters names in function prototypes, to match gcc behavior.
1234 2007-04-23 Jan Hubicka <jh@suse.cz>
1236 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1239 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1241 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1242 instead of checking GIMPLE_STMT_P in chain_next.
1244 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1247 * call.c (convert_for_arg_passing): Convert bitfields to their
1250 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1253 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1255 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1258 * cp/decl2.c (constrain_class_visibility):
1259 Do not warn about the use of anonymous namespace in the main input file.
1261 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1263 * cp-tree.h (current_template_parms): Fix typo in comment.
1265 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1267 * cp-tree.h, error.c: Fix comment typos.
1269 2007-04-13 Jason Merrill <jason@redhat.com>
1272 * call.c (reference_binding): Add c_cast_p parm. If true,
1273 add quals to TO as needed to make it reference-compatible.
1275 2007-04-11 Jan Hubicka <jh@suse.cz>
1277 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1278 that we are not processing template_decl.
1280 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1283 * class.c (build_base_path): Ensure that the converted pointer has
1284 the same cv-qualification as the input.
1286 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1288 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1290 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1292 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1294 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1295 * tree.c (cp_add_pending_fn_decls): Remove.
1296 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1298 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1300 Revert change removing staticp.
1302 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1304 * cp-objcp-common.c (cxx_staticp): Remove.
1305 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1306 * cp-tree.h (cxx_staticp):
1308 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1310 * class.c (check_for_override): Don't remove dllmport attribute
1313 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1316 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1317 type issue error and return early.
1319 2007-03-30 Jason Merrill <jason@redhat.com>
1322 * typeck.c (cp_type_readonly): New fn.
1323 * cp-tree.h: Declare it.
1324 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1325 (cp_finish_decl): Not here.
1327 2007-03-31 Richard Guenther <rguenther@suse.de>
1329 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1332 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1337 * parser.c (declarator_can_be_parameter_pack): New.
1338 (cp_parser_template_parameter): Only parse the `...' if the
1339 declarator can be a parameter pack.
1340 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1342 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1343 types (they could be used as array bounds).
1344 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1345 (tsubst_pack_expansion): Handle failure to expand parameter
1348 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1351 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1352 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1353 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1354 (CLASS_TYPE_NON_UNION_P): Add.
1355 (struct lang_type_class): Add has_complex_dflt.
1356 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1357 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1358 * cp-tree.def: Add TRAIT_EXPR.
1359 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1360 * lex.c (struct resword): Add __has_nothrow_assign,
1361 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1362 __has_trivial_constructor, __has_trivial_copy,
1363 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1364 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1365 __is_pod, __is_polymorphic, __is_union.
1366 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1367 (cp_parser_trait_expr): New.
1368 * semantics.c (finish_trait_expr, trait_expr_value
1369 classtype_has_nothrow_copy_or_assign_p): New.
1370 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1372 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1373 * class.c (check_bases, check_field_decl, check_bases_and_members):
1374 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1375 * pt.c (uses_template_parms, tsubst_copy_and_build,
1376 value_dependent_expression_p, type_dependent_expression_p): Deal with
1378 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1380 2007-03-29 Richard Guenther <rguenther@suse.de>
1382 * tree.c (cp_walk_subtrees): Do not set input_location.
1384 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1387 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1390 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1392 * parser.c (struct cp_parser): Update comment for
1393 greater_than_is_operator_p.
1394 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1395 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1396 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1397 !GREATER_THAN_IS_OPERATOR_P.
1398 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1399 `>>' operators that will become two `>' tokens in C++0x.
1400 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1401 mode, allowing it to terminate default arguments.
1402 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1403 `>>' like two consecutive `>' tokens.
1404 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1405 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1406 ends a template argument.
1408 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1410 * decl.c (redeclaration_error_message): Complain when redeclaring
1411 a friend function with default template arguments (C++0x mode only).
1412 * cp-tree.h (check_default_tmpl_args): Declare.
1413 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1414 template arguments in function templates. Add support for checking
1415 the default template arguments of friend templates.
1416 (push_template_decl_real): Fix call to check_default_tmpl_args.
1417 (type_unification_real): If a template parameter has not been
1418 deduced but provides a default template argument, substitute into
1419 that default template argument.
1420 * parser.c (cp_parser_init_declarator): When declaring (but not
1421 defining!) a function template in C++0x mode, check for default
1424 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1427 * decl.c (grokdeclarator): Deal with cv-qualified function type
1428 typedefs in the same way for member and non-member functions.
1430 2007-03-26 Dirk Mueller <dmueller@suse.de>
1432 * parser.c (cp_parser_member_declaration): Pedwarn
1433 about stray semicolons after member declarations.
1435 2007-03-26 Paolo Carlini <pcarlini@suse.de>
1438 * pt.c (instantiate_decl): Set in_system_header.
1440 2007-03-22 Mark Mitchell <mark@codesourcery.com>
1442 * cp-tree.h (current_tempalte_parms): Improve documentation.
1443 * pt.c (current_template_args): Likewise.
1446 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1447 not consume tokens when failing.
1449 2007-03-22 Jim Wilson <wilson@specifix.com>
1450 Mark Mitchell <mark@codesourcery.com>
1453 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
1454 consistent with FROM.
1456 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1458 * error.c (dump_expr): Handle dependent names that designate types.
1459 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1461 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
1463 * cp-tree.def, parser.c, pt.c: Fix comment typos.
1465 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1467 * cvt.c (cp_convert_and_check) : Define.
1468 * cp-tree.h (cp_convert_and_check): Declare.
1469 * call.c (convert_conversion_warnings): Rename to
1470 conversion_null_warnings. The warning for floating-point to
1471 integer is handled by convert_and_check in convert_like_real.
1472 (convert_like_real): convert_conversion_warnings was renamed as
1473 conversion_null_warnings.
1474 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1475 overflow and changes of value during conversion.
1477 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1480 * parser.c (cp_parser_statement): If 'namespace' is found, this
1481 only can be a namespace alias definition, so parse it now.
1482 (cp_parser_namespace_alias_definition): if we find an open brace
1483 instead of '=', then this is actually a misplaced namespace
1486 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1489 * decl.c (cxx_init_decl_processing): Move command-line options
1490 processing to c-opts.c.
1492 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
1494 * ptree.c (cxx_print_type): Use formatting markup for integers
1495 when printing template parameter index/level/orig level.
1496 (cxx_print_xnode): Ditto.
1497 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1498 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1499 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1501 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1502 rather than a HOST_WIDE_INT.
1503 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1504 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1506 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1507 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1508 IN_BASE_INITIALIZER bool bitfields.
1509 (struct cp_declarator): Make KIND a 4-bit field. Make
1510 PARAMETER_PACK_P a bool bitfield just after KIND.
1511 * pt.c (uses_parameter_packs): Destroy the pointer set.
1512 (make_pack_expansion): Ditto.
1513 (check_for_bare_parameter_packs): Ditto.
1514 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1516 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
1519 * call.c (convert_default_arg): Instead of copying the node,
1522 2007-03-15 Dirk Mueller <dmueller@suse.de>
1525 * call.c (convert_conversion_warnings): New..
1526 (convert_like_real): .. factored out from here.
1527 (convert_conversion_warnings): Add warning about
1528 false being converted to NULL in argument passing.
1530 2007-03-14 Dirk Mueller <dmueller@suse.de>
1532 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1533 (finish_do_body): Warn about empty body in do/while statement.
1535 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1537 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1539 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1542 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1545 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
1547 * cp/repo.c (init_repo): Initialize random_seed saved options.
1548 (finish_repo): Adjust.
1550 2007-03-13 Mark Mitchell <mark@codesourcery.com>
1553 * Make-lang.in (doc/g++.1): Use $< to specify the location from
1556 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
1558 * decl.c (compute_array_index_type): New warning flag warn_vla.
1560 2007-03-12 Mark Mitchell <mark@codesourcery.com>
1563 * call.c (convert_default_arg): Copy non-constant arguments.
1565 2007-03-11 Mark Mitchell <mark@codesourcery.com>
1568 * parser.c (cp_parser_postfix_expression): Disallow compound
1569 literals in constant expressions.
1572 * semantics.c (finish_typeof): Use unlowered_expr_type.
1574 2007-03-10 Mark Mitchell <mark@codesourcery.com>
1577 * cp-tree.h (unlowered_expr_type): New function.
1578 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1579 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1580 (unlowered_expr_type): New function.
1581 (build_unary_op): Disallow predecrements of bool bitfields.
1582 * call.c (build_conditional_expr): Use unlowered_expr_type.
1583 * pt.c (type_unification_real): Likewise.
1585 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
1588 * typeck.c (check_return_expr): Check for bare parameter packs.
1589 (comptypes): Compare template parameter packs and
1590 type pack expansions.
1591 * decl.c (grokdeclarator): Deal with the declaration of function
1593 (grokparms): Verify that the (optional) function parameter pack is
1594 at the end of the parameter list.
1595 (xref_basetypes): Handle pack expansions in the base class.
1596 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1597 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1598 (NONTYPE_ARGUMENT_PACK): New.
1599 (TYPE_PACK_EXPANSION): New.
1600 (EXPR_PACK_EXPANSION): New.
1601 (ARGUMENT_PACK_SELECT): New.
1602 * cp-objcp-common.c (cp_tree_size): Compute size of
1603 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1604 ARGUMENT_PACK_SELECT.
1605 * error.c (dump_template_argument): Print template argument packs.
1606 (dump_template_argument_list): Ditto.
1607 (dump_template_parameter): Dump `...' for template type parameter
1609 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1610 (dump_parameters): Print function parameter packs.
1611 (dump_template_parms): Print template argument packs.
1612 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1613 (maybe_warn_variadic_templates): New.
1614 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1615 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1616 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1618 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1619 (write_template_arg): Write argument packs as separate arguments.
1620 * cp-tree.h (struct template_parm_index_s): Add flag that
1621 indicates that the template parameter is actually a parameter
1623 (struct tree_argument_pack_select): New.
1624 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1625 (union lang_tree_node): Add argument_pack_select.
1626 (FUNCTION_PARAMETER_PACK_P): New.
1627 (PACK_EXPANSION_P): New.
1628 (PACK_EXPANSION_PATTERN): New.
1629 (SET_PACK_EXPANSION_PATTERN): New.
1630 (PACK_EXPANSION_PARAMETER_PACKS): New.
1631 (ARGUMENT_PACK_P): New.
1632 (ARGUMENT_PACK_ARGS): New.
1633 (SET_ARGUMENT_PACK_ARGS): New.
1634 (ARGUMENT_PACK_INCOMPLETE_P): New.
1635 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1636 (TEMPLATE_PARM_PARAMETER_PACK): New.
1637 (TEMPLATE_TYPE_PARAMETER_PACK): New.
1638 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1639 (ARGUMENT_PACK_SELECT_INDEX): New.
1640 (ARGUMENT_PACK_SELECT_ARG): New.
1641 (struct cp_declarator): Add parameter_pack_p flag.
1642 (maybe_warn_variadic_templates): Declare.
1643 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1644 indicate a template parameter pack.
1645 (uses_parameter_packs): Declare.
1646 (template_parameter_pack_p): Declare.
1647 (template_parms_variadic_p): Declare.
1648 (make_pack_expansion): Declare.
1649 (check_for_bare_parameter_packs): Declare.
1650 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1651 sizeof... expressions.
1652 (pp_cxx_expression): Print pack expansions and non-type argument
1654 (pp_cxx_exception_specification): Print pack expansions.
1655 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1656 (pp_cxx_ctor_initializer): Print pack expansions.
1657 (pp_cxx_type_id): Print pack expansions.
1658 (pp_cxx_template_argument_list): Print argument packs.
1659 (pp_cxx_template_parameter): Print ellipsis for template parameter
1661 * pt.c (comp_template_parms): Compare template parameter packs.
1662 (template_parameter_pack_p): New.
1663 (template_parms_variadic_p): New.
1664 (template_args_variadic_p): New.
1665 (make_ith_pack_parameter_name): New.
1666 (struct find_parameter_pack_data): New.
1667 (find_parameter_packs_r): New.
1668 (uses_parameter_packs): New.
1669 (make_pack_expansion): New.
1670 (check_for_bare_parameter_packs): New.
1671 (expand_template_argument_pack): New.
1672 (reduce_template_parm_level): Propagate parameter pack flag.
1673 (process_template_parm): Add is_parameter_pack parameter to state
1674 when the parameter is actually a parameter pack. Create template
1675 parameter packs when is_parameter_pack is true.
1676 (current_template_args): The argument for a template parameter
1677 pack is an argument pack containing a single pack expansion.
1678 (process_partial_specialization): When checking that non-type
1679 argument expressions do not involve template parameters, loop over
1680 the arguments in argument packs separately.
1681 (push_template_decl_real): Check that the type of the declaration
1682 does not have any bare parameter packs. Check that primary
1683 templates have no more than one parameter pack, and that it comes
1684 at the end of the template parameter list.
1685 (convert_template_argument): Handle coercions for pack expansion
1686 expressions by coercing the pattern then rebuilding the expansion.
1687 (coerce_template_parms): When coercing the arguments for a
1688 variadic template, pack "extra" arguments into an argument pack.
1689 (coerce_template_template_parms): Cannot coerce between parameter
1690 packs and non-pack parameters.
1691 (template_args_equal): Compare PACK_EXPANSION_P expressions.
1692 (comp_template_args): Expand all template arguments packs before
1693 comparing template argument lists.
1694 (mangle_class_name_for_template): Make argument packs as separate
1696 (for_each_template_parm_r): No need to handle BASELINK.
1697 (instantiate_class_template): Handle pack expansions in the base
1699 (tsubst_pack_expansion): New.
1700 (tsubst_template_args): Handle substitutions of argument packs and
1701 pack expansion into template argument lists.
1702 (tsubst_decl): Expand function parameter packs into separate
1703 function parameters.
1704 (tsubst_arg_types): Expand a type pack expansion into separate
1706 (tsubst_exception_specification): Handle pack expansions in
1707 exception specifiers.
1708 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1709 replacing a template parameter with its argument. If we encounter
1710 a substitution for an argument pack, just return the parameter
1712 (tsubst_copy): sizeof(X...) returns the number of elements in
1713 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1714 PARM_DECL is a parameter pack.
1715 (tsubst_expr): Expression pack expansions and argument packs
1716 cannot show up here; they will all be handled through function
1717 calls, sizeof, and template argument lists.
1718 (tsubst_copy_and_build): sizeof(X...) returns the number of
1719 elements in parameter pack X. Handle pack expansions in TREE_LIST
1720 and CONSTRUCTOR nodes.
1721 (fn_type_unification): Handle "incomplete" explicit template
1722 argument lists that specify some of the arguments for a template
1724 (type_unification_real): Unify arguments against pack expansions.
1725 (template_parm_level_and_index): New, helper function.
1726 (unify_pack_expansion): New.
1727 (unify): Unify argument packs on an argument-by-argument basis,
1728 handling variadic argument packs as well.
1729 (more_specialized_fn): Handle unification of function parameter
1730 packs. All things being equal, prefer non-variadic function
1731 templates to variadic function templates.
1732 (more_specialized_class): Prefer the variadic class template
1733 partial specialization that binds fewer arguments to a parameter
1735 (regenerate_decl_from_template): Expand function parameter packs
1736 into separate parameters.
1737 (instantiate_decl): Ditto.
1738 (tsubst_initializer_list): Handle pack expansions for base-class
1740 (dependent_type_p_r): Determine dependent types in argument packs
1741 and pack expansions.
1742 (value_dependent_expression_p): Determine value-dependence of
1743 non-type argument packs.
1744 (dependent_template_arg_p): Handle argument packs.
1745 * semantics.c (finish_cond): Check for bare parameter packs.
1746 (finish_expr_stmt): Ditto.
1747 (finish_for_expr): Ditto.
1748 (finish_switch_cond): Ditto.
1749 (finish_mem_initializers): Ditto.
1750 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1752 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1753 * parser.c (make_declarator): Declarator is not an expansion.
1754 (make_pointer_declarator): Transfer parameter pack flag to outer
1756 (make_reference_declarator): Ditto.
1757 (make_ptrmem_declarator): Ditto.
1758 (make_call_declarator): Ditto.
1759 (make_array_declarator): Ditto.
1760 (cp_parser_postfix_expression): Allow pack expansion expressions
1761 in the argument list for a call expression.
1762 (cp_parser_parenthesized_expression_list): Add new parameter
1763 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1764 into separate arguments."
1765 (cp_parser_new_placement): Allow pack expansion expressions.
1766 (cp_parser_new_initializer): Ditto.
1767 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1768 base-class initializer expansion.
1769 (cp_parser_mem_initializer): Ditto.
1770 (cp_parser_template_parameter_list): Keep track of whether the
1771 template parameter is a template parameter pack.
1772 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1773 template parameter pack.
1774 (cp_parser_type_parameter): Ditto.
1775 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1777 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1778 this declarator is a parameter pack.
1779 (cp_parser_parameter_declaration): The ellipsis does not end the
1780 parameter declaration, because it might be a parameter pack. Parse
1781 the ellipsis to indicate a parameter pack.
1782 (cp_parser_initializer): Allow pack expansions.
1783 (cp_parser_initializer_list): Allow ellipsis to create an
1784 initializer expansion.
1785 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1787 (cp_parser_type_id_list): Allow ellipsis to create an exception
1788 specifier expansion.
1789 (cp_parser_attribute_list): Don't allow pack expansions.
1790 (cp_parser_functional_cast): Allow pack expansions.
1791 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1792 compute the length of a parameter pack.
1793 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1794 end a template argument.
1795 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1796 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1799 2007-03-09 Dirk Mueller <dmueller@suse.de>
1801 * cp/call.c (build_new_op): Call warn_logical_operator.
1803 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1806 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1809 * pt.c (any_template_arguments_need_structural_equality_p):
1812 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1814 * decl.c (grokdeclarator): Disable warnings for anonymous
1817 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1819 * typeck2.c (readonly_error): Always emit a hard error.
1820 Remove last argument.
1821 * cp-tree.h (readonly_error): Adjust prototype.
1822 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1823 * typeck.c (build_unary_op): Likewise.
1824 (build_modify_expr): Likewise.
1826 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1829 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1831 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1834 * parser.c (struct cp_parser): New IN_IF_STMT.
1835 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1836 returning if parsing the body of an 'if' statement or issuing an
1837 error and continuing.
1838 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1840 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1842 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1845 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1848 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1850 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1851 Objective-C++. Don't exit early if -shared-libgcc needs to be
1854 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1856 * typeck.c (common_base_type): Delete unused function.
1858 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1860 * Make-lang.in: Add dummy lang.install-pdf target.
1862 2007-03-01 Simon Baldwin <simonb@google.com>
1865 * decl.c (check_tag_decl): Added new warning for typedef ignored
1866 when it precedes an otherwise valid non-typedef declaration.
1868 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1870 * typeck.c (build_function_call): Store converted arguments
1871 in a stack-allocated array instead of building a list.
1872 (convert_arguments): Store arguments in the array passed in as an
1873 argument, and return the actual number of arguments.
1874 * call.c (build_call): Delete, and replace with...
1875 (build_call_n, build_call_a): New.
1876 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1877 (build_over_call): Store converted arguments in a stack-allocated
1878 array instead of building a list.
1879 (build_cxx_call): Pass arguments in an array instead of as a list.
1880 (build_java_interface_fn_ref): Rewrite to avoid constructing
1882 * tree.h: Update declarations to reflect above changes.
1883 * method.c (use_thunk): Use a stack-allocated array to hold
1884 the arguments instead of a list.
1885 * rtti.c (throw_bad_cast): Update call to cxx_call.
1886 (throw_bad_typeid): Likewise.
1887 (build_dynamic_cast_1): Likewise.
1888 * init.c (build_builtin_delete_call): Use build_call_n.
1889 * decl.c (expand_static_init): Likewise.
1890 * except.c (cp_protect_cleanup_actions): Likewise.
1891 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1892 (gimplify_must_not_throw_expr): Likewise.
1893 (cxx_omp_apply_fn): Use build_call_a.
1895 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1897 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1898 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1900 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1902 * cp-tree.h (static_ctors): Remove.
1903 * cp-tree.h (static_dtors): Likewise.
1904 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1905 refactoring of tree_map hierarchy.
1906 (decl_shadowed_for_var_insert): Likewise.
1907 * semantics.c (expand_body): Use c_expand_body.
1908 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1909 * decl2.c (static_ctors): Remove.
1910 (static_dtors): Likewise.
1911 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1912 objc_generate_static_init_call. Do not call static_[cd]tors.
1913 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1915 (cp_write_global_declarations): Likewise.
1917 2007-02-23 Richard Guenther <rguenther@suse.de>
1919 * class.c (note_name_declared_in_class): Make declaration
1920 changes meaning a pedwarn.
1922 2007-02-22 Michael Matz <matz@suse.de>
1925 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1926 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1927 dump_function_decl): Guard emitting outer scopes by new flag.
1928 * cp-lang.c (cxx_dwarf_name): New function.
1929 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1930 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1932 (push_template_decl_real, lookup_template_class): Remove calls
1935 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1937 * call.c (build_new_method_call): Ensure that explicit calls of
1938 destructors have type "void".
1940 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1942 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1943 and -Walways-true with -Waddress.
1944 * cvt.c (convert_to_void): Replace unconditional warning with
1947 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1949 * decl.c, tree.c: Fix comment typos.
1951 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1954 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1955 statement expression if we had an error mark node.
1957 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1958 Brooks Moses <brooks.moses@codesourcery.com>
1959 Lee Millward <lee.millward@codesourcery.com>
1961 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1962 Change class to tcc_vl_exp.
1964 * call.c (build_call): Use build_call_list instead
1966 (build_over_call): Likewise.
1967 (build_new_method_call): Use build_min_non_dep_call_list
1968 instead of build_min_non_dep.
1970 * error.c (dump_call_expr_args): New function.
1971 (dump_aggr_init_expr_args): New function.
1972 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1973 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1975 * cvt.c (convert_to_void): Use build_call_array instead
1976 of build3; use new AGGR_INIT_EXPR accessor macros.
1978 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1979 instead of TREE_CODE_LENGTH.
1981 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1982 AGGR_INIT_EXPR accessor macros.
1984 * cp-gimplify.c (cp_gimplify_init_expr): Use
1985 AGGR_INIT_EXPR_SLOT to set the slot operand.
1987 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1988 (AGGR_INIT_EXPR_SLOT): New macro.
1989 (AGGR_INIT_EXPR_ARG): New macro.
1990 (aggr_init_expr_nargs): New macro.
1991 (AGGR_INIT_EXPR_ARGP): New macro.
1992 (aggr_init_expr_arg_iterator): New.
1993 (init_aggr_init_expr_arg_iterator): New.
1994 (next_aggr_init_expr_arg): New.
1995 (first_aggr_init_expr_arg): New.
1996 (more_aggr_init_expr_args_p): New.
1997 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1998 (stabilize_aggr_init): New declaration.
1999 (build_min_non_dep_call_list): Likewise.
2001 * tree.c (process_aggr_init_operands): New function.
2002 (build_aggr_init_array) New function.
2003 (build_cplus_new): Update to use new CALL_EXPR and
2004 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
2005 build_aggr_init_array.
2006 (build_min_non_dep_call_list) New function.
2007 (build_min_nt): Assert input code parameter is not a variable
2008 length expression class.
2009 (build_min, build_min_non_dep): Likewise.
2010 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
2011 to check for equality instead of recursing. Handle tcc_vl_exp
2013 (stabilize_call): Update to only handle CALL_EXPRs, not
2014 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
2015 (stabilize_aggr_init): New function.
2016 (stabilize_init): Use it.
2018 * cxx-pretty-print.c (pp_cxx_postfix_expression)
2019 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
2020 AGGR_INIT_EXPR accessor macros and argument iterators.
2022 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
2023 build_vl_exp. Iterate through the operands, recursively
2024 processing each one.
2025 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
2026 CALL_EXPR accessor macros.
2027 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
2028 tree code classes. Use TREE_OPERAND_LENGTH instead of
2031 * semantics.c (finish_call_expr): Use build_nt_call_list
2032 instead of build_nt.
2033 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
2034 accessor macros. Use build_call_array to construct the
2035 CALL_EXPR node instead of build3
2037 * decl2.c (build_offset_ref_call_from_tree): Use
2038 build_nt_call_list and build_min_non_dep_call_list instead
2039 of build_min_nt and build_min_non_dep.
2041 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
2042 Use build_nt_call_list instead of build_min_nt.
2044 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2047 * call.c (build_conditional_expr): Improve error message.
2049 2007-02-13 Dirk Mueller <dmueller@suse.de>
2051 * friend.c (do_friend): Annotate warning about friend
2052 declarations in templates with OPT_Wnon_template_friend.
2053 Convert informal message from warning() to inform().
2055 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
2056 Mark Mitchell <mark@codesourcery.com>
2059 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2060 instantiations for variables.
2062 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2065 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2066 Check warn_unused_value just once.
2068 2007-02-11 Mark Mitchell <mark@codesourcery.com>
2071 * pt.c (determine_specialization): Use skip_artificial_parms_for.
2072 (fn_type_unificiation): Likewise.
2073 (get_bindings): Likewise.
2075 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
2078 * decl.c (finish_function): Use DECL_REPLACEABLE.
2079 * tree.c (cp_cannot_inline_tree_fn): Likewise.
2081 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
2083 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2085 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
2087 * decl.c (grokvardecl): Don't error if !have_tls.
2088 (grokdeclarator): Likewise.
2089 * parser.c (cp_parser_omp_threadprivate): Likewise.
2091 2007-02-07 Jakub Jelinek <jakub@redhat.com>
2094 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2095 parameters and result decls in omp clauses.
2096 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2099 2007-02-05 Dirk Mueller <dmueller@suse.de>
2102 * parser.c (cp_parser_class_specifier): Always initialize bases.
2104 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
2106 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2107 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2108 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2110 * semantics.c (finish_omp_atomic): Store a whole expression node
2111 in operand 1, and integer_zero_node in operand 0, for dependent
2112 OMP_ATOMIC. Rewrite to make flow easier to understand.
2114 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2116 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2118 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
2120 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2121 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2123 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2125 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2126 keyword warning to -Wc++0x-compat.
2128 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2130 * decl.c (grokdeclarator): Update documentation.
2132 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2135 * decl.c (grokdeclarator): If __thread is used together with
2136 a storage class other than extern and static, clear thread_p
2137 after issuing diagnostics and fall through to checking the
2140 2007-01-30 Roger Sayle <roger@eyesopen.com>
2142 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2143 calculating the size of an array (to avoid recursive errors).
2145 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2148 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2150 * call.c (convert_like_real): Don't warn when converting to
2153 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2155 * decl.c (pop_label): Replace warning with call to
2156 warn_for_unused_label.
2158 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2161 * semantics.c (finish_pseudo_destructor_expr): Check the
2162 destrutor name by calling check_dtor_name.
2164 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2166 * lex.c (D_CPP0X): Rename.
2168 (reswords): D_CPP0X -> D_CXX0X.
2169 (init_reswords): Ditto.
2170 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2171 of C++0x keywords as identifiers.
2173 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2176 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2179 2007-01-23 Ian Lance Taylor <iant@google.com>
2181 * typeck.c (convert_for_assignment): Only warn about a = b = c
2182 when converting to bool.
2184 2007-01-23 Roger Sayle <roger@eyesopen.com>
2186 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2188 * typeck.c (ignore_overflows): Remove the remaining uses of
2189 TREE_CONSTANT_OVERFLOW.
2191 2007-01-20 Jan Hubicka <jh@suse.cz>
2193 * decl2.c (start_objects, start_static_storage_duration_function):
2194 Do not make the functions uninlinable.
2196 2007-01-17 Ian Lance Taylor <iant@google.com>
2198 * class.c (add_method): Call VEC_reserve_exact rather than passing
2199 a negative size to VEC_reserve.
2201 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2204 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2206 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2209 * decl.c (make_typename_type): If the qualified name is not a
2210 type, issue an error.
2211 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2214 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2216 * rtti.c: Include target.h.
2217 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2218 don't emit typeinfo for fundamental types as weak.
2219 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2221 2007-01-08 Richard Guenther <rguenther@suse.de>
2223 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2225 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2227 * call.c (standard_conversion): Pass flag to
2228 vector_types_convertible_p to disallow emission of note.
2229 * typeck.c (convert_for_assignment): Pass flag to
2230 vector_types_convertible_p to allow emission of note.
2231 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2232 to disallow emission of note.
2234 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2237 * typeck.c (build_binary_op): Call overflow_warning if
2238 TREE_OVERFLOW_P is true for the result and not for any of the
2241 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2244 * class.c (add_method): Don't wait until template
2245 instantiation time to complain about duplicate methods.
2247 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2250 * semantics.c (finish_unary_op_expr): Warn only if result
2251 overflowed and operands did not.
2253 2007-01-05 Ian Lance Taylor <iant@google.com>
2255 * typeck.c (build_binary_op): Warn about comparing a non-weak
2258 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2260 * pt.c (tsubst): Propagate the need for structural equality checks
2261 when reducing the level of template parameters.
2263 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2265 * pt.c: Fix a comment typo.
2267 2007-01-02 Ian Lance Taylor <iant@google.com>
2269 * semantics.c (maybe_convert_cond): Optionally warn when using an
2270 assignment as a condition.
2271 * typeck.c (convert_for_assignment): Optionally warn about
2272 assigning the result of an assignment to a bool.
2274 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2276 * pt.c (canonical_template_parms): Correct typo in comment.
2278 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2280 * typeck.c (structural_comptypes): Renamed from "comptypes".
2281 (comptypes): Use canonical type information to perform fast type
2282 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2283 canonical type comparison returns the same results as we would see
2284 from the current, structural check. Support COMPARE_STRUCTURAL
2285 when we need structural checks.
2286 * decl.c (typename_compare): Fix comment.
2287 (build_typename_type): TYPENAME_TYPE nodes require structural
2288 equality checks, because they resolve different based on the
2290 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2291 require structural equality checks (for now).
2292 (build_ptrmemfunc_type): Build the canonical pointer to member
2294 (compute_array_index_type): Whenever we build a new index type
2295 to represent the size of an array in a template, we need to mark
2296 this index type as requiring structural equality. This goes for
2297 arrays with value-dependent sizes with the current ABI, or all
2299 * tree.c (cplus_array_hash): New.
2300 (struct cplus_array_info): New.
2301 (cplus_array_compare): New.
2302 (cplus_array_htab): New.
2303 (build_cplus_array_type_1): Use a hash table to cache the array
2304 types we build. Build the canonical array type for each array
2306 (cp_build_qualified_type_real): When building a cv-qualified array
2307 type, use the hash table of array types and build canonical array
2309 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2310 use structural equality (for now).
2311 * cp-tree.h (COMPARE_STRUCTURAL): New.
2312 * pt.c (canonical_template_parms): New.
2313 (canonical_type_parameter): New.
2314 (process_template_parm): Find the canonical type parameter.
2315 (lookup_template_class): When we have named the primary template
2316 type, set the canonical type for our template class to the primary
2317 template type. If any of the template arguments need structural
2318 equality checks, the template class needs structural equality
2320 (tsubst): When reducing the level of a template template
2321 parameter, we require structural equality tests for the resulting
2322 parameter because its template parameters have not had their types
2323 canonicalized. When reducing a template type parameter, find the
2324 canonical reduced type parameter.
2325 (any_template_arguments_need_structural_equality_p): New.