1 2007-09-08 Jason Merrill <jason@redhat.com>
4 * pt.c (most_specialized_class): Set processing_template_decl
5 while tsubsting partial spec args.
7 2007-09-06 Jason Merrill <jason@redhat.com>
9 * decl2.c (get_guard): Copy visibility from the guarded variable.
11 2007-09-06 Jan Hubicka <jh@suse.cz>
13 * semantics.c (expand_body): Do not mark arguments of clones used.
15 2007-09-06 Paolo Carlini <pcarlini@suse.de>
18 * decl.c (cp_finish_decl): When processing_template_decl,
19 deal correctly with init as TREE_LIST.
21 2007-09-06 Tom Tromey <tromey@redhat.com>
23 * decl.c (finish_function): Put return's location on line zero of
26 2007-09-05 Jason Merrill <jason@redhat.com>
29 * except.c (prepare_eh_type): Use type_decays_to.
32 * init.c (build_delete): Use build_headof to get the address of the
33 complete object if we aren't using the deleting destructor.
34 * rtti.c (build_headof): No longer static.
35 * cp-tree.h: Declare it.
37 2007-09-06 Jakub Jelinek <jakub@redhat.com>
39 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
40 decl if a prototype for XX is provided with throw().
43 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
44 on __*_chk non-__builtin_* decls.
46 2007-09-05 Paolo Carlini <pcarlini@suse.de>
49 * semantics.c (finish_id_expression): Use context_for_name_lookup
50 insted of DECL_CONTEXT, to see through anonymous structs and unions.
51 * class.c (finish_struct_anon): Deal correctly with anonymous
52 structs (vs unions, as GNU extension) in error messages.
54 2007-09-05 Jan Hubicka <jh@suse.cz>
56 * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
57 call, DECL_EXTERNAL checks and current_function_decl saving.
59 2007-09-05 Paolo Carlini <pcarlini@suse.de>
62 * parser.c (cp_parser_primary_expression): Return error_mark_node
63 when a statement-expression is found in a template-argument list.
65 2007-09-04 Jason Merrill <jason@redhat.com>
67 * except.c (initialize_handler_parm): Use
68 fold_build_cleanup_point_expr.
71 * call.c (reference_binding): Don't look for user-defined conversions
75 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
76 the MUST_NOT_THROW_EXPR.
78 2007-09-04 Richard Sandiford <richard@codesourcery.com>
80 * decl.c (cp_finish_decl): Call determine_visibility before
81 make_rtl_for_nonlocal_decl.
83 2007-09-04 Jason Merrill <jason@redhat.com>
86 * pt.c (most_specialized_class): Substitute outer template
87 arguments into the arguments of a member template partial
89 (strip_innermost_template_args): New fn.
91 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
93 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
95 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
97 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
98 * decl.c (cp_make_fname_decl): Likewise,
99 * parser.c (cp_parser_string_literal): Likewise,
100 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
101 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
104 2007-09-02 Paolo Carlini <pcarlini@suse.de>
107 * typeck.c (build_unary_op): Fix error message for
108 Boolean expression as operand to operator--.
110 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
112 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
113 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
116 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
119 * init.c (build_default_init): Make extern.
120 * cp-tree.h (build_default_init): Declare here.
121 * pt.c (tsubst_expr): When the instantiation of the initializer of
122 a variable results in an empty list, default-initialize the
124 (tsubst_copy_and_build): When the instantiation of the initializer
125 in a new expression results in an empty initializer list,
126 default-initialize it.
128 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
130 * mangle.c (write_type): Change mangling of rvalue reference from
133 2007-08-31 Jakub Jelinek <jakub@redhat.com>
135 * decl.c (duplicate_decls): Remove duplicated line.
137 2007-08-31 Paolo Carlini <pcarlini@suse.de>
140 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
141 BOUND_TEMPLATE_TEMPLATE_PARM.
143 2007-08-31 Paolo Carlini <pcarlini@suse.de>
146 * search.c (lookup_member): Check the name argument for
149 2007-08-31 Paolo Carlini <pcarlini@suse.de>
152 * parser.c (cp_parser_trait_expr): Check rerurn value of
155 2007-08-30 Ollie Wild <aaw@google.com>
157 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
158 convert_ptrmem for pointer to member conversions.
159 (convert_to_pointer_force): Update cp_convert_to_pointer call.
160 (ocp_convert): Update cp_convert_to_pointer call.
161 * typeck.c (convert_ptrmem): Add conditional for null pointers to
163 (build_static_cast_1): Check can_convert for conversions in either
165 (get_delta_difference_1): New function.
166 (get_delta_difference): Refactor to call get_delta_difference_1.
168 2007-08-30 Jakub Jelinek <jakub@redhat.com>
170 * decl.c (start_preparsed_function): Set
171 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
173 2007-08-28 Paolo Carlini <pcarlini@suse.de>
176 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
177 BOUND_TEMPLATE_TEMPLATE_PARM.
179 2007-08-28 Jakub Jelinek <jakub@redhat.com>
183 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
184 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
186 2007-08-27 Jason Merrill <jason@redhat.com>
189 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
190 Look inside STMT_EXPR.
191 * semantics.c (stmt_expr_value_expr): New fn.
192 * cp-tree.h: Declare it.
195 * decl.c (groktypename): Ignore attributes applied to class type.
197 2007-08-28 Richard Guenther <rguenther@suse.de>
199 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
201 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
203 * error.c (dump_expr): Handle COMPLEX_CST.
204 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
205 (pp_cxx_expression): Likewise.
207 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
209 * decl.c (GNU_INLINE_P): New.
210 (duplicate_decls): Handle gnu_inline. Merge attributes and
211 some flags in overriding definitions.
212 (redeclaration_error_message): Handle gnu_inline.
213 (start_preparsed_function): Likewise.
215 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
217 * call.c (sufficient_parms_p): Constify.
218 * class.c (same_signature_p): Likewise.
219 * cp-gimplify.c (is_invisiref_parm,
220 cxx_omp_privatize_by_reference): Likewise.
221 * cp-objcp-common.c (has_c_linkage): Likewise.
222 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
223 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
224 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
225 num_artificial_parms_for, comp_template_parms,
226 template_parameter_pack_p, any_dependent_template_arguments_p,
227 any_type_dependent_arguments_p, any_value_dependent_elements_p,
228 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
229 zero_init_p, member_p, cp_lvalue_kind,
230 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
231 varargs_function_p, is_dummy_object, special_function_kind,
232 string_conv_p, type_unknown_p, comp_except_specs, compparms,
233 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
234 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
235 cp_has_mutable_p, at_least_as_qualified_p,
236 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
237 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
238 * except.c (nothrow_libfn_p): Likewise.
239 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
241 * pt.c (comp_template_parms, template_parameter_pack_p,
242 any_type_dependent_arguments_p, any_value_dependent_elements_p,
243 any_dependent_template_arguments_p): Likewise.
244 * repo.c (repo_export_class_p): Likewise.
245 * semantics.c (anon_aggr_type_p): Likewise.
246 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
247 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
248 varargs_function_p, member_p, is_dummy_object, pod_type_p,
249 zero_init_p, special_function_p): Likewise.
250 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
251 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
252 compparms, invalid_nonstatic_memfn_p,
253 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
254 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
255 cp_has_mutable_p, lvalue_or_else): Likewise.
257 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
259 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
260 * cp-objcp-common.c (cp_tree_size): Ditto.
261 * tree.c (cp_walk_subtrees): Ditto
262 * cp-tree.def (TINST_LEVEL): Go away.
263 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
264 move together with other non-tree structs.
265 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
266 (union lang_tree_node): Eliminate tinst_level field.
267 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
268 (current_instantiation, outermost_tinst_level): Return
269 a "struct tinst_level *".
271 * error.c (print_instantiation_partial_context): Change second
272 parameter to a "struct tinst_level *". Replace accessor macros
274 (print_instantiation_full_context): Likewise.
275 * lex.c (in_main_input_context): Likewise.
277 * pt.c (struct pending_templates): New.
278 (pending_templates, last_pending_template): Use it as a type.
279 (current_tinst_level): Change typo to "struct tinst_level *"
280 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
281 (add_pending_template): Construct a "struct pending_template".
282 Replace TINST_LEVEL accessor macros with field access.
283 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
284 (pop_tinst_level): Likewise.
285 (instantiate_pending_templates): Likewise. Factor common code used
286 when an instantiation has been done.
287 (outermost_tinst_level): Replace tree_last with loop.
288 (current_instantiation): Return a "struct tinst_level *".
290 2007-08-24 Ollie Wild <aaw@google.com>
292 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
293 * name-lookup.h (cp_binding_level): Remove vtables member.
295 2007-08-24 Richard Guenther <rguenther@suse.de>
297 * tree.c (cp_cannot_inline_tree_fn): Remove.
298 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
299 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
302 2007-08-24 Jakub Jelinek <jakub@redhat.com>
305 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
306 error_mark_node right away if build_expr_type_conversion
310 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
311 is error_mark_node rather than NULL_TREE.
312 * pt.c (check_explicit_specialization): Likewise.
315 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
316 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
318 2007-08-22 Jason Merrill <jason@redhat.com>
321 * pt.c (outermost_tinst_level): New function.
322 * lex.c (in_main_input_context): New function.
323 * cp-tree.h: Declare it.
324 * decl2.c (constrain_class_visibility): Use it to avoid warning
325 about uses of the anonymous namespace in the main input file.
327 2007-08-21 Jakub Jelinek <jakub@redhat.com>
329 * init.c (build_new_1): Use get_target_expr instead of save_expr.
331 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
334 * class.c (finish_struct_1): Warn when a class has virtual
335 functions and accessible non-virtual destructor.
337 2007-08-20 Richard Guenther <rguenther@suse.de>
341 * call.c (build_new_method_call): Convert initializer to
343 * init.c (build_aggr_init): Do not fiddle with types.
344 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
345 * except.c (build_throw): Do not drop qualifiers for the
347 * typeck.c (get_member_function_from_ptrfunc): Do not
348 fiddle with types, instead convert.
349 (build_ptrmemfunc1): Convert to the target type for
351 (gfc_trans_allocate): Convert result to target type.
352 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
353 pointer-to-member structures shall have alias set zero as well.
355 2007-08-20 Richard Guenther <rguenther@suse.de>
357 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
359 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
360 (nonstatic_local_decl_p): Likewise.
361 * tree.c (cp_auto_var_in_fn_p): Remove.
362 * decl.c (nonstatic_local_decl_p): Remove.
364 2007-08-20 Richard Guenther <rguenther@suse.de>
366 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
368 * tree.h (cp_walk_tree): New define to walk_tree_1 with
369 cp_walk_subtrees lh parameter.
370 (cp_walk_tree_without_duplicates): New define to
371 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
372 * tree.c (count_trees): Call
373 cp_walk_tree_without_duplicates.
374 (verify_stmt_tree): Call cp_walk_tree.
375 (break_out_target_exprs): Likewise.
376 (WALK_SUBTREE): Likewise.
377 * cp-gimplify.c (cp_genericize): Likewise.
378 * cp-pt.c (find_parameter_packs_r): Likewise.
379 (uses_parameter_packs): Likewise.
380 (make_pack_expansion): Likewise.
381 (check_for_bare_parameter_packs): Likewise.
382 (for_each_template_parm): Likewise.
383 * decl.c (check_default_argument): Call
384 cp_walk_tree_without_duplicates.
385 * except.c (build_throw): Likewise.
386 * decl2.c (type_visibility): Likewise.
387 * semantics.c (expand_or_defer_fn): Likewise.
388 (finalize_nrv): Call cp_walk_tree.
390 2007-08-20 Jakub Jelinek <jakub@redhat.com>
393 * init.c (build_new_1): Rename placement_var variable to placement_expr.
394 Initialize it with save_expr rather than get_temp_regvar.
396 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
399 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
402 2007-08-17 Ollie Wild <aaw@google.com>
405 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
406 declarations into appropriate slots for comparison. Fix type
409 2007-08-17 Paolo Carlini <pcarlini@suse.de>
412 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
413 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
415 2007-08-17 Paolo Carlini <pcarlini@suse.de>
418 * parser.c (cp_parser_class_head): Improve error message.
420 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
422 * pt.c (instantiate_decl): Set input_location
423 for the function end.
425 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
427 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
429 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
430 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
431 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
432 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
433 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
434 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
435 * typeck.c (cp_type_quals): Likewise.
436 * typeck2.c (cxx_incomplete_type_diagnostic,
437 cxx_incomplete_type_error): Likewise.
439 2007-08-16 Paolo Carlini <pcarlini@suse.de>
442 * pt.c (tsubst_friend_function): When check_classfn
443 returns error_mark_node likewise return it.
445 2007-08-15 Jakub Jelinek <jakub@redhat.com>
448 * typeck.c (check_return_expr): Don't NRV optimize vars in
450 * decl.c (finish_function): Comment fix.
452 2007-08-15 Paolo Carlini <pcarlini@suse.de>
455 * pt.c (push_template_decl_real): Depending on TYPE_P
456 use either TYPE_CONTEXT or DECL_CONTEXT.
458 2007-08-14 Mark Mitchell <mark@codesourcery.com>
460 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
461 constructors and destructors return this.
463 2007-08-14 Paolo Carlini <pcarlini@suse.de>
466 * decl2.c (check_classfn): Return error_mark_node in case of error;
467 in that case, do not call add_method.
468 * decl.c (start_decl): Deal with check_classfn returning
470 (grokfndecl): Likewise.
471 * pt.c (tsubst_friend_function): Likewise.
473 2007-08-14 Andrew Pinski <pinskia@gmail.com>
476 * typeck.c (build_binary_op): Disallow vector float types with
477 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
479 2007-08-11 Ian Lance Taylor <iant@google.com>
481 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
483 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
485 2007-08-10 Ollie Wild <aaw@google.com>
487 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
489 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
491 (unqualified_namespace_lookup): Fix ambiguous_decl call.
492 (lookup_using_namespace): Fix ambiguous_decl call.
493 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
495 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
497 * call.c (name_as_c_string): Use CONST_CAST.
498 * decl.c (build_decl): Likewise.
499 * parser.c (cp_parser_string_literal): Likewise.
501 2007-08-10 Paolo Carlini <pcarlini@suse.de>
504 * error.c (dump_expr): Consistently use the *_cxx_*
505 variants of the pretty-print functions.
507 2007-08-10 Paolo Carlini <pcarlini@suse.de>
510 * decl.c (check_special_function_return_type): Just error
511 on return type specified for conversion operator.
513 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
515 * typeck2.c (readonly_error): Handle general expressions.
516 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
518 2007-08-06 Dan Hipschman <dsh@google.com>
520 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
521 access function name.
523 2007-08-04 Alfred Minarik <a.minarik@aon.at>
526 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
527 * g++spec.c (lang_specific_driver): Check them.
529 2007-08-06 Paolo Carlini <pcarlini@suse.de>
532 * pt.c (inline_needs_template_parms): Fix comment; change return type
535 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
538 2007-03-26 Dirk Mueller <dmueller@suse.de>
540 * parser.c (cp_parser_member_declaration): Pedwarn
541 about stray semicolons after member declarations.
543 2007-08-02 Lee Millward <lee.millward@gmail.com>
548 * parser.c (cp_parser_asm_definition): Detect and discard asm
549 statements with invalid inputs or outputs.
550 (cp_parser_asm_operand_list): Return error mark node if any
551 of the operands are invalid. Adjust documentation.
553 2007-08-02 Nick Clifton <nickc@redhat.com>
555 * typeck.c: Change copyright header to refer to version 3 of the
556 GNU General Public License and to point readers at the COPYING3
557 file and the FSF's license web page.
558 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
559 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
560 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
561 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
562 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
563 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
564 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
565 name-lookup.h, parser.c: Likewise.
567 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
570 * call.c (magic_varargs_p): Honor the "type generic" attribute.
572 2007-07-30 Paolo Carlini <pcarlini@suse.de>
575 * semantics.c (finish_label_stmt): Reject the __label__
576 extension outside function scopes.
578 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
580 * parser.c (eof_token): Un-constify.
581 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
582 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
585 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
587 * pt.c, tree.c, typeck2.c: Fix comment typos.
589 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
590 Mark Mitchell <mark@codesourcery.com>
593 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
594 hidden due to friend declarations in local classes.
596 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
598 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
599 * cp-tree.def (DECLTYPE_TYPE): New.
600 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
601 (dump_type_prefix): Ditto.
602 (dump_type_suffix): Ditto.
603 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
604 * mangle.c (write_type): Handle DECLTYPE_TYPE.
605 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
607 (DECLTYPE_TYPE_EXPR): New.
608 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
609 (finish_declared_type): Declare.
610 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
612 (pp_cxx_type_id): Ditto.
613 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
614 (tsubst): Substitute into a DECLTYPE_TYPE node.
615 (tsubst_copy): Ditto.
616 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
618 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
619 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
620 structural equality (because we can't hash the expressions).
621 (finish_declared_type): New.
622 * lex.c (reswords): Add "decltype" keyword.
623 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
624 (cp_parser_postfix_expression): Add member_access_only_p to
625 restrict postfix expression to member access expressions.
626 (cp_parser_unary_expression): Update call to
627 cp_parser_postfix_expression to reflect new parameter.
628 (cp_parser_declared_type): New.
629 (cp_parser_simple_type_specifier): Parse decltype types.
631 2007-07-27 Mark Mitchell <mark@codesourcery.com>
634 * call.c (convert_for_arg_passing): Only widen bitfields to their
635 declared types if necessary.
637 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
639 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
642 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
644 * decl.c (typename_hash, typename_compare): Constify.
645 * mangle.c (hash_type, compare_type): Likewise.
646 * pt.c (eq_local_specializations, hash_local_specialization):
648 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
649 list_hash): Likewise.
650 * typeck2.c (pat_compare): Likewise.
652 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
654 * method.c (implicitly_declare_fn): Increase alignment if member
655 function pointer format requires it.
657 2007-07-24 Paolo Carlini <pcarlini@suse.de>
660 * typeck.c (check_return_expr): Do not pass a null argument
663 2007-07-24 Paolo Carlini <pcarlini@suse.de>
666 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
669 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
672 * typeck.c (convert_arguments): Only use default args if we have
676 * typeck.c (structural_comptypes): No need to check
677 resolve_typename_type return value here.
678 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
679 * pt.c (resolve_typename_type): Follow typename typedefs. Return
680 original type rather than error_mark_node in case of failure.
681 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
682 resolve_typename_type result check.
683 (cp_parser_direct_declarator, cp_parser_head,
684 cp_parser_constructor_declarator_p): Likewise.
686 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
688 * pt.c (template_parms_variadic_p): Remove.
689 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
691 2007-07-12 Jakub Jelinek <jakub@redhat.com>
694 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
695 argument to dump_aggr_init_expr_args instead of false.
697 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
699 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
700 canonical types; otherwise, fall back to structural type
701 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
702 internal compiler error if the canonical types are wrong.
704 2007-07-11 Paolo Carlini <pcarlini@suse.de>
707 * parser.c (cp_parser_make_indirect_declarator): When the
708 the code argument is ERROR_MARK return cp_error_declarator.
710 2007-07-09 Geoffrey Keating <geoffk@apple.com>
713 * decl.c (cxx_init_decl_processing): Don't set
714 force_align_functions_log.
715 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
716 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
717 FUNCTION_DECL, return its alignment.
719 2007-07-09 Richard Guenther <rguenther@suse.de>
721 * decl.c (start_preparsed_function): Do not promote return type.
723 2007-07-08 Paolo Carlini <pcarlini@suse.de>
726 * pt.c (unify): Never pass error_mark_node to template_decl_level.
728 2007-07-07 Mark Mitchell <mark@codesourcery.com>
731 * pt.c (resolve_overloaded_unification): Robustify. Return a
733 (type_unification_real): Adjust accordingly.
735 2007-07-06 Richard Guenther <rguenther@suse.de>
737 * init.c (build_new_1): Use the correct pointer type.
738 * typeck2.c (build_m_component_ref): Likewise.
740 2007-07-05 Mark Mitchell <mark@codesourcery.com>
743 * init.c (build_zero_init): Always build an initializer for
745 * typeck2.c (build_functional_cast): Use build_zero_init.
748 * init.c (build_new_1): Always pass the allocation function to
749 build_op_delete_call.
750 * call.c (build_op_delete_call): Handle operator delete with a
751 variable-argument list. Do not issue an error when no matching
752 deallocation function is available for a new operator.
755 * cp-tree.h (any_value_dependent_elements_p): Declare it.
756 * decl.c (value_dependent_init_p): New function.
757 (cp_finish_decl): Use it.
758 * pt.c (value_dependent_expression_p): Use
759 any_value_dependent_elements_p.
760 * parser.c (cp_parser_primary_expression): Add comment about
761 treating dependent qualified names as integral
762 constant-expressions.
764 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
766 * decl.c (build_ptrmemfunc_type): Always use structural equality
767 tests when comparing pointer-to-member-function types, because the
768 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
771 2007-07-03 Mark Mitchell <mark@codesourcery.com>
773 * init.c (build_new): Tweak comment.
775 2007-06-29 Dave Brolley <brolley@redhat.com>
778 * parser.c (cp_parser_new_type_id): Don't reduce a named array
779 type to its base type and number of elements here.
780 * init.c (build_new): Call complete_type_or_else to ensure that the
781 type is complete and to issue a diagnostic if it is not.
782 (build_new_1): Don't call complete_type_or_else here.
784 2007-07-03 Richard Guenther <rguenther@suse.de>
787 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
790 2007-07-02 Simon Baldwin <simonb@google.com>
792 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
793 for inner-style nested forward declarations that don't declare
796 2007-07-02 Jakub Jelinek <jakub@redhat.com>
799 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
800 DECL_P in not a variable and appears more than once error messages.
802 2007-07-01 Ollie Wild <aaw@google.com>
804 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
805 (select_decl): Remove function.
806 (unqualified_namespace_lookup): Populate binding by calling
807 ambiguous_decl. Remove select_decl call.
808 (lookup_qualified_name): Remove select_decl call.
809 * decl.c (lookup_and_check_tag): Check for ambiguous references.
810 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
811 generation when name lookup is ambiguous.
813 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
816 * init.c (build_new_1): Use structural equality on the copy of the
819 2007-06-28 Geoffrey Keating <geoffk@apple.com>
821 * decl2.c (determine_visibility): Implement
822 flag_visibility_ms_compat effect on type info.
823 * decl.c (cxx_init_decl_processing): Implement
824 global effect of flag_visibility_ms_compat.
826 2007-06-28 Geoffrey Keating <geoffk@apple.com>
828 * decl2.c (start_objects): Mark constructor-running function
831 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
834 * decl.c (grokdeclarator): Reset friendp for member functions declared
835 friend of their own class.
837 2007-06-23 Mark Mitchell <mark@codesourcery.com>
839 * decl2.c (determine_visibility): Don't look for dllexport here.
840 (determine_visibility_from_class): Tidy.
842 2007-06-18 Simon Baldwin <simonb@google.com>
845 * parser.c (cp_parser_single_declaration): Added check for storage
846 class other than sc_none in parsed declaration, and a flag to indicate
847 if the call is part of an explicit template specialization parse.
848 * (cp_parser_explicit_specialization): Specialization check flag added
849 to call to cp_parser_single_declaration(), set true.
850 * (cp_parser_template_declaration_after_export): Specialization check
851 flag added to call to cp_parser_single_declaration(), set false.
852 * pt.c (check_explicit_specialization): Added code to copy visiblity
853 and linkage from the templated function to the explicit specialization.
855 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
857 * typeck.c (build_binary_op): For templates build the
858 expression in pieces to avoid the assert in build2_stat.
859 (get_member_function_from_ptrfunc):
860 Change over to using POINTER_PLUS_EXPR and convert
861 the second operand to sizetype.
862 * typeck2.c (build_m_component_ref): Likewise.
863 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
864 instead of PLUS_EXPR for pointers.
865 (build_new_1): Likewise.
866 (build_vec_delete_1): Likewise.
867 (build_vec_delete): Likewise.
868 * class.c (build_base_path): Likewise.
869 (build_base_path): Likewise.
870 (convert_to_base_statically): Likewise.
871 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
872 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
873 instead of PLUS_EXPR.
874 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
875 instead of PLUS_EXPR for pointers.
876 * call.c (build_special_member_call): Likewise.
877 * rtti.c (build_headof): Likewise.
878 Use sizetype instead of ptrdiff_type_node.
879 (tinfo_base_init): Create a POINTER_PLUS_EXPR
880 instead of PLUS_EXPR for pointers.
881 * except.c (expand_start_catch_block): Do a
882 NEGATIVE and then a POINTER_PLUS_EXPR instead
884 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
885 PLUS_EXPR on pointer types over to use
886 POINTER_PLUS_EXPR and remove the conversion
887 to the pointer types.
888 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
889 adding to a pointer type. Use size_int instead of
890 ssize_int. Convert the index to sizetype before
891 adding it to the pointer.
893 2007-06-15 Mark Mitchell <mark@codesourcery.com>
895 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
896 (DECL_ANON_UNION_VAR_P): New macro.
897 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
898 than DECL_VAR_MARKED_P, to keep track of which variables we have
900 * decl.c (redeclaration_error_message): Complain about redeclaring
901 anonymous union members at namespace scope.
902 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
904 2007-06-14 Geoff Keating <geoffk@apple.com>
906 * decl2.c (determine_visibility): Ensure that functions with
907 hidden types as parameters are hidden.
910 * decl2.c (determine_visibility): Remove duplicate code for
913 2007-06-12 Ian Lance Taylor <iant@google.com>
916 * init.c (avoid_placement_new_aliasing): New static function.
917 (build_new_1): Call it.
919 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
921 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
922 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
924 2007-06-08 Jakub Jelinek <jakub@redhat.com>
927 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
928 on init, the non-decl cond operand and increment value.
930 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
933 * decl.c (check_initializer): Report an error when a brace enclosed
934 initializer is used for a non-aggregate type in C++98.
935 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
937 (grokdeclarator): Likewise.
938 (move_fn_p): Likewise.
939 * typeck.c (check_return_expr): Likewise.
940 * call.c (reference_binding): Likewise.
941 * error.c (cp_cpp_error): Likewise.
942 * pt.c (check_default_tmpl_args): Likewise.
944 * lex.c (init_reswords): Likewise.
945 * parser.c (p_parser_primary_expression): Likewise.
946 (TOKEN_PRECEDENCE): Likewise.
947 (cp_parser_init_declarator): Likewise.
948 (cp_parser_ptr_operator): Likewise.
949 (cp_parser_parameter_declaration): Likewise.
950 (cp_parser_enclosed_template_argument_list): Likewise.
951 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
952 (cp_parser_next_token_ends_template_argument_p): Likewise.
954 2007-06-04 Simon Baldwin <simonb@google.com>
956 * decl.c (grokdeclarator): Readability change. Moved case labels
957 into direct switch statement scope.
959 2007-06-04 Paolo Carlini <pcarlini@suse.de>
961 * call.c (convert_like_real): Remove pointless code.
963 2007-05-31 Mark Mitchell <mark@codesourcery.com>
965 * decl.c (get_atexit_fn_ptr_type): New function.
966 (get_atexit_node): Use it.
967 (start_cleanup_fn): Likewise.
968 (register_dtor_fn): Use the object's destructor, instead of a
969 separate cleanup function, where possible.
970 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
971 (atexit_fn_ptr_type_node): New macro.
972 * decl2.c (build_cleanup): Use build_address.
974 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
976 * typeck.c (build_binary_op): Include types in error.
978 2007-05-31 Jakub Jelinek <jakub@redhat.com>
981 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
982 needs runtime initialization.
984 2007-05-31 Paolo Carlini <pcarlini@suse.de>
987 * semantics.c (finish_trait_expr): Complete the types.
989 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
990 Douglas Gregor <doug.gregor@gmail.com>
991 Pedro Lamarao <pedro.lamarao@mndfck.org>
992 Howard Hinnant <howard.hinnant@gmail.com>
996 * typeck.c (comptypes): Don't consider rvalue and lvalue
997 reference types to be equivalent.
998 (check_return_expr): Move from certain lvalues when returning
1000 * decl.c (grokdeclarator): Implement reference collapsing.
1001 (copy_fn_p): Don't consider constructors taking rvalue references
1002 to be copy constructors.
1004 * call.c (conversion): New "rvaluedness_matches_p" member.
1005 (convert_class_to_reference): Require reference type as first
1006 parameter instead of base type.
1007 (reference_binding): Add logic to handle rvalue references.
1008 (implicit_conversion): Update inaccurate comment.
1009 (convert_like_real): Disable creation of temporaries that are
1010 impossible to initialize for types with move constructors.
1011 (build_over_call): Elide move constructors when possible.
1012 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
1013 (maybe_handle_ref_bind): Return conversion instead of type node.
1014 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
1015 determine preferred conversion sequences.
1016 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
1017 (LOOKUP_PREFER_RVALUE): New.
1018 (DECL_MOVE_CONSTRUCTOR_P): New.
1019 (struct cp_declarator): Add "reference" member for reference
1020 types, with new "rvalue_ref" flag.
1021 (cp_build_reference_type): Declare.
1022 (move_fn_p): Declare.
1023 * error.c (dump_type_prefix): Format rvalue reference types
1024 correctly in error messages.
1025 * except.c (build_throw): Move from certain lvalues when
1027 * mangle.c (write_type): Mangle rvalue references differently
1028 than regular references.
1029 * parser.c (make_reference_declarator): Add boolean parameter for
1031 (cp_parser_make_indirect_declarator): New.
1032 (cp_parser_new_declarator_opt): Call
1033 cp_parser_make_indirect_declarator.
1034 (cp_parser_conversion_declarator_opt): Ditto.
1035 (cp_parser_declarator): Ditto.
1036 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
1038 * pt.c (tsubst): Implement reference collapsing.
1039 (maybe_adjust_types_for_deduction): Implement special template
1040 parameter deduction rule for rvalue references.
1041 (type_unification_real): Update calls to
1042 maybe_adjust_types_for_deduction.
1043 (try_one_overload): Ditto.
1044 (unify_pack_expansion): Ditto.
1045 * tree.c (lvalue_p_1): Handle rvalue reference types.
1046 (cp_build_reference_type): New.
1048 2007-05-30 Jakub Jelinek <jakub@redhat.com>
1051 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
1052 variables that need runtime initialization.
1054 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
1057 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
1058 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
1059 case POSTDECREMENT_EXPR>): Return the error_mark_node
1060 if either the real or imaginary parts would an
1063 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
1064 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1067 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1068 token is a closing brace, false if there are no tokens left.
1069 (cp_parser_namespace_alias_definition): Only consume the next token if
1070 it is a closing brace.
1072 * parser.c (cp_parser_class_specifier): Likewise.
1074 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
1076 * semantics.c (finish_member_declaration): Fix a typo in the
1079 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
1091 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1092 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1093 * pt.c (check_for_bare_parameter_packs): Return bool indicated
1094 whether everything was okay. Fix indentation.
1095 (push_template_decl_real): Check for bare parameter packs in
1096 function parameters; where errors occur, mark the parameter types
1097 with ERROR_MARK_NODEs to avert ICEs.
1098 (coerce_template_parameter_pack): New.
1099 (coerce_template_parms): Moved parameter pack coercion into
1100 coerce_template_parameter_pack, and permit it anywhere in the
1101 template parameter list (not just at the end). Parameter and
1102 argument indices can vary (somewhat) separately now, so add
1103 PARM_IDX and ARG_IDX.
1104 (fn_type_unification): Don't set an argument pack as incomplete if
1105 no argument pack was deduced.
1106 (type_unification_real): If a type parameter is a parameter pack
1107 and has not otherwise been deduced, it will be deduced to an empty
1109 (more_specialized_fn): Use the actual lengths of the argument
1110 lists when comparing against expansions.
1111 * semantics.c (finish_member_declaration): If a field's type has
1112 bare parameter packs, error and set its type to ERROR_MARK_NODE.
1114 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
1117 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1119 2007-05-22 Ollie Wild <aaw@google.com>
1121 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1122 (unqualified_namespace_lookup): Adds check for hidden types.
1124 2007-05-22 Ollie Wild <aaw@google.com>
1126 * decl.c (duplicate_decls): Verify namespace names are unique.
1128 2007-05-21 Mark Mitchell <mark@codesourcery.com>
1130 * decl.c (cxx_maybe_build_cleanup): Handle
1131 __attribute__((cleanup)).
1133 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1135 * cvt.c (cp_convert_and_check): Don't check warnings if the
1138 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1140 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1142 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1145 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1146 type only if is a class type (5.2.8/4).
1148 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1150 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1151 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1152 c_common_unsigned_type.
1154 2007-05-11 Silvius Rus <rus@google.com>
1156 * cp/typeck.c (build_indirect_ref): Add call to
1157 strict_aliasing_warning.
1158 (build_reinterpret_cast_1): Condition call to
1159 strict_aliasing_warning.
1161 2007-05-11 Jan Hubicka <jh@suse.cz>
1163 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1164 * decl2.c (start_objects): ctors and dtors are no longer public.
1165 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1167 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1169 * typeck.c (build_unary_op): Remove code that used to
1170 handle non lvalue increments/decrements.
1172 2007-05-07 Mike Stump <mrs@apple.com>
1174 * parser.c (check_empty_body): Add.
1175 (cp_parser_iteration_statement): Add call to check_empty_body.
1177 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1180 * mangle.c (write_mangled_name): Mangle static variable names.
1181 (write_unqualified_name): Use local-source-name for
1182 namespace-scope static variables.
1184 2007-05-04 Dirk Mueller <dmueller@suse.de>
1186 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1189 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1192 * decl2.c (constrain_class_visibility):
1193 Use strip_pointer_or_array_types instead of strip_array_types.
1195 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1198 * decl.c (reshape_init_r): Don't reshape the first element if it
1199 is a pointer to member function.
1201 2007-04-27 Simon Baldwin <simonb@google.com>
1203 * decl.c (grokparms): Changed message format from %qD to %qE.
1205 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1207 * error.c (maybe_warn_variadic_templates): Variadic templates are
1208 now in C++0x, so only warn about them in C++98 mode.
1210 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1213 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1214 integeral types from vectors types.
1216 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1219 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1220 for type dependent OMP_CLAUSE_DECLs.
1222 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1225 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1226 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1227 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1228 * init.c (build_zero_init): Adjust, as
1229 COMPLEX_TYPE is now a SCALAR_TYPE.
1230 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1231 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1233 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1235 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1236 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1237 (trait_expr_value): Adjust.
1239 2007-04-23 Simon Baldwin <simonb@google.com>
1241 * decl.c (grokparms): Added new error for duplicate function
1242 parameters names in function prototypes, to match gcc behavior.
1244 2007-04-23 Jan Hubicka <jh@suse.cz>
1246 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1249 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1251 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1252 instead of checking GIMPLE_STMT_P in chain_next.
1254 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1257 * call.c (convert_for_arg_passing): Convert bitfields to their
1260 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1263 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1265 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1268 * cp/decl2.c (constrain_class_visibility):
1269 Do not warn about the use of anonymous namespace in the main input file.
1271 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1273 * cp-tree.h (current_template_parms): Fix typo in comment.
1275 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1277 * cp-tree.h, error.c: Fix comment typos.
1279 2007-04-13 Jason Merrill <jason@redhat.com>
1282 * call.c (reference_binding): Add c_cast_p parm. If true,
1283 add quals to TO as needed to make it reference-compatible.
1285 2007-04-11 Jan Hubicka <jh@suse.cz>
1287 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1288 that we are not processing template_decl.
1290 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1293 * class.c (build_base_path): Ensure that the converted pointer has
1294 the same cv-qualification as the input.
1296 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1298 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1300 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1302 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1304 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1305 * tree.c (cp_add_pending_fn_decls): Remove.
1306 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1308 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1310 Revert change removing staticp.
1312 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1314 * cp-objcp-common.c (cxx_staticp): Remove.
1315 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1316 * cp-tree.h (cxx_staticp):
1318 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1320 * class.c (check_for_override): Don't remove dllmport attribute
1323 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1326 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1327 type issue error and return early.
1329 2007-03-30 Jason Merrill <jason@redhat.com>
1332 * typeck.c (cp_type_readonly): New fn.
1333 * cp-tree.h: Declare it.
1334 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1335 (cp_finish_decl): Not here.
1337 2007-03-31 Richard Guenther <rguenther@suse.de>
1339 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1342 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1347 * parser.c (declarator_can_be_parameter_pack): New.
1348 (cp_parser_template_parameter): Only parse the `...' if the
1349 declarator can be a parameter pack.
1350 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1352 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1353 types (they could be used as array bounds).
1354 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1355 (tsubst_pack_expansion): Handle failure to expand parameter
1358 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1361 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1362 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1363 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1364 (CLASS_TYPE_NON_UNION_P): Add.
1365 (struct lang_type_class): Add has_complex_dflt.
1366 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1367 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1368 * cp-tree.def: Add TRAIT_EXPR.
1369 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1370 * lex.c (struct resword): Add __has_nothrow_assign,
1371 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1372 __has_trivial_constructor, __has_trivial_copy,
1373 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1374 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1375 __is_pod, __is_polymorphic, __is_union.
1376 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1377 (cp_parser_trait_expr): New.
1378 * semantics.c (finish_trait_expr, trait_expr_value
1379 classtype_has_nothrow_copy_or_assign_p): New.
1380 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1382 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1383 * class.c (check_bases, check_field_decl, check_bases_and_members):
1384 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1385 * pt.c (uses_template_parms, tsubst_copy_and_build,
1386 value_dependent_expression_p, type_dependent_expression_p): Deal with
1388 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1390 2007-03-29 Richard Guenther <rguenther@suse.de>
1392 * tree.c (cp_walk_subtrees): Do not set input_location.
1394 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1397 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1400 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1402 * parser.c (struct cp_parser): Update comment for
1403 greater_than_is_operator_p.
1404 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1405 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1406 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1407 !GREATER_THAN_IS_OPERATOR_P.
1408 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1409 `>>' operators that will become two `>' tokens in C++0x.
1410 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1411 mode, allowing it to terminate default arguments.
1412 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1413 `>>' like two consecutive `>' tokens.
1414 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1415 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1416 ends a template argument.
1418 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1420 * decl.c (redeclaration_error_message): Complain when redeclaring
1421 a friend function with default template arguments (C++0x mode only).
1422 * cp-tree.h (check_default_tmpl_args): Declare.
1423 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1424 template arguments in function templates. Add support for checking
1425 the default template arguments of friend templates.
1426 (push_template_decl_real): Fix call to check_default_tmpl_args.
1427 (type_unification_real): If a template parameter has not been
1428 deduced but provides a default template argument, substitute into
1429 that default template argument.
1430 * parser.c (cp_parser_init_declarator): When declaring (but not
1431 defining!) a function template in C++0x mode, check for default
1434 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1437 * decl.c (grokdeclarator): Deal with cv-qualified function type
1438 typedefs in the same way for member and non-member functions.
1440 2007-03-26 Dirk Mueller <dmueller@suse.de>
1442 * parser.c (cp_parser_member_declaration): Pedwarn
1443 about stray semicolons after member declarations.
1445 2007-03-26 Paolo Carlini <pcarlini@suse.de>
1448 * pt.c (instantiate_decl): Set in_system_header.
1450 2007-03-22 Mark Mitchell <mark@codesourcery.com>
1452 * cp-tree.h (current_tempalte_parms): Improve documentation.
1453 * pt.c (current_template_args): Likewise.
1456 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1457 not consume tokens when failing.
1459 2007-03-22 Jim Wilson <wilson@specifix.com>
1460 Mark Mitchell <mark@codesourcery.com>
1463 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
1464 consistent with FROM.
1466 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1468 * error.c (dump_expr): Handle dependent names that designate types.
1469 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1471 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
1473 * cp-tree.def, parser.c, pt.c: Fix comment typos.
1475 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1477 * cvt.c (cp_convert_and_check) : Define.
1478 * cp-tree.h (cp_convert_and_check): Declare.
1479 * call.c (convert_conversion_warnings): Rename to
1480 conversion_null_warnings. The warning for floating-point to
1481 integer is handled by convert_and_check in convert_like_real.
1482 (convert_like_real): convert_conversion_warnings was renamed as
1483 conversion_null_warnings.
1484 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1485 overflow and changes of value during conversion.
1487 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1490 * parser.c (cp_parser_statement): If 'namespace' is found, this
1491 only can be a namespace alias definition, so parse it now.
1492 (cp_parser_namespace_alias_definition): if we find an open brace
1493 instead of '=', then this is actually a misplaced namespace
1496 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1499 * decl.c (cxx_init_decl_processing): Move command-line options
1500 processing to c-opts.c.
1502 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
1504 * ptree.c (cxx_print_type): Use formatting markup for integers
1505 when printing template parameter index/level/orig level.
1506 (cxx_print_xnode): Ditto.
1507 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1508 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1509 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1511 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1512 rather than a HOST_WIDE_INT.
1513 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1514 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1516 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1517 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1518 IN_BASE_INITIALIZER bool bitfields.
1519 (struct cp_declarator): Make KIND a 4-bit field. Make
1520 PARAMETER_PACK_P a bool bitfield just after KIND.
1521 * pt.c (uses_parameter_packs): Destroy the pointer set.
1522 (make_pack_expansion): Ditto.
1523 (check_for_bare_parameter_packs): Ditto.
1524 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1526 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
1529 * call.c (convert_default_arg): Instead of copying the node,
1532 2007-03-15 Dirk Mueller <dmueller@suse.de>
1535 * call.c (convert_conversion_warnings): New..
1536 (convert_like_real): .. factored out from here.
1537 (convert_conversion_warnings): Add warning about
1538 false being converted to NULL in argument passing.
1540 2007-03-14 Dirk Mueller <dmueller@suse.de>
1542 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1543 (finish_do_body): Warn about empty body in do/while statement.
1545 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1547 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1549 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1552 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1555 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
1557 * cp/repo.c (init_repo): Initialize random_seed saved options.
1558 (finish_repo): Adjust.
1560 2007-03-13 Mark Mitchell <mark@codesourcery.com>
1563 * Make-lang.in (doc/g++.1): Use $< to specify the location from
1566 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
1568 * decl.c (compute_array_index_type): New warning flag warn_vla.
1570 2007-03-12 Mark Mitchell <mark@codesourcery.com>
1573 * call.c (convert_default_arg): Copy non-constant arguments.
1575 2007-03-11 Mark Mitchell <mark@codesourcery.com>
1578 * parser.c (cp_parser_postfix_expression): Disallow compound
1579 literals in constant expressions.
1582 * semantics.c (finish_typeof): Use unlowered_expr_type.
1584 2007-03-10 Mark Mitchell <mark@codesourcery.com>
1587 * cp-tree.h (unlowered_expr_type): New function.
1588 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1589 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1590 (unlowered_expr_type): New function.
1591 (build_unary_op): Disallow predecrements of bool bitfields.
1592 * call.c (build_conditional_expr): Use unlowered_expr_type.
1593 * pt.c (type_unification_real): Likewise.
1595 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
1598 * typeck.c (check_return_expr): Check for bare parameter packs.
1599 (comptypes): Compare template parameter packs and
1600 type pack expansions.
1601 * decl.c (grokdeclarator): Deal with the declaration of function
1603 (grokparms): Verify that the (optional) function parameter pack is
1604 at the end of the parameter list.
1605 (xref_basetypes): Handle pack expansions in the base class.
1606 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1607 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1608 (NONTYPE_ARGUMENT_PACK): New.
1609 (TYPE_PACK_EXPANSION): New.
1610 (EXPR_PACK_EXPANSION): New.
1611 (ARGUMENT_PACK_SELECT): New.
1612 * cp-objcp-common.c (cp_tree_size): Compute size of
1613 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1614 ARGUMENT_PACK_SELECT.
1615 * error.c (dump_template_argument): Print template argument packs.
1616 (dump_template_argument_list): Ditto.
1617 (dump_template_parameter): Dump `...' for template type parameter
1619 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1620 (dump_parameters): Print function parameter packs.
1621 (dump_template_parms): Print template argument packs.
1622 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1623 (maybe_warn_variadic_templates): New.
1624 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1625 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1626 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1628 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1629 (write_template_arg): Write argument packs as separate arguments.
1630 * cp-tree.h (struct template_parm_index_s): Add flag that
1631 indicates that the template parameter is actually a parameter
1633 (struct tree_argument_pack_select): New.
1634 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1635 (union lang_tree_node): Add argument_pack_select.
1636 (FUNCTION_PARAMETER_PACK_P): New.
1637 (PACK_EXPANSION_P): New.
1638 (PACK_EXPANSION_PATTERN): New.
1639 (SET_PACK_EXPANSION_PATTERN): New.
1640 (PACK_EXPANSION_PARAMETER_PACKS): New.
1641 (ARGUMENT_PACK_P): New.
1642 (ARGUMENT_PACK_ARGS): New.
1643 (SET_ARGUMENT_PACK_ARGS): New.
1644 (ARGUMENT_PACK_INCOMPLETE_P): New.
1645 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1646 (TEMPLATE_PARM_PARAMETER_PACK): New.
1647 (TEMPLATE_TYPE_PARAMETER_PACK): New.
1648 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1649 (ARGUMENT_PACK_SELECT_INDEX): New.
1650 (ARGUMENT_PACK_SELECT_ARG): New.
1651 (struct cp_declarator): Add parameter_pack_p flag.
1652 (maybe_warn_variadic_templates): Declare.
1653 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1654 indicate a template parameter pack.
1655 (uses_parameter_packs): Declare.
1656 (template_parameter_pack_p): Declare.
1657 (template_parms_variadic_p): Declare.
1658 (make_pack_expansion): Declare.
1659 (check_for_bare_parameter_packs): Declare.
1660 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1661 sizeof... expressions.
1662 (pp_cxx_expression): Print pack expansions and non-type argument
1664 (pp_cxx_exception_specification): Print pack expansions.
1665 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1666 (pp_cxx_ctor_initializer): Print pack expansions.
1667 (pp_cxx_type_id): Print pack expansions.
1668 (pp_cxx_template_argument_list): Print argument packs.
1669 (pp_cxx_template_parameter): Print ellipsis for template parameter
1671 * pt.c (comp_template_parms): Compare template parameter packs.
1672 (template_parameter_pack_p): New.
1673 (template_parms_variadic_p): New.
1674 (template_args_variadic_p): New.
1675 (make_ith_pack_parameter_name): New.
1676 (struct find_parameter_pack_data): New.
1677 (find_parameter_packs_r): New.
1678 (uses_parameter_packs): New.
1679 (make_pack_expansion): New.
1680 (check_for_bare_parameter_packs): New.
1681 (expand_template_argument_pack): New.
1682 (reduce_template_parm_level): Propagate parameter pack flag.
1683 (process_template_parm): Add is_parameter_pack parameter to state
1684 when the parameter is actually a parameter pack. Create template
1685 parameter packs when is_parameter_pack is true.
1686 (current_template_args): The argument for a template parameter
1687 pack is an argument pack containing a single pack expansion.
1688 (process_partial_specialization): When checking that non-type
1689 argument expressions do not involve template parameters, loop over
1690 the arguments in argument packs separately.
1691 (push_template_decl_real): Check that the type of the declaration
1692 does not have any bare parameter packs. Check that primary
1693 templates have no more than one parameter pack, and that it comes
1694 at the end of the template parameter list.
1695 (convert_template_argument): Handle coercions for pack expansion
1696 expressions by coercing the pattern then rebuilding the expansion.
1697 (coerce_template_parms): When coercing the arguments for a
1698 variadic template, pack "extra" arguments into an argument pack.
1699 (coerce_template_template_parms): Cannot coerce between parameter
1700 packs and non-pack parameters.
1701 (template_args_equal): Compare PACK_EXPANSION_P expressions.
1702 (comp_template_args): Expand all template arguments packs before
1703 comparing template argument lists.
1704 (mangle_class_name_for_template): Make argument packs as separate
1706 (for_each_template_parm_r): No need to handle BASELINK.
1707 (instantiate_class_template): Handle pack expansions in the base
1709 (tsubst_pack_expansion): New.
1710 (tsubst_template_args): Handle substitutions of argument packs and
1711 pack expansion into template argument lists.
1712 (tsubst_decl): Expand function parameter packs into separate
1713 function parameters.
1714 (tsubst_arg_types): Expand a type pack expansion into separate
1716 (tsubst_exception_specification): Handle pack expansions in
1717 exception specifiers.
1718 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1719 replacing a template parameter with its argument. If we encounter
1720 a substitution for an argument pack, just return the parameter
1722 (tsubst_copy): sizeof(X...) returns the number of elements in
1723 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1724 PARM_DECL is a parameter pack.
1725 (tsubst_expr): Expression pack expansions and argument packs
1726 cannot show up here; they will all be handled through function
1727 calls, sizeof, and template argument lists.
1728 (tsubst_copy_and_build): sizeof(X...) returns the number of
1729 elements in parameter pack X. Handle pack expansions in TREE_LIST
1730 and CONSTRUCTOR nodes.
1731 (fn_type_unification): Handle "incomplete" explicit template
1732 argument lists that specify some of the arguments for a template
1734 (type_unification_real): Unify arguments against pack expansions.
1735 (template_parm_level_and_index): New, helper function.
1736 (unify_pack_expansion): New.
1737 (unify): Unify argument packs on an argument-by-argument basis,
1738 handling variadic argument packs as well.
1739 (more_specialized_fn): Handle unification of function parameter
1740 packs. All things being equal, prefer non-variadic function
1741 templates to variadic function templates.
1742 (more_specialized_class): Prefer the variadic class template
1743 partial specialization that binds fewer arguments to a parameter
1745 (regenerate_decl_from_template): Expand function parameter packs
1746 into separate parameters.
1747 (instantiate_decl): Ditto.
1748 (tsubst_initializer_list): Handle pack expansions for base-class
1750 (dependent_type_p_r): Determine dependent types in argument packs
1751 and pack expansions.
1752 (value_dependent_expression_p): Determine value-dependence of
1753 non-type argument packs.
1754 (dependent_template_arg_p): Handle argument packs.
1755 * semantics.c (finish_cond): Check for bare parameter packs.
1756 (finish_expr_stmt): Ditto.
1757 (finish_for_expr): Ditto.
1758 (finish_switch_cond): Ditto.
1759 (finish_mem_initializers): Ditto.
1760 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1762 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1763 * parser.c (make_declarator): Declarator is not an expansion.
1764 (make_pointer_declarator): Transfer parameter pack flag to outer
1766 (make_reference_declarator): Ditto.
1767 (make_ptrmem_declarator): Ditto.
1768 (make_call_declarator): Ditto.
1769 (make_array_declarator): Ditto.
1770 (cp_parser_postfix_expression): Allow pack expansion expressions
1771 in the argument list for a call expression.
1772 (cp_parser_parenthesized_expression_list): Add new parameter
1773 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1774 into separate arguments."
1775 (cp_parser_new_placement): Allow pack expansion expressions.
1776 (cp_parser_new_initializer): Ditto.
1777 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1778 base-class initializer expansion.
1779 (cp_parser_mem_initializer): Ditto.
1780 (cp_parser_template_parameter_list): Keep track of whether the
1781 template parameter is a template parameter pack.
1782 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1783 template parameter pack.
1784 (cp_parser_type_parameter): Ditto.
1785 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1787 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1788 this declarator is a parameter pack.
1789 (cp_parser_parameter_declaration): The ellipsis does not end the
1790 parameter declaration, because it might be a parameter pack. Parse
1791 the ellipsis to indicate a parameter pack.
1792 (cp_parser_initializer): Allow pack expansions.
1793 (cp_parser_initializer_list): Allow ellipsis to create an
1794 initializer expansion.
1795 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1797 (cp_parser_type_id_list): Allow ellipsis to create an exception
1798 specifier expansion.
1799 (cp_parser_attribute_list): Don't allow pack expansions.
1800 (cp_parser_functional_cast): Allow pack expansions.
1801 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1802 compute the length of a parameter pack.
1803 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1804 end a template argument.
1805 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1806 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1809 2007-03-09 Dirk Mueller <dmueller@suse.de>
1811 * cp/call.c (build_new_op): Call warn_logical_operator.
1813 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1816 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1819 * pt.c (any_template_arguments_need_structural_equality_p):
1822 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1824 * decl.c (grokdeclarator): Disable warnings for anonymous
1827 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1829 * typeck2.c (readonly_error): Always emit a hard error.
1830 Remove last argument.
1831 * cp-tree.h (readonly_error): Adjust prototype.
1832 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1833 * typeck.c (build_unary_op): Likewise.
1834 (build_modify_expr): Likewise.
1836 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1839 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1841 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1844 * parser.c (struct cp_parser): New IN_IF_STMT.
1845 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1846 returning if parsing the body of an 'if' statement or issuing an
1847 error and continuing.
1848 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1850 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1852 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1855 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1858 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1860 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1861 Objective-C++. Don't exit early if -shared-libgcc needs to be
1864 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1866 * typeck.c (common_base_type): Delete unused function.
1868 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1870 * Make-lang.in: Add dummy lang.install-pdf target.
1872 2007-03-01 Simon Baldwin <simonb@google.com>
1875 * decl.c (check_tag_decl): Added new warning for typedef ignored
1876 when it precedes an otherwise valid non-typedef declaration.
1878 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1880 * typeck.c (build_function_call): Store converted arguments
1881 in a stack-allocated array instead of building a list.
1882 (convert_arguments): Store arguments in the array passed in as an
1883 argument, and return the actual number of arguments.
1884 * call.c (build_call): Delete, and replace with...
1885 (build_call_n, build_call_a): New.
1886 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1887 (build_over_call): Store converted arguments in a stack-allocated
1888 array instead of building a list.
1889 (build_cxx_call): Pass arguments in an array instead of as a list.
1890 (build_java_interface_fn_ref): Rewrite to avoid constructing
1892 * tree.h: Update declarations to reflect above changes.
1893 * method.c (use_thunk): Use a stack-allocated array to hold
1894 the arguments instead of a list.
1895 * rtti.c (throw_bad_cast): Update call to cxx_call.
1896 (throw_bad_typeid): Likewise.
1897 (build_dynamic_cast_1): Likewise.
1898 * init.c (build_builtin_delete_call): Use build_call_n.
1899 * decl.c (expand_static_init): Likewise.
1900 * except.c (cp_protect_cleanup_actions): Likewise.
1901 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1902 (gimplify_must_not_throw_expr): Likewise.
1903 (cxx_omp_apply_fn): Use build_call_a.
1905 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1907 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1908 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1910 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1912 * cp-tree.h (static_ctors): Remove.
1913 * cp-tree.h (static_dtors): Likewise.
1914 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1915 refactoring of tree_map hierarchy.
1916 (decl_shadowed_for_var_insert): Likewise.
1917 * semantics.c (expand_body): Use c_expand_body.
1918 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1919 * decl2.c (static_ctors): Remove.
1920 (static_dtors): Likewise.
1921 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1922 objc_generate_static_init_call. Do not call static_[cd]tors.
1923 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1925 (cp_write_global_declarations): Likewise.
1927 2007-02-23 Richard Guenther <rguenther@suse.de>
1929 * class.c (note_name_declared_in_class): Make declaration
1930 changes meaning a pedwarn.
1932 2007-02-22 Michael Matz <matz@suse.de>
1935 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1936 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1937 dump_function_decl): Guard emitting outer scopes by new flag.
1938 * cp-lang.c (cxx_dwarf_name): New function.
1939 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1940 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1942 (push_template_decl_real, lookup_template_class): Remove calls
1945 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1947 * call.c (build_new_method_call): Ensure that explicit calls of
1948 destructors have type "void".
1950 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1952 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1953 and -Walways-true with -Waddress.
1954 * cvt.c (convert_to_void): Replace unconditional warning with
1957 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1959 * decl.c, tree.c: Fix comment typos.
1961 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1964 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1965 statement expression if we had an error mark node.
1967 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1968 Brooks Moses <brooks.moses@codesourcery.com>
1969 Lee Millward <lee.millward@codesourcery.com>
1971 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1972 Change class to tcc_vl_exp.
1974 * call.c (build_call): Use build_call_list instead
1976 (build_over_call): Likewise.
1977 (build_new_method_call): Use build_min_non_dep_call_list
1978 instead of build_min_non_dep.
1980 * error.c (dump_call_expr_args): New function.
1981 (dump_aggr_init_expr_args): New function.
1982 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1983 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1985 * cvt.c (convert_to_void): Use build_call_array instead
1986 of build3; use new AGGR_INIT_EXPR accessor macros.
1988 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1989 instead of TREE_CODE_LENGTH.
1991 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1992 AGGR_INIT_EXPR accessor macros.
1994 * cp-gimplify.c (cp_gimplify_init_expr): Use
1995 AGGR_INIT_EXPR_SLOT to set the slot operand.
1997 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1998 (AGGR_INIT_EXPR_SLOT): New macro.
1999 (AGGR_INIT_EXPR_ARG): New macro.
2000 (aggr_init_expr_nargs): New macro.
2001 (AGGR_INIT_EXPR_ARGP): New macro.
2002 (aggr_init_expr_arg_iterator): New.
2003 (init_aggr_init_expr_arg_iterator): New.
2004 (next_aggr_init_expr_arg): New.
2005 (first_aggr_init_expr_arg): New.
2006 (more_aggr_init_expr_args_p): New.
2007 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
2008 (stabilize_aggr_init): New declaration.
2009 (build_min_non_dep_call_list): Likewise.
2011 * tree.c (process_aggr_init_operands): New function.
2012 (build_aggr_init_array) New function.
2013 (build_cplus_new): Update to use new CALL_EXPR and
2014 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
2015 build_aggr_init_array.
2016 (build_min_non_dep_call_list) New function.
2017 (build_min_nt): Assert input code parameter is not a variable
2018 length expression class.
2019 (build_min, build_min_non_dep): Likewise.
2020 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
2021 to check for equality instead of recursing. Handle tcc_vl_exp
2023 (stabilize_call): Update to only handle CALL_EXPRs, not
2024 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
2025 (stabilize_aggr_init): New function.
2026 (stabilize_init): Use it.
2028 * cxx-pretty-print.c (pp_cxx_postfix_expression)
2029 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
2030 AGGR_INIT_EXPR accessor macros and argument iterators.
2032 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
2033 build_vl_exp. Iterate through the operands, recursively
2034 processing each one.
2035 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
2036 CALL_EXPR accessor macros.
2037 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
2038 tree code classes. Use TREE_OPERAND_LENGTH instead of
2041 * semantics.c (finish_call_expr): Use build_nt_call_list
2042 instead of build_nt.
2043 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
2044 accessor macros. Use build_call_array to construct the
2045 CALL_EXPR node instead of build3
2047 * decl2.c (build_offset_ref_call_from_tree): Use
2048 build_nt_call_list and build_min_non_dep_call_list instead
2049 of build_min_nt and build_min_non_dep.
2051 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
2052 Use build_nt_call_list instead of build_min_nt.
2054 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2057 * call.c (build_conditional_expr): Improve error message.
2059 2007-02-13 Dirk Mueller <dmueller@suse.de>
2061 * friend.c (do_friend): Annotate warning about friend
2062 declarations in templates with OPT_Wnon_template_friend.
2063 Convert informal message from warning() to inform().
2065 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
2066 Mark Mitchell <mark@codesourcery.com>
2069 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2070 instantiations for variables.
2072 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2075 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2076 Check warn_unused_value just once.
2078 2007-02-11 Mark Mitchell <mark@codesourcery.com>
2081 * pt.c (determine_specialization): Use skip_artificial_parms_for.
2082 (fn_type_unificiation): Likewise.
2083 (get_bindings): Likewise.
2085 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
2088 * decl.c (finish_function): Use DECL_REPLACEABLE.
2089 * tree.c (cp_cannot_inline_tree_fn): Likewise.
2091 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
2093 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2095 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
2097 * decl.c (grokvardecl): Don't error if !have_tls.
2098 (grokdeclarator): Likewise.
2099 * parser.c (cp_parser_omp_threadprivate): Likewise.
2101 2007-02-07 Jakub Jelinek <jakub@redhat.com>
2104 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2105 parameters and result decls in omp clauses.
2106 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2109 2007-02-05 Dirk Mueller <dmueller@suse.de>
2112 * parser.c (cp_parser_class_specifier): Always initialize bases.
2114 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
2116 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2117 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2118 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2120 * semantics.c (finish_omp_atomic): Store a whole expression node
2121 in operand 1, and integer_zero_node in operand 0, for dependent
2122 OMP_ATOMIC. Rewrite to make flow easier to understand.
2124 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2126 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2128 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
2130 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2131 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2133 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2135 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2136 keyword warning to -Wc++0x-compat.
2138 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2140 * decl.c (grokdeclarator): Update documentation.
2142 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2145 * decl.c (grokdeclarator): If __thread is used together with
2146 a storage class other than extern and static, clear thread_p
2147 after issuing diagnostics and fall through to checking the
2150 2007-01-30 Roger Sayle <roger@eyesopen.com>
2152 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2153 calculating the size of an array (to avoid recursive errors).
2155 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2158 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2160 * call.c (convert_like_real): Don't warn when converting to
2163 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2165 * decl.c (pop_label): Replace warning with call to
2166 warn_for_unused_label.
2168 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2171 * semantics.c (finish_pseudo_destructor_expr): Check the
2172 destrutor name by calling check_dtor_name.
2174 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2176 * lex.c (D_CPP0X): Rename.
2178 (reswords): D_CPP0X -> D_CXX0X.
2179 (init_reswords): Ditto.
2180 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2181 of C++0x keywords as identifiers.
2183 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2186 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2189 2007-01-23 Ian Lance Taylor <iant@google.com>
2191 * typeck.c (convert_for_assignment): Only warn about a = b = c
2192 when converting to bool.
2194 2007-01-23 Roger Sayle <roger@eyesopen.com>
2196 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2198 * typeck.c (ignore_overflows): Remove the remaining uses of
2199 TREE_CONSTANT_OVERFLOW.
2201 2007-01-20 Jan Hubicka <jh@suse.cz>
2203 * decl2.c (start_objects, start_static_storage_duration_function):
2204 Do not make the functions uninlinable.
2206 2007-01-17 Ian Lance Taylor <iant@google.com>
2208 * class.c (add_method): Call VEC_reserve_exact rather than passing
2209 a negative size to VEC_reserve.
2211 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2214 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2216 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2219 * decl.c (make_typename_type): If the qualified name is not a
2220 type, issue an error.
2221 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2224 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2226 * rtti.c: Include target.h.
2227 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2228 don't emit typeinfo for fundamental types as weak.
2229 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2231 2007-01-08 Richard Guenther <rguenther@suse.de>
2233 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2235 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2237 * call.c (standard_conversion): Pass flag to
2238 vector_types_convertible_p to disallow emission of note.
2239 * typeck.c (convert_for_assignment): Pass flag to
2240 vector_types_convertible_p to allow emission of note.
2241 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2242 to disallow emission of note.
2244 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2247 * typeck.c (build_binary_op): Call overflow_warning if
2248 TREE_OVERFLOW_P is true for the result and not for any of the
2251 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2254 * class.c (add_method): Don't wait until template
2255 instantiation time to complain about duplicate methods.
2257 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2260 * semantics.c (finish_unary_op_expr): Warn only if result
2261 overflowed and operands did not.
2263 2007-01-05 Ian Lance Taylor <iant@google.com>
2265 * typeck.c (build_binary_op): Warn about comparing a non-weak
2268 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2270 * pt.c (tsubst): Propagate the need for structural equality checks
2271 when reducing the level of template parameters.
2273 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2275 * pt.c: Fix a comment typo.
2277 2007-01-02 Ian Lance Taylor <iant@google.com>
2279 * semantics.c (maybe_convert_cond): Optionally warn when using an
2280 assignment as a condition.
2281 * typeck.c (convert_for_assignment): Optionally warn about
2282 assigning the result of an assignment to a bool.
2284 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2286 * pt.c (canonical_template_parms): Correct typo in comment.
2288 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2290 * typeck.c (structural_comptypes): Renamed from "comptypes".
2291 (comptypes): Use canonical type information to perform fast type
2292 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2293 canonical type comparison returns the same results as we would see
2294 from the current, structural check. Support COMPARE_STRUCTURAL
2295 when we need structural checks.
2296 * decl.c (typename_compare): Fix comment.
2297 (build_typename_type): TYPENAME_TYPE nodes require structural
2298 equality checks, because they resolve different based on the
2300 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2301 require structural equality checks (for now).
2302 (build_ptrmemfunc_type): Build the canonical pointer to member
2304 (compute_array_index_type): Whenever we build a new index type
2305 to represent the size of an array in a template, we need to mark
2306 this index type as requiring structural equality. This goes for
2307 arrays with value-dependent sizes with the current ABI, or all
2309 * tree.c (cplus_array_hash): New.
2310 (struct cplus_array_info): New.
2311 (cplus_array_compare): New.
2312 (cplus_array_htab): New.
2313 (build_cplus_array_type_1): Use a hash table to cache the array
2314 types we build. Build the canonical array type for each array
2316 (cp_build_qualified_type_real): When building a cv-qualified array
2317 type, use the hash table of array types and build canonical array
2319 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2320 use structural equality (for now).
2321 * cp-tree.h (COMPARE_STRUCTURAL): New.
2322 * pt.c (canonical_template_parms): New.
2323 (canonical_type_parameter): New.
2324 (process_template_parm): Find the canonical type parameter.
2325 (lookup_template_class): When we have named the primary template
2326 type, set the canonical type for our template class to the primary
2327 template type. If any of the template arguments need structural
2328 equality checks, the template class needs structural equality
2330 (tsubst): When reducing the level of a template template
2331 parameter, we require structural equality tests for the resulting
2332 parameter because its template parameters have not had their types
2333 canonicalized. When reducing a template type parameter, find the
2334 canonical reduced type parameter.
2335 (any_template_arguments_need_structural_equality_p): New.