1 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
4 * init.c (build_default_init): Make extern.
5 * cp-tree.h (build_default_init): Declare here.
6 * pt.c (tsubst_expr): When the instantiation of the initializer of
7 a variable results in an empty list, default-initialize the
9 (tsubst_copy_and_build): When the instantiation of the initializer
10 in a new expression results in an empty initializer list,
11 default-initialize it.
13 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
15 * mangle.c (write_type): Change mangling of rvalue reference from
18 2007-08-31 Jakub Jelinek <jakub@redhat.com>
20 * decl.c (duplicate_decls): Remove duplicated line.
22 2007-08-31 Paolo Carlini <pcarlini@suse.de>
25 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
26 BOUND_TEMPLATE_TEMPLATE_PARM.
28 2007-08-31 Paolo Carlini <pcarlini@suse.de>
31 * search.c (lookup_member): Check the name argument for
34 2007-08-31 Paolo Carlini <pcarlini@suse.de>
37 * parser.c (cp_parser_trait_expr): Check rerurn value of
40 2007-08-30 Ollie Wild <aaw@google.com>
42 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
43 convert_ptrmem for pointer to member conversions.
44 (convert_to_pointer_force): Update cp_convert_to_pointer call.
45 (ocp_convert): Update cp_convert_to_pointer call.
46 * typeck.c (convert_ptrmem): Add conditional for null pointers to
48 (build_static_cast_1): Check can_convert for conversions in either
50 (get_delta_difference_1): New function.
51 (get_delta_difference): Refactor to call get_delta_difference_1.
54 2007-08-28 Paolo Carlini <pcarlini@suse.de>
57 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
58 BOUND_TEMPLATE_TEMPLATE_PARM.
60 2007-08-28 Jakub Jelinek <jakub@redhat.com>
64 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
65 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
67 2007-08-27 Jason Merrill <jason@redhat.com>
70 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
71 Look inside STMT_EXPR.
72 * semantics.c (stmt_expr_value_expr): New fn.
73 * cp-tree.h: Declare it.
76 * decl.c (groktypename): Ignore attributes applied to class type.
78 2007-08-28 Richard Guenther <rguenther@suse.de>
80 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
82 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
84 * error.c (dump_expr): Handle COMPLEX_CST.
85 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
86 (pp_cxx_expression): Likewise.
88 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
90 * decl.c (GNU_INLINE_P): New.
91 (duplicate_decls): Handle gnu_inline. Merge attributes and
92 some flags in overriding definitions.
93 (redeclaration_error_message): Handle gnu_inline.
94 (start_preparsed_function): Likewise.
96 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
98 * call.c (sufficient_parms_p): Constify.
99 * class.c (same_signature_p): Likewise.
100 * cp-gimplify.c (is_invisiref_parm,
101 cxx_omp_privatize_by_reference): Likewise.
102 * cp-objcp-common.c (has_c_linkage): Likewise.
103 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
104 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
105 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
106 num_artificial_parms_for, comp_template_parms,
107 template_parameter_pack_p, any_dependent_template_arguments_p,
108 any_type_dependent_arguments_p, any_value_dependent_elements_p,
109 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
110 zero_init_p, member_p, cp_lvalue_kind,
111 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
112 varargs_function_p, is_dummy_object, special_function_kind,
113 string_conv_p, type_unknown_p, comp_except_specs, compparms,
114 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
115 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
116 cp_has_mutable_p, at_least_as_qualified_p,
117 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
118 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
119 * except.c (nothrow_libfn_p): Likewise.
120 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
122 * pt.c (comp_template_parms, template_parameter_pack_p,
123 any_type_dependent_arguments_p, any_value_dependent_elements_p,
124 any_dependent_template_arguments_p): Likewise.
125 * repo.c (repo_export_class_p): Likewise.
126 * semantics.c (anon_aggr_type_p): Likewise.
127 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
128 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
129 varargs_function_p, member_p, is_dummy_object, pod_type_p,
130 zero_init_p, special_function_p): Likewise.
131 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
132 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
133 compparms, invalid_nonstatic_memfn_p,
134 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
135 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
136 cp_has_mutable_p, lvalue_or_else): Likewise.
138 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
140 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
141 * cp-objcp-common.c (cp_tree_size): Ditto.
142 * tree.c (cp_walk_subtrees): Ditto
143 * cp-tree.def (TINST_LEVEL): Go away.
144 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
145 move together with other non-tree structs.
146 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
147 (union lang_tree_node): Eliminate tinst_level field.
148 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
149 (current_instantiation, outermost_tinst_level): Return
150 a "struct tinst_level *".
152 * error.c (print_instantiation_partial_context): Change second
153 parameter to a "struct tinst_level *". Replace accessor macros
155 (print_instantiation_full_context): Likewise.
156 * lex.c (in_main_input_context): Likewise.
158 * pt.c (struct pending_templates): New.
159 (pending_templates, last_pending_template): Use it as a type.
160 (current_tinst_level): Change typo to "struct tinst_level *"
161 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
162 (add_pending_template): Construct a "struct pending_template".
163 Replace TINST_LEVEL accessor macros with field access.
164 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
165 (pop_tinst_level): Likewise.
166 (instantiate_pending_templates): Likewise. Factor common code used
167 when an instantiation has been done.
168 (outermost_tinst_level): Replace tree_last with loop.
169 (current_instantiation): Return a "struct tinst_level *".
171 2007-08-24 Ollie Wild <aaw@google.com>
173 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
174 * name-lookup.h (cp_binding_level): Remove vtables member.
176 2007-08-24 Richard Guenther <rguenther@suse.de>
178 * tree.c (cp_cannot_inline_tree_fn): Remove.
179 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
180 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
183 2007-08-24 Jakub Jelinek <jakub@redhat.com>
186 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
187 error_mark_node right away if build_expr_type_conversion
191 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
192 is error_mark_node rather than NULL_TREE.
193 * pt.c (check_explicit_specialization): Likewise.
196 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
197 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
199 2007-08-22 Jason Merrill <jason@redhat.com>
202 * pt.c (outermost_tinst_level): New function.
203 * lex.c (in_main_input_context): New function.
204 * cp-tree.h: Declare it.
205 * decl2.c (constrain_class_visibility): Use it to avoid warning
206 about uses of the anonymous namespace in the main input file.
208 2007-08-21 Jakub Jelinek <jakub@redhat.com>
210 * init.c (build_new_1): Use get_target_expr instead of save_expr.
212 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
215 * class.c (finish_struct_1): Warn when a class has virtual
216 functions and accessible non-virtual destructor.
218 2007-08-20 Richard Guenther <rguenther@suse.de>
222 * call.c (build_new_method_call): Convert initializer to
224 * init.c (build_aggr_init): Do not fiddle with types.
225 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
226 * except.c (build_throw): Do not drop qualifiers for the
228 * typeck.c (get_member_function_from_ptrfunc): Do not
229 fiddle with types, instead convert.
230 (build_ptrmemfunc1): Convert to the target type for
232 (gfc_trans_allocate): Convert result to target type.
233 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
234 pointer-to-member structures shall have alias set zero as well.
236 2007-08-20 Richard Guenther <rguenther@suse.de>
238 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
240 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
241 (nonstatic_local_decl_p): Likewise.
242 * tree.c (cp_auto_var_in_fn_p): Remove.
243 * decl.c (nonstatic_local_decl_p): Remove.
245 2007-08-20 Richard Guenther <rguenther@suse.de>
247 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
249 * tree.h (cp_walk_tree): New define to walk_tree_1 with
250 cp_walk_subtrees lh parameter.
251 (cp_walk_tree_without_duplicates): New define to
252 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
253 * tree.c (count_trees): Call
254 cp_walk_tree_without_duplicates.
255 (verify_stmt_tree): Call cp_walk_tree.
256 (break_out_target_exprs): Likewise.
257 (WALK_SUBTREE): Likewise.
258 * cp-gimplify.c (cp_genericize): Likewise.
259 * cp-pt.c (find_parameter_packs_r): Likewise.
260 (uses_parameter_packs): Likewise.
261 (make_pack_expansion): Likewise.
262 (check_for_bare_parameter_packs): Likewise.
263 (for_each_template_parm): Likewise.
264 * decl.c (check_default_argument): Call
265 cp_walk_tree_without_duplicates.
266 * except.c (build_throw): Likewise.
267 * decl2.c (type_visibility): Likewise.
268 * semantics.c (expand_or_defer_fn): Likewise.
269 (finalize_nrv): Call cp_walk_tree.
271 2007-08-20 Jakub Jelinek <jakub@redhat.com>
274 * init.c (build_new_1): Rename placement_var variable to placement_expr.
275 Initialize it with save_expr rather than get_temp_regvar.
277 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
280 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
283 2007-08-17 Ollie Wild <aaw@google.com>
286 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
287 declarations into appropriate slots for comparison. Fix type
290 2007-08-17 Paolo Carlini <pcarlini@suse.de>
293 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
294 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
296 2007-08-17 Paolo Carlini <pcarlini@suse.de>
299 * parser.c (cp_parser_class_head): Improve error message.
301 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
303 * pt.c (instantiate_decl): Set input_location
304 for the function end.
306 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
308 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
310 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
311 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
312 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
313 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
314 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
315 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
316 * typeck.c (cp_type_quals): Likewise.
317 * typeck2.c (cxx_incomplete_type_diagnostic,
318 cxx_incomplete_type_error): Likewise.
320 2007-08-16 Paolo Carlini <pcarlini@suse.de>
323 * pt.c (tsubst_friend_function): When check_classfn
324 returns error_mark_node likewise return it.
326 2007-08-15 Jakub Jelinek <jakub@redhat.com>
329 * typeck.c (check_return_expr): Don't NRV optimize vars in
331 * decl.c (finish_function): Comment fix.
333 2007-08-15 Paolo Carlini <pcarlini@suse.de>
336 * pt.c (push_template_decl_real): Depending on TYPE_P
337 use either TYPE_CONTEXT or DECL_CONTEXT.
339 2007-08-14 Mark Mitchell <mark@codesourcery.com>
341 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
342 constructors and destructors return this.
344 2007-08-14 Paolo Carlini <pcarlini@suse.de>
347 * decl2.c (check_classfn): Return error_mark_node in case of error;
348 in that case, do not call add_method.
349 * decl.c (start_decl): Deal with check_classfn returning
351 (grokfndecl): Likewise.
352 * pt.c (tsubst_friend_function): Likewise.
354 2007-08-14 Andrew Pinski <pinskia@gmail.com>
357 * typeck.c (build_binary_op): Disallow vector float types with
358 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
360 2007-08-11 Ian Lance Taylor <iant@google.com>
362 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
364 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
366 2007-08-10 Ollie Wild <aaw@google.com>
368 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
370 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
372 (unqualified_namespace_lookup): Fix ambiguous_decl call.
373 (lookup_using_namespace): Fix ambiguous_decl call.
374 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
376 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
378 * call.c (name_as_c_string): Use CONST_CAST.
379 * decl.c (build_decl): Likewise.
380 * parser.c (cp_parser_string_literal): Likewise.
382 2007-08-10 Paolo Carlini <pcarlini@suse.de>
385 * error.c (dump_expr): Consistently use the *_cxx_*
386 variants of the pretty-print functions.
388 2007-08-10 Paolo Carlini <pcarlini@suse.de>
391 * decl.c (check_special_function_return_type): Just error
392 on return type specified for conversion operator.
394 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
396 * typeck2.c (readonly_error): Handle general expressions.
397 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
399 2007-08-06 Dan Hipschman <dsh@google.com>
401 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
402 access function name.
404 2007-08-04 Alfred Minarik <a.minarik@aon.at>
407 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
408 * g++spec.c (lang_specific_driver): Check them.
410 2007-08-06 Paolo Carlini <pcarlini@suse.de>
413 * pt.c (template_class_depth): Fix comment; change return type
416 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
419 2007-03-26 Dirk Mueller <dmueller@suse.de>
421 * parser.c (cp_parser_member_declaration): Pedwarn
422 about stray semicolons after member declarations.
424 2007-08-02 Lee Millward <lee.millward@gmail.com>
429 * parser.c (cp_parser_asm_definition): Detect and discard asm
430 statements with invalid inputs or outputs.
431 (cp_parser_asm_operand_list): Return error mark node if any
432 of the operands are invalid. Adjust documentation.
434 2007-08-02 Nick Clifton <nickc@redhat.com>
436 * typeck.c: Change copyright header to refer to version 3 of the
437 GNU General Public License and to point readers at the COPYING3
438 file and the FSF's license web page.
439 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
440 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
441 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
442 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
443 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
444 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
445 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
446 name-lookup.h, parser.c: Likewise.
448 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
451 * call.c (magic_varargs_p): Honor the "type generic" attribute.
453 2007-07-30 Paolo Carlini <pcarlini@suse.de>
456 * semantics.c (finish_label_stmt): Reject the __label__
457 extension outside function scopes.
459 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
461 * parser.c (eof_token): Un-constify.
462 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
463 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
466 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
468 * pt.c, tree.c, typeck2.c: Fix comment typos.
470 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
471 Mark Mitchell <mark@codesourcery.com>
474 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
475 hidden due to friend declarations in local classes.
477 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
479 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
480 * cp-tree.def (DECLTYPE_TYPE): New.
481 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
482 (dump_type_prefix): Ditto.
483 (dump_type_suffix): Ditto.
484 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
485 * mangle.c (write_type): Handle DECLTYPE_TYPE.
486 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
488 (DECLTYPE_TYPE_EXPR): New.
489 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
490 (finish_declared_type): Declare.
491 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
493 (pp_cxx_type_id): Ditto.
494 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
495 (tsubst): Substitute into a DECLTYPE_TYPE node.
496 (tsubst_copy): Ditto.
497 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
499 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
500 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
501 structural equality (because we can't hash the expressions).
502 (finish_declared_type): New.
503 * lex.c (reswords): Add "decltype" keyword.
504 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
505 (cp_parser_postfix_expression): Add member_access_only_p to
506 restrict postfix expression to member access expressions.
507 (cp_parser_unary_expression): Update call to
508 cp_parser_postfix_expression to reflect new parameter.
509 (cp_parser_declared_type): New.
510 (cp_parser_simple_type_specifier): Parse decltype types.
512 2007-07-27 Mark Mitchell <mark@codesourcery.com>
515 * call.c (convert_for_arg_passing): Only widen bitfields to their
516 declared types if necessary.
518 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
520 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
523 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
525 * decl.c (typename_hash, typename_compare): Constify.
526 * mangle.c (hash_type, compare_type): Likewise.
527 * pt.c (eq_local_specializations, hash_local_specialization):
529 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
530 list_hash): Likewise.
531 * typeck2.c (pat_compare): Likewise.
533 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
535 * method.c (implicitly_declare_fn): Increase alignment if member
536 function pointer format requires it.
538 2007-07-24 Paolo Carlini <pcarlini@suse.de>
541 * typeck.c (check_return_expr): Do not pass a null argument
544 2007-07-24 Paolo Carlini <pcarlini@suse.de>
547 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
550 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
553 * typeck.c (convert_arguments): Only use default args if we have
557 * typeck.c (structural_comptypes): No need to check
558 resolve_typename_type return value here.
559 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
560 * pt.c (resolve_typename_type): Follow typename typedefs. Return
561 original type rather than error_mark_node in case of failure.
562 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
563 resolve_typename_type result check.
564 (cp_parser_direct_declarator, cp_parser_head,
565 cp_parser_constructor_declarator_p): Likewise.
567 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
569 * pt.c (template_parms_variadic_p): Remove.
570 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
572 2007-07-12 Jakub Jelinek <jakub@redhat.com>
575 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
576 argument to dump_aggr_init_expr_args instead of false.
578 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
580 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
581 canonical types; otherwise, fall back to structural type
582 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
583 internal compiler error if the canonical types are wrong.
585 2007-07-11 Paolo Carlini <pcarlini@suse.de>
588 * parser.c (cp_parser_make_indirect_declarator): When the
589 the code argument is ERROR_MARK return cp_error_declarator.
591 2007-07-09 Geoffrey Keating <geoffk@apple.com>
594 * decl.c (cxx_init_decl_processing): Don't set
595 force_align_functions_log.
596 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
597 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
598 FUNCTION_DECL, return its alignment.
600 2007-07-09 Richard Guenther <rguenther@suse.de>
602 * decl.c (start_preparsed_function): Do not promote return type.
604 2007-07-08 Paolo Carlini <pcarlini@suse.de>
607 * pt.c (unify): Never pass error_mark_node to template_decl_level.
609 2007-07-07 Mark Mitchell <mark@codesourcery.com>
612 * pt.c (resolve_overloaded_unification): Robustify. Return a
614 (type_unification_real): Adjust accordingly.
616 2007-07-06 Richard Guenther <rguenther@suse.de>
618 * init.c (build_new_1): Use the correct pointer type.
619 * typeck2.c (build_m_component_ref): Likewise.
621 2007-07-05 Mark Mitchell <mark@codesourcery.com>
624 * init.c (build_zero_init): Always build an initializer for
626 * typeck2.c (build_functional_cast): Use build_zero_init.
629 * init.c (build_new_1): Always pass the allocation function to
630 build_op_delete_call.
631 * call.c (build_op_delete_call): Handle operator delete with a
632 variable-argument list. Do not issue an error when no matching
633 deallocation function is available for a new operator.
636 * cp-tree.h (any_value_dependent_elements_p): Declare it.
637 * decl.c (value_dependent_init_p): New function.
638 (cp_finish_decl): Use it.
639 * pt.c (value_dependent_expression_p): Use
640 any_value_dependent_elements_p.
641 * parser.c (cp_parser_primary_expression): Add comment about
642 treating dependent qualified names as integral
643 constant-expressions.
645 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
647 * decl.c (build_ptrmemfunc_type): Always use structural equality
648 tests when comparing pointer-to-member-function types, because the
649 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
652 2007-07-03 Mark Mitchell <mark@codesourcery.com>
654 * init.c (build_new): Tweak comment.
656 2007-06-29 Dave Brolley <brolley@redhat.com>
659 * parser.c (cp_parser_new_type_id): Don't reduce a named array
660 type to its base type and number of elements here.
661 * init.c (build_new): Call complete_type_or_else to ensure that the
662 type is complete and to issue a diagnostic if it is not.
663 (build_new_1): Don't call complete_type_or_else here.
665 2007-07-03 Richard Guenther <rguenther@suse.de>
668 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
671 2007-07-02 Simon Baldwin <simonb@google.com>
673 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
674 for inner-style nested forward declarations that don't declare
677 2007-07-02 Jakub Jelinek <jakub@redhat.com>
680 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
681 DECL_P in not a variable and appears more than once error messages.
683 2007-07-01 Ollie Wild <aaw@google.com>
685 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
686 (select_decl): Remove function.
687 (unqualified_namespace_lookup): Populate binding by calling
688 ambiguous_decl. Remove select_decl call.
689 (lookup_qualified_name): Remove select_decl call.
690 * decl.c (lookup_and_check_tag): Check for ambiguous references.
691 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
692 generation when name lookup is ambiguous.
694 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
697 * init.c (build_new_1): Use structural equality on the copy of the
700 2007-06-28 Geoffrey Keating <geoffk@apple.com>
702 * decl2.c (determine_visibility): Implement
703 flag_visibility_ms_compat effect on type info.
704 * decl.c (cxx_init_decl_processing): Implement
705 global effect of flag_visibility_ms_compat.
707 2007-06-28 Geoffrey Keating <geoffk@apple.com>
709 * decl2.c (start_objects): Mark constructor-running function
712 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
715 * decl.c (grokdeclarator): Reset friendp for member functions declared
716 friend of their own class.
718 2007-06-23 Mark Mitchell <mark@codesourcery.com>
720 * decl2.c (determine_visibility): Don't look for dllexport here.
721 (determine_visibility_from_class): Tidy.
723 2007-06-18 Simon Baldwin <simonb@google.com>
726 * parser.c (cp_parser_single_declaration): Added check for storage
727 class other than sc_none in parsed declaration, and a flag to indicate
728 if the call is part of an explicit template specialization parse.
729 * (cp_parser_explicit_specialization): Specialization check flag added
730 to call to cp_parser_single_declaration(), set true.
731 * (cp_parser_template_declaration_after_export): Specialization check
732 flag added to call to cp_parser_single_declaration(), set false.
733 * pt.c (check_explicit_specialization): Added code to copy visiblity
734 and linkage from the templated function to the explicit specialization.
736 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
738 * typeck.c (build_binary_op): For templates build the
739 expression in pieces to avoid the assert in build2_stat.
740 (get_member_function_from_ptrfunc):
741 Change over to using POINTER_PLUS_EXPR and convert
742 the second operand to sizetype.
743 * typeck2.c (build_m_component_ref): Likewise.
744 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
745 instead of PLUS_EXPR for pointers.
746 (build_new_1): Likewise.
747 (build_vec_delete_1): Likewise.
748 (build_vec_delete): Likewise.
749 * class.c (build_base_path): Likewise.
750 (build_base_path): Likewise.
751 (convert_to_base_statically): Likewise.
752 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
753 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
754 instead of PLUS_EXPR.
755 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
756 instead of PLUS_EXPR for pointers.
757 * call.c (build_special_member_call): Likewise.
758 * rtti.c (build_headof): Likewise.
759 Use sizetype instead of ptrdiff_type_node.
760 (tinfo_base_init): Create a POINTER_PLUS_EXPR
761 instead of PLUS_EXPR for pointers.
762 * except.c (expand_start_catch_block): Do a
763 NEGATIVE and then a POINTER_PLUS_EXPR instead
765 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
766 PLUS_EXPR on pointer types over to use
767 POINTER_PLUS_EXPR and remove the conversion
768 to the pointer types.
769 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
770 adding to a pointer type. Use size_int instead of
771 ssize_int. Convert the index to sizetype before
772 adding it to the pointer.
774 2007-06-15 Mark Mitchell <mark@codesourcery.com>
776 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
777 (DECL_ANON_UNION_VAR_P): New macro.
778 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
779 than DECL_VAR_MARKED_P, to keep track of which variables we have
781 * decl.c (redeclaration_error_message): Complain about redeclaring
782 anonymous union members at namespace scope.
783 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
785 2007-06-14 Geoff Keating <geoffk@apple.com>
787 * decl2.c (determine_visibility): Ensure that functions with
788 hidden types as parameters are hidden.
791 * decl2.c (determine_visibility): Remove duplicate code for
794 2007-06-12 Ian Lance Taylor <iant@google.com>
797 * init.c (avoid_placement_new_aliasing): New static function.
798 (build_new_1): Call it.
800 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
802 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
803 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
805 2007-06-08 Jakub Jelinek <jakub@redhat.com>
808 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
809 on init, the non-decl cond operand and increment value.
811 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
814 * decl.c (check_initializer): Report an error when a brace enclosed
815 initializer is used for a non-aggregate type in C++98.
816 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
818 (grokdeclarator): Likewise.
819 (move_fn_p): Likewise.
820 * typeck.c (check_return_expr): Likewise.
821 * call.c (reference_binding): Likewise.
822 * error.c (cp_cpp_error): Likewise.
823 * pt.c (check_default_tmpl_args): Likewise.
825 * lex.c (init_reswords): Likewise.
826 * parser.c (p_parser_primary_expression): Likewise.
827 (TOKEN_PRECEDENCE): Likewise.
828 (cp_parser_init_declarator): Likewise.
829 (cp_parser_ptr_operator): Likewise.
830 (cp_parser_parameter_declaration): Likewise.
831 (cp_parser_enclosed_template_argument_list): Likewise.
832 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
833 (cp_parser_next_token_ends_template_argument_p): Likewise.
835 2007-06-04 Simon Baldwin <simonb@google.com>
837 * decl.c (grokdeclarator): Readability change. Moved case labels
838 into direct switch statement scope.
840 2007-06-04 Paolo Carlini <pcarlini@suse.de>
842 * call.c (convert_like_real): Remove pointless code.
844 2007-05-31 Mark Mitchell <mark@codesourcery.com>
846 * decl.c (get_atexit_fn_ptr_type): New function.
847 (get_atexit_node): Use it.
848 (start_cleanup_fn): Likewise.
849 (register_dtor_fn): Use the object's destructor, instead of a
850 separate cleanup function, where possible.
851 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
852 (atexit_fn_ptr_type_node): New macro.
853 * decl2.c (build_cleanup): Use build_address.
855 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
857 * typeck.c (build_binary_op): Include types in error.
859 2007-05-31 Jakub Jelinek <jakub@redhat.com>
862 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
863 needs runtime initialization.
865 2007-05-31 Paolo Carlini <pcarlini@suse.de>
868 * semantics.c (finish_trait_expr): Complete the types.
870 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
871 Douglas Gregor <doug.gregor@gmail.com>
872 Pedro Lamarao <pedro.lamarao@mndfck.org>
873 Howard Hinnant <howard.hinnant@gmail.com>
877 * typeck.c (comptypes): Don't consider rvalue and lvalue
878 reference types to be equivalent.
879 (check_return_expr): Move from certain lvalues when returning
881 * decl.c (grokdeclarator): Implement reference collapsing.
882 (copy_fn_p): Don't consider constructors taking rvalue references
883 to be copy constructors.
885 * call.c (conversion): New "rvaluedness_matches_p" member.
886 (convert_class_to_reference): Require reference type as first
887 parameter instead of base type.
888 (reference_binding): Add logic to handle rvalue references.
889 (implicit_conversion): Update inaccurate comment.
890 (convert_like_real): Disable creation of temporaries that are
891 impossible to initialize for types with move constructors.
892 (build_over_call): Elide move constructors when possible.
893 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
894 (maybe_handle_ref_bind): Return conversion instead of type node.
895 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
896 determine preferred conversion sequences.
897 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
898 (LOOKUP_PREFER_RVALUE): New.
899 (DECL_MOVE_CONSTRUCTOR_P): New.
900 (struct cp_declarator): Add "reference" member for reference
901 types, with new "rvalue_ref" flag.
902 (cp_build_reference_type): Declare.
903 (move_fn_p): Declare.
904 * error.c (dump_type_prefix): Format rvalue reference types
905 correctly in error messages.
906 * except.c (build_throw): Move from certain lvalues when
908 * mangle.c (write_type): Mangle rvalue references differently
909 than regular references.
910 * parser.c (make_reference_declarator): Add boolean parameter for
912 (cp_parser_make_indirect_declarator): New.
913 (cp_parser_new_declarator_opt): Call
914 cp_parser_make_indirect_declarator.
915 (cp_parser_conversion_declarator_opt): Ditto.
916 (cp_parser_declarator): Ditto.
917 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
919 * pt.c (tsubst): Implement reference collapsing.
920 (maybe_adjust_types_for_deduction): Implement special template
921 parameter deduction rule for rvalue references.
922 (type_unification_real): Update calls to
923 maybe_adjust_types_for_deduction.
924 (try_one_overload): Ditto.
925 (unify_pack_expansion): Ditto.
926 * tree.c (lvalue_p_1): Handle rvalue reference types.
927 (cp_build_reference_type): New.
929 2007-05-30 Jakub Jelinek <jakub@redhat.com>
932 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
933 variables that need runtime initialization.
935 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
938 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
939 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
940 case POSTDECREMENT_EXPR>): Return the error_mark_node
941 if either the real or imaginary parts would an
944 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
945 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
948 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
949 token is a closing brace, false if there are no tokens left.
950 (cp_parser_namespace_alias_definition): Only consume the next token if
951 it is a closing brace.
953 * parser.c (cp_parser_class_specifier): Likewise.
955 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
957 * semantics.c (finish_member_declaration): Fix a typo in the
960 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
972 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
973 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
974 * pt.c (check_for_bare_parameter_packs): Return bool indicated
975 whether everything was okay. Fix indentation.
976 (push_template_decl_real): Check for bare parameter packs in
977 function parameters; where errors occur, mark the parameter types
978 with ERROR_MARK_NODEs to avert ICEs.
979 (coerce_template_parameter_pack): New.
980 (coerce_template_parms): Moved parameter pack coercion into
981 coerce_template_parameter_pack, and permit it anywhere in the
982 template parameter list (not just at the end). Parameter and
983 argument indices can vary (somewhat) separately now, so add
984 PARM_IDX and ARG_IDX.
985 (fn_type_unification): Don't set an argument pack as incomplete if
986 no argument pack was deduced.
987 (type_unification_real): If a type parameter is a parameter pack
988 and has not otherwise been deduced, it will be deduced to an empty
990 (more_specialized_fn): Use the actual lengths of the argument
991 lists when comparing against expansions.
992 * semantics.c (finish_member_declaration): If a field's type has
993 bare parameter packs, error and set its type to ERROR_MARK_NODE.
995 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
998 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1000 2007-05-22 Ollie Wild <aaw@google.com>
1002 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1003 (unqualified_namespace_lookup): Adds check for hidden types.
1005 2007-05-22 Ollie Wild <aaw@google.com>
1007 * decl.c (duplicate_decls): Verify namespace names are unique.
1009 2007-05-21 Mark Mitchell <mark@codesourcery.com>
1011 * decl.c (cxx_maybe_build_cleanup): Handle
1012 __attribute__((cleanup)).
1014 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1016 * cvt.c (cp_convert_and_check): Don't check warnings if the
1019 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1021 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1023 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1026 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1027 type only if is a class type (5.2.8/4).
1029 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1031 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1032 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1033 c_common_unsigned_type.
1035 2007-05-11 Silvius Rus <rus@google.com>
1037 * cp/typeck.c (build_indirect_ref): Add call to
1038 strict_aliasing_warning.
1039 (build_reinterpret_cast_1): Condition call to
1040 strict_aliasing_warning.
1042 2007-05-11 Jan Hubicka <jh@suse.cz>
1044 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1045 * decl2.c (start_objects): ctors and dtors are no longer public.
1046 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1048 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1050 * typeck.c (build_unary_op): Remove code that used to
1051 handle non lvalue increments/decrements.
1053 2007-05-07 Mike Stump <mrs@apple.com>
1055 * parser.c (check_empty_body): Add.
1056 (cp_parser_iteration_statement): Add call to check_empty_body.
1058 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1061 * mangle.c (write_mangled_name): Mangle static variable names.
1062 (write_unqualified_name): Use local-source-name for
1063 namespace-scope static variables.
1065 2007-05-04 Dirk Mueller <dmueller@suse.de>
1067 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1070 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1073 * decl2.c (constrain_class_visibility):
1074 Use strip_pointer_or_array_types instead of strip_array_types.
1076 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1079 * decl.c (reshape_init_r): Don't reshape the first element if it
1080 is a pointer to member function.
1082 2007-04-27 Simon Baldwin <simonb@google.com>
1084 * decl.c (grokparms): Changed message format from %qD to %qE.
1086 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1088 * error.c (maybe_warn_variadic_templates): Variadic templates are
1089 now in C++0x, so only warn about them in C++98 mode.
1091 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1094 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1095 integeral types from vectors types.
1097 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1100 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1101 for type dependent OMP_CLAUSE_DECLs.
1103 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1106 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1107 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1108 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1109 * init.c (build_zero_init): Adjust, as
1110 COMPLEX_TYPE is now a SCALAR_TYPE.
1111 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1112 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1114 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1116 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1117 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1118 (trait_expr_value): Adjust.
1120 2007-04-23 Simon Baldwin <simonb@google.com>
1122 * decl.c (grokparms): Added new error for duplicate function
1123 parameters names in function prototypes, to match gcc behavior.
1125 2007-04-23 Jan Hubicka <jh@suse.cz>
1127 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1130 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1132 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1133 instead of checking GIMPLE_STMT_P in chain_next.
1135 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1138 * call.c (convert_for_arg_passing): Convert bitfields to their
1141 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1144 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1146 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1149 * cp/decl2.c (constrain_class_visibility):
1150 Do not warn about the use of anonymous namespace in the main input file.
1152 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1154 * cp-tree.h (current_template_parms): Fix typo in comment.
1156 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1158 * cp-tree.h, error.c: Fix comment typos.
1160 2007-04-13 Jason Merrill <jason@redhat.com>
1163 * call.c (reference_binding): Add c_cast_p parm. If true,
1164 add quals to TO as needed to make it reference-compatible.
1166 2007-04-11 Jan Hubicka <jh@suse.cz>
1168 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1169 that we are not processing template_decl.
1171 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1174 * class.c (build_base_path): Ensure that the converted pointer has
1175 the same cv-qualification as the input.
1177 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1179 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1181 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1183 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1185 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1186 * tree.c (cp_add_pending_fn_decls): Remove.
1187 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1189 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1191 Revert change removing staticp.
1193 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1195 * cp-objcp-common.c (cxx_staticp): Remove.
1196 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1197 * cp-tree.h (cxx_staticp):
1199 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1201 * class.c (check_for_override): Don't remove dllmport attribute
1204 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1207 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1208 type issue error and return early.
1210 2007-03-30 Jason Merrill <jason@redhat.com>
1213 * typeck.c (cp_type_readonly): New fn.
1214 * cp-tree.h: Declare it.
1215 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1216 (cp_finish_decl): Not here.
1218 2007-03-31 Richard Guenther <rguenther@suse.de>
1220 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1223 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1228 * parser.c (declarator_can_be_parameter_pack): New.
1229 (cp_parser_template_parameter): Only parse the `...' if the
1230 declarator can be a parameter pack.
1231 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1233 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1234 types (they could be used as array bounds).
1235 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1236 (tsubst_pack_expansion): Handle failure to expand parameter
1239 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1242 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1243 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1244 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1245 (CLASS_TYPE_NON_UNION_P): Add.
1246 (struct lang_type_class): Add has_complex_dflt.
1247 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1248 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1249 * cp-tree.def: Add TRAIT_EXPR.
1250 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1251 * lex.c (struct resword): Add __has_nothrow_assign,
1252 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1253 __has_trivial_constructor, __has_trivial_copy,
1254 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1255 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1256 __is_pod, __is_polymorphic, __is_union.
1257 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1258 (cp_parser_trait_expr): New.
1259 * semantics.c (finish_trait_expr, trait_expr_value
1260 classtype_has_nothrow_copy_or_assign_p): New.
1261 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1263 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1264 * class.c (check_bases, check_field_decl, check_bases_and_members):
1265 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1266 * pt.c (uses_template_parms, tsubst_copy_and_build,
1267 value_dependent_expression_p, type_dependent_expression_p): Deal with
1269 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1271 2007-03-29 Richard Guenther <rguenther@suse.de>
1273 * tree.c (cp_walk_subtrees): Do not set input_location.
1275 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1278 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1281 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1283 * parser.c (struct cp_parser): Update comment for
1284 greater_than_is_operator_p.
1285 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1286 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1287 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1288 !GREATER_THAN_IS_OPERATOR_P.
1289 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1290 `>>' operators that will become two `>' tokens in C++0x.
1291 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1292 mode, allowing it to terminate default arguments.
1293 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1294 `>>' like two consecutive `>' tokens.
1295 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1296 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1297 ends a template argument.
1299 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1301 * decl.c (redeclaration_error_message): Complain when redeclaring
1302 a friend function with default template arguments (C++0x mode only).
1303 * cp-tree.h (check_default_tmpl_args): Declare.
1304 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1305 template arguments in function templates. Add support for checking
1306 the default template arguments of friend templates.
1307 (push_template_decl_real): Fix call to check_default_tmpl_args.
1308 (type_unification_real): If a template parameter has not been
1309 deduced but provides a default template argument, substitute into
1310 that default template argument.
1311 * parser.c (cp_parser_init_declarator): When declaring (but not
1312 defining!) a function template in C++0x mode, check for default
1315 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1318 * decl.c (grokdeclarator): Deal with cv-qualified function type
1319 typedefs in the same way for member and non-member functions.
1321 2007-03-26 Dirk Mueller <dmueller@suse.de>
1323 * parser.c (cp_parser_member_declaration): Pedwarn
1324 about stray semicolons after member declarations.
1326 2007-03-26 Paolo Carlini <pcarlini@suse.de>
1329 * pt.c (instantiate_decl): Set in_system_header.
1331 2007-03-22 Mark Mitchell <mark@codesourcery.com>
1333 * cp-tree.h (current_tempalte_parms): Improve documentation.
1334 * pt.c (current_template_args): Likewise.
1337 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1338 not consume tokens when failing.
1340 2007-03-22 Jim Wilson <wilson@specifix.com>
1341 Mark Mitchell <mark@codesourcery.com>
1344 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
1345 consistent with FROM.
1347 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1349 * error.c (dump_expr): Handle dependent names that designate types.
1350 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1352 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
1354 * cp-tree.def, parser.c, pt.c: Fix comment typos.
1356 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1358 * cvt.c (cp_convert_and_check) : Define.
1359 * cp-tree.h (cp_convert_and_check): Declare.
1360 * call.c (convert_conversion_warnings): Rename to
1361 conversion_null_warnings. The warning for floating-point to
1362 integer is handled by convert_and_check in convert_like_real.
1363 (convert_like_real): convert_conversion_warnings was renamed as
1364 conversion_null_warnings.
1365 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1366 overflow and changes of value during conversion.
1368 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1371 * parser.c (cp_parser_statement): If 'namespace' is found, this
1372 only can be a namespace alias definition, so parse it now.
1373 (cp_parser_namespace_alias_definition): if we find an open brace
1374 instead of '=', then this is actually a misplaced namespace
1377 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1380 * decl.c (cxx_init_decl_processing): Move command-line options
1381 processing to c-opts.c.
1383 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
1385 * ptree.c (cxx_print_type): Use formatting markup for integers
1386 when printing template parameter index/level/orig level.
1387 (cxx_print_xnode): Ditto.
1388 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1389 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1390 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1392 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1393 rather than a HOST_WIDE_INT.
1394 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1395 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1397 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1398 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1399 IN_BASE_INITIALIZER bool bitfields.
1400 (struct cp_declarator): Make KIND a 4-bit field. Make
1401 PARAMETER_PACK_P a bool bitfield just after KIND.
1402 * pt.c (uses_parameter_packs): Destroy the pointer set.
1403 (make_pack_expansion): Ditto.
1404 (check_for_bare_parameter_packs): Ditto.
1405 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1407 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
1410 * call.c (convert_default_arg): Instead of copying the node,
1413 2007-03-15 Dirk Mueller <dmueller@suse.de>
1416 * call.c (convert_conversion_warnings): New..
1417 (convert_like_real): .. factored out from here.
1418 (convert_conversion_warnings): Add warning about
1419 false being converted to NULL in argument passing.
1421 2007-03-14 Dirk Mueller <dmueller@suse.de>
1423 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1424 (finish_do_body): Warn about empty body in do/while statement.
1426 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1428 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1430 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1433 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1436 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
1438 * cp/repo.c (init_repo): Initialize random_seed saved options.
1439 (finish_repo): Adjust.
1441 2007-03-13 Mark Mitchell <mark@codesourcery.com>
1444 * Make-lang.in (doc/g++.1): Use $< to specify the location from
1447 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
1449 * decl.c (compute_array_index_type): New warning flag warn_vla.
1451 2007-03-12 Mark Mitchell <mark@codesourcery.com>
1454 * call.c (convert_default_arg): Copy non-constant arguments.
1456 2007-03-11 Mark Mitchell <mark@codesourcery.com>
1459 * parser.c (cp_parser_postfix_expression): Disallow compound
1460 literals in constant expressions.
1463 * semantics.c (finish_typeof): Use unlowered_expr_type.
1465 2007-03-10 Mark Mitchell <mark@codesourcery.com>
1468 * cp-tree.h (unlowered_expr_type): New function.
1469 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1470 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1471 (unlowered_expr_type): New function.
1472 (build_unary_op): Disallow predecrements of bool bitfields.
1473 * call.c (build_conditional_expr): Use unlowered_expr_type.
1474 * pt.c (type_unification_real): Likewise.
1476 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
1479 * typeck.c (check_return_expr): Check for bare parameter packs.
1480 (comptypes): Compare template parameter packs and
1481 type pack expansions.
1482 * decl.c (grokdeclarator): Deal with the declaration of function
1484 (grokparms): Verify that the (optional) function parameter pack is
1485 at the end of the parameter list.
1486 (xref_basetypes): Handle pack expansions in the base class.
1487 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1488 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1489 (NONTYPE_ARGUMENT_PACK): New.
1490 (TYPE_PACK_EXPANSION): New.
1491 (EXPR_PACK_EXPANSION): New.
1492 (ARGUMENT_PACK_SELECT): New.
1493 * cp-objcp-common.c (cp_tree_size): Compute size of
1494 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1495 ARGUMENT_PACK_SELECT.
1496 * error.c (dump_template_argument): Print template argument packs.
1497 (dump_template_argument_list): Ditto.
1498 (dump_template_parameter): Dump `...' for template type parameter
1500 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1501 (dump_parameters): Print function parameter packs.
1502 (dump_template_parms): Print template argument packs.
1503 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1504 (maybe_warn_variadic_templates): New.
1505 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1506 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1507 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1509 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1510 (write_template_arg): Write argument packs as separate arguments.
1511 * cp-tree.h (struct template_parm_index_s): Add flag that
1512 indicates that the template parameter is actually a parameter
1514 (struct tree_argument_pack_select): New.
1515 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1516 (union lang_tree_node): Add argument_pack_select.
1517 (FUNCTION_PARAMETER_PACK_P): New.
1518 (PACK_EXPANSION_P): New.
1519 (PACK_EXPANSION_PATTERN): New.
1520 (SET_PACK_EXPANSION_PATTERN): New.
1521 (PACK_EXPANSION_PARAMETER_PACKS): New.
1522 (ARGUMENT_PACK_P): New.
1523 (ARGUMENT_PACK_ARGS): New.
1524 (SET_ARGUMENT_PACK_ARGS): New.
1525 (ARGUMENT_PACK_INCOMPLETE_P): New.
1526 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1527 (TEMPLATE_PARM_PARAMETER_PACK): New.
1528 (TEMPLATE_TYPE_PARAMETER_PACK): New.
1529 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1530 (ARGUMENT_PACK_SELECT_INDEX): New.
1531 (ARGUMENT_PACK_SELECT_ARG): New.
1532 (struct cp_declarator): Add parameter_pack_p flag.
1533 (maybe_warn_variadic_templates): Declare.
1534 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1535 indicate a template parameter pack.
1536 (uses_parameter_packs): Declare.
1537 (template_parameter_pack_p): Declare.
1538 (template_parms_variadic_p): Declare.
1539 (make_pack_expansion): Declare.
1540 (check_for_bare_parameter_packs): Declare.
1541 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1542 sizeof... expressions.
1543 (pp_cxx_expression): Print pack expansions and non-type argument
1545 (pp_cxx_exception_specification): Print pack expansions.
1546 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1547 (pp_cxx_ctor_initializer): Print pack expansions.
1548 (pp_cxx_type_id): Print pack expansions.
1549 (pp_cxx_template_argument_list): Print argument packs.
1550 (pp_cxx_template_parameter): Print ellipsis for template parameter
1552 * pt.c (comp_template_parms): Compare template parameter packs.
1553 (template_parameter_pack_p): New.
1554 (template_parms_variadic_p): New.
1555 (template_args_variadic_p): New.
1556 (make_ith_pack_parameter_name): New.
1557 (struct find_parameter_pack_data): New.
1558 (find_parameter_packs_r): New.
1559 (uses_parameter_packs): New.
1560 (make_pack_expansion): New.
1561 (check_for_bare_parameter_packs): New.
1562 (expand_template_argument_pack): New.
1563 (reduce_template_parm_level): Propagate parameter pack flag.
1564 (process_template_parm): Add is_parameter_pack parameter to state
1565 when the parameter is actually a parameter pack. Create template
1566 parameter packs when is_parameter_pack is true.
1567 (current_template_args): The argument for a template parameter
1568 pack is an argument pack containing a single pack expansion.
1569 (process_partial_specialization): When checking that non-type
1570 argument expressions do not involve template parameters, loop over
1571 the arguments in argument packs separately.
1572 (push_template_decl_real): Check that the type of the declaration
1573 does not have any bare parameter packs. Check that primary
1574 templates have no more than one parameter pack, and that it comes
1575 at the end of the template parameter list.
1576 (convert_template_argument): Handle coercions for pack expansion
1577 expressions by coercing the pattern then rebuilding the expansion.
1578 (coerce_template_parms): When coercing the arguments for a
1579 variadic template, pack "extra" arguments into an argument pack.
1580 (coerce_template_template_parms): Cannot coerce between parameter
1581 packs and non-pack parameters.
1582 (template_args_equal): Compare PACK_EXPANSION_P expressions.
1583 (comp_template_args): Expand all template arguments packs before
1584 comparing template argument lists.
1585 (mangle_class_name_for_template): Make argument packs as separate
1587 (for_each_template_parm_r): No need to handle BASELINK.
1588 (instantiate_class_template): Handle pack expansions in the base
1590 (tsubst_pack_expansion): New.
1591 (tsubst_template_args): Handle substitutions of argument packs and
1592 pack expansion into template argument lists.
1593 (tsubst_decl): Expand function parameter packs into separate
1594 function parameters.
1595 (tsubst_arg_types): Expand a type pack expansion into separate
1597 (tsubst_exception_specification): Handle pack expansions in
1598 exception specifiers.
1599 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1600 replacing a template parameter with its argument. If we encounter
1601 a substitution for an argument pack, just return the parameter
1603 (tsubst_copy): sizeof(X...) returns the number of elements in
1604 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1605 PARM_DECL is a parameter pack.
1606 (tsubst_expr): Expression pack expansions and argument packs
1607 cannot show up here; they will all be handled through function
1608 calls, sizeof, and template argument lists.
1609 (tsubst_copy_and_build): sizeof(X...) returns the number of
1610 elements in parameter pack X. Handle pack expansions in TREE_LIST
1611 and CONSTRUCTOR nodes.
1612 (fn_type_unification): Handle "incomplete" explicit template
1613 argument lists that specify some of the arguments for a template
1615 (type_unification_real): Unify arguments against pack expansions.
1616 (template_parm_level_and_index): New, helper function.
1617 (unify_pack_expansion): New.
1618 (unify): Unify argument packs on an argument-by-argument basis,
1619 handling variadic argument packs as well.
1620 (more_specialized_fn): Handle unification of function parameter
1621 packs. All things being equal, prefer non-variadic function
1622 templates to variadic function templates.
1623 (more_specialized_class): Prefer the variadic class template
1624 partial specialization that binds fewer arguments to a parameter
1626 (regenerate_decl_from_template): Expand function parameter packs
1627 into separate parameters.
1628 (instantiate_decl): Ditto.
1629 (tsubst_initializer_list): Handle pack expansions for base-class
1631 (dependent_type_p_r): Determine dependent types in argument packs
1632 and pack expansions.
1633 (value_dependent_expression_p): Determine value-dependence of
1634 non-type argument packs.
1635 (dependent_template_arg_p): Handle argument packs.
1636 * semantics.c (finish_cond): Check for bare parameter packs.
1637 (finish_expr_stmt): Ditto.
1638 (finish_for_expr): Ditto.
1639 (finish_switch_cond): Ditto.
1640 (finish_mem_initializers): Ditto.
1641 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1643 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1644 * parser.c (make_declarator): Declarator is not an expansion.
1645 (make_pointer_declarator): Transfer parameter pack flag to outer
1647 (make_reference_declarator): Ditto.
1648 (make_ptrmem_declarator): Ditto.
1649 (make_call_declarator): Ditto.
1650 (make_array_declarator): Ditto.
1651 (cp_parser_postfix_expression): Allow pack expansion expressions
1652 in the argument list for a call expression.
1653 (cp_parser_parenthesized_expression_list): Add new parameter
1654 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1655 into separate arguments."
1656 (cp_parser_new_placement): Allow pack expansion expressions.
1657 (cp_parser_new_initializer): Ditto.
1658 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1659 base-class initializer expansion.
1660 (cp_parser_mem_initializer): Ditto.
1661 (cp_parser_template_parameter_list): Keep track of whether the
1662 template parameter is a template parameter pack.
1663 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1664 template parameter pack.
1665 (cp_parser_type_parameter): Ditto.
1666 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1668 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1669 this declarator is a parameter pack.
1670 (cp_parser_parameter_declaration): The ellipsis does not end the
1671 parameter declaration, because it might be a parameter pack. Parse
1672 the ellipsis to indicate a parameter pack.
1673 (cp_parser_initializer): Allow pack expansions.
1674 (cp_parser_initializer_list): Allow ellipsis to create an
1675 initializer expansion.
1676 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1678 (cp_parser_type_id_list): Allow ellipsis to create an exception
1679 specifier expansion.
1680 (cp_parser_attribute_list): Don't allow pack expansions.
1681 (cp_parser_functional_cast): Allow pack expansions.
1682 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1683 compute the length of a parameter pack.
1684 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1685 end a template argument.
1686 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1687 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1690 2007-03-09 Dirk Mueller <dmueller@suse.de>
1692 * cp/call.c (build_new_op): Call warn_logical_operator.
1694 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1697 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1700 * pt.c (any_template_arguments_need_structural_equality_p):
1703 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1705 * decl.c (grokdeclarator): Disable warnings for anonymous
1708 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1710 * typeck2.c (readonly_error): Always emit a hard error.
1711 Remove last argument.
1712 * cp-tree.h (readonly_error): Adjust prototype.
1713 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1714 * typeck.c (build_unary_op): Likewise.
1715 (build_modify_expr): Likewise.
1717 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1720 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1722 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1725 * parser.c (struct cp_parser): New IN_IF_STMT.
1726 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1727 returning if parsing the body of an 'if' statement or issuing an
1728 error and continuing.
1729 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1731 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1733 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1736 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1739 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1741 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1742 Objective-C++. Don't exit early if -shared-libgcc needs to be
1745 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1747 * typeck.c (common_base_type): Delete unused function.
1749 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1751 * Make-lang.in: Add dummy lang.install-pdf target.
1753 2007-03-01 Simon Baldwin <simonb@google.com>
1756 * decl.c (check_tag_decl): Added new warning for typedef ignored
1757 when it precedes an otherwise valid non-typedef declaration.
1759 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1761 * typeck.c (build_function_call): Store converted arguments
1762 in a stack-allocated array instead of building a list.
1763 (convert_arguments): Store arguments in the array passed in as an
1764 argument, and return the actual number of arguments.
1765 * call.c (build_call): Delete, and replace with...
1766 (build_call_n, build_call_a): New.
1767 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1768 (build_over_call): Store converted arguments in a stack-allocated
1769 array instead of building a list.
1770 (build_cxx_call): Pass arguments in an array instead of as a list.
1771 (build_java_interface_fn_ref): Rewrite to avoid constructing
1773 * tree.h: Update declarations to reflect above changes.
1774 * method.c (use_thunk): Use a stack-allocated array to hold
1775 the arguments instead of a list.
1776 * rtti.c (throw_bad_cast): Update call to cxx_call.
1777 (throw_bad_typeid): Likewise.
1778 (build_dynamic_cast_1): Likewise.
1779 * init.c (build_builtin_delete_call): Use build_call_n.
1780 * decl.c (expand_static_init): Likewise.
1781 * except.c (cp_protect_cleanup_actions): Likewise.
1782 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1783 (gimplify_must_not_throw_expr): Likewise.
1784 (cxx_omp_apply_fn): Use build_call_a.
1786 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1788 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1789 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1791 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1793 * cp-tree.h (static_ctors): Remove.
1794 * cp-tree.h (static_dtors): Likewise.
1795 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1796 refactoring of tree_map hierarchy.
1797 (decl_shadowed_for_var_insert): Likewise.
1798 * semantics.c (expand_body): Use c_expand_body.
1799 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1800 * decl2.c (static_ctors): Remove.
1801 (static_dtors): Likewise.
1802 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1803 objc_generate_static_init_call. Do not call static_[cd]tors.
1804 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1806 (cp_write_global_declarations): Likewise.
1808 2007-02-23 Richard Guenther <rguenther@suse.de>
1810 * class.c (note_name_declared_in_class): Make declaration
1811 changes meaning a pedwarn.
1813 2007-02-22 Michael Matz <matz@suse.de>
1816 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1817 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1818 dump_function_decl): Guard emitting outer scopes by new flag.
1819 * cp-lang.c (cxx_dwarf_name): New function.
1820 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1821 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1823 (push_template_decl_real, lookup_template_class): Remove calls
1826 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1828 * call.c (build_new_method_call): Ensure that explicit calls of
1829 destructors have type "void".
1831 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1833 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1834 and -Walways-true with -Waddress.
1835 * cvt.c (convert_to_void): Replace unconditional warning with
1838 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1840 * decl.c, tree.c: Fix comment typos.
1842 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1845 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1846 statement expression if we had an error mark node.
1848 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1849 Brooks Moses <brooks.moses@codesourcery.com>
1850 Lee Millward <lee.millward@codesourcery.com>
1852 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1853 Change class to tcc_vl_exp.
1855 * call.c (build_call): Use build_call_list instead
1857 (build_over_call): Likewise.
1858 (build_new_method_call): Use build_min_non_dep_call_list
1859 instead of build_min_non_dep.
1861 * error.c (dump_call_expr_args): New function.
1862 (dump_aggr_init_expr_args): New function.
1863 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1864 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1866 * cvt.c (convert_to_void): Use build_call_array instead
1867 of build3; use new AGGR_INIT_EXPR accessor macros.
1869 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1870 instead of TREE_CODE_LENGTH.
1872 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1873 AGGR_INIT_EXPR accessor macros.
1875 * cp-gimplify.c (cp_gimplify_init_expr): Use
1876 AGGR_INIT_EXPR_SLOT to set the slot operand.
1878 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1879 (AGGR_INIT_EXPR_SLOT): New macro.
1880 (AGGR_INIT_EXPR_ARG): New macro.
1881 (aggr_init_expr_nargs): New macro.
1882 (AGGR_INIT_EXPR_ARGP): New macro.
1883 (aggr_init_expr_arg_iterator): New.
1884 (init_aggr_init_expr_arg_iterator): New.
1885 (next_aggr_init_expr_arg): New.
1886 (first_aggr_init_expr_arg): New.
1887 (more_aggr_init_expr_args_p): New.
1888 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1889 (stabilize_aggr_init): New declaration.
1890 (build_min_non_dep_call_list): Likewise.
1892 * tree.c (process_aggr_init_operands): New function.
1893 (build_aggr_init_array) New function.
1894 (build_cplus_new): Update to use new CALL_EXPR and
1895 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1896 build_aggr_init_array.
1897 (build_min_non_dep_call_list) New function.
1898 (build_min_nt): Assert input code parameter is not a variable
1899 length expression class.
1900 (build_min, build_min_non_dep): Likewise.
1901 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1902 to check for equality instead of recursing. Handle tcc_vl_exp
1904 (stabilize_call): Update to only handle CALL_EXPRs, not
1905 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1906 (stabilize_aggr_init): New function.
1907 (stabilize_init): Use it.
1909 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1910 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1911 AGGR_INIT_EXPR accessor macros and argument iterators.
1913 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1914 build_vl_exp. Iterate through the operands, recursively
1915 processing each one.
1916 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1917 CALL_EXPR accessor macros.
1918 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1919 tree code classes. Use TREE_OPERAND_LENGTH instead of
1922 * semantics.c (finish_call_expr): Use build_nt_call_list
1923 instead of build_nt.
1924 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1925 accessor macros. Use build_call_array to construct the
1926 CALL_EXPR node instead of build3
1928 * decl2.c (build_offset_ref_call_from_tree): Use
1929 build_nt_call_list and build_min_non_dep_call_list instead
1930 of build_min_nt and build_min_non_dep.
1932 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1933 Use build_nt_call_list instead of build_min_nt.
1935 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1938 * call.c (build_conditional_expr): Improve error message.
1940 2007-02-13 Dirk Mueller <dmueller@suse.de>
1942 * friend.c (do_friend): Annotate warning about friend
1943 declarations in templates with OPT_Wnon_template_friend.
1944 Convert informal message from warning() to inform().
1946 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
1947 Mark Mitchell <mark@codesourcery.com>
1950 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1951 instantiations for variables.
1953 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1956 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1957 Check warn_unused_value just once.
1959 2007-02-11 Mark Mitchell <mark@codesourcery.com>
1962 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1963 (fn_type_unificiation): Likewise.
1964 (get_bindings): Likewise.
1966 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
1969 * decl.c (finish_function): Use DECL_REPLACEABLE.
1970 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1972 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1974 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1976 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1978 * decl.c (grokvardecl): Don't error if !have_tls.
1979 (grokdeclarator): Likewise.
1980 * parser.c (cp_parser_omp_threadprivate): Likewise.
1982 2007-02-07 Jakub Jelinek <jakub@redhat.com>
1985 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1986 parameters and result decls in omp clauses.
1987 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1990 2007-02-05 Dirk Mueller <dmueller@suse.de>
1993 * parser.c (cp_parser_class_specifier): Always initialize bases.
1995 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1997 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1998 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1999 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2001 * semantics.c (finish_omp_atomic): Store a whole expression node
2002 in operand 1, and integer_zero_node in operand 0, for dependent
2003 OMP_ATOMIC. Rewrite to make flow easier to understand.
2005 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2007 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2009 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
2011 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2012 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2014 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2016 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2017 keyword warning to -Wc++0x-compat.
2019 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2021 * decl.c (grokdeclarator): Update documentation.
2023 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2026 * decl.c (grokdeclarator): If __thread is used together with
2027 a storage class other than extern and static, clear thread_p
2028 after issuing diagnostics and fall through to checking the
2031 2007-01-30 Roger Sayle <roger@eyesopen.com>
2033 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2034 calculating the size of an array (to avoid recursive errors).
2036 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2039 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2041 * call.c (convert_like_real): Don't warn when converting to
2044 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2046 * decl.c (pop_label): Replace warning with call to
2047 warn_for_unused_label.
2049 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2052 * semantics.c (finish_pseudo_destructor_expr): Check the
2053 destrutor name by calling check_dtor_name.
2055 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2057 * lex.c (D_CPP0X): Rename.
2059 (reswords): D_CPP0X -> D_CXX0X.
2060 (init_reswords): Ditto.
2061 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2062 of C++0x keywords as identifiers.
2064 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2067 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2070 2007-01-23 Ian Lance Taylor <iant@google.com>
2072 * typeck.c (convert_for_assignment): Only warn about a = b = c
2073 when converting to bool.
2075 2007-01-23 Roger Sayle <roger@eyesopen.com>
2077 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2079 * typeck.c (ignore_overflows): Remove the remaining uses of
2080 TREE_CONSTANT_OVERFLOW.
2082 2007-01-20 Jan Hubicka <jh@suse.cz>
2084 * decl2.c (start_objects, start_static_storage_duration_function):
2085 Do not make the functions uninlinable.
2087 2007-01-17 Ian Lance Taylor <iant@google.com>
2089 * class.c (add_method): Call VEC_reserve_exact rather than passing
2090 a negative size to VEC_reserve.
2092 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2095 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2097 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2100 * decl.c (make_typename_type): If the qualified name is not a
2101 type, issue an error.
2102 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2105 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2107 * rtti.c: Include target.h.
2108 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2109 don't emit typeinfo for fundamental types as weak.
2110 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2112 2007-01-08 Richard Guenther <rguenther@suse.de>
2114 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2116 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2118 * call.c (standard_conversion): Pass flag to
2119 vector_types_convertible_p to disallow emission of note.
2120 * typeck.c (convert_for_assignment): Pass flag to
2121 vector_types_convertible_p to allow emission of note.
2122 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2123 to disallow emission of note.
2125 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2128 * typeck.c (build_binary_op): Call overflow_warning if
2129 TREE_OVERFLOW_P is true for the result and not for any of the
2132 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2135 * class.c (add_method): Don't wait until template
2136 instantiation time to complain about duplicate methods.
2138 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2141 * semantics.c (finish_unary_op_expr): Warn only if result
2142 overflowed and operands did not.
2144 2007-01-05 Ian Lance Taylor <iant@google.com>
2146 * typeck.c (build_binary_op): Warn about comparing a non-weak
2149 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2151 * pt.c (tsubst): Propagate the need for structural equality checks
2152 when reducing the level of template parameters.
2154 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2156 * pt.c: Fix a comment typo.
2158 2007-01-02 Ian Lance Taylor <iant@google.com>
2160 * semantics.c (maybe_convert_cond): Optionally warn when using an
2161 assignment as a condition.
2162 * typeck.c (convert_for_assignment): Optionally warn about
2163 assigning the result of an assignment to a bool.
2165 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2167 * pt.c (canonical_template_parms): Correct typo in comment.
2169 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2171 * typeck.c (structural_comptypes): Renamed from "comptypes".
2172 (comptypes): Use canonical type information to perform fast type
2173 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2174 canonical type comparison returns the same results as we would see
2175 from the current, structural check. Support COMPARE_STRUCTURAL
2176 when we need structural checks.
2177 * decl.c (typename_compare): Fix comment.
2178 (build_typename_type): TYPENAME_TYPE nodes require structural
2179 equality checks, because they resolve different based on the
2181 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2182 require structural equality checks (for now).
2183 (build_ptrmemfunc_type): Build the canonical pointer to member
2185 (compute_array_index_type): Whenever we build a new index type
2186 to represent the size of an array in a template, we need to mark
2187 this index type as requiring structural equality. This goes for
2188 arrays with value-dependent sizes with the current ABI, or all
2190 * tree.c (cplus_array_hash): New.
2191 (struct cplus_array_info): New.
2192 (cplus_array_compare): New.
2193 (cplus_array_htab): New.
2194 (build_cplus_array_type_1): Use a hash table to cache the array
2195 types we build. Build the canonical array type for each array
2197 (cp_build_qualified_type_real): When building a cv-qualified array
2198 type, use the hash table of array types and build canonical array
2200 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2201 use structural equality (for now).
2202 * cp-tree.h (COMPARE_STRUCTURAL): New.
2203 * pt.c (canonical_template_parms): New.
2204 (canonical_type_parameter): New.
2205 (process_template_parm): Find the canonical type parameter.
2206 (lookup_template_class): When we have named the primary template
2207 type, set the canonical type for our template class to the primary
2208 template type. If any of the template arguments need structural
2209 equality checks, the template class needs structural equality
2211 (tsubst): When reducing the level of a template template
2212 parameter, we require structural equality tests for the resulting
2213 parameter because its template parameters have not had their types
2214 canonicalized. When reducing a template type parameter, find the
2215 canonical reduced type parameter.
2216 (any_template_arguments_need_structural_equality_p): New.