1 2007-09-05 Paolo Carlini <pcarlini@suse.de>
4 * semantics.c (finish_id_expression): Use context_for_name_lookup
5 insted of DECL_CONTEXT, to see through anonymous structs and unions.
6 * class.c (finish_struct_anon): Deal correctly with anonymous
7 structs (vs unions, as GNU extension) in error messages.
9 2007-09-05 Jan Hubicka <jh@suse.cz>
11 * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
12 call, DECL_EXTERNAL checks and current_function_decl saving.
14 2007-09-05 Paolo Carlini <pcarlini@suse.de>
17 * parser.c (cp_parser_primary_expression): Return error_mark_node
18 when a statement-expression is found in a template-argument list.
20 2007-09-04 Jason Merrill <jason@redhat.com>
23 * call.c (reference_binding): Don't look for user-defined conversions
27 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
28 the MUST_NOT_THROW_EXPR.
30 2007-09-04 Richard Sandiford <richard@codesourcery.com>
32 * decl.c (cp_finish_decl): Call determine_visibility before
33 make_rtl_for_nonlocal_decl.
35 2007-09-04 Jason Merrill <jason@redhat.com>
38 * pt.c (most_specialized_class): Substitute outer template
39 arguments into the arguments of a member template partial
41 (strip_innermost_template_args): New fn.
43 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
45 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
47 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
49 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
50 * decl.c (cp_make_fname_decl): Likewise,
51 * parser.c (cp_parser_string_literal): Likewise,
52 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
53 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
56 2007-09-02 Paolo Carlini <pcarlini@suse.de>
59 * typeck.c (build_unary_op): Fix error message for
60 Boolean expression as operand to operator--.
62 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
64 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
65 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
68 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
71 * init.c (build_default_init): Make extern.
72 * cp-tree.h (build_default_init): Declare here.
73 * pt.c (tsubst_expr): When the instantiation of the initializer of
74 a variable results in an empty list, default-initialize the
76 (tsubst_copy_and_build): When the instantiation of the initializer
77 in a new expression results in an empty initializer list,
78 default-initialize it.
80 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
82 * mangle.c (write_type): Change mangling of rvalue reference from
85 2007-08-31 Jakub Jelinek <jakub@redhat.com>
87 * decl.c (duplicate_decls): Remove duplicated line.
89 2007-08-31 Paolo Carlini <pcarlini@suse.de>
92 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
93 BOUND_TEMPLATE_TEMPLATE_PARM.
95 2007-08-31 Paolo Carlini <pcarlini@suse.de>
98 * search.c (lookup_member): Check the name argument for
101 2007-08-31 Paolo Carlini <pcarlini@suse.de>
104 * parser.c (cp_parser_trait_expr): Check rerurn value of
107 2007-08-30 Ollie Wild <aaw@google.com>
109 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
110 convert_ptrmem for pointer to member conversions.
111 (convert_to_pointer_force): Update cp_convert_to_pointer call.
112 (ocp_convert): Update cp_convert_to_pointer call.
113 * typeck.c (convert_ptrmem): Add conditional for null pointers to
115 (build_static_cast_1): Check can_convert for conversions in either
117 (get_delta_difference_1): New function.
118 (get_delta_difference): Refactor to call get_delta_difference_1.
120 2007-08-28 Paolo Carlini <pcarlini@suse.de>
123 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
124 BOUND_TEMPLATE_TEMPLATE_PARM.
126 2007-08-28 Jakub Jelinek <jakub@redhat.com>
130 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
131 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
133 2007-08-27 Jason Merrill <jason@redhat.com>
136 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
137 Look inside STMT_EXPR.
138 * semantics.c (stmt_expr_value_expr): New fn.
139 * cp-tree.h: Declare it.
142 * decl.c (groktypename): Ignore attributes applied to class type.
144 2007-08-28 Richard Guenther <rguenther@suse.de>
146 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
148 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
150 * error.c (dump_expr): Handle COMPLEX_CST.
151 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
152 (pp_cxx_expression): Likewise.
154 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
156 * decl.c (GNU_INLINE_P): New.
157 (duplicate_decls): Handle gnu_inline. Merge attributes and
158 some flags in overriding definitions.
159 (redeclaration_error_message): Handle gnu_inline.
160 (start_preparsed_function): Likewise.
162 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
164 * call.c (sufficient_parms_p): Constify.
165 * class.c (same_signature_p): Likewise.
166 * cp-gimplify.c (is_invisiref_parm,
167 cxx_omp_privatize_by_reference): Likewise.
168 * cp-objcp-common.c (has_c_linkage): Likewise.
169 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
170 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
171 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
172 num_artificial_parms_for, comp_template_parms,
173 template_parameter_pack_p, any_dependent_template_arguments_p,
174 any_type_dependent_arguments_p, any_value_dependent_elements_p,
175 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
176 zero_init_p, member_p, cp_lvalue_kind,
177 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
178 varargs_function_p, is_dummy_object, special_function_kind,
179 string_conv_p, type_unknown_p, comp_except_specs, compparms,
180 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
181 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
182 cp_has_mutable_p, at_least_as_qualified_p,
183 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
184 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
185 * except.c (nothrow_libfn_p): Likewise.
186 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
188 * pt.c (comp_template_parms, template_parameter_pack_p,
189 any_type_dependent_arguments_p, any_value_dependent_elements_p,
190 any_dependent_template_arguments_p): Likewise.
191 * repo.c (repo_export_class_p): Likewise.
192 * semantics.c (anon_aggr_type_p): Likewise.
193 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
194 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
195 varargs_function_p, member_p, is_dummy_object, pod_type_p,
196 zero_init_p, special_function_p): Likewise.
197 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
198 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
199 compparms, invalid_nonstatic_memfn_p,
200 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
201 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
202 cp_has_mutable_p, lvalue_or_else): Likewise.
204 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
206 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
207 * cp-objcp-common.c (cp_tree_size): Ditto.
208 * tree.c (cp_walk_subtrees): Ditto
209 * cp-tree.def (TINST_LEVEL): Go away.
210 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
211 move together with other non-tree structs.
212 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
213 (union lang_tree_node): Eliminate tinst_level field.
214 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
215 (current_instantiation, outermost_tinst_level): Return
216 a "struct tinst_level *".
218 * error.c (print_instantiation_partial_context): Change second
219 parameter to a "struct tinst_level *". Replace accessor macros
221 (print_instantiation_full_context): Likewise.
222 * lex.c (in_main_input_context): Likewise.
224 * pt.c (struct pending_templates): New.
225 (pending_templates, last_pending_template): Use it as a type.
226 (current_tinst_level): Change typo to "struct tinst_level *"
227 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
228 (add_pending_template): Construct a "struct pending_template".
229 Replace TINST_LEVEL accessor macros with field access.
230 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
231 (pop_tinst_level): Likewise.
232 (instantiate_pending_templates): Likewise. Factor common code used
233 when an instantiation has been done.
234 (outermost_tinst_level): Replace tree_last with loop.
235 (current_instantiation): Return a "struct tinst_level *".
237 2007-08-24 Ollie Wild <aaw@google.com>
239 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
240 * name-lookup.h (cp_binding_level): Remove vtables member.
242 2007-08-24 Richard Guenther <rguenther@suse.de>
244 * tree.c (cp_cannot_inline_tree_fn): Remove.
245 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
246 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
249 2007-08-24 Jakub Jelinek <jakub@redhat.com>
252 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
253 error_mark_node right away if build_expr_type_conversion
257 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
258 is error_mark_node rather than NULL_TREE.
259 * pt.c (check_explicit_specialization): Likewise.
262 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
263 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
265 2007-08-22 Jason Merrill <jason@redhat.com>
268 * pt.c (outermost_tinst_level): New function.
269 * lex.c (in_main_input_context): New function.
270 * cp-tree.h: Declare it.
271 * decl2.c (constrain_class_visibility): Use it to avoid warning
272 about uses of the anonymous namespace in the main input file.
274 2007-08-21 Jakub Jelinek <jakub@redhat.com>
276 * init.c (build_new_1): Use get_target_expr instead of save_expr.
278 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
281 * class.c (finish_struct_1): Warn when a class has virtual
282 functions and accessible non-virtual destructor.
284 2007-08-20 Richard Guenther <rguenther@suse.de>
288 * call.c (build_new_method_call): Convert initializer to
290 * init.c (build_aggr_init): Do not fiddle with types.
291 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
292 * except.c (build_throw): Do not drop qualifiers for the
294 * typeck.c (get_member_function_from_ptrfunc): Do not
295 fiddle with types, instead convert.
296 (build_ptrmemfunc1): Convert to the target type for
298 (gfc_trans_allocate): Convert result to target type.
299 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
300 pointer-to-member structures shall have alias set zero as well.
302 2007-08-20 Richard Guenther <rguenther@suse.de>
304 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
306 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
307 (nonstatic_local_decl_p): Likewise.
308 * tree.c (cp_auto_var_in_fn_p): Remove.
309 * decl.c (nonstatic_local_decl_p): Remove.
311 2007-08-20 Richard Guenther <rguenther@suse.de>
313 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
315 * tree.h (cp_walk_tree): New define to walk_tree_1 with
316 cp_walk_subtrees lh parameter.
317 (cp_walk_tree_without_duplicates): New define to
318 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
319 * tree.c (count_trees): Call
320 cp_walk_tree_without_duplicates.
321 (verify_stmt_tree): Call cp_walk_tree.
322 (break_out_target_exprs): Likewise.
323 (WALK_SUBTREE): Likewise.
324 * cp-gimplify.c (cp_genericize): Likewise.
325 * cp-pt.c (find_parameter_packs_r): Likewise.
326 (uses_parameter_packs): Likewise.
327 (make_pack_expansion): Likewise.
328 (check_for_bare_parameter_packs): Likewise.
329 (for_each_template_parm): Likewise.
330 * decl.c (check_default_argument): Call
331 cp_walk_tree_without_duplicates.
332 * except.c (build_throw): Likewise.
333 * decl2.c (type_visibility): Likewise.
334 * semantics.c (expand_or_defer_fn): Likewise.
335 (finalize_nrv): Call cp_walk_tree.
337 2007-08-20 Jakub Jelinek <jakub@redhat.com>
340 * init.c (build_new_1): Rename placement_var variable to placement_expr.
341 Initialize it with save_expr rather than get_temp_regvar.
343 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
346 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
349 2007-08-17 Ollie Wild <aaw@google.com>
352 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
353 declarations into appropriate slots for comparison. Fix type
356 2007-08-17 Paolo Carlini <pcarlini@suse.de>
359 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
360 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
362 2007-08-17 Paolo Carlini <pcarlini@suse.de>
365 * parser.c (cp_parser_class_head): Improve error message.
367 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
369 * pt.c (instantiate_decl): Set input_location
370 for the function end.
372 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
374 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
376 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
377 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
378 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
379 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
380 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
381 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
382 * typeck.c (cp_type_quals): Likewise.
383 * typeck2.c (cxx_incomplete_type_diagnostic,
384 cxx_incomplete_type_error): Likewise.
386 2007-08-16 Paolo Carlini <pcarlini@suse.de>
389 * pt.c (tsubst_friend_function): When check_classfn
390 returns error_mark_node likewise return it.
392 2007-08-15 Jakub Jelinek <jakub@redhat.com>
395 * typeck.c (check_return_expr): Don't NRV optimize vars in
397 * decl.c (finish_function): Comment fix.
399 2007-08-15 Paolo Carlini <pcarlini@suse.de>
402 * pt.c (push_template_decl_real): Depending on TYPE_P
403 use either TYPE_CONTEXT or DECL_CONTEXT.
405 2007-08-14 Mark Mitchell <mark@codesourcery.com>
407 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
408 constructors and destructors return this.
410 2007-08-14 Paolo Carlini <pcarlini@suse.de>
413 * decl2.c (check_classfn): Return error_mark_node in case of error;
414 in that case, do not call add_method.
415 * decl.c (start_decl): Deal with check_classfn returning
417 (grokfndecl): Likewise.
418 * pt.c (tsubst_friend_function): Likewise.
420 2007-08-14 Andrew Pinski <pinskia@gmail.com>
423 * typeck.c (build_binary_op): Disallow vector float types with
424 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
426 2007-08-11 Ian Lance Taylor <iant@google.com>
428 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
430 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
432 2007-08-10 Ollie Wild <aaw@google.com>
434 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
436 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
438 (unqualified_namespace_lookup): Fix ambiguous_decl call.
439 (lookup_using_namespace): Fix ambiguous_decl call.
440 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
442 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
444 * call.c (name_as_c_string): Use CONST_CAST.
445 * decl.c (build_decl): Likewise.
446 * parser.c (cp_parser_string_literal): Likewise.
448 2007-08-10 Paolo Carlini <pcarlini@suse.de>
451 * error.c (dump_expr): Consistently use the *_cxx_*
452 variants of the pretty-print functions.
454 2007-08-10 Paolo Carlini <pcarlini@suse.de>
457 * decl.c (check_special_function_return_type): Just error
458 on return type specified for conversion operator.
460 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
462 * typeck2.c (readonly_error): Handle general expressions.
463 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
465 2007-08-06 Dan Hipschman <dsh@google.com>
467 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
468 access function name.
470 2007-08-04 Alfred Minarik <a.minarik@aon.at>
473 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
474 * g++spec.c (lang_specific_driver): Check them.
476 2007-08-06 Paolo Carlini <pcarlini@suse.de>
479 * pt.c (inline_needs_template_parms): Fix comment; change return type
482 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
485 2007-03-26 Dirk Mueller <dmueller@suse.de>
487 * parser.c (cp_parser_member_declaration): Pedwarn
488 about stray semicolons after member declarations.
490 2007-08-02 Lee Millward <lee.millward@gmail.com>
495 * parser.c (cp_parser_asm_definition): Detect and discard asm
496 statements with invalid inputs or outputs.
497 (cp_parser_asm_operand_list): Return error mark node if any
498 of the operands are invalid. Adjust documentation.
500 2007-08-02 Nick Clifton <nickc@redhat.com>
502 * typeck.c: Change copyright header to refer to version 3 of the
503 GNU General Public License and to point readers at the COPYING3
504 file and the FSF's license web page.
505 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
506 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
507 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
508 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
509 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
510 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
511 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
512 name-lookup.h, parser.c: Likewise.
514 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
517 * call.c (magic_varargs_p): Honor the "type generic" attribute.
519 2007-07-30 Paolo Carlini <pcarlini@suse.de>
522 * semantics.c (finish_label_stmt): Reject the __label__
523 extension outside function scopes.
525 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
527 * parser.c (eof_token): Un-constify.
528 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
529 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
532 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
534 * pt.c, tree.c, typeck2.c: Fix comment typos.
536 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
537 Mark Mitchell <mark@codesourcery.com>
540 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
541 hidden due to friend declarations in local classes.
543 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
545 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
546 * cp-tree.def (DECLTYPE_TYPE): New.
547 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
548 (dump_type_prefix): Ditto.
549 (dump_type_suffix): Ditto.
550 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
551 * mangle.c (write_type): Handle DECLTYPE_TYPE.
552 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
554 (DECLTYPE_TYPE_EXPR): New.
555 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
556 (finish_declared_type): Declare.
557 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
559 (pp_cxx_type_id): Ditto.
560 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
561 (tsubst): Substitute into a DECLTYPE_TYPE node.
562 (tsubst_copy): Ditto.
563 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
565 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
566 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
567 structural equality (because we can't hash the expressions).
568 (finish_declared_type): New.
569 * lex.c (reswords): Add "decltype" keyword.
570 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
571 (cp_parser_postfix_expression): Add member_access_only_p to
572 restrict postfix expression to member access expressions.
573 (cp_parser_unary_expression): Update call to
574 cp_parser_postfix_expression to reflect new parameter.
575 (cp_parser_declared_type): New.
576 (cp_parser_simple_type_specifier): Parse decltype types.
578 2007-07-27 Mark Mitchell <mark@codesourcery.com>
581 * call.c (convert_for_arg_passing): Only widen bitfields to their
582 declared types if necessary.
584 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
586 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
589 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
591 * decl.c (typename_hash, typename_compare): Constify.
592 * mangle.c (hash_type, compare_type): Likewise.
593 * pt.c (eq_local_specializations, hash_local_specialization):
595 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
596 list_hash): Likewise.
597 * typeck2.c (pat_compare): Likewise.
599 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
601 * method.c (implicitly_declare_fn): Increase alignment if member
602 function pointer format requires it.
604 2007-07-24 Paolo Carlini <pcarlini@suse.de>
607 * typeck.c (check_return_expr): Do not pass a null argument
610 2007-07-24 Paolo Carlini <pcarlini@suse.de>
613 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
616 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
619 * typeck.c (convert_arguments): Only use default args if we have
623 * typeck.c (structural_comptypes): No need to check
624 resolve_typename_type return value here.
625 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
626 * pt.c (resolve_typename_type): Follow typename typedefs. Return
627 original type rather than error_mark_node in case of failure.
628 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
629 resolve_typename_type result check.
630 (cp_parser_direct_declarator, cp_parser_head,
631 cp_parser_constructor_declarator_p): Likewise.
633 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
635 * pt.c (template_parms_variadic_p): Remove.
636 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
638 2007-07-12 Jakub Jelinek <jakub@redhat.com>
641 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
642 argument to dump_aggr_init_expr_args instead of false.
644 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
646 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
647 canonical types; otherwise, fall back to structural type
648 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
649 internal compiler error if the canonical types are wrong.
651 2007-07-11 Paolo Carlini <pcarlini@suse.de>
654 * parser.c (cp_parser_make_indirect_declarator): When the
655 the code argument is ERROR_MARK return cp_error_declarator.
657 2007-07-09 Geoffrey Keating <geoffk@apple.com>
660 * decl.c (cxx_init_decl_processing): Don't set
661 force_align_functions_log.
662 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
663 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
664 FUNCTION_DECL, return its alignment.
666 2007-07-09 Richard Guenther <rguenther@suse.de>
668 * decl.c (start_preparsed_function): Do not promote return type.
670 2007-07-08 Paolo Carlini <pcarlini@suse.de>
673 * pt.c (unify): Never pass error_mark_node to template_decl_level.
675 2007-07-07 Mark Mitchell <mark@codesourcery.com>
678 * pt.c (resolve_overloaded_unification): Robustify. Return a
680 (type_unification_real): Adjust accordingly.
682 2007-07-06 Richard Guenther <rguenther@suse.de>
684 * init.c (build_new_1): Use the correct pointer type.
685 * typeck2.c (build_m_component_ref): Likewise.
687 2007-07-05 Mark Mitchell <mark@codesourcery.com>
690 * init.c (build_zero_init): Always build an initializer for
692 * typeck2.c (build_functional_cast): Use build_zero_init.
695 * init.c (build_new_1): Always pass the allocation function to
696 build_op_delete_call.
697 * call.c (build_op_delete_call): Handle operator delete with a
698 variable-argument list. Do not issue an error when no matching
699 deallocation function is available for a new operator.
702 * cp-tree.h (any_value_dependent_elements_p): Declare it.
703 * decl.c (value_dependent_init_p): New function.
704 (cp_finish_decl): Use it.
705 * pt.c (value_dependent_expression_p): Use
706 any_value_dependent_elements_p.
707 * parser.c (cp_parser_primary_expression): Add comment about
708 treating dependent qualified names as integral
709 constant-expressions.
711 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
713 * decl.c (build_ptrmemfunc_type): Always use structural equality
714 tests when comparing pointer-to-member-function types, because the
715 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
718 2007-07-03 Mark Mitchell <mark@codesourcery.com>
720 * init.c (build_new): Tweak comment.
722 2007-06-29 Dave Brolley <brolley@redhat.com>
725 * parser.c (cp_parser_new_type_id): Don't reduce a named array
726 type to its base type and number of elements here.
727 * init.c (build_new): Call complete_type_or_else to ensure that the
728 type is complete and to issue a diagnostic if it is not.
729 (build_new_1): Don't call complete_type_or_else here.
731 2007-07-03 Richard Guenther <rguenther@suse.de>
734 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
737 2007-07-02 Simon Baldwin <simonb@google.com>
739 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
740 for inner-style nested forward declarations that don't declare
743 2007-07-02 Jakub Jelinek <jakub@redhat.com>
746 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
747 DECL_P in not a variable and appears more than once error messages.
749 2007-07-01 Ollie Wild <aaw@google.com>
751 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
752 (select_decl): Remove function.
753 (unqualified_namespace_lookup): Populate binding by calling
754 ambiguous_decl. Remove select_decl call.
755 (lookup_qualified_name): Remove select_decl call.
756 * decl.c (lookup_and_check_tag): Check for ambiguous references.
757 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
758 generation when name lookup is ambiguous.
760 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
763 * init.c (build_new_1): Use structural equality on the copy of the
766 2007-06-28 Geoffrey Keating <geoffk@apple.com>
768 * decl2.c (determine_visibility): Implement
769 flag_visibility_ms_compat effect on type info.
770 * decl.c (cxx_init_decl_processing): Implement
771 global effect of flag_visibility_ms_compat.
773 2007-06-28 Geoffrey Keating <geoffk@apple.com>
775 * decl2.c (start_objects): Mark constructor-running function
778 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
781 * decl.c (grokdeclarator): Reset friendp for member functions declared
782 friend of their own class.
784 2007-06-23 Mark Mitchell <mark@codesourcery.com>
786 * decl2.c (determine_visibility): Don't look for dllexport here.
787 (determine_visibility_from_class): Tidy.
789 2007-06-18 Simon Baldwin <simonb@google.com>
792 * parser.c (cp_parser_single_declaration): Added check for storage
793 class other than sc_none in parsed declaration, and a flag to indicate
794 if the call is part of an explicit template specialization parse.
795 * (cp_parser_explicit_specialization): Specialization check flag added
796 to call to cp_parser_single_declaration(), set true.
797 * (cp_parser_template_declaration_after_export): Specialization check
798 flag added to call to cp_parser_single_declaration(), set false.
799 * pt.c (check_explicit_specialization): Added code to copy visiblity
800 and linkage from the templated function to the explicit specialization.
802 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
804 * typeck.c (build_binary_op): For templates build the
805 expression in pieces to avoid the assert in build2_stat.
806 (get_member_function_from_ptrfunc):
807 Change over to using POINTER_PLUS_EXPR and convert
808 the second operand to sizetype.
809 * typeck2.c (build_m_component_ref): Likewise.
810 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
811 instead of PLUS_EXPR for pointers.
812 (build_new_1): Likewise.
813 (build_vec_delete_1): Likewise.
814 (build_vec_delete): Likewise.
815 * class.c (build_base_path): Likewise.
816 (build_base_path): Likewise.
817 (convert_to_base_statically): Likewise.
818 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
819 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
820 instead of PLUS_EXPR.
821 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
822 instead of PLUS_EXPR for pointers.
823 * call.c (build_special_member_call): Likewise.
824 * rtti.c (build_headof): Likewise.
825 Use sizetype instead of ptrdiff_type_node.
826 (tinfo_base_init): Create a POINTER_PLUS_EXPR
827 instead of PLUS_EXPR for pointers.
828 * except.c (expand_start_catch_block): Do a
829 NEGATIVE and then a POINTER_PLUS_EXPR instead
831 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
832 PLUS_EXPR on pointer types over to use
833 POINTER_PLUS_EXPR and remove the conversion
834 to the pointer types.
835 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
836 adding to a pointer type. Use size_int instead of
837 ssize_int. Convert the index to sizetype before
838 adding it to the pointer.
840 2007-06-15 Mark Mitchell <mark@codesourcery.com>
842 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
843 (DECL_ANON_UNION_VAR_P): New macro.
844 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
845 than DECL_VAR_MARKED_P, to keep track of which variables we have
847 * decl.c (redeclaration_error_message): Complain about redeclaring
848 anonymous union members at namespace scope.
849 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
851 2007-06-14 Geoff Keating <geoffk@apple.com>
853 * decl2.c (determine_visibility): Ensure that functions with
854 hidden types as parameters are hidden.
857 * decl2.c (determine_visibility): Remove duplicate code for
860 2007-06-12 Ian Lance Taylor <iant@google.com>
863 * init.c (avoid_placement_new_aliasing): New static function.
864 (build_new_1): Call it.
866 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
868 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
869 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
871 2007-06-08 Jakub Jelinek <jakub@redhat.com>
874 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
875 on init, the non-decl cond operand and increment value.
877 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
880 * decl.c (check_initializer): Report an error when a brace enclosed
881 initializer is used for a non-aggregate type in C++98.
882 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
884 (grokdeclarator): Likewise.
885 (move_fn_p): Likewise.
886 * typeck.c (check_return_expr): Likewise.
887 * call.c (reference_binding): Likewise.
888 * error.c (cp_cpp_error): Likewise.
889 * pt.c (check_default_tmpl_args): Likewise.
891 * lex.c (init_reswords): Likewise.
892 * parser.c (p_parser_primary_expression): Likewise.
893 (TOKEN_PRECEDENCE): Likewise.
894 (cp_parser_init_declarator): Likewise.
895 (cp_parser_ptr_operator): Likewise.
896 (cp_parser_parameter_declaration): Likewise.
897 (cp_parser_enclosed_template_argument_list): Likewise.
898 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
899 (cp_parser_next_token_ends_template_argument_p): Likewise.
901 2007-06-04 Simon Baldwin <simonb@google.com>
903 * decl.c (grokdeclarator): Readability change. Moved case labels
904 into direct switch statement scope.
906 2007-06-04 Paolo Carlini <pcarlini@suse.de>
908 * call.c (convert_like_real): Remove pointless code.
910 2007-05-31 Mark Mitchell <mark@codesourcery.com>
912 * decl.c (get_atexit_fn_ptr_type): New function.
913 (get_atexit_node): Use it.
914 (start_cleanup_fn): Likewise.
915 (register_dtor_fn): Use the object's destructor, instead of a
916 separate cleanup function, where possible.
917 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
918 (atexit_fn_ptr_type_node): New macro.
919 * decl2.c (build_cleanup): Use build_address.
921 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
923 * typeck.c (build_binary_op): Include types in error.
925 2007-05-31 Jakub Jelinek <jakub@redhat.com>
928 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
929 needs runtime initialization.
931 2007-05-31 Paolo Carlini <pcarlini@suse.de>
934 * semantics.c (finish_trait_expr): Complete the types.
936 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
937 Douglas Gregor <doug.gregor@gmail.com>
938 Pedro Lamarao <pedro.lamarao@mndfck.org>
939 Howard Hinnant <howard.hinnant@gmail.com>
943 * typeck.c (comptypes): Don't consider rvalue and lvalue
944 reference types to be equivalent.
945 (check_return_expr): Move from certain lvalues when returning
947 * decl.c (grokdeclarator): Implement reference collapsing.
948 (copy_fn_p): Don't consider constructors taking rvalue references
949 to be copy constructors.
951 * call.c (conversion): New "rvaluedness_matches_p" member.
952 (convert_class_to_reference): Require reference type as first
953 parameter instead of base type.
954 (reference_binding): Add logic to handle rvalue references.
955 (implicit_conversion): Update inaccurate comment.
956 (convert_like_real): Disable creation of temporaries that are
957 impossible to initialize for types with move constructors.
958 (build_over_call): Elide move constructors when possible.
959 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
960 (maybe_handle_ref_bind): Return conversion instead of type node.
961 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
962 determine preferred conversion sequences.
963 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
964 (LOOKUP_PREFER_RVALUE): New.
965 (DECL_MOVE_CONSTRUCTOR_P): New.
966 (struct cp_declarator): Add "reference" member for reference
967 types, with new "rvalue_ref" flag.
968 (cp_build_reference_type): Declare.
969 (move_fn_p): Declare.
970 * error.c (dump_type_prefix): Format rvalue reference types
971 correctly in error messages.
972 * except.c (build_throw): Move from certain lvalues when
974 * mangle.c (write_type): Mangle rvalue references differently
975 than regular references.
976 * parser.c (make_reference_declarator): Add boolean parameter for
978 (cp_parser_make_indirect_declarator): New.
979 (cp_parser_new_declarator_opt): Call
980 cp_parser_make_indirect_declarator.
981 (cp_parser_conversion_declarator_opt): Ditto.
982 (cp_parser_declarator): Ditto.
983 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
985 * pt.c (tsubst): Implement reference collapsing.
986 (maybe_adjust_types_for_deduction): Implement special template
987 parameter deduction rule for rvalue references.
988 (type_unification_real): Update calls to
989 maybe_adjust_types_for_deduction.
990 (try_one_overload): Ditto.
991 (unify_pack_expansion): Ditto.
992 * tree.c (lvalue_p_1): Handle rvalue reference types.
993 (cp_build_reference_type): New.
995 2007-05-30 Jakub Jelinek <jakub@redhat.com>
998 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
999 variables that need runtime initialization.
1001 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
1004 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
1005 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
1006 case POSTDECREMENT_EXPR>): Return the error_mark_node
1007 if either the real or imaginary parts would an
1010 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
1011 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1014 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1015 token is a closing brace, false if there are no tokens left.
1016 (cp_parser_namespace_alias_definition): Only consume the next token if
1017 it is a closing brace.
1019 * parser.c (cp_parser_class_specifier): Likewise.
1021 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
1023 * semantics.c (finish_member_declaration): Fix a typo in the
1026 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
1038 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1039 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1040 * pt.c (check_for_bare_parameter_packs): Return bool indicated
1041 whether everything was okay. Fix indentation.
1042 (push_template_decl_real): Check for bare parameter packs in
1043 function parameters; where errors occur, mark the parameter types
1044 with ERROR_MARK_NODEs to avert ICEs.
1045 (coerce_template_parameter_pack): New.
1046 (coerce_template_parms): Moved parameter pack coercion into
1047 coerce_template_parameter_pack, and permit it anywhere in the
1048 template parameter list (not just at the end). Parameter and
1049 argument indices can vary (somewhat) separately now, so add
1050 PARM_IDX and ARG_IDX.
1051 (fn_type_unification): Don't set an argument pack as incomplete if
1052 no argument pack was deduced.
1053 (type_unification_real): If a type parameter is a parameter pack
1054 and has not otherwise been deduced, it will be deduced to an empty
1056 (more_specialized_fn): Use the actual lengths of the argument
1057 lists when comparing against expansions.
1058 * semantics.c (finish_member_declaration): If a field's type has
1059 bare parameter packs, error and set its type to ERROR_MARK_NODE.
1061 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
1064 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1066 2007-05-22 Ollie Wild <aaw@google.com>
1068 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1069 (unqualified_namespace_lookup): Adds check for hidden types.
1071 2007-05-22 Ollie Wild <aaw@google.com>
1073 * decl.c (duplicate_decls): Verify namespace names are unique.
1075 2007-05-21 Mark Mitchell <mark@codesourcery.com>
1077 * decl.c (cxx_maybe_build_cleanup): Handle
1078 __attribute__((cleanup)).
1080 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1082 * cvt.c (cp_convert_and_check): Don't check warnings if the
1085 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1087 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1089 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1092 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1093 type only if is a class type (5.2.8/4).
1095 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1097 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1098 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1099 c_common_unsigned_type.
1101 2007-05-11 Silvius Rus <rus@google.com>
1103 * cp/typeck.c (build_indirect_ref): Add call to
1104 strict_aliasing_warning.
1105 (build_reinterpret_cast_1): Condition call to
1106 strict_aliasing_warning.
1108 2007-05-11 Jan Hubicka <jh@suse.cz>
1110 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1111 * decl2.c (start_objects): ctors and dtors are no longer public.
1112 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1114 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1116 * typeck.c (build_unary_op): Remove code that used to
1117 handle non lvalue increments/decrements.
1119 2007-05-07 Mike Stump <mrs@apple.com>
1121 * parser.c (check_empty_body): Add.
1122 (cp_parser_iteration_statement): Add call to check_empty_body.
1124 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1127 * mangle.c (write_mangled_name): Mangle static variable names.
1128 (write_unqualified_name): Use local-source-name for
1129 namespace-scope static variables.
1131 2007-05-04 Dirk Mueller <dmueller@suse.de>
1133 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1136 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1139 * decl2.c (constrain_class_visibility):
1140 Use strip_pointer_or_array_types instead of strip_array_types.
1142 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1145 * decl.c (reshape_init_r): Don't reshape the first element if it
1146 is a pointer to member function.
1148 2007-04-27 Simon Baldwin <simonb@google.com>
1150 * decl.c (grokparms): Changed message format from %qD to %qE.
1152 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1154 * error.c (maybe_warn_variadic_templates): Variadic templates are
1155 now in C++0x, so only warn about them in C++98 mode.
1157 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1160 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1161 integeral types from vectors types.
1163 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1166 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1167 for type dependent OMP_CLAUSE_DECLs.
1169 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1172 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1173 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1174 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1175 * init.c (build_zero_init): Adjust, as
1176 COMPLEX_TYPE is now a SCALAR_TYPE.
1177 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1178 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1180 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1182 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1183 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1184 (trait_expr_value): Adjust.
1186 2007-04-23 Simon Baldwin <simonb@google.com>
1188 * decl.c (grokparms): Added new error for duplicate function
1189 parameters names in function prototypes, to match gcc behavior.
1191 2007-04-23 Jan Hubicka <jh@suse.cz>
1193 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1196 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1198 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1199 instead of checking GIMPLE_STMT_P in chain_next.
1201 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1204 * call.c (convert_for_arg_passing): Convert bitfields to their
1207 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1210 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1212 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1215 * cp/decl2.c (constrain_class_visibility):
1216 Do not warn about the use of anonymous namespace in the main input file.
1218 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1220 * cp-tree.h (current_template_parms): Fix typo in comment.
1222 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1224 * cp-tree.h, error.c: Fix comment typos.
1226 2007-04-13 Jason Merrill <jason@redhat.com>
1229 * call.c (reference_binding): Add c_cast_p parm. If true,
1230 add quals to TO as needed to make it reference-compatible.
1232 2007-04-11 Jan Hubicka <jh@suse.cz>
1234 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1235 that we are not processing template_decl.
1237 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1240 * class.c (build_base_path): Ensure that the converted pointer has
1241 the same cv-qualification as the input.
1243 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1245 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1247 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1249 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1251 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1252 * tree.c (cp_add_pending_fn_decls): Remove.
1253 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1255 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1257 Revert change removing staticp.
1259 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1261 * cp-objcp-common.c (cxx_staticp): Remove.
1262 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1263 * cp-tree.h (cxx_staticp):
1265 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1267 * class.c (check_for_override): Don't remove dllmport attribute
1270 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1273 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1274 type issue error and return early.
1276 2007-03-30 Jason Merrill <jason@redhat.com>
1279 * typeck.c (cp_type_readonly): New fn.
1280 * cp-tree.h: Declare it.
1281 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1282 (cp_finish_decl): Not here.
1284 2007-03-31 Richard Guenther <rguenther@suse.de>
1286 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1289 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1294 * parser.c (declarator_can_be_parameter_pack): New.
1295 (cp_parser_template_parameter): Only parse the `...' if the
1296 declarator can be a parameter pack.
1297 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1299 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1300 types (they could be used as array bounds).
1301 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1302 (tsubst_pack_expansion): Handle failure to expand parameter
1305 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1308 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1309 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1310 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1311 (CLASS_TYPE_NON_UNION_P): Add.
1312 (struct lang_type_class): Add has_complex_dflt.
1313 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1314 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1315 * cp-tree.def: Add TRAIT_EXPR.
1316 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1317 * lex.c (struct resword): Add __has_nothrow_assign,
1318 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1319 __has_trivial_constructor, __has_trivial_copy,
1320 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1321 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1322 __is_pod, __is_polymorphic, __is_union.
1323 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1324 (cp_parser_trait_expr): New.
1325 * semantics.c (finish_trait_expr, trait_expr_value
1326 classtype_has_nothrow_copy_or_assign_p): New.
1327 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1329 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1330 * class.c (check_bases, check_field_decl, check_bases_and_members):
1331 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1332 * pt.c (uses_template_parms, tsubst_copy_and_build,
1333 value_dependent_expression_p, type_dependent_expression_p): Deal with
1335 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1337 2007-03-29 Richard Guenther <rguenther@suse.de>
1339 * tree.c (cp_walk_subtrees): Do not set input_location.
1341 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1344 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1347 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1349 * parser.c (struct cp_parser): Update comment for
1350 greater_than_is_operator_p.
1351 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1352 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1353 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1354 !GREATER_THAN_IS_OPERATOR_P.
1355 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1356 `>>' operators that will become two `>' tokens in C++0x.
1357 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1358 mode, allowing it to terminate default arguments.
1359 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1360 `>>' like two consecutive `>' tokens.
1361 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1362 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1363 ends a template argument.
1365 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1367 * decl.c (redeclaration_error_message): Complain when redeclaring
1368 a friend function with default template arguments (C++0x mode only).
1369 * cp-tree.h (check_default_tmpl_args): Declare.
1370 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1371 template arguments in function templates. Add support for checking
1372 the default template arguments of friend templates.
1373 (push_template_decl_real): Fix call to check_default_tmpl_args.
1374 (type_unification_real): If a template parameter has not been
1375 deduced but provides a default template argument, substitute into
1376 that default template argument.
1377 * parser.c (cp_parser_init_declarator): When declaring (but not
1378 defining!) a function template in C++0x mode, check for default
1381 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1384 * decl.c (grokdeclarator): Deal with cv-qualified function type
1385 typedefs in the same way for member and non-member functions.
1387 2007-03-26 Dirk Mueller <dmueller@suse.de>
1389 * parser.c (cp_parser_member_declaration): Pedwarn
1390 about stray semicolons after member declarations.
1392 2007-03-26 Paolo Carlini <pcarlini@suse.de>
1395 * pt.c (instantiate_decl): Set in_system_header.
1397 2007-03-22 Mark Mitchell <mark@codesourcery.com>
1399 * cp-tree.h (current_tempalte_parms): Improve documentation.
1400 * pt.c (current_template_args): Likewise.
1403 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1404 not consume tokens when failing.
1406 2007-03-22 Jim Wilson <wilson@specifix.com>
1407 Mark Mitchell <mark@codesourcery.com>
1410 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
1411 consistent with FROM.
1413 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1415 * error.c (dump_expr): Handle dependent names that designate types.
1416 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1418 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
1420 * cp-tree.def, parser.c, pt.c: Fix comment typos.
1422 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1424 * cvt.c (cp_convert_and_check) : Define.
1425 * cp-tree.h (cp_convert_and_check): Declare.
1426 * call.c (convert_conversion_warnings): Rename to
1427 conversion_null_warnings. The warning for floating-point to
1428 integer is handled by convert_and_check in convert_like_real.
1429 (convert_like_real): convert_conversion_warnings was renamed as
1430 conversion_null_warnings.
1431 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1432 overflow and changes of value during conversion.
1434 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1437 * parser.c (cp_parser_statement): If 'namespace' is found, this
1438 only can be a namespace alias definition, so parse it now.
1439 (cp_parser_namespace_alias_definition): if we find an open brace
1440 instead of '=', then this is actually a misplaced namespace
1443 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1446 * decl.c (cxx_init_decl_processing): Move command-line options
1447 processing to c-opts.c.
1449 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
1451 * ptree.c (cxx_print_type): Use formatting markup for integers
1452 when printing template parameter index/level/orig level.
1453 (cxx_print_xnode): Ditto.
1454 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1455 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1456 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1458 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1459 rather than a HOST_WIDE_INT.
1460 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1461 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1463 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1464 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1465 IN_BASE_INITIALIZER bool bitfields.
1466 (struct cp_declarator): Make KIND a 4-bit field. Make
1467 PARAMETER_PACK_P a bool bitfield just after KIND.
1468 * pt.c (uses_parameter_packs): Destroy the pointer set.
1469 (make_pack_expansion): Ditto.
1470 (check_for_bare_parameter_packs): Ditto.
1471 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1473 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
1476 * call.c (convert_default_arg): Instead of copying the node,
1479 2007-03-15 Dirk Mueller <dmueller@suse.de>
1482 * call.c (convert_conversion_warnings): New..
1483 (convert_like_real): .. factored out from here.
1484 (convert_conversion_warnings): Add warning about
1485 false being converted to NULL in argument passing.
1487 2007-03-14 Dirk Mueller <dmueller@suse.de>
1489 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1490 (finish_do_body): Warn about empty body in do/while statement.
1492 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1494 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1496 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1499 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1502 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
1504 * cp/repo.c (init_repo): Initialize random_seed saved options.
1505 (finish_repo): Adjust.
1507 2007-03-13 Mark Mitchell <mark@codesourcery.com>
1510 * Make-lang.in (doc/g++.1): Use $< to specify the location from
1513 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
1515 * decl.c (compute_array_index_type): New warning flag warn_vla.
1517 2007-03-12 Mark Mitchell <mark@codesourcery.com>
1520 * call.c (convert_default_arg): Copy non-constant arguments.
1522 2007-03-11 Mark Mitchell <mark@codesourcery.com>
1525 * parser.c (cp_parser_postfix_expression): Disallow compound
1526 literals in constant expressions.
1529 * semantics.c (finish_typeof): Use unlowered_expr_type.
1531 2007-03-10 Mark Mitchell <mark@codesourcery.com>
1534 * cp-tree.h (unlowered_expr_type): New function.
1535 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1536 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1537 (unlowered_expr_type): New function.
1538 (build_unary_op): Disallow predecrements of bool bitfields.
1539 * call.c (build_conditional_expr): Use unlowered_expr_type.
1540 * pt.c (type_unification_real): Likewise.
1542 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
1545 * typeck.c (check_return_expr): Check for bare parameter packs.
1546 (comptypes): Compare template parameter packs and
1547 type pack expansions.
1548 * decl.c (grokdeclarator): Deal with the declaration of function
1550 (grokparms): Verify that the (optional) function parameter pack is
1551 at the end of the parameter list.
1552 (xref_basetypes): Handle pack expansions in the base class.
1553 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1554 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1555 (NONTYPE_ARGUMENT_PACK): New.
1556 (TYPE_PACK_EXPANSION): New.
1557 (EXPR_PACK_EXPANSION): New.
1558 (ARGUMENT_PACK_SELECT): New.
1559 * cp-objcp-common.c (cp_tree_size): Compute size of
1560 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1561 ARGUMENT_PACK_SELECT.
1562 * error.c (dump_template_argument): Print template argument packs.
1563 (dump_template_argument_list): Ditto.
1564 (dump_template_parameter): Dump `...' for template type parameter
1566 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1567 (dump_parameters): Print function parameter packs.
1568 (dump_template_parms): Print template argument packs.
1569 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1570 (maybe_warn_variadic_templates): New.
1571 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1572 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1573 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1575 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1576 (write_template_arg): Write argument packs as separate arguments.
1577 * cp-tree.h (struct template_parm_index_s): Add flag that
1578 indicates that the template parameter is actually a parameter
1580 (struct tree_argument_pack_select): New.
1581 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1582 (union lang_tree_node): Add argument_pack_select.
1583 (FUNCTION_PARAMETER_PACK_P): New.
1584 (PACK_EXPANSION_P): New.
1585 (PACK_EXPANSION_PATTERN): New.
1586 (SET_PACK_EXPANSION_PATTERN): New.
1587 (PACK_EXPANSION_PARAMETER_PACKS): New.
1588 (ARGUMENT_PACK_P): New.
1589 (ARGUMENT_PACK_ARGS): New.
1590 (SET_ARGUMENT_PACK_ARGS): New.
1591 (ARGUMENT_PACK_INCOMPLETE_P): New.
1592 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1593 (TEMPLATE_PARM_PARAMETER_PACK): New.
1594 (TEMPLATE_TYPE_PARAMETER_PACK): New.
1595 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1596 (ARGUMENT_PACK_SELECT_INDEX): New.
1597 (ARGUMENT_PACK_SELECT_ARG): New.
1598 (struct cp_declarator): Add parameter_pack_p flag.
1599 (maybe_warn_variadic_templates): Declare.
1600 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1601 indicate a template parameter pack.
1602 (uses_parameter_packs): Declare.
1603 (template_parameter_pack_p): Declare.
1604 (template_parms_variadic_p): Declare.
1605 (make_pack_expansion): Declare.
1606 (check_for_bare_parameter_packs): Declare.
1607 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1608 sizeof... expressions.
1609 (pp_cxx_expression): Print pack expansions and non-type argument
1611 (pp_cxx_exception_specification): Print pack expansions.
1612 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1613 (pp_cxx_ctor_initializer): Print pack expansions.
1614 (pp_cxx_type_id): Print pack expansions.
1615 (pp_cxx_template_argument_list): Print argument packs.
1616 (pp_cxx_template_parameter): Print ellipsis for template parameter
1618 * pt.c (comp_template_parms): Compare template parameter packs.
1619 (template_parameter_pack_p): New.
1620 (template_parms_variadic_p): New.
1621 (template_args_variadic_p): New.
1622 (make_ith_pack_parameter_name): New.
1623 (struct find_parameter_pack_data): New.
1624 (find_parameter_packs_r): New.
1625 (uses_parameter_packs): New.
1626 (make_pack_expansion): New.
1627 (check_for_bare_parameter_packs): New.
1628 (expand_template_argument_pack): New.
1629 (reduce_template_parm_level): Propagate parameter pack flag.
1630 (process_template_parm): Add is_parameter_pack parameter to state
1631 when the parameter is actually a parameter pack. Create template
1632 parameter packs when is_parameter_pack is true.
1633 (current_template_args): The argument for a template parameter
1634 pack is an argument pack containing a single pack expansion.
1635 (process_partial_specialization): When checking that non-type
1636 argument expressions do not involve template parameters, loop over
1637 the arguments in argument packs separately.
1638 (push_template_decl_real): Check that the type of the declaration
1639 does not have any bare parameter packs. Check that primary
1640 templates have no more than one parameter pack, and that it comes
1641 at the end of the template parameter list.
1642 (convert_template_argument): Handle coercions for pack expansion
1643 expressions by coercing the pattern then rebuilding the expansion.
1644 (coerce_template_parms): When coercing the arguments for a
1645 variadic template, pack "extra" arguments into an argument pack.
1646 (coerce_template_template_parms): Cannot coerce between parameter
1647 packs and non-pack parameters.
1648 (template_args_equal): Compare PACK_EXPANSION_P expressions.
1649 (comp_template_args): Expand all template arguments packs before
1650 comparing template argument lists.
1651 (mangle_class_name_for_template): Make argument packs as separate
1653 (for_each_template_parm_r): No need to handle BASELINK.
1654 (instantiate_class_template): Handle pack expansions in the base
1656 (tsubst_pack_expansion): New.
1657 (tsubst_template_args): Handle substitutions of argument packs and
1658 pack expansion into template argument lists.
1659 (tsubst_decl): Expand function parameter packs into separate
1660 function parameters.
1661 (tsubst_arg_types): Expand a type pack expansion into separate
1663 (tsubst_exception_specification): Handle pack expansions in
1664 exception specifiers.
1665 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1666 replacing a template parameter with its argument. If we encounter
1667 a substitution for an argument pack, just return the parameter
1669 (tsubst_copy): sizeof(X...) returns the number of elements in
1670 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1671 PARM_DECL is a parameter pack.
1672 (tsubst_expr): Expression pack expansions and argument packs
1673 cannot show up here; they will all be handled through function
1674 calls, sizeof, and template argument lists.
1675 (tsubst_copy_and_build): sizeof(X...) returns the number of
1676 elements in parameter pack X. Handle pack expansions in TREE_LIST
1677 and CONSTRUCTOR nodes.
1678 (fn_type_unification): Handle "incomplete" explicit template
1679 argument lists that specify some of the arguments for a template
1681 (type_unification_real): Unify arguments against pack expansions.
1682 (template_parm_level_and_index): New, helper function.
1683 (unify_pack_expansion): New.
1684 (unify): Unify argument packs on an argument-by-argument basis,
1685 handling variadic argument packs as well.
1686 (more_specialized_fn): Handle unification of function parameter
1687 packs. All things being equal, prefer non-variadic function
1688 templates to variadic function templates.
1689 (more_specialized_class): Prefer the variadic class template
1690 partial specialization that binds fewer arguments to a parameter
1692 (regenerate_decl_from_template): Expand function parameter packs
1693 into separate parameters.
1694 (instantiate_decl): Ditto.
1695 (tsubst_initializer_list): Handle pack expansions for base-class
1697 (dependent_type_p_r): Determine dependent types in argument packs
1698 and pack expansions.
1699 (value_dependent_expression_p): Determine value-dependence of
1700 non-type argument packs.
1701 (dependent_template_arg_p): Handle argument packs.
1702 * semantics.c (finish_cond): Check for bare parameter packs.
1703 (finish_expr_stmt): Ditto.
1704 (finish_for_expr): Ditto.
1705 (finish_switch_cond): Ditto.
1706 (finish_mem_initializers): Ditto.
1707 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1709 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1710 * parser.c (make_declarator): Declarator is not an expansion.
1711 (make_pointer_declarator): Transfer parameter pack flag to outer
1713 (make_reference_declarator): Ditto.
1714 (make_ptrmem_declarator): Ditto.
1715 (make_call_declarator): Ditto.
1716 (make_array_declarator): Ditto.
1717 (cp_parser_postfix_expression): Allow pack expansion expressions
1718 in the argument list for a call expression.
1719 (cp_parser_parenthesized_expression_list): Add new parameter
1720 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1721 into separate arguments."
1722 (cp_parser_new_placement): Allow pack expansion expressions.
1723 (cp_parser_new_initializer): Ditto.
1724 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1725 base-class initializer expansion.
1726 (cp_parser_mem_initializer): Ditto.
1727 (cp_parser_template_parameter_list): Keep track of whether the
1728 template parameter is a template parameter pack.
1729 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1730 template parameter pack.
1731 (cp_parser_type_parameter): Ditto.
1732 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1734 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1735 this declarator is a parameter pack.
1736 (cp_parser_parameter_declaration): The ellipsis does not end the
1737 parameter declaration, because it might be a parameter pack. Parse
1738 the ellipsis to indicate a parameter pack.
1739 (cp_parser_initializer): Allow pack expansions.
1740 (cp_parser_initializer_list): Allow ellipsis to create an
1741 initializer expansion.
1742 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1744 (cp_parser_type_id_list): Allow ellipsis to create an exception
1745 specifier expansion.
1746 (cp_parser_attribute_list): Don't allow pack expansions.
1747 (cp_parser_functional_cast): Allow pack expansions.
1748 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1749 compute the length of a parameter pack.
1750 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1751 end a template argument.
1752 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1753 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1756 2007-03-09 Dirk Mueller <dmueller@suse.de>
1758 * cp/call.c (build_new_op): Call warn_logical_operator.
1760 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1763 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1766 * pt.c (any_template_arguments_need_structural_equality_p):
1769 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1771 * decl.c (grokdeclarator): Disable warnings for anonymous
1774 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1776 * typeck2.c (readonly_error): Always emit a hard error.
1777 Remove last argument.
1778 * cp-tree.h (readonly_error): Adjust prototype.
1779 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1780 * typeck.c (build_unary_op): Likewise.
1781 (build_modify_expr): Likewise.
1783 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1786 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1788 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1791 * parser.c (struct cp_parser): New IN_IF_STMT.
1792 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1793 returning if parsing the body of an 'if' statement or issuing an
1794 error and continuing.
1795 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1797 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1799 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1802 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1805 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1807 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1808 Objective-C++. Don't exit early if -shared-libgcc needs to be
1811 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1813 * typeck.c (common_base_type): Delete unused function.
1815 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1817 * Make-lang.in: Add dummy lang.install-pdf target.
1819 2007-03-01 Simon Baldwin <simonb@google.com>
1822 * decl.c (check_tag_decl): Added new warning for typedef ignored
1823 when it precedes an otherwise valid non-typedef declaration.
1825 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1827 * typeck.c (build_function_call): Store converted arguments
1828 in a stack-allocated array instead of building a list.
1829 (convert_arguments): Store arguments in the array passed in as an
1830 argument, and return the actual number of arguments.
1831 * call.c (build_call): Delete, and replace with...
1832 (build_call_n, build_call_a): New.
1833 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1834 (build_over_call): Store converted arguments in a stack-allocated
1835 array instead of building a list.
1836 (build_cxx_call): Pass arguments in an array instead of as a list.
1837 (build_java_interface_fn_ref): Rewrite to avoid constructing
1839 * tree.h: Update declarations to reflect above changes.
1840 * method.c (use_thunk): Use a stack-allocated array to hold
1841 the arguments instead of a list.
1842 * rtti.c (throw_bad_cast): Update call to cxx_call.
1843 (throw_bad_typeid): Likewise.
1844 (build_dynamic_cast_1): Likewise.
1845 * init.c (build_builtin_delete_call): Use build_call_n.
1846 * decl.c (expand_static_init): Likewise.
1847 * except.c (cp_protect_cleanup_actions): Likewise.
1848 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1849 (gimplify_must_not_throw_expr): Likewise.
1850 (cxx_omp_apply_fn): Use build_call_a.
1852 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1854 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1855 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1857 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1859 * cp-tree.h (static_ctors): Remove.
1860 * cp-tree.h (static_dtors): Likewise.
1861 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1862 refactoring of tree_map hierarchy.
1863 (decl_shadowed_for_var_insert): Likewise.
1864 * semantics.c (expand_body): Use c_expand_body.
1865 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1866 * decl2.c (static_ctors): Remove.
1867 (static_dtors): Likewise.
1868 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1869 objc_generate_static_init_call. Do not call static_[cd]tors.
1870 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1872 (cp_write_global_declarations): Likewise.
1874 2007-02-23 Richard Guenther <rguenther@suse.de>
1876 * class.c (note_name_declared_in_class): Make declaration
1877 changes meaning a pedwarn.
1879 2007-02-22 Michael Matz <matz@suse.de>
1882 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1883 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1884 dump_function_decl): Guard emitting outer scopes by new flag.
1885 * cp-lang.c (cxx_dwarf_name): New function.
1886 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1887 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1889 (push_template_decl_real, lookup_template_class): Remove calls
1892 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1894 * call.c (build_new_method_call): Ensure that explicit calls of
1895 destructors have type "void".
1897 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1899 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1900 and -Walways-true with -Waddress.
1901 * cvt.c (convert_to_void): Replace unconditional warning with
1904 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1906 * decl.c, tree.c: Fix comment typos.
1908 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1911 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1912 statement expression if we had an error mark node.
1914 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1915 Brooks Moses <brooks.moses@codesourcery.com>
1916 Lee Millward <lee.millward@codesourcery.com>
1918 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1919 Change class to tcc_vl_exp.
1921 * call.c (build_call): Use build_call_list instead
1923 (build_over_call): Likewise.
1924 (build_new_method_call): Use build_min_non_dep_call_list
1925 instead of build_min_non_dep.
1927 * error.c (dump_call_expr_args): New function.
1928 (dump_aggr_init_expr_args): New function.
1929 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1930 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1932 * cvt.c (convert_to_void): Use build_call_array instead
1933 of build3; use new AGGR_INIT_EXPR accessor macros.
1935 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1936 instead of TREE_CODE_LENGTH.
1938 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1939 AGGR_INIT_EXPR accessor macros.
1941 * cp-gimplify.c (cp_gimplify_init_expr): Use
1942 AGGR_INIT_EXPR_SLOT to set the slot operand.
1944 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1945 (AGGR_INIT_EXPR_SLOT): New macro.
1946 (AGGR_INIT_EXPR_ARG): New macro.
1947 (aggr_init_expr_nargs): New macro.
1948 (AGGR_INIT_EXPR_ARGP): New macro.
1949 (aggr_init_expr_arg_iterator): New.
1950 (init_aggr_init_expr_arg_iterator): New.
1951 (next_aggr_init_expr_arg): New.
1952 (first_aggr_init_expr_arg): New.
1953 (more_aggr_init_expr_args_p): New.
1954 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1955 (stabilize_aggr_init): New declaration.
1956 (build_min_non_dep_call_list): Likewise.
1958 * tree.c (process_aggr_init_operands): New function.
1959 (build_aggr_init_array) New function.
1960 (build_cplus_new): Update to use new CALL_EXPR and
1961 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1962 build_aggr_init_array.
1963 (build_min_non_dep_call_list) New function.
1964 (build_min_nt): Assert input code parameter is not a variable
1965 length expression class.
1966 (build_min, build_min_non_dep): Likewise.
1967 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1968 to check for equality instead of recursing. Handle tcc_vl_exp
1970 (stabilize_call): Update to only handle CALL_EXPRs, not
1971 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1972 (stabilize_aggr_init): New function.
1973 (stabilize_init): Use it.
1975 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1976 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1977 AGGR_INIT_EXPR accessor macros and argument iterators.
1979 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1980 build_vl_exp. Iterate through the operands, recursively
1981 processing each one.
1982 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1983 CALL_EXPR accessor macros.
1984 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1985 tree code classes. Use TREE_OPERAND_LENGTH instead of
1988 * semantics.c (finish_call_expr): Use build_nt_call_list
1989 instead of build_nt.
1990 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1991 accessor macros. Use build_call_array to construct the
1992 CALL_EXPR node instead of build3
1994 * decl2.c (build_offset_ref_call_from_tree): Use
1995 build_nt_call_list and build_min_non_dep_call_list instead
1996 of build_min_nt and build_min_non_dep.
1998 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1999 Use build_nt_call_list instead of build_min_nt.
2001 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2004 * call.c (build_conditional_expr): Improve error message.
2006 2007-02-13 Dirk Mueller <dmueller@suse.de>
2008 * friend.c (do_friend): Annotate warning about friend
2009 declarations in templates with OPT_Wnon_template_friend.
2010 Convert informal message from warning() to inform().
2012 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
2013 Mark Mitchell <mark@codesourcery.com>
2016 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2017 instantiations for variables.
2019 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2022 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2023 Check warn_unused_value just once.
2025 2007-02-11 Mark Mitchell <mark@codesourcery.com>
2028 * pt.c (determine_specialization): Use skip_artificial_parms_for.
2029 (fn_type_unificiation): Likewise.
2030 (get_bindings): Likewise.
2032 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
2035 * decl.c (finish_function): Use DECL_REPLACEABLE.
2036 * tree.c (cp_cannot_inline_tree_fn): Likewise.
2038 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
2040 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2042 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
2044 * decl.c (grokvardecl): Don't error if !have_tls.
2045 (grokdeclarator): Likewise.
2046 * parser.c (cp_parser_omp_threadprivate): Likewise.
2048 2007-02-07 Jakub Jelinek <jakub@redhat.com>
2051 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2052 parameters and result decls in omp clauses.
2053 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2056 2007-02-05 Dirk Mueller <dmueller@suse.de>
2059 * parser.c (cp_parser_class_specifier): Always initialize bases.
2061 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
2063 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2064 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2065 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2067 * semantics.c (finish_omp_atomic): Store a whole expression node
2068 in operand 1, and integer_zero_node in operand 0, for dependent
2069 OMP_ATOMIC. Rewrite to make flow easier to understand.
2071 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2073 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2075 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
2077 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2078 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2080 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2082 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2083 keyword warning to -Wc++0x-compat.
2085 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2087 * decl.c (grokdeclarator): Update documentation.
2089 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2092 * decl.c (grokdeclarator): If __thread is used together with
2093 a storage class other than extern and static, clear thread_p
2094 after issuing diagnostics and fall through to checking the
2097 2007-01-30 Roger Sayle <roger@eyesopen.com>
2099 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2100 calculating the size of an array (to avoid recursive errors).
2102 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2105 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2107 * call.c (convert_like_real): Don't warn when converting to
2110 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2112 * decl.c (pop_label): Replace warning with call to
2113 warn_for_unused_label.
2115 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2118 * semantics.c (finish_pseudo_destructor_expr): Check the
2119 destrutor name by calling check_dtor_name.
2121 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2123 * lex.c (D_CPP0X): Rename.
2125 (reswords): D_CPP0X -> D_CXX0X.
2126 (init_reswords): Ditto.
2127 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2128 of C++0x keywords as identifiers.
2130 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2133 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2136 2007-01-23 Ian Lance Taylor <iant@google.com>
2138 * typeck.c (convert_for_assignment): Only warn about a = b = c
2139 when converting to bool.
2141 2007-01-23 Roger Sayle <roger@eyesopen.com>
2143 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2145 * typeck.c (ignore_overflows): Remove the remaining uses of
2146 TREE_CONSTANT_OVERFLOW.
2148 2007-01-20 Jan Hubicka <jh@suse.cz>
2150 * decl2.c (start_objects, start_static_storage_duration_function):
2151 Do not make the functions uninlinable.
2153 2007-01-17 Ian Lance Taylor <iant@google.com>
2155 * class.c (add_method): Call VEC_reserve_exact rather than passing
2156 a negative size to VEC_reserve.
2158 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2161 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2163 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2166 * decl.c (make_typename_type): If the qualified name is not a
2167 type, issue an error.
2168 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2171 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2173 * rtti.c: Include target.h.
2174 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2175 don't emit typeinfo for fundamental types as weak.
2176 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2178 2007-01-08 Richard Guenther <rguenther@suse.de>
2180 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2182 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2184 * call.c (standard_conversion): Pass flag to
2185 vector_types_convertible_p to disallow emission of note.
2186 * typeck.c (convert_for_assignment): Pass flag to
2187 vector_types_convertible_p to allow emission of note.
2188 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2189 to disallow emission of note.
2191 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2194 * typeck.c (build_binary_op): Call overflow_warning if
2195 TREE_OVERFLOW_P is true for the result and not for any of the
2198 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2201 * class.c (add_method): Don't wait until template
2202 instantiation time to complain about duplicate methods.
2204 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2207 * semantics.c (finish_unary_op_expr): Warn only if result
2208 overflowed and operands did not.
2210 2007-01-05 Ian Lance Taylor <iant@google.com>
2212 * typeck.c (build_binary_op): Warn about comparing a non-weak
2215 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2217 * pt.c (tsubst): Propagate the need for structural equality checks
2218 when reducing the level of template parameters.
2220 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2222 * pt.c: Fix a comment typo.
2224 2007-01-02 Ian Lance Taylor <iant@google.com>
2226 * semantics.c (maybe_convert_cond): Optionally warn when using an
2227 assignment as a condition.
2228 * typeck.c (convert_for_assignment): Optionally warn about
2229 assigning the result of an assignment to a bool.
2231 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2233 * pt.c (canonical_template_parms): Correct typo in comment.
2235 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2237 * typeck.c (structural_comptypes): Renamed from "comptypes".
2238 (comptypes): Use canonical type information to perform fast type
2239 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2240 canonical type comparison returns the same results as we would see
2241 from the current, structural check. Support COMPARE_STRUCTURAL
2242 when we need structural checks.
2243 * decl.c (typename_compare): Fix comment.
2244 (build_typename_type): TYPENAME_TYPE nodes require structural
2245 equality checks, because they resolve different based on the
2247 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2248 require structural equality checks (for now).
2249 (build_ptrmemfunc_type): Build the canonical pointer to member
2251 (compute_array_index_type): Whenever we build a new index type
2252 to represent the size of an array in a template, we need to mark
2253 this index type as requiring structural equality. This goes for
2254 arrays with value-dependent sizes with the current ABI, or all
2256 * tree.c (cplus_array_hash): New.
2257 (struct cplus_array_info): New.
2258 (cplus_array_compare): New.
2259 (cplus_array_htab): New.
2260 (build_cplus_array_type_1): Use a hash table to cache the array
2261 types we build. Build the canonical array type for each array
2263 (cp_build_qualified_type_real): When building a cv-qualified array
2264 type, use the hash table of array types and build canonical array
2266 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2267 use structural equality (for now).
2268 * cp-tree.h (COMPARE_STRUCTURAL): New.
2269 * pt.c (canonical_template_parms): New.
2270 (canonical_type_parameter): New.
2271 (process_template_parm): Find the canonical type parameter.
2272 (lookup_template_class): When we have named the primary template
2273 type, set the canonical type for our template class to the primary
2274 template type. If any of the template arguments need structural
2275 equality checks, the template class needs structural equality
2277 (tsubst): When reducing the level of a template template
2278 parameter, we require structural equality tests for the resulting
2279 parameter because its template parameters have not had their types
2280 canonicalized. When reducing a template type parameter, find the
2281 canonical reduced type parameter.
2282 (any_template_arguments_need_structural_equality_p): New.