1 2008-05-01 Simon Baldwin <simonb@google.com>
3 * typeck.c (build_array_ref): Call warn_array_subscript_range.
5 2008-04-30 Jakub Jelinek <jakub@redhat.com>
8 * pt.c (more_specialized_fn): Stop the loop even if there are no
9 arguments before ellipsis.
11 2008-04-29 Jakub Jelinek <jakub@redhat.com>
14 * parser.c (cp_parser_lookup_name): Look through single function
18 * typeck.c (cp_build_modify_expr) <case PREINCREMENT_EXPR>: Don't build
19 COMPOUND_EXPR if the second argument would be error_mark_node.
21 2008-04-28 Jason Merrill <jason@redhat.com>
22 Liu Guanwei <liu_gw@163.com>
25 * parser.c (cp_parser_parameter_declaration): Handle < ambiguity
28 2008-04-25 Jan Hubicka <jh@suse.cz>
30 * typeck.c (check_return_expr): Update.
31 * decl.c (start_preparsed_function): Update.
32 * method.c (use_thunk): Update.
34 2008-04-24 Jakub Jelinek <jakub@redhat.com>
37 * cp-tree.h (cp_reconstruct_complex_type): New prototype.
38 * cp-objcp-common.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define.
39 * decl2.c (is_late_template_attribute): Only make vector_size
40 late tmpl attribute if argument is type or value dependent.
41 (cp_reconstruct_complex_type): New function.
43 2008-04-24 Richard Guenther <rguenther@suse.de>
45 * typeck.c (cp_build_function_call): Call
46 check_builtin_function_arguments.
48 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
50 * typeck.c (get_member_function_from_ptrfunc): Don't set TREE_INVARIANT.
51 (build_ptrmemfunc1): Don't set TREE_INVARIANT.
52 * init.c (build_zero_init): Don't set TREE_INVARIANT.
53 * class.c (build_base_path): Don't set TREE_INVARIANT.
54 (build_vtbl_ref_1): Don't set TREE_INVARIANT.
55 (build_vtbl_initializer): Don't set TREE_INVARIANT.
56 * decl.c (build_enumerator): Don't set TREE_INVARIANT.
57 * rtti.c (tinfo_base_init): Don't set TREE_INVARIANT.
58 (generic_initializer): Don't set TREE_INVARIANT.
59 (ptr_initializer): Don't set TREE_INVARIANT.
60 (ptm_initializer): Don't set TREE_INVARIANT.
61 (class_initializer): Don't set TREE_INVARIANT.
62 * typeck2.c (process_init_constructor): Don't set TREE_INVARIANT.
63 * pt.c (push_inline_template_parms_recursive): Don't set TREE_INVARIANT.
64 (build_template_parm_index): Don't set TREE_INVARIANT.
65 (reduce_template_parm_level): Don't set TREE_INVARIANT.
66 (process_template_parm): Don't set TREE_INVARIANT.
68 2008-04-22 Jason Merrill <jason@redhat.com>
71 * semantics.c (finish_decltype_type): Check DECL_BIT_FIELD_TYPE
72 to see if DECL_BIT_FIELD_TYPE should be used, not some other flag.
73 * typeck.c (is_bitfield_expr_with_lowered_type): Likewise.
75 2008-04-22 Jakub Jelinek <jakub@redhat.com>
78 * semantics.c (finish_stmt_expr): Call pop_stmt_list even if the stmt
79 expression is errorneous.
81 2008-04-21 Jason Merrill <jason@redhat.com>
84 * tree.c (cp_tree_equal): Handle FIXED_CST.
87 * pt.c (template_template_parm_bindings_ok_p): Set
88 processing_template_decl while in this function.
90 2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
92 * cvt.c (type_promotes_to): Support char16_t and char32_t.
93 * decl.c (grokdeclarator): Disallow signed/unsigned/short/long on
94 char16_t and char32_t.
95 * lex.c (reswords): Add char16_t and char32_t (for c++0x).
96 * mangle.c (write_builtin_type): Mangle char16_t/char32_t as vendor
97 extended builtin type "u8char{16,32}_t".
98 * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Support
100 (cp_lexer_print_token): Support CPP_STRING{16,32}.
101 (cp_parser_is_string_literal): Idem.
102 (cp_parser_string_literal): Idem.
103 (cp_parser_primary_expression): Support CPP_CHAR{16,32} and
105 (cp_parser_simple_type_specifier): Support RID_CHAR{16,32}.
106 * tree.c (char_type_p): Support char16_t and char32_t as char types.
107 * typeck.c (string_conv_p): Support char16_t and char32_t.
109 2008-04-17 Jason Merrill <jason@redhat.com>
112 * call.c (build_user_type_conversion_1): Represent second step of
113 copy-init with an rvalue conversion.
114 (convert_like_real) [ck_user]: Don't implicitly add it here.
116 2008-04-15 Jakub Jelinek <jakub@redhat.com>
119 * decl.c (layout_var_decl): If extern or static var has variable
120 size, set TREE_TYPE (decl) to error_mark_node.
122 2008-04-16 Danny Smith <dannysmith@users.sourceforge.net>
125 * optimize.c (maybe_clone_body): Copy DECL_DLLIMPORT_P flag
128 2008-04-09 Jason Merrill <jason@redhat.com>
131 * semantics.c (finish_compound_literal): Return a TARGET_EXPR,
132 not a pushed variable.
134 2008-04-09 Volker Reichelt <v.reichelt@netcologne.de>
136 * call.c (build_op_delete_call): Fix quotation in warning message.
137 * decl.c (grokdeclarator): Quote keyword in error message.
138 * pt.c (check_for_bare_parameter_packs): Fix quotation in error
141 * parser.c (cp_parser_check_type_definition): Print error string
142 directly rather than using "%s".
143 (cp_parser_postfix_expression): Fix quotation.
144 (cp_parser_decltype): Likewise.
145 (cp_parser_sizeof_operand): Fix quotation. Simplify.
147 * parser.c (cp_parser_non_integral_constant_expression): Build error
148 message with CONCAT rather than using "%s".
149 (cp_parser_primary_expression): Fix quotation.
150 (cp_parser_postfix_expression): Likewise.
151 (cp_parser_postfix_dot_deref_expression): Likewise.
152 (cp_parser_unary_expression): Likewise.
153 (cp_parser_new_expression): Likewise.
154 (cp_parser_delete_expression): Likewise.
156 * parser.c (cp_parser_asm_specification_opt): Print CPP_CLOSE_PAREN
157 as `)', not as `('. Fix quotation.
158 (cp_parser_consume_semicolon_at_end_of_statement): Fix quotation.
159 (cp_parser_primary_expression): Likewise.
160 (cp_parser_nested_name_specifier_opt): Likewise.
161 (cp_parser_postfix_expression): Likewise.
162 (cp_parser_postfix_open_square_expression): Likewise.
163 (cp_parser_parenthesized_expression_list): Likewise.
164 (cp_parser_pseudo_destructor_name): Likewise.
165 (cp_parser_new_expression): Likewise.
166 (cp_parser_direct_new_declarator): Likewise.
167 (cp_parser_delete_expression): Likewise.
168 (cp_parser_cast_expression): Likewise.
169 (cp_parser_question_colon_clause): Likewise.
170 (cp_parser_builtin_offsetof): Likewise.
171 (cp_parser_trait_expr): Likewise.
172 (cp_parser_label_for_labeled_statement): Likewise.
173 (cp_parser_compound_statement): Likewise.
174 (cp_parser_selection_statement): Likewise.
175 (cp_parser_condition): Likewise.
176 (cp_parser_iteration_statement): Likewise.
177 (cp_parser_already_scoped_statement): Likewise.
178 (cp_parser_simple_declaration): Likewise.
179 (cp_parser_linkage_specification): Likewise.
180 (cp_parser_static_assert): Likewise.
181 (cp_parser_decltype): Likewise.
182 (cp_parser_conversion_function_id): Likewise.
183 (cp_parser_operator_function_id): Likewise.
184 (cp_parser_operator): Likewise.
185 (cp_parser_type_parameter): Likewise.
186 (cp_parser_template_id): Likewise.
187 (cp_parser_explicit_instantiation): Likewise.
188 (cp_parser_explicit_specialization): Likewise.
189 (cp_parser_enum_specifier): Likewise.
190 (cp_parser_namespace_definition): Likewise.
191 (cp_parser_namespace_alias_definition): Likewise.
192 (cp_parser_using_declaration): Likewise.
193 (cp_parser_using_directive): Likewise.
194 (cp_parser_asm_definition): Likewise.
195 (cp_parser_direct_declarator): Likewise.
196 (cp_parser_ptr_operator): Likewise.
197 (cp_parser_parameter_declaration_clause): Likewise.
198 (cp_parser_initializer_clause): Likewise.
199 (cp_parser_class_specifier): Likewise.
200 (cp_parser_member_specification_opt): Likewise.
201 (cp_parser_member_declaration): Likewise.
202 (cp_parser_pure_specifier): Likewise.
203 (cp_parser_constant_initializer): Likewise.
204 (cp_parser_base_clause): Likewise.
205 (cp_parser_exception_specification_opt): Likewise.
206 (cp_parser_try_block): Likewise.
207 (cp_parser_function_try_block): Likewise.
208 (cp_parser_handler): Likewise.
209 (cp_parser_throw_expression): Likewise.
210 (cp_parser_asm_operand_list): Likewise.
211 (cp_parser_attributes_opt): Likewise.
212 (cp_parser_label_declaration): Likewise.
213 (cp_parser_constructor_declarator_p): Likewise.
214 (cp_parser_template_declaration_after_export): Likewise.
215 (cp_parser_single_declaration): Likewise.
216 (cp_parser_objc_message_expression): Likewise.
217 (cp_parser_objc_message_args): Likewise.
218 (cp_parser_objc_encode_expression): Likewise.
219 (cp_parser_objc_defs_expression): Likewise.
220 (cp_parser_objc_protocol_expression): Likewise.
221 (cp_parser_objc_selector_expression): Likewise.
222 (cp_parser_objc_protocol_refs_opt): Likewise.
223 (cp_parser_objc_typename): Likewise.
224 (cp_parser_objc_method_keyword_params): Likewise.
225 (cp_parser_objc_superclass_or_category): Likewise.
226 (cp_parser_objc_try_catch_finally_statement): Likewise.
227 (cp_parser_objc_synchronized_statement): Likewise.
228 (cp_parser_objc_throw_statement): Likewise.
229 (cp_parser_omp_var_list_no_open): Likewise.
230 (cp_parser_omp_clause_default): Likewise.
231 (cp_parser_omp_clause_if): Likewise.
232 (cp_parser_omp_clause_num_threads): Likewise.
233 (cp_parser_omp_clause_reduction): Likewise.
234 (cp_parser_omp_clause_schedule): Likewise.
235 (cp_parser_omp_critical): Likewise.
236 (cp_parser_omp_for_loop): Likewise.
237 (cp_parser_omp_sections_scope): Likewise.
239 * parser.c (cp_parser_template_parameter_list): Simplify.
241 2008-04-07 James E. Wilson <wilson@tuliptree.org>
243 * pt.c (tsubst_copy, case SIZEOF_EXPR): Initialize len.
245 2008-04-07 Jason Merrill <jason@redhat.com>
248 * class.c (type_has_user_nondefault_constructor): A template
249 counts as a nondefault constructor.
251 2008-04-04 Paolo Bonzini <bonzini@gnu.org>
253 * decl.c (cxx_push_function_context): Delete.
254 (cxx_pop_function_context): Delete.
255 (start_preparsed_function): Merge cxx_push_function_context (!f->decl
257 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_INIT,
258 LANG_HOOKS_FUNCTION_FINAL): Delete.
259 (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to
260 LANG_HOOKS_MISSING_NORETURN_OK_P.
261 * cp-tree.h (cxx_push_function_context, cxx_pop_function_context):
263 * semantics.c (current_stmt_tree): Fix comment.
265 2008-04-03 Jakub Jelinek <jakub@redhat.com>
268 * semantics.c (finish_offsetof): Undo effect of convert_from_reference
269 before calling fold_offsetof.
271 2008-04-03 Tom Tromey <tromey@redhat.com>
273 * Make-lang.in (c++_OBJS): New variable.
275 2008-04-03 Paolo Bonzini <bonzini@gnu.org>
277 * optimize.c (clone_body): New, from tree-inline.c.
279 2008-04-03 Paolo Bonzini <bonzini@gnu.org>
281 * method.c (synthesize_method): Use {push,pop}_function_context.
282 * name-lookup.c (push_to_top_level): Likewise.
283 * parser.c (cp_parser_late_parsing_for_member): Likewise.
285 2008-03-30 Volker Reichelt <v.reichelt@netcologne.de>
288 * parser.c (cp_parser_decl_specifier_seq): Add location to error
291 2008-03-27 Tom Tromey <tromey@redhat.com>
293 * Make-lang.in: Revert automatic dependency patch.
295 2008-03-27 Douglas Gregor <doug.gregor@gmail.com>
298 * typeck.c (build_x_compound_expr): Use cp_build_compound_expr.
299 (build_compound_expr): New, for compatibility with C
301 (cp_build_compound_expr): Renamed from build_compound_expr.
302 (build_c_cast): New, for compatibility with C build_c_cast.
303 (cp_build_c_cast): Renamed from build_c_cast.
304 * init.c (build_vec_delete_1): Fix calls to build_compound_expr.
305 * decl.c (cxx_maybe_build_cleanup): Ditto.
306 * cp-tree.h (build_compound_expr): Add C-compatibile prototype.
307 (cp_build_compound_expr): Renamed from build_compound_expr.
308 (build_c_cast): Add C-compatible prototype.
309 (cp_build_c_cast): Renamed from build_c_cast.
310 * typeck2.c (build_functional_cast): Use cp_build_c_cast.
311 * parser.c (cp_parser_cast_expression): Fix call to build_c_cast.
313 2008-03-27 Douglas Gregor <doug.gregor@gmail.com>
315 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Cope with
316 tsubst_pack_expansion returning a pack expansion, or a TREE_VEC
317 ending in a pack expansion, both of which can occur when
318 substituting into a nested template.
319 (tsubst_copy_and_build) <case SIZEOF_EXPR>: When we're
320 instantiating the sizeof...(X) form, make tsubst_copy do the work.
321 * parser.c (cp_parser_template_parameter): Deal with unnamed
322 non-type template parameter packs identified by pack expansions in
325 2008-03-26 Jakub Jelinek <jakub@redhat.com>
328 * pt.c (apply_late_template_attributes): Don't call tsubst on
329 first attribute argument if it is IDENTIFIER_NODE.
332 * error.c (dump_expr): Pass {,UN}ORDERED_EXPR, UN{LT,LE,GT,GE,EQ}_EXPR
333 and LTGT_EXPR to pp_expression.
335 2008-03-26 Douglas Gregor <doug.gregor@gmail.com>
337 * pt.c (coerce_template_template_parm): Moved the body of the loop
338 of coerce_template_template_parms here, to make iteration over a
339 template argument pack simpler.
340 Also, allow matching of a template parameter pack in the template
341 template parameter to a template parameter in the template
343 (coerce_template_template_parms): Deal with variadic template
344 template parameters. Use coerce_template_template_parm.
345 (unify): Make sure we coerce the template template argument's
346 template arguments to the template template parameter's template
347 parameters, not the other way around.
349 2008-03-25 Tom Tromey <tromey@redhat.com>
351 * Make-lang.in: Remove .o targets.
352 (cp/g++spec.o): Moved to cp/. Reduce to variable setting.
354 (c++_OBJS): New variable.
355 (CXX_TREE_H, CXX_PRETTY_PRINT_H): Remove.
357 2008-03-25 Douglas Gregor <doug.gregor@gmail.com>
359 * typeck.c (composite_pointer_type_r): Add SFINAE support.
360 (composite_pointer_type): Ditto.
361 (common_type): Fix call to composite_pointer_type.
362 (cxx_sizeof_nowarn): New; used to be a macro.
363 (cxx_sizeof_expr): Add SFINAE support.
364 (cxx_alignof_expr): Ditto.
365 (decay_conversion): Fix calls for SFINAE support.
366 (rationalize_conditional_expr): Add SFINAE support.
367 (build_class_member_access_expr): Ditto.
368 (finish_class_member_access_expr): Ditto.
369 (build_x_indirect_ref): Ditto.
370 (build_indirect_ref): Original version renamed to
371 cp_build_indirect_ref; new version provides a bridge from
373 (cp_build_indirect_ref): Was build_indirect_ref; added SFINAE
375 (get_member_function_from_ptrfunc): Fix calls for SFINAE support.
376 (build_function_call): Original version renamed to
377 cp_build_function_call; new version provides a bridge from
379 (cp_build_function_call): Was build_function_call; added SFINAE
381 (convert_arguments): Add SFINAE support.
382 (build_x_binary_op): Ditto.
383 (build_binary_op): Original version renamed to cp_build_binary_op;
384 new version provides a bridge from c-common.
385 (cp_build_binary_op): Was build_binary_op; added SFINAE support.
386 (pointer_diff): Fix calls for SFINAE.
387 (build_x_unary_op): Add SFINAE support.
388 (condition_conversion): Fix calls for SFINAE.
389 (build_unary_op): Original version renamed to cp_build_unary_op;
390 new version provides a bridge from c-common.
391 (cp_build_unary_op): Was build_unary_op; added SFINAE support.
392 (unary_complex_lvalue): Fix calls for SFINAE.
393 (build_x_conditional_expr): Add SFINAE support.
394 (build_x_compound_expr_from_list): Fix calls for SFINAE.
395 (build_x_compound_expr): Add SFINAE support.
396 (convert_ptrmem): Fix calls for SFINAE.
397 (build_static_cast_1): Add SFINAE support.
398 (build_static_cast): Ditto.
399 (build_reinterpret_cast_1): Ditto.
400 (build_reinterpret_cast): Ditto.
401 (build_const_cast_1): Ditto.
402 (build_const_cast): Ditto.
403 (build_c_cast): Ditto.
404 (build_modify_expr): Original version renamed to
405 cp_build_modify_expr; new version provides a bridge from c-common.
406 (cp_build_modify_expr): Was build_modify_expr; added SFINAE
408 (build_x_modify_expr): Add SFINAE support.
409 (build_ptrmemfunc): Fix calls for SFINAE.
410 (convert_for_assignment): Add SFINAE support.
411 (convert_for_initialization): Ditto.
412 (check_return_expr): Fix calls for SFINAE.
413 (lvalue_or_else): Add SFINAE support.
414 * init.c (perform_member_init): Fix calls for SFINAE.
415 (emit_mem_initializers): Ditto.
416 (expand_virtual_init): Ditto.
417 (expand_cleanup_for_base): Ditto.
418 (build_aggr_init): Add SFINAE support.
419 (expand_default_init): Ditto.
420 (expand_aggr_init_1): Fix calls for SFINAE.
421 (build_offset_ref): Ditto.
422 (build_new_1): Add SFINAE support.
424 (build_vec_delete_1): Fix calls for SFINAE.
425 (get_temp_regvar): Ditto.
426 (build_vec_init): Add SFINAE support.
427 (build_dtor_call): Fix calls for SFINAE.
428 (build_delete): Ditto.
429 (push_base_cleanups): Ditto.
430 (build_vec_delete_1): Ditto.
431 * class.c (build_base_path): Fix calls for SFINAE.
432 (build_simple_base_path): Ditto.
433 (convert_to_base_statically): Ditto.
434 (build_vfn_ref): Ditto.
435 (resolve_address_of_overloaded_function): Ditto.
436 * decl.c (check_initializer): Fix calls for SFINAE.
437 (register_dtor_fn): Ditto.
438 (compute_array_index_type): Ditto.
439 (finish_enum): Ditto.
440 (start_preparsed_function): Ditto.
441 (cxx_maybe_build_cleanup): Ditto.
442 * call.c (convert_like): Add COMPLAIN argument.
443 (convert_like_with_context): Ditto.
444 (build_this): Fix calls for SFINAE.
445 (build_user_type_conversion): Ditto.
446 (resolve_args): Ditto.
447 (build_new_function_call): Add SFINAE support.
448 (build_operator_new_call): Fix calls for SFINAE.
449 (build_object_call): Add SFINAE support.
450 (build_conditional_expr): Ditto.
451 (build_new_op): Ditto.
452 (build_op_delete_call): Fix calls for SFINAE.
454 (convert_like_real): Add SFINAE support.
455 (build_x_va_arg): Fix calls for SFINAE.
456 (convert_default_arg): Ditto.
457 (build_over_call): Add SFINAE support.
458 (build_java_interface_fn_ref): Fix calls for SFINAE.
459 (build_special_member_call): Add SFINAE support.
460 (build_new_method_call): Ditto.
461 (perform_implicit_conversion): Ditto.
462 (perform_direct_initialization_if_possible): Ditto.
463 (initialize_reference): Fix calls for SFINAE.
464 * method.c (do_build_assign_ref): Fix calls for SFINAE.
465 * rtti.c (build_headof): Fix calls for SFINAE.
466 (get_tinfo_decl_dynamic): Ditto.
468 (build_dynamic_cast_1): Add SFINAE support.
469 (build_dynamic_cast): Ditto.
470 (tinfo_base_init): Fix calls for SFINAE.
471 * except.c (do_get_exception_ptr): Fix calls for SFINAE.
472 (do_end_catch): Ditto.
473 (initialize_handler_parm): Ditto.
474 (expand_start_catch_block): Ditto.
475 (do_allocate_exception): Ditto.
476 (do_free_exception): Ditto.
477 (build_throw): Ditto.
478 * cvt.c (build_up_reference): Fix calls for SFINAE.
479 (convert_to_reference): Ditto.
480 (ocp_convert): Ditto.
481 (convert_to_void): Add SFINAE support.
482 * tree.c (build_dummy_object): Fix calls for SFINAE.
483 (stabilize_expr): Ditto.
484 * cp-tree.h (build_conditional_expr): Add tsubst_flags_t
486 (build_new_method_call): Ditto.
487 (build_special_member_call): Ditto.
488 (build_new_op): Ditto.
489 (perform_implicit_conversion): Ditto.
490 (perform_direct_initialization_if_possible): Ditto.
491 (convert_to_void): Ditto.
492 (build_aggr_init): Ditto.
494 (build_vec_init): Ditto.
495 (build_dynamic_cast): Ditto.
496 (finish_call_expr): Ditto
497 (cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter.
498 (cxx_sizeof_nowarn): Remove macro; add function declaration.
499 (build_class_member_access_expr): Add tsubst_flags_t parameter.
500 (finish_class_member_access_expr): Ditto.
501 (build_x_indirect_ref): Ditto.
502 (cp_build_indirect_ref): New.
503 (cp_build_function_call): Add tsubst_flags_t parameter.
504 (build_x_unary_op): Ditto.
505 (cp_build_unary_op): New.
506 (build_x_conditional_expr): Add tsubst_flags_t parameter.
507 (build_x_compound_expr): Ditto.
508 (build_compound_expr): Ditto.
509 (build_static_cast): Ditto.
510 (build_reinterpret_cast): Ditto.
511 (build_const_cast): Ditto.
512 (build_c_cast): Ditto.
513 (build_x_modify_expr): Ditto.
514 (cp_build_modify_expr): New.
515 (convert_for_initialization): Add tsubst_flags_t parameter.
516 (cp_build_binary_op): Remove macro; add function declaration.
517 (invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter.
518 (lvalue_or_else): Ditto.
519 (build_functional_cast): Ditto.
520 * typeck2.c (digest_init): Fix calls for SFINAE.
521 (process_init_constructor_array): Ditto.
522 (process_init_constructor_record): Ditto.
523 (build_x_arrow): Ditto.
524 (build_m_component_ref): Ditto.
525 (build_functional_cast): Add SFINAE support.
526 * pt.c (tsubst_copy_and_build): Add (more) SFINAE support.
527 * semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE.
528 (finish_expr_stmt): Ditto.
529 (finish_for_expr): Ditto.
530 (finish_asm_stmt): Ditto.
531 (finish_non_static_data_member): Ditto.
532 (finish_qualified_id_expr): Ditto.
533 (finish_call_expr): Add SFINAE support.
534 (finish_increment_expr): Fix calls for SFINAE.
535 (finish_unary_op_expr): Ditto.
536 (simplify_aggr_init_expr): Ditto.
537 (finish_omp_clauses): Ditto.
538 (finish_omp_for): Ditto.
539 (finish_omp_barrier): Ditto.
540 (finish_omo_flush): Ditto.
541 * decl2.c (grok_array_decl): Fix calls or SFINAE.
542 (build_anon_union_vars): Ditto.
543 (get_guard_cond): Ditto.
545 (one_static_initialization_or_destruction): Ditto.
546 (do_static_initialization_or_destruction): Ditto.
547 (generate_ctor_or_dtor_function): Ditto.
548 (build_offset_ref_call_from_tree): Ditto.
549 * parser.c (cp_parser_postfix_expression): Fix calls for SFINAE.
550 (cp_parser_postfix_dot_deref_expression): Ditto.
551 (cp_parser_unary_expression): Ditto.
552 (cp_parser_new_expression): Ditto.
553 (cp_parser_cast_expression): Ditto.
554 (cp_parser_binary_expression): Ditto.
555 (cp_parser_question_colon_clause): Ditto.
556 (cp_parser_assignment_expression): Ditto.
557 (cp_parser_expression): Ditto.
558 (cp_parser_builtin_offsetof): Ditto.
559 (cp_parser_template_argument): Ditto.
560 (cp_parser_functional_cast): Ditto.
562 2008-03-24 Tom Tromey <tromey@redhat.com>
564 * lex.c (handle_pragma_interface): Don't copy the filename.
565 (handle_pragma_implementation): Copy filename using xstrdup.
567 2008-03-21 Paolo Carlini <pcarlini@suse.de>
569 * cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
570 (SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P.
571 (IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P.
572 (PROMOTES_TO_AGGR_TYPE): Remove.
573 (CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust.
574 * typeck.c (unary_complex_lvalue, build_modify_expr,
575 convert_for_initialization): Adjust.
576 * init.c (is_aggr_type): Remove.
577 (is_class_type): Add.
578 (build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init,
579 build_delete): Adjust.
580 * lex.c (make_aggr_type): Remove.
581 (make_class_type): Add.
582 (cxx_make_type): Adjust.
583 * class.c (finish_struct_1, fixed_type_or_null, is_empty_class):
585 * decl.c (build_typename_type, make_typename_type,
586 make_unbound_class_template, cxx_init_decl_processing,
587 check_tag_decl, groktypename, start_decl_1, layout_var_decl,
588 check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms,
589 grok_op_properties, xref_tag, check_function_type): Adjust.
590 * call.c (check_dtor_name, standard_conversion, implicit_conversion,
591 add_builtin_candidate, add_builtin_candidates,
592 build_user_type_conversion_1, convert_like_real, build_cxx_call,
593 is_subseq, compare_ics): Adjust.
594 * method.c (use_thunk): Adjust.
595 * rtti.c (build_dynamic_cast_1, create_pseudo_type_info,
596 create_tinfo_types): Adjust.
597 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
598 build_up_reference, convert_to_reference, convert_from_reference,
599 ocp_convert, build_expr_type_conversion): Adjust.
600 * tree.c (bind_template_template_parm, error_type): Adjust.
601 * dump.c (cp_dump_tree): Adjust.
602 * search.c (lookup_member): Adjust.
603 * friend.c (make_friend_class, do_friend): Adjust.
604 * typeck2.c (store_init_value, process_init_constructor_array,
605 process_init_constructor_record, build_x_arrow, build_m_component_ref,
606 build_functional_cast): Adjust.
607 * pt.c (finish_member_template_decl, process_template_parm,
608 lookup_template_class, tsubst_function_type, tsubst,
609 tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc):
611 * semantics.c (begin_class_definition, finish_base_specifier,
612 finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type):
614 * name-lookup.c (constructor_name_p, push_overloaded_decl,
615 do_class_using_decl, lookup_qualified_name,
616 maybe_process_template_type_declaration): Adjust.
617 * decl2.c (grok_array_decl, check_member_template,
618 constrain_class_visibility): Adjust.
619 * parser.c (cp_parser_class_name): Adjust.
621 2008-03-18 Paolo Bonzini <bonzini@gnu.org>
623 * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.
625 2008-03-17 Jason Merrill <jason@redhat.com>
628 * call.c (reference_binding): Check LOOKUP_NO_TEMP_BIND when binding
629 a temp directly to a reference as per DR391.
631 2008-03-12 Richard Guenther <rguenther@suse.de>
635 2008-02-04 Richard Guenther <rguenther@suse.de>
638 * decl.c (record_builtin_java_type): Make jboolean a
639 integer type again where its mode doesn't match that of bool.
641 2008-01-25 Richard Guenther <rguenther@suse.de>
644 * decl.c (record_builtin_java_type): Make __java_boolean
646 * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
647 after TYPE_MAIN_VARIANT check.
649 2008-03-10 Jakub Jelinek <jakub@redhat.com>
652 * semantics.c (finish_omp_clauses): Look through NOP_EXPR even
656 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
657 DECL_P in not a variable and appears more than once error messages.
659 2008-03-07 Paolo Bonzini <bonzini@gnu.org>
663 2008-02-06 Douglas Gregor <doug.gregor@gmail.com>
667 * typeck.c (structural_comptypes): Call cp_comptypes.
668 (comptypes): New; called from the C/C++ common bits to perform
670 (cp_comptypes): Renamed from comptypes, which is already used,
671 with a different signature, by the C++ front end.
672 (build_reinterpret_cast_1): Call cp_comptypes.
673 (ptr_reasonably_similar): Ditto.
674 * decl.c (decls_match): Ditto.
675 * cvt.c (convert_to_reference): Ditto.
676 * cp-tree.h (same_type_p): Ditto.
677 (same_or_base_type_p): Ditto.
678 (comptypes): Rename to cp_comptypes.
679 * pt.c (canonical_type_parameter): Call cp_comptypes.
681 2008-03-07 Paolo Bonzini <bonzini@gnu.org>
683 * cp-objcp-common.c (cxx_types_compatible_p): Remove obsolete
684 test for equivalence between pointer and references.
686 2008-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
689 * class.c (finish_struct_anon): Use permerror instead of pedwarn.
690 (check_field_decls): Likewise.
691 (note_name_declared_in_class): Likewise.
692 * call.c (build_new_op): Likewise.
693 (convert_like_real): Likewise.
694 (build_over_call): Likewise.
695 * lex.c (unqualified_fn_lookup_error): Likewise.
696 * parser.c (cp_parser_template_id): Likewise.
697 * cvt.c (warn_ref_binding): Likewise.
698 (convert_to_reference): Likewise.
699 (ocp_convert): Likewise.
700 (convert_to_void): Use error instead of pedwarn.
701 * error.c (cp_cpp_error): Use pedantic_warning_kind.
702 * decl.c (compute_array_index_type): Use constant_expression_error.
704 2008-03-01 Douglas Gregor <doug.gregor@gmail.com>
706 * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Note
707 that auto is either a storage class or a simple type specifier,
708 depending on the dialect.
709 (cp_parser_decl_specifier_seq): Complain about `auto' as a storage
710 specifier in C++98 mode, error in C++0x mode (since we don't
711 support auto as a type specifier, yet).
712 (cp_parser_storage_class_specifier_opt): Don't treat `auto' as a
713 storage specifier in C++0x mode.
714 (cp_parser_simple_type_specifier): Parse `auto' as a
715 simple-type-specifier, but error because we don't support it yet.
717 2008-02-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
719 * parser.c (cp_parser_nonclass_name): New.
720 (cp_parser_pseudo_destructor_name): Use it instead of
722 (cp_parser_type_name): Move code to cp_parser_nonclass_name.
724 2008-02-29 Tom Tromey <tromey@redhat.com>
726 * parser.c (struct cp_token) <input_file_stack_index>: Remove.
727 (cp_lexer_get_preprocessor_token): Update.
728 (cp_lexer_set_source_position_from_token): Don't call
729 restore_input_file_stack.
730 * lex.c (cxx_init): Don't use push_srcloc or pop_srcloc.
732 2008-02-28 Richard Guenther <rguenther@suse.de>
735 2008-02-26 Richard Guenther <rguenther@suse.de>
737 * decl.c (duplicate_decls): Remove decl from global mapping
738 before ggc_freeing it.
740 2008-02-27 Jakub Jelinek <jakub@redhat.com>
743 * rtti.c: Include c-pragma.h.
744 (push_abi_namespace, pop_abi_namespace): New functions.
745 (build_dynamic_cast_1, tinfo_base_init, get_pseudo_ti_index,
746 create_tinfo_types, emit_support_tinfos): Use them.
747 * Make-lang.in (cp/rtti.o): Depend on $(C_PRAGMA_H).
749 2008-02-26 Jason Merrill <jason@redhat.com>
752 * decl.c (grokdeclarator): Allow a typedef of an unnamed struct
753 to name the struct for linkage purposes even if it has attributes.
754 (start_decl): In that case, set ATTR_FLAG_TYPE_IN_PLACE.
756 2008-02-26 Tom Tromey <tromey@redhat.com>
758 * parser.c (eof_token): Remove old location code.
759 (check_empty_body): Remove test of USE_MAPPED_LOCATION.
760 * decl2.c (generate_ctor_or_dtor_function): Remove old location
762 (cp_write_global_declarations): Likewise.
763 * lex.c (cxx_init): Remove old location code.
764 (handle_pragma_implementation): Remove test of
766 * pt.c (tsubst): Remove old location code.
767 * error.c (cp_print_error_function): Remove test of
769 * decl.c (pop_label): Remove old location code.
770 (finish_function): Likewise.
772 2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
775 * call.c (magic_varargs_p): Remove BUILT_IN_STDARG_START.
777 2008-02-26 Richard Guenther <rguenther@suse.de>
779 * decl.c (duplicate_decls): Remove decl from global mapping
780 before ggc_freeing it.
782 2008-02-26 Paolo Carlini <pcarlini@suse.de>
785 * name-lookup.c (arg_assoc_type): Handle FIXED_POINT_TYPE.
787 2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
789 * typeck.c (build_class_member_access_expr): Add appropriate
790 OPT_W* parameter to warning.
791 (build_reinterpret_cast_1): Likewise.
792 * name-lookup.c (push_overloaded_decl): Likewise.
794 2008-02-25 Paolo Carlini <pcarlini@suse.de>
797 * error.c (dump_expr): Handle CONJ_EXPR.
799 2008-02-25 Paolo Carlini <pcarlini@suse.de>
802 * error.c (dump_type): Handle FIXED_POINT_TYPE.
803 (dump_expr): Handle FIXED_CST.
805 2008-02-24 Jason Merrill <jason@redhat.com>
807 * parser.c (cp_parser_declaration): Handle "inline namespace".
808 (cp_parser_namespace_definition): Likewise.
811 * name-lookup.c (arg_assoc_namespace): Look down into inline
814 2008-02-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
816 * typeck.c (check_for_casting_away_constness): Use 1 single
817 argument, the type of cast, to decide what diagnostics generate.
818 (build_static_cast_1): Remove unused code. Update call to
819 check_for_casting_away_constness.
820 (build_reinterpret_cast_1): Update call to
821 check_for_casting_away_constness.
822 (build_const_cast_1): Likewise.
824 2008-02-24 Paolo Carlini <pcarlini@suse.de>
826 * error.c (dump_expr): Don't deal directly with NEW_EXPR (and
827 VEC_NEW_EXPR), forward to pp_expression.
828 * cxx-pretty-print.c (pp_cxx_new_expression): Fix FIXME.
830 2008-02-24 Danny Smith <dannysmith@users.sourceforge.net>
833 * friend.c (do_friend): Call cplus_decl_attributes earlier.
835 2008-02-22 Andrew Pinski <andrew_pinski@playstation.sony.com>
838 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS for
839 template decls' function decl.
841 2008-02-22 Paolo Carlini <pcarlini@suse.de>
845 2008-02-14 Paolo Carlini <pcarlini@suse.de>
848 * pt.c (determine_specialization): In case of function templates,
849 when the type of DECL does not match FN there is no match.
851 2008-02-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
854 * typeck.c (build_binary_op): Warn about floating point
855 comparisons if FLOAT_TYPE_P, not only for REAL_TYPE.
857 2008-02-19 Jason Merrill <jason@redhat.com>
860 * pt.c (resolve_overloaded_unification): Set processing_template_decl
861 while we look for possible bindings.
863 2008-02-19 Jakub Jelinek <jakub@redhat.com>
866 * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors.
870 * semantics.c (finish_omp_threadprivate): Do nothing for error_operand_p
871 vars. Afterwards ensure v is VAR_DECL.
874 * parser.c (cp_parser_omp_for_loop): If DECL has REFERENCE_TYPE, don't
876 * semantics.c (finish_omp_for): Fail if DECL doesn't have integral type
879 2008-02-15 Douglas Gregor <doug.gregor@gmail.com>
884 * pt.c (finish_member_template_decl): If the type in a TYPE_DECL
885 is error_mark_node, return an error early.
886 (find_parameter_packs_r): Pass the pointer set along to recursive
887 calls of cp_walk_subtrees; don't try to manage the pointer set
889 (uses_parameter_packs): Pass the pointer set to cp_walk_tree.
890 (make_pack_expansion): Ditto.
891 (check_for_bare_parameter_packs): Ditto. Also, don't bother taking
892 a second pass through the tree with find_parameter_packs_r; that
893 second pass no longer does anything.
894 (push_template_decl_real): If we have an erroneous declaration,
895 set its type to error_mark_node before returning an error.
897 2008-02-14 Douglas Gregor <doug.gregor@gmail.com>
900 * pt.c (tsubst_initializer_list): Deal with the use of
901 VOID_TYPE_NODE to indicate value-initialization of the bases.
903 2008-02-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
904 Jason Merrill <jason@redhat.com>
908 * class.c (type_has_user_nondefault_constructor): New fn.
909 * cp-tree.h: Declare it.
910 * init.c (emit_mem_initializers): Use it for -W warning about
911 missing base initializer.
913 2008-02-14 Paolo Carlini <pcarlini@suse.de>
916 * pt.c (determine_specialization): In case of function templates,
917 when the type of DECL does not match FN there is no match.
919 2008-02-13 Jakub Jelinek <jakub@redhat.com>
920 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
923 * parser.c (cp_parser_pseudo_destructor_name): If next tokens
924 are not identifier :: ~, return before calling cp_parser_type_name.
926 2008-02-13 Jason Merrill <jason@redhat.com>
928 PR c++/34962, c++/34937, c++/34939
929 * decl2.c (is_late_template_attribute): Always defer attributes
930 vector_size and weak.
933 * pt.c (value_dependent_expression_p): Look into DECL_INITIAL
936 2008-02-12 Jason Merrill <jason@redhat.com>
939 * call.c (convert_like_real): Pass LOOKUP_NO_CONVERSION to build_temp
940 if we're doing conversions to call a user-defined conversion function.
942 2008-02-12 Steven Bosscher <steven@gcc.gnu.org>
945 * semantics.c (finish_qualified_id_expr): Avoid duplicate access
948 2008-02-12 Jakub Jelinek <jakub@redhat.com>
951 * init.c (build_new_1): Don't create placement_expr before
952 constructing alloc_call. Verify that the pointer is passed by
953 value to operator new.
955 2008-02-11 Jason Merrill <jason@redhat.com>
958 * pt.c (tsubst): Don't look up a template typedef in an explicit
961 2008-02-11 Douglas Gregor <doug.gregor@gmail.com>
964 * tree.c (cp_build_qualified_type_real): When building a
965 cv-qualified array type, build it as a unique type with
966 build_cplus_array_type_1 and then adopt the unqualified type's
969 2008-02-11 Paolo Carlini <pcarlini@suse.de>
972 * decl.c (groktypename): Check grokdeclarator return.
974 2008-02-10 Jason Merrill <jason@redhat.com>
977 * decl2.c (cp_write_global_declarations): Don't write out static
978 data members with DECL_IN_AGGR_P set.
980 2008-02-08 Jason Merrill <jason@redhat.com>
983 * tree.c (build_target_expr_with_type): Handle void initializer.
984 (bot_manip): Remap slot before recursing.
986 2008-02-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
989 * Make-lang.in (cc1plus-dummy, cc1plus): Add $(GMPLIBS).
991 2008-02-06 Alexandre Oliva <aoliva@redhat.com>
994 * tree.c: Include tree-flow.h.
995 (build_target_expr): Check type compatibility.
996 * Make-lang.in (cp/tree.o): Depend on $(TREE_FLOW_H).
997 * call.c (convert_like_real): Convert bitfield to expected type.
999 2008-02-06 Douglas Gregor <doug.gregor@gmail.com>
1003 * typeck.c (structural_comptypes): Call cp_comptypes.
1004 (comptypes): New; called from the C/C++ common bits to perform
1006 (cp_comptypes): Renamed from comptypes, which is already used,
1007 with a different signature, by the C++ front end.
1008 (build_reinterpret_cast_1): Call cp_comptypes.
1009 (ptr_reasonably_similar): Ditto.
1010 * decl.c (decls_match): Ditto.
1011 * cvt.c (convert_to_reference): Ditto.
1012 * cp-tree.h (same_type_p): Ditto.
1013 (same_or_base_type_p): Ditto.
1014 (comptypes): Rename to cp_comptypes.
1015 * pt.c (canonical_type_parameter): Call cp_comptypes.
1017 2008-02-05 Jakub Jelinek <jakub@redhat.com>
1020 * pt.c (tsubst) <case INTEGER_TYPE>: Don't issue error if max is
1021 value dependent expression.
1023 2008-02-05 Douglas Gregor <doug.gregor@gmail.com>
1026 * decl2.c (save_template_attributes): When we're modifying the
1027 TYPE_MAIN_VARIANT to add new attributes, be sure to also modify
1028 all of the other variants to add those same attributes. Otherwise,
1029 the main variant will be inconsistent with those other variants.
1031 2008-02-04 Richard Guenther <rguenther@suse.de>
1034 * decl.c (record_builtin_java_type): Make jboolean a
1035 integer type again where its mode doesn't match that of bool.
1037 2008-02-02 Jason Merrill <jason@redhat.com>
1038 Mark Mitchell <mark@codesourcery.com>
1041 * init.c (build_value_init_1): New function.
1042 (build_value_init): New function.
1043 * typeck2.c (build_functional_cast): Call it.
1044 * cp-gimplify.c (cp_gimplify_init_expr): Handle its output.
1046 * cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from
1047 TYPE_HAS_CONSTRUCTOR.
1048 * class.c (finish_struct_bits, maybe_warn_about_overly_private_class,
1049 add_implicitly_declared_members): Adjust.
1050 (check_field_decls): Adjust. Remove warnings about reference/const
1051 in class without constructor.
1052 (check_bases_and_members): Adjust. Give those warnings here instead.
1053 * decl.c (fixup_anonymous_aggr): Adjust.
1054 (check_initializer): Adjust, clarify logic slightly.
1055 (grok_special_member_properties): Adjust, only set if user-provided.
1056 * rtti.c (create_tinfo_types): Don't set.
1057 * cvt.c (ocp_convert): Remove exception for vtable_entry_type et al.
1058 Use same_type_ignoring_top_level_qualifiers_p.
1059 * pt.c (check_explicit_specialization): Adjust.
1060 (instantiate_class_template): Adjust.
1062 2008-01-31 Douglas Gregor <doug.gregor@gmail.com>
1063 Jakub Jelinek <jakub@redhat.com>
1067 * typeck.c (structural_comptypes): Handle comparisons of
1068 VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, FIXED_POINT_TYPE, and
1070 * mangle.c (write_builtin_type): Map down to the canonical type,
1071 which will be one of the predefined type nodes.
1073 2008-01-29 Michael Meissner <michael.meissner@amd.com>
1076 * cp-tree.h (struct full_lang_decl): Make tree_code bitfield 16
1077 bits to allow for expansion of the number of middle end tree
1080 2008-01-29 Douglas Gregor <doug.gregor@gmail.com>
1091 * typeck.c (check_return_expr): Tweak call to
1092 check_for_bare_parameter_packs.
1093 * class.c (add_method): Be careful with error_mark_nodes.
1094 * cp-tree.h (check_for_bare_parameter_packs): Remove "*" from
1096 * pt.c (struct find_parameter_pack_data): Remove
1098 (find_parameter_packs_r): Don't use SET_PACKS_TO_ERROR.
1099 (uses_parameter_packs): Don't set SET_PACKS_TO_ERROR.
1100 (make_pack_expansion): Ditto.
1101 (check_for_bare_parameter_packs): Parameter is now a tree, not a
1103 (process_template_parm): Tweak call to
1104 check_for_bare_parameter_packs.
1105 (push_template_decl_real): Tweak calls to
1106 check_for_bare_parameter_packs. If bare parameter packs are found
1107 in the list of exceptions, clear out that list after giving an
1109 * semantics.c (finish_cond): Tweak call to
1110 check_for_bare_parameter_packs.
1111 (finish_expr_stmt): Ditto.
1112 (finish_for_expr): Ditto.
1113 (finish_switch_cond): Ditto.
1114 (finish_mem_initializers): Ditto.
1115 (finish_member_declaration): Ditto.
1116 (finish_static_assert): Check for bare parameter packs in the
1118 * decl2.c (cplus_decl_attributes): Check for bare parameter packs in the
1119 attributes of a declaration.
1120 * parser.c (cp_parser_using_declaration): Tweak call to
1121 check_for_bare_parameter_packs.
1122 (cp_parser_base_clause): Ditto.
1124 2008-01-28 Jason Merrill <jason@redhat.com>
1127 * class.c (build_base_path): Fix !want_pointer case.
1129 2008-01-27 Jason Merrill <jason@redhat.com>
1132 * class.c (build_base_path): Fix previous change.
1134 2008-01-26 Jakub Jelinek <jakub@redhat.com>
1137 * error.c (dump_expr): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR
1140 2008-01-26 Richard Guenther <rguenther@suse.de>
1143 * typeck.c (build_binary_op): Remove code to shorten compares.
1145 2008-01-25 Richard Guenther <rguenther@suse.de>
1148 * decl.c (record_builtin_java_type): Make __java_boolean
1150 * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
1151 after TYPE_MAIN_VARIANT check.
1153 2008-01-25 Jason Merrill <jason@redhat.com>
1156 * class.c (build_base_path): Don't mess with virtual access if
1158 * call.c (standard_conversion): Don't check whether source type
1161 * decl2.c (is_late_template_attribute): Don't defer attribute
1162 visibility just because the type is dependent.
1164 2008-01-25 Jason Merrill <jason@redhat.com>
1165 Mark Mitchell <mark@codesourcery.com>
1168 * call.c (standard_conversion): Allow conversion from integer/real
1170 (compare_ics): Such a conversion is worse than a normal arithmetic
1173 2008-01-25 Richard Guenther <rguenther@suse.de>
1176 * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define
1179 2008-01-24 Paolo Carlini <pcarlini@suse.de>
1182 * pt.c (push_template_decl_real): Return error_mark_node in case
1183 of template definition of non-template.
1185 2008-01-24 Jason Merrill <jason@redhat.com>
1188 * decl2.c (is_late_template_attribute): Defer any attribute with
1189 dependent args. Also defer type attributes if the type is dependent.
1191 2008-01-22 Jakub Jelinek <jakub@redhat.com>
1192 Alexandre Oliva <aoliva@redhat.com>
1195 * call.c (reference_binding): For bitfields use the declared bitfield
1197 (add_builtin_candidates): Likewise.
1198 * class.c (layout_class_type): For bitfields copy over the
1199 original type quals.
1201 2008-01-22 Jason Merrill <jason@redhat.com>
1204 * decl.c (groktypename): Also ignore attributes on dependent
1205 possibly-class types.
1208 * friend.c (do_friend): Check for prior declaration of a friend
1209 function of a local class.
1210 * name-lookup.c (lookup_name_innermost_nonclass_level):
1212 * name-lookup.h: Declare it.
1214 2008-01-22 Tom Tromey <tromey@redhat.com>
1217 * init.c (build_new_1): Only disallow Java aggregates.
1219 2008-01-22 Jakub Jelinek <jakub@redhat.com>
1222 * semantics.c (finish_omp_for): Don't call c_finish_omp_for
1223 if decl or init is error_mark_node.
1226 * error.c (dump_expr): Handle VECTOR_CST.
1228 2008-01-21 Jason Merrill <jason@redhat.com>
1231 * pt.c (tsubst_aggr_type): Make sure our context is complete.
1234 * pt.c (retrieve_local_specialization): Robustify.
1235 (tsubst_pack_expansion, tsubst_decl): Remove redundant checks.
1238 * pt.c (tsubst): Only call retrieve_local_specialization if the
1239 original typedef was in a function template.
1242 * decl.c (wrap_cleanups_r): Set TRY_CATCH_IS_CLEANUP.
1244 2008-01-21 Richard Guenther <rguenther@suse.de>
1247 * error.c (cp_print_error_function): Deal with recursive
1250 2008-01-20 Paolo Carlini <pcarlini@suse.de>
1253 * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR.
1255 2008-01-20 Paolo Carlini <pcarlini@suse.de>
1259 * name-lookup.c (do_class_using_decl): Do not call constructor_name_p
1260 on non-IS_AGGR_TYPE scope.
1261 (constructor_name_p): Assert IS_AGGR_TYPE.
1263 2008-01-18 Ian Lance Taylor <iant@google.com>
1266 * decl.c (duplicate_decls): Copy DECL_IS_OPERATOR_NEW flag.
1267 (grok_op_properties): For NEW_EXPR and VEC_NEW_EXPR set
1268 DECL_IS_OPERATOR_NEW flag.
1270 2008-01-16 Richard Guenther <rguenther@suse.de>
1273 * typeck.c (is_bitfield_expr_with_lowered_type): Recurse
1274 for conversions to type variants.
1276 2008-01-15 Andreas Tobler <a.tobler@schweiz.org>
1278 * parser.c (cp_parser_template_parameter): Fix C90 issue with mixing
1279 declaration and code. Update copyright year.
1281 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
1284 * friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we
1285 know we have a class type.
1287 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
1290 * pt.c (coerce_template_parameter_pack): When substituting into
1291 the type of a non-type template parameter pack. use the
1292 deduced/substituted arguments.
1293 * parser.c (declarator_can_be_parameter_pack): A pointer-to-member
1294 can be a parameter pack with the ellipsis following it. When we
1295 have an erroneous declaration, allow it to be a parameter pack.
1296 (cp_parser_template_parameter): Complain about default
1297 arguments on non-type template parameter packs, and parse them
1298 using the new cp_parser_default_argument.
1299 (cp_parser_parameter_declaration): Complain about parameter packs
1300 with default arguments. Move parsing of default arguments into a
1301 new function, cp_parser_default_argument.
1302 (cp_parser_default_argument): New; extracted from
1303 cp_parser_parameter_declaration.
1305 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
1311 * typeck.c (check_return_expr): If there are bare parameter packs
1312 in the return value, set it to error_mark_node.
1313 * tree.c (cp_walk_subtrees): Walk USING_DECL nodes.
1314 * pt.c (find_parameter_packs_r): Look at the type of
1315 IDENTIFIER_NODEs (e.g., for user-defined conversions).
1316 (check_for_bare_parameter_packs): Flip the result: now returns
1317 TRUE when there were bare parameter packs, FALSE otherwise.
1318 (push_template_decl_real): Deal with flipped result of
1319 check_for_bare_parameter_packs.
1320 * semantics.c (finish_cond): If there are bare parameter packs in
1321 the conditional, set it to error_mark_node.
1322 (finish_expr_stmt): If there are bare parameter packs in the
1323 expression, set it to error_mark_node.
1324 (finish_for_expr): Ditto.
1325 (finish_switch_cond): If there are bare parameter packs in
1326 the conditional, set it to error_mark_node.
1327 (finish_mem_initializers): If there are bare parameter packs in
1328 the member initializer, set it to error_mark_node.
1329 (finish_member_declaration): Check the attributes of the
1330 declaration for bare parameter packs, and remove the attributes if
1331 any have bare parameter packs.
1332 * parser.c (cp_parser_using_declaration): Check the using
1333 declaration for bare parameter packs.
1334 (cp_parser_base_clause): If there are bare parameter packs in a
1335 base specifier, don't add it to the chain.
1337 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
1340 * error.c (dump_simple_decl): Display ellipsis for template
1341 non-type parameter packs.
1342 (dump_decl): Display ellipsis for template type parameter packs.
1343 (dump_template_decl): Display ellipsis for template template
1345 * pt.c (redeclare_class_template): When redeclaring a class
1346 template, check for collisions between template parameters and
1347 template parameter packs.
1349 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
1352 * pt.c (process_partial_specialization): Don't mark template
1353 parameters that occur in non-deduced contexts.
1354 (struct pair_fn_data): Add include_nondeduced_p.
1355 (for_each_template_parm_r): Only visit non-deduced contexts if
1356 include_nondeduced_p is set.
1357 (for_each_template_parm): Added parameter include_nondeduced_p,
1358 which states whether template parameters found in non-deduced
1359 contexts should be visited.
1360 (uses_template_parms): Visit all template parameters, even those
1361 in non-deduced contexts.
1363 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
1366 * pt.c (check_default_tmpl_args): Check for parameter packs that
1367 aren't at the end of a primary template.
1368 (push_template_decl_real): Remove check for parameter packs that
1369 aren't at the end of a primary template; that now happens in
1370 check_default_tmpl_args.
1371 * semantics.c (finish_template_template_parm): Use
1372 check_default_tmpl_args to check for errors in the template
1375 2008-01-12 Doug Kwan <dougkwan@google.com>
1377 * decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers
1378 instead of OPT_Wreturn_type in warning due to ignored return type
1380 * pt.c: (tsubst_function_type): Use OPT_Wignored_qualifiers
1381 instead of OPT_Wreturn_type in warning due to ignored return type
1384 2008-01-08 Jakub Jelinek <jakub@redhat.com>
1387 * semantics.c (finish_omp_for): Don't call
1388 fold_build_cleanup_point_expr if processing_template_decl.
1390 2008-01-04 Paolo Carlini <pcarlini@suse.de>
1391 Jakub Jelinek <jakub@redhat.com>
1394 * error.c (dump_template_argument): Deal with TREE_LIST.
1396 2008-01-01 Douglas Gregor <doug.gregor@gmail.com>
1398 * parser.c (cp_parser_check_decl_spec): Don't warn about "long
1399 long" in C++0x mode; change the warning to note that "long long"
1400 is only unsupported in C++98 mode.
1402 2007-12-20 Jason Merrill <jason@redhat.com>
1405 * call.c (standard_conversion): Derived-to-base is considered a
1406 standard conversion.
1408 2007-12-19 Jakub Jelinek <jakub@redhat.com>
1411 * parser.c (cp_parser_omp_parallel): For non-combined parallel
1412 call cp_parser_statement rather than
1413 cp_parser_already_scoped_statement.
1415 2007-12-18 Jason Merrill <jason@redhat.com>
1418 * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't
1420 (dependent_type_p_r): Handle the domain of an array.
1422 2007-12-18 Douglas Gregor <doug.gregor@gmail.com>
1423 Jakub Jelinek <jakub@redhat.com>
1428 * pt.c (template_template_parm_bindings_ok_p): New; verifies
1429 bindings of template template parameters after all template
1430 arguments have been deduced.
1431 (coerce_template_parms): Don't complain when COMPLAIN doesn't
1433 (fn_type_unification): Use template_template_parm_bindings_ok_p.
1434 (unify): Deal with variadic, bound template template parameters.
1435 (get_class_bindings): Use template_template_parm_bindings_ok_p.
1437 2007-12-18 Jakub Jelinek <jakub@redhat.com>
1440 * decl.c (grokdeclarator): Reject friend sfk_constructor
1443 2007-12-17 Jakub Jelinek <jakub@redhat.com>
1446 * parser.c (cp_parser_omp_all_clauses): Accept optional comma
1449 2007-12-15 Alexandre Oliva <aoliva@redhat.com>
1452 * cp-lang.c (cp_classify_record): New.
1453 (LANG_HOOKS_CLASSIFY_RECORD): Override.
1455 2007-12-11 Jakub Jelinek <jakub@redhat.com>
1458 * decl2.c (cp_write_global_declarations): Revert 2007-11-22 change.
1461 * rtti.c (build_dynamic_cast): Call convert_from_reference even for
1462 dynamic_cast in a template.
1464 2007-12-10 Simon Martin <simartin@users.sourceforge.net>
1467 * typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from
1468 MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO.
1470 2007-12-10 Jakub Jelinek <jakub@redhat.com>
1473 * error.c (dump_type_prefix, dump_type_suffix): Handle
1474 TYPE_PACK_EXPANSION.
1477 * error.c (dump_expr): Handle ABS_EXPR.
1479 2007-12-09 Jakub Jelinek <jakub@redhat.com>
1483 * repo.c (repo_emit_p): Return 2 for DECL_INTEGRAL_CONSTANT_VAR_P
1484 in class scope rather than DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1485 Return 2 also if DECL_EXPLICIT_INSTANTIATION.
1486 * decl2.c (import_export_decl): Don't make VAR_DECLs import_p when
1487 flag_use_repository and repo_emit_p returned 2.
1489 2007-12-06 Jakub Jelinek <jakub@redhat.com>
1492 * tree.c (stabilize_call, stabilize_init): Do nothing if
1493 processing_template_decl.
1495 2007-12-05 Jakub Jelinek <jakub@redhat.com>
1498 * semantics.c (finish_decltype_type): For SCOPE_REF issue an
1499 error instead of assertion failure.
1500 * parser.c (cp_parser_decltype): If closing paren is not found,
1501 return error_mark_node.
1503 2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
1506 * name-lookup.c (arg_assoc_template_arg): Recurse on argument
1508 (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
1509 since arg_assoc_template_arg will deal with them (better).
1511 2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
1514 * pt.c (tsubst_exception_specification): Handle substitutions into
1515 member templates, where tsubst_pack_expansion returns a
1516 TYPE_PACK_EXPANSION.
1518 2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
1521 * pt.c (unify_pack_expansion): If we didn't deduce any actual
1522 bindings for the template parameter pack, don't try to keep the
1523 empty deduced arguments.
1524 (unify): If a parameter is a template-id whose template argument
1525 list contains a pack expansion that is not at the end, then we
1526 cannot unify against that template-id.
1528 2007-12-02 Paolo Carlini <pcarlini@suse.de>
1531 * pt.c (current_template_args): Use error_operand_p.
1533 2007-12-02 Paolo Carlini <pcarlini@suse.de>
1536 * error.c (dump_decl): Handle TREE_BINFO.
1538 2007-12-01 Ollie Wild <aaw@google.com>
1541 * typeck.c (build_binary_op): Add conversion of pointers to function
1542 members appearing as operands to the equality operators.
1544 2007-11-30 Jakub Jelinek <jakub@redhat.com>
1547 * error.c (dump_expr): Handle OBJ_TYPE_REF.
1549 2007-11-29 Jakub Jelinek <jakub@redhat.com>
1552 * tree.c (lvalue_p_1) <case COND_EXPR>: Handle x ?: y
1554 * typeck.c (is_bitfield_expr_with_lowered_type) <case COND_EXPR>:
1559 * parser.c (cp_parser_decltype): Don't call finish_id_expression
1561 * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs
1564 2007-11-27 Jakub Jelinek <jakub@redhat.com>
1566 PR tree-optimization/34181
1567 * method.c (use_thunk): Don't inline the call in the thunk.
1570 * tree.c (decl_linkage): Static data members and static member
1571 functions in anonymous ns classes are lk_external.
1573 2007-11-26 Andreas Krebbel <krebbel1@de.ibm.com>
1576 * decl.c (start_preparsed_function): Pass
1577 processing_template_decl for the new allocate_struct_function
1580 2007-11-25 Richard Guenther <rguenther@suse.de>
1582 * decl.c (poplevel): Use BLOCK_CHAIN.
1584 2007-11-24 Ollie Wild <aaw@google.com>
1586 * typeck.c (delta_from_ptrmemfunc): New function.
1587 (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc.
1588 (build_binary_op): Call delta_from_ptrmemfunc.
1590 2007-11-23 Jakub Jelinek <jakub@redhat.com>
1594 * decl.c (cp_finish_decl): Disallow variable or field
1595 definitions if extern "Java" aggregates.
1596 (grokparms): Disallow parameters with extern "Java"
1598 (check_function_type): Disallow function return values
1599 with extern "Java" aggregates.
1600 * init.c (build_new_1): Disallow placement new with
1601 extern "Java" aggregates.
1603 2007-11-23 Mark Mitchell <mark@codesourcery.com>
1604 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1607 * call.c (convert_like_real): Build a zero constant when __null is
1608 converted to an integer type.
1610 2007-11-22 Jakub Jelinek <jakub@redhat.com>
1613 * decl2.c (cp_write_global_declarations): Issue error about static
1614 data members in anonymous namespace which are declared and used,
1617 2007-11-20 Jakub Jelinek <jakub@redhat.com>
1620 * parser.c (cp_parser_class_head): Reject function template ids.
1623 * tree.c (build_cplus_array_type_1): Don't pass any VLA types
1624 when processing_template_decl to build_array_type.
1627 * pt.c (more_specialized_fn): Don't segfault if one or
1628 both argument list end with ellipsis.
1630 2007-11-18 Jakub Jelinek <jakub@redhat.com>
1633 * semantics.c (finish_call_expr): Set
1634 current_function_returns_abnormally if fn is noreturn FUNCTION_DECL
1635 or OVERLOAD with all noreturn functions.
1637 2007-11-16 Jakub Jelinek <jakub@redhat.com>
1640 * pt.c (apply_late_template_attributes): Do nothing if decl's type is
1643 2007-11-13 Jakub Jelinek <jakub@redhat.com>
1650 * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error,
1651 set to error_mark_node the outermost POINTER_TYPE to the pack if
1652 it is seen in a POINTER_TYPE.
1653 (push_template_decl_real): If check_for_bare_parameter_packs
1654 fails for function return type, set the return type to
1655 integer_type_node. If check_for_bare_parameter_packs failed
1656 for non-function, return error_mark_node.
1659 * call.c (build_new_op): Call resolve_args before calling
1662 2007-11-11 Tom Tromey <tromey@redhat.com>
1665 * lex.c (handle_pragma_implementation): Use cpp_included_before.
1667 2007-11-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1670 * pt.c (redeclare_class_template): Update error message. Use a
1671 note to show the previous declaration.
1672 (tsubst_friend_class): Use the location of the friend template as
1673 the input location before calling redeclare_class_template.
1675 2007-11-11 Jakub Jelinek <jakub@redhat.com>
1678 * semantics.c (finish_pseudo_destructor_expr): Handle
1679 object == error_mark_node.
1681 2007-11-10 Jakub Jelinek <jakub@redhat.com>
1684 * pt.c (tsubst_copy_and_build) <case COMPONENT_REF>: If object_type
1685 is not scalar type, let finish_class_member_access_expr handle
1686 diagnostics. Pass BIT_NOT_EXPR argument to
1687 finish_pseudo_destructor_expr. Handle SCOPE_REF properly.
1689 2007-11-09 Douglas Gregor <doug.gregor@gmail.com>
1692 * decl.c (cp_complete_array_type): If any of the initializer
1693 elements are pack expansions, don't compute the array size yet.
1695 2007-11-08 Andrew Pinski <pinskia@gmail.com>
1698 * tree.c (decl_linkage): Fields have no linkage.
1700 2007-11-08 Daniel Jacobowitz <dan@codesourcery.com>
1702 * class.c (build_ctor_vtbl_group): Lay out the new type and decl.
1704 2007-11-07 Douglas Gregor <doug.gregor@gmail.com>
1709 * semantics.c (finish_decltype_type): See through INDIRECT_REFs.
1710 Be careful with ERROR_MARK_NODEs.
1711 * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL
1714 2007-11-07 Jakub Jelinek <jakub@redhat.com>
1717 * call.c (build_over_call): Don't check TREE_ADDRESSABLE
1720 2007-11-06 Douglas Gregor <doug.gregor@gmail.com>
1724 * tree.c (c_build_qualified_type): Define bridge to
1725 cp_build_qualified_type.
1727 2007-11-06 Douglas Gregor <doug.gregor@gmail.com>
1738 * typeck.c (check_return_expr): Pass address of retval to
1739 check_for_bare_parameter_packs.
1740 * class.c (build_base_field): Tolerate bases that have no layout
1742 (end_of_base): Ditto.
1743 * tree.c (canonical_type_variant): Be careful with
1745 * cp-tree.h (check_for_bare_parameter_packs): Now accepts a
1747 * pt.c (find_parameter_pack_data): Add set_packs_to_error field,
1748 which states whether parameter packs should be replaced with
1750 (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever
1751 possible. If set_packs_to_error is set true, replace the parameter
1752 pack with ERROR_MARK_NODE. Manage our own pointer sets.
1753 (uses_parameter_packs): Don't set parameter packs to
1755 (check_for_bare_parameter_packs): Now takes a pointer to a tree,
1756 which may be modified (if it is a parameter pack). Instructs
1757 find_parameter_packs_r to replace parameter packs with
1758 ERROR_MARK_NODE (so that they won't cause errors later on).
1759 (process_template_parm): Pass pointer to
1760 check_for_bare_parameter_packs.
1761 (process_partial_specialization): Replace pack expansions before
1762 the end of the template argument list with ERROR_MARK_NODE.
1763 (push_template_decl_real): Pass pointer to
1764 check_for_bare_parameter_packs. Replace parameter packs not at the
1765 end of the template parameter list with ERROR_MARK_NODE.
1766 (convert_template_argument): Be more careful about using DECL_NAME
1767 on only declarations.
1768 (unify): Can't unify against ERROR_MARK_NODE.
1769 * semantics.c (finish_cond): Pass pointer to
1770 check_for_bare_parameter_packs.
1771 (finish_expr_stmt): Ditto.
1772 (finish_for_expr): Ditto.
1773 (finish_switch_cond): Pass pointer to
1774 check_for_bare_parameter_packs, and call it before we put the
1775 condition into the statement.
1776 (finish_mem_initializers): Pass pointer to
1777 check_for_bare_parameter_packs.
1778 (finish_member_declaration): Ditto.
1779 * parser.c (cp_parser_base_clause): Ditto.
1781 2007-11-06 Jakub Jelinek <jakub@redhat.com>
1784 * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already
1785 with the final TREE_READONLY flag in place. processing_template_decl
1786 is known to be 0 in this part of function.
1789 * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not
1790 OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC.
1791 * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P.
1792 * semantics.c (finish_omp_atomic): Revert most of the
1793 2007-02-05 changes, just keep the new representation of
1794 OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC.
1796 2007-11-05 H.J. Lu <hongjiu.lu@intel.com>
1799 * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked
1802 2007-11-05 Douglas Gregor <doug.gregor@gmail.com>
1807 * typeck.c (merge_types): Don't lose rvalue references when
1809 * call.c (build_over_call): Don't elide move constructors just
1810 because the copy constructor is trivial (!).
1811 (compare_ics): If comparing cv-qualifiers fails, we can still order
1812 based on binding lvalues vs. rvalues.
1814 2007-11-05 Douglas Gregor <doug.gregor@gmail.com>
1817 * pt.c (unify_pack_expansion): bring handling of function call
1818 arguments into line with type_unification_real.
1820 2007-11-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1822 * typeck.c (build_binary_op): Use pedwarn instead of error for
1825 2007-11-05 Jakub Jelinek <jakub@redhat.com>
1828 * parser.c (cp_parser_unary_expression): For &&label call
1829 cp_parser_non_integral_constant_expression and return error_mark_node
1830 if it returned true.
1833 * decl.c (grokdeclarator): Don't call build_memfn_type if type
1834 is neither FUNCTION_TYPE nor METHOD_TYPE.
1836 2007-11-02 Jakub Jelinek <jakub@redhat.com>
1839 * parser.c (cp_parser_nested_name_specifier_opt): Use
1840 TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete
1841 typedef of currently open class.
1843 2007-11-02 Paolo Carlini <pcarlini@suse.de>
1846 * error.c (dump_expr): Deal specially with statements.
1848 2007-11-01 Jason Merrill <jason@redhat.com>
1851 * pt.c (push_template_decl_real): Set DECL_CONTEXT on template
1853 (lookup_template_class): Use it to get the outer template args
1854 for instantiating one.
1857 * pt.c (reduce_template_parm_level): tsubst the parameters
1858 of a template template parm.
1860 2007-11-01 Douglas Gregor <doug.gregor@gmail.com>
1863 * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
1865 2007-11-01 Jakub Jelinek <jakub@redhat.com>
1868 * parser.c (cp_parser_postfix_dot_deref_expression): If
1869 POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor
1870 first and if that succeeds and type is SCALAR_TYPE_P, create
1874 * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment.
1875 (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo
1876 as for std::type_info.
1878 2007-10-31 Paolo Carlini <pcarlini@suse.de>
1881 * cxx-pretty-print.c (pp_cxx_typeid_expression,
1882 pp_cxx_delete_expression): Change to static linkage.
1883 * cxx-pretty-print.h: Adjust declarations.
1884 * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
1885 MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
1886 MODOP_EXPR): Forward to pp_expression.
1888 * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
1891 2007-10-31 Christian Bruel <christian.bruel@st.com>
1892 Mark Mitchell <mark@codesourcery.com>
1895 * typeck.c (check_return_expr): Don't set named_return_value_okay_p
1896 if retval is volatile.
1898 2007-10-30 Jakub Jelinek <jakub@redhat.com>
1901 * decl2.c (build_offset_ref_call_from_tree): Call
1902 build_non_dependent_expr on object prior to building ADDR_EXPR from it
1903 if FN is DOTSTAR_EXPR.
1905 2007-10-30 Douglas Gregor <doug.gregor@gmail.com>
1909 * pt.c (find_parameter_packs_r): Fix typo in comment.
1910 (convert_template_argument): Look at the pattern of a pack
1911 expansion to determine what kind of entity we're converting.
1912 (coerce_template_parameter_pack): When we have coerced a non-type
1913 template parameter pack, substitute into the type of that pack.
1914 (tsubst_pack_expansion): When our substitution of a parameter pack
1915 is a "trivial" substitution of itself, just substitute into the
1916 pack expansion rather than actually expanding.
1918 2007-10-29 Jakub Jelinek <jakub@redhat.com>
1921 * class.c (check_bitfield_decl): Don't set field's type to error_mark_node
1922 for non-integral type bitfields. Return true if bitfield is correct, false
1923 error has been diagnosed.
1924 (check_field_decls): If check_bitfield_decl returned false, call also
1927 2007-10-28 Paolo Carlini <pcarlini@suse.de>
1928 Mark Mitchell <mark@codesourcery.com>
1931 * pt.c (do_decl_instantiation): If the VAR_DECL is not a
1932 class member error out and return.
1934 2007-10-27 Jakub Jelinek <jakub@redhat.com>
1936 * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
1937 to current_function_decl rather than 0.
1940 * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
1942 * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
1944 2007-10-27 Jason Merrill <jason@redhat.com>
1947 * call.c (convert_default_arg): Detect recursion.
1949 2007-10-27 Jakub Jelinek <jakub@redhat.com>
1952 * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
1953 * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
1955 (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
1957 * error.c (dump_expr): Handle OFFSETOF_EXPR.
1959 2007-10-26 Jason Merrill <jason@redhat.com>
1962 * pt.c (get_template_info): New fn.
1963 (template_class_depth): Use it.
1964 (push_template_decl_real): Check that the template args of the
1965 definition match the args of the previous declaration.
1967 2007-10-26 Paolo Carlini <pcarlini@suse.de>
1970 * decl2.c (coerce_new_type): Do not allow a default argument for
1971 the first parameter.
1973 2007-10-26 Douglas Gregor <doug.gregor@gmail.com>
1976 * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
1977 don't see the leading '('. Only lookup names if we get an
1980 2007-10-26 Jakub Jelinek <jakub@redhat.com>
1983 * parser.c (cp_parser_parenthesized_expression_list): Set
1984 greater_than_is_operator_p to true in between the parens.
1986 2007-10-26 Paolo Carlini <pcarlini@suse.de>
1989 * decl.c (grokdeclarator): In case of conflicting specifiers
1990 just return error_mark_node.
1992 2007-10-26 Ollie Wild <aaw@google.com>
1994 * expr.c (cxx_expand_expr): Removed.
1995 * cp-tree.h (exx_expand_expr): Removed.
1996 * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
1999 2007-10-25 Paolo Carlini <pcarlini@suse.de>
2002 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
2004 2007-10-23 Jason Merrill <jason@redhat.com>
2006 PR c++/25950 (DR 391)
2007 * call.c (struct conversion): Remove check_copy_constructor_p.
2008 (reference_binding): Always bind a reference directly to a
2009 compatible class rvalue. Pass down LOOKUP_NO_TEMP_BIND during
2011 (check_constructor_callable): Remove.
2012 (convert_like_real): Don't call it.
2013 (initialize_reference): Don't call check_constructor_callable.
2014 (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
2015 LOOKUP_CONSTRUCTOR_CALLABLE. Don't require a temporary for base
2016 conversions if LOOKUP_NO_TEMP_BIND.
2017 (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
2018 (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
2020 * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
2022 2007-10-22 Jakub Jelinek <jakub@redhat.com>
2025 * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
2026 before checking if its type is integral.
2028 2007-10-22 Jason Merrill <jason@redhat.com>
2031 * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
2032 * pt.c (apply_late_template_attributes): Splice out dependent
2033 attributes from DECL_ATTRIBUTES.
2035 * decl.c (cxx_maybe_build_cleanup): Use build_address.
2037 2007-10-17 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2039 * typeck.c (build_binary_op) : Use appropriate warning option
2040 instead of unnamed warning.
2042 2007-10-16 Paolo Carlini <pcarlini@suse.de>
2045 * pt.c (current_template_args): Do not change TREE_LIST elements
2046 with a TREE_VALUE of error_mark_node.
2048 2007-10-16 Mark Mitchell <mark@codesourcery.com>
2050 * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
2051 * decl.c (start_decl): Tidy.
2052 (start_decl_1): Call cp_apply_type_quals_to_decl after completing
2054 (grokdeclarator): Clarify comment.
2056 2007-10-14 Andrew Pinski <pinskia@gmail.com>
2059 * decl.c (grokfndecl): Return NULL after the "definition of
2060 implicitly-declared" error happened.
2062 2007-10-12 Simon Martin <simartin@users.sourceforge.net>
2065 * call.c (build_user_type_conversion_1): Do not consider conversion
2066 functions to convert a (possibly cv-qualified) object to the (possibly
2067 cv-qualified) same object type (or a reference to it), to a (possibly
2068 cv-qualified) base class of that type (or a reference to it).
2070 2007-10-12 Paolo Carlini <pcarlini@suse.de>
2072 * pt.c (tsubst): Use template_parm_level_and_index.
2074 2007-10-12 Jakub Jelinek <jakub@redhat.com>
2077 * parser.c (cp_parser_compound_statement): Handle label-declarations
2078 at the beginning of the compound statement.
2079 (cp_parser_block_declaration): Issue diagnostics about __label__
2080 not at the beginning of a block.
2082 2007-10-11 Paolo Carlini <pcarlini@suse.de>
2085 * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
2086 to convert_template_argument.
2087 (coerce_template_parms): Return error_mark_node after fixed-length
2089 (tsubst_decl): Check for error_mark_node the return value of the
2090 first tsubst in 'case VAR_DECL'.
2092 2007-10-08 Ollie Wild <aaw@google.com>
2094 * typeck2.c (digest_init): Call cplus_expand_constant after
2095 convert_for_initialization.
2096 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
2097 * expr.c (cplus_expand_constant): Updated function description.
2099 2007-10-04 Jason Merrill <jason@redhat.com>
2102 * call.c (initialize_reference): Handle local static reference
2105 2007-10-03 Jason Merrill <jason@redhat.com>
2108 * name-lookup.c (push_namespace_with_attrs): Fold back into...
2109 (push_namespace): Here.
2110 (handle_namespace_attrs): New fn for the attr code.
2111 (leave_scope): Don't pop_visibility.
2112 * name-lookup.h (struct cp_binding_level): Remove has_visibility.
2113 * parser.c (cp_parser_namespace_definition): Call
2114 handle_namespace_attrs and pop_visibility as appropriate.
2117 * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
2119 2007-10-03 Alexandre Oliva <aoliva@redhat.com>
2121 * decl.c (duplicate_decls): Preserve linkage flags for mere
2122 redeclarations of gnu_inline definitions.
2124 2007-10-03 Jason Merrill <jason@redhat.com>
2127 * decl.c (wrap_cleanups_r): New fn.
2128 (wrap_temporary_cleanups): New fn.
2129 (initialize_local_var): Call it.
2131 2007-09-29 Jason Merrill <jason@redhat.com>
2134 * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
2135 constant to not have DECL_EXTERNAL if it's file-local.
2137 2007-09-28 Ollie Wild <aaw@google.com>
2140 2007-09-27 Ollie Wild <aaw@google.com>
2142 * typeck2.c (digest_init): Call cplus_expand_constant after
2143 convert_for_initialization.
2144 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
2145 * expr.c (cplus_expand_constant): Updated function description.
2147 2007-09-28 Jason Merrill <jason@redhat.com>
2150 * class.c (layout_empty_base): Take rli parameter, update
2151 rli->record_align if empty base has user-specified alignment.
2152 (build_base_field): Pass rli to it.
2154 2007-09-28 Paolo Carlini <pcarlini@suse.de>
2157 * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
2159 2007-09-28 Paolo Carlini <pcarlini@suse.de>
2162 * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
2163 (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
2164 (dump_parameters): Just call dump_type for argument packs too.
2166 2007-09-28 Jakub Jelinek <jakub@redhat.com>
2169 * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
2170 qualification by creating qualified PACK_EXPANSION_PATTERN and
2171 then calling make_pack_expansion on it.
2173 2007-09-27 Ollie Wild <aaw@google.com>
2175 * typeck2.c (digest_init): Call cplus_expand_constant after
2176 convert_for_initialization.
2177 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
2178 * expr.c (cplus_expand_constant): Updated function description.
2180 2007-09-27 Jason Merrill <jason@redhat.com>
2183 * decl2.c (is_late_template_attribute): Don't crash on unknown
2186 2007-09-27 Paolo Carlini <pcarlini@suse.de>
2189 * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
2190 * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
2191 spaces in the formatting.
2192 * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
2194 2007-09-27 Jakub Jelinek <jakub@redhat.com>
2196 * error.c (cxx_print_error_function): Add third argument, pass
2197 it over to lhd_print_error_function.
2198 (cp_print_error_function): If diagnostic->abstract_origin, print
2200 * cp-tree.h (struct diagnostic_info): New forward decl.
2201 (cxx_print_error_function): Add third argument.
2203 2007-09-25 Simon Martin <simartin@users.sourceforge.net>
2206 * name-lookup.c (pushtag): Do not create an implicit typedef before
2207 the associated type declaration is known to be valid.
2209 2007-09-25 Jakub Jelinek <jakub@redhat.com>
2211 * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
2212 rather than pointers.
2214 2007-09-24 Danny Smith <dannysmith@user.sourceforge.net>
2217 * search.c (check_final_overrider): Fail if
2218 targetm.comp_type_attributes returns 0.
2220 2007-09-24 Jason Merrill <jason@redhat.com>
2223 * pt.c (resolve_typename_type): Don't look things up in the original
2224 template if it would mean losing template arguments.
2226 2007-09-24 Jakub Jelinek <jakub@redhat.com>
2229 * cp-tree.h (cxx_type_hash_eq): New prototype.
2230 * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
2231 * tree.c (cxx_type_hash_eq): New function.
2233 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
2236 * tree.c (cp_build_qualified_type_real): Build a canonical
2237 ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
2239 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
2243 * tree.c (cplus_array_compare): Compare pointers, not types.
2244 (build_cplus_array_type_1): Store new array type into the hash
2245 table before building the canonical type; build the canonical type
2247 (cp_build_qualified_type_real): Put all of the array types with
2248 cv-qualified element types into the C++ array hash table, built as
2249 variants of the unqualified versions.
2251 2007-09-23 Jason Merrill <jason@redhat.com>
2254 * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
2255 for deprecation warnings.
2257 2007-09-22 Jason Merrill <jason@redhat.com>
2260 * call.c (build_over_call): Warn about deprecated virtuals.
2263 * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
2264 (MAYBE_TAGGED_TYPE_P): Remove.
2265 * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
2266 instead of calling is_late_template_attribute again.
2267 (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
2268 (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
2269 Don't crash on typedefs from non-template classes.
2270 * decl2.c (grokfield): Don't sorry about attrs on template parms.
2271 (is_late_template_attribute): All attributes applied to template
2272 parms or typename types are dependent. Static.
2273 (splice_template_attributes): Pass decl through.
2274 (save_template_attributes): Likewise.
2276 2007-09-20 Jakub Jelinek <jakub@redhat.com>
2279 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
2280 returned from tsubst_pack_expansion.
2281 (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
2282 (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
2284 2007-09-20 Paolo Carlini <pcarlini@suse.de>
2287 * semantics.c (finish_id_expression): Use consistently
2288 context_for_name_lookup.
2289 * decl.c (fixup_anonymous_aggr): Fix error message for
2290 anonymous struct (vs union).
2292 2007-09-19 Jason Merrill <jason@redhat.com>
2295 * pt.c (tsubst): Handle typedefs by looking for the specialization.
2296 (retrieve_specialization): Only tagged types use
2297 DECL_TEMPLATE_INSTANTIATIONS.
2298 (instantiate_class_template): Push nested classes too.
2299 (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
2301 * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
2302 * init.c (is_aggr_type): Remove redundant tests.
2303 * class.c (push_nested_class): Use CLASS_TYPE_P.
2305 2007-09-20 Paolo Carlini <pcarlini@suse.de>
2308 * init.c (build_zero_init): If, recursively, build_zero_init
2309 returns a NULL_TREE, do not append it to the VEC of constructors.
2311 2007-09-18 Jason Merrill <jason@redhat.com>
2314 * pt.c (apply_late_template_attributes): Set processing_template_decl.
2315 (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
2316 ATTR_FLAG_TYPE_IN_PLACE.
2317 (tsubst): Do unqualified lookup to find typedefs from current class.
2318 [ARRAY_TYPE]: Propagate alignment info.
2319 * decl2.c (is_late_template_attribute): Only defer handling of
2320 attribute aligned if the expression is dependent.
2321 (save_template_attributes): If we're deferring any attributes,
2322 make this a naming typedef.
2324 2007-09-18 Paolo Carlini <pcarlini@suse.de>
2326 PR c++/33462 (again)
2327 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
2328 va_arg instead of __builtin_va_arg.
2330 2007-09-18 Paolo Carlini <pcarlini@suse.de>
2333 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
2334 (pp_cxx_primary_expression): Use it.
2335 * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
2336 * error.c (dump_expr): Use it.
2338 2007-09-18 Paolo Carlini <pcarlini@suse.de>
2341 * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
2342 out case TYPEID_EXPR to...
2343 (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
2344 and pp_cxx_right_paren.
2345 * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
2346 * error.c (dump_expr): Use it.
2348 2007-09-18 Paolo Carlini <pcarlini@suse.de>
2351 * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
2352 (pp_cxx_primary_expression): Use it.
2353 * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
2354 * error.c (dump_expr): Use it.
2356 2007-09-16 Paolo Carlini <pcarlini@suse.de>
2359 * init.c (build_new): Remove warning for zero-element
2362 2007-09-16 Nathan Sidwell <nathan@codesourcery.com>
2365 * call.c (maybe_handle_implicit_object): Set this_p, clear
2366 rvaluedness_matches_p.
2367 (compare_ics): Do not compare rvaluedness matching when one of the
2368 operands is an implicit object.
2370 2007-09-14 Jason Merrill <jason@redhat.com>
2372 PR c++/17743, c++/19163
2373 * decl2.c (is_late_template_attribute): New fn.
2374 (splice_template_attributes, save_template_attributes): New fns.
2375 (cplus_decl_attributes): Call save_template_attributes.
2376 * pt.c (apply_late_template_attributes): New fn.
2377 (instantiate_class_template, tsubst_decl): Use it.
2378 * cp-tree.h: Declare is_late_template_attribute.
2380 2007-09-13 Tom Tromey <tromey@redhat.com>
2382 * parser.c (cp_lexer_new_main): Don't use
2383 c_lex_return_raw_strings.
2384 (cp_lexer_get_preprocessor_token): Update. Add special case when
2387 2007-09-11 Jan Hubicka <jh@suse.cz>
2389 * method.c (use_thunk): Use tree_rest_of_compilation
2390 * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
2391 (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
2392 * cp-tree.h (expand_body): Kill.
2393 (emit_associated_thunks): Declare.
2394 * semantics.c (emit_associated_thunks): Export.
2395 (expand_body): Kill.
2397 2007-09-09 David Daney <ddaney@avtrex.com>
2400 * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR
2401 to calculate cookie_ptr.
2403 2007-09-08 Jason Merrill <jason@redhat.com>
2406 * pt.c (most_specialized_class): Set processing_template_decl
2407 while tsubsting partial spec args.
2409 2007-09-06 Jason Merrill <jason@redhat.com>
2411 * decl2.c (get_guard): Copy visibility from the guarded variable.
2413 2007-09-06 Jan Hubicka <jh@suse.cz>
2415 * semantics.c (expand_body): Do not mark arguments of clones used.
2417 2007-09-06 Paolo Carlini <pcarlini@suse.de>
2420 * decl.c (cp_finish_decl): When processing_template_decl,
2421 deal correctly with init as TREE_LIST.
2423 2007-09-06 Tom Tromey <tromey@redhat.com>
2425 * decl.c (finish_function): Put return's location on line zero of
2428 2007-09-05 Jason Merrill <jason@redhat.com>
2431 * except.c (prepare_eh_type): Use type_decays_to.
2434 * init.c (build_delete): Use build_headof to get the address of the
2435 complete object if we aren't using the deleting destructor.
2436 * rtti.c (build_headof): No longer static.
2437 * cp-tree.h: Declare it.
2439 2007-09-06 Jakub Jelinek <jakub@redhat.com>
2441 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
2442 decl if a prototype for XX is provided with throw().
2445 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
2446 on __*_chk non-__builtin_* decls.
2448 2007-09-05 Paolo Carlini <pcarlini@suse.de>
2451 * semantics.c (finish_id_expression): Use context_for_name_lookup
2452 insted of DECL_CONTEXT, to see through anonymous structs and unions.
2453 * class.c (finish_struct_anon): Deal correctly with anonymous
2454 structs (vs unions, as GNU extension) in error messages.
2456 2007-09-05 Jan Hubicka <jh@suse.cz>
2458 * sematics.c (expand_body): Remove unnecesary import_export_decl
2459 call, DECL_EXTERNAL checks and current_function_decl saving.
2461 2007-09-05 Paolo Carlini <pcarlini@suse.de>
2463 PR c++/29731 (again)
2464 * parser.c (cp_parser_primary_expression): Return error_mark_node
2465 when a statement-expression is found in a template-argument list.
2467 2007-09-04 Jason Merrill <jason@redhat.com>
2469 * except.c (initialize_handler_parm): Use
2470 fold_build_cleanup_point_expr.
2473 * call.c (reference_binding): Don't look for user-defined conversions
2477 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
2478 the MUST_NOT_THROW_EXPR.
2480 2007-09-04 Richard Sandiford <richard@codesourcery.com>
2482 * decl.c (cp_finish_decl): Call determine_visibility before
2483 make_rtl_for_nonlocal_decl.
2485 2007-09-04 Jason Merrill <jason@redhat.com>
2488 * pt.c (most_specialized_class): Substitute outer template
2489 arguments into the arguments of a member template partial
2491 (strip_innermost_template_args): New fn.
2493 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
2495 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
2497 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2499 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
2500 * decl.c (cp_make_fname_decl): Likewise,
2501 * parser.c (cp_parser_string_literal): Likewise,
2502 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
2503 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
2506 2007-09-02 Paolo Carlini <pcarlini@suse.de>
2509 * typeck.c (build_unary_op): Fix error message for
2510 Boolean expression as operand to operator--.
2512 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2514 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
2515 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
2518 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
2521 * init.c (build_default_init): Make extern.
2522 * cp-tree.h (build_default_init): Declare here.
2523 * pt.c (tsubst_expr): When the instantiation of the initializer of
2524 a variable results in an empty list, default-initialize the
2526 (tsubst_copy_and_build): When the instantiation of the initializer
2527 in a new expression results in an empty initializer list,
2528 default-initialize it.
2530 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
2532 * mangle.c (write_type): Change mangling of rvalue reference from
2535 2007-08-31 Jakub Jelinek <jakub@redhat.com>
2537 * decl.c (duplicate_decls): Remove duplicated line.
2539 2007-08-31 Paolo Carlini <pcarlini@suse.de>
2542 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
2543 BOUND_TEMPLATE_TEMPLATE_PARM.
2545 2007-08-31 Paolo Carlini <pcarlini@suse.de>
2548 * search.c (lookup_member): Check the name argument for
2551 2007-08-31 Paolo Carlini <pcarlini@suse.de>
2554 * parser.c (cp_parser_trait_expr): Check rerurn value of
2557 2007-08-30 Ollie Wild <aaw@google.com>
2559 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
2560 convert_ptrmem for pointer to member conversions.
2561 (convert_to_pointer_force): Update cp_convert_to_pointer call.
2562 (ocp_convert): Update cp_convert_to_pointer call.
2563 * typeck.c (convert_ptrmem): Add conditional for null pointers to
2565 (build_static_cast_1): Check can_convert for conversions in either
2567 (get_delta_difference_1): New function.
2568 (get_delta_difference): Refactor to call get_delta_difference_1.
2570 2007-08-30 Jakub Jelinek <jakub@redhat.com>
2572 * decl.c (start_preparsed_function): Set
2573 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
2575 2007-08-28 Paolo Carlini <pcarlini@suse.de>
2578 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
2579 BOUND_TEMPLATE_TEMPLATE_PARM.
2581 2007-08-28 Jakub Jelinek <jakub@redhat.com>
2585 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
2586 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
2588 2007-08-27 Jason Merrill <jason@redhat.com>
2591 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
2592 Look inside STMT_EXPR.
2593 * semantics.c (stmt_expr_value_expr): New fn.
2594 * cp-tree.h: Declare it.
2597 * decl.c (groktypename): Ignore attributes applied to class type.
2599 2007-08-28 Richard Guenther <rguenther@suse.de>
2601 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
2603 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
2605 * error.c (dump_expr): Handle COMPLEX_CST.
2606 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
2607 (pp_cxx_expression): Likewise.
2609 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
2611 * decl.c (GNU_INLINE_P): New.
2612 (duplicate_decls): Handle gnu_inline. Merge attributes and
2613 some flags in overriding definitions.
2614 (redeclaration_error_message): Handle gnu_inline.
2615 (start_preparsed_function): Likewise.
2617 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2619 * call.c (sufficient_parms_p): Constify.
2620 * class.c (same_signature_p): Likewise.
2621 * cp-gimplify.c (is_invisiref_parm,
2622 cxx_omp_privatize_by_reference): Likewise.
2623 * cp-objcp-common.c (has_c_linkage): Likewise.
2624 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
2625 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
2626 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
2627 num_artificial_parms_for, comp_template_parms,
2628 template_parameter_pack_p, any_dependent_template_arguments_p,
2629 any_type_dependent_arguments_p, any_value_dependent_elements_p,
2630 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
2631 zero_init_p, member_p, cp_lvalue_kind,
2632 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
2633 varargs_function_p, is_dummy_object, special_function_kind,
2634 string_conv_p, type_unknown_p, comp_except_specs, compparms,
2635 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
2636 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
2637 cp_has_mutable_p, at_least_as_qualified_p,
2638 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
2639 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
2640 * except.c (nothrow_libfn_p): Likewise.
2641 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
2643 * pt.c (comp_template_parms, template_parameter_pack_p,
2644 any_type_dependent_arguments_p, any_value_dependent_elements_p,
2645 any_dependent_template_arguments_p): Likewise.
2646 * repo.c (repo_export_class_p): Likewise.
2647 * semantics.c (anon_aggr_type_p): Likewise.
2648 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
2649 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
2650 varargs_function_p, member_p, is_dummy_object, pod_type_p,
2651 zero_init_p, special_function_p): Likewise.
2652 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
2653 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
2654 compparms, invalid_nonstatic_memfn_p,
2655 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
2656 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
2657 cp_has_mutable_p, lvalue_or_else): Likewise.
2659 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
2661 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
2662 * cp-objcp-common.c (cp_tree_size): Ditto.
2663 * tree.c (cp_walk_subtrees): Ditto
2664 * cp-tree.def (TINST_LEVEL): Go away.
2665 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
2666 move together with other non-tree structs.
2667 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
2668 (union lang_tree_node): Eliminate tinst_level field.
2669 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
2670 (current_instantiation, outermost_tinst_level): Return
2671 a "struct tinst_level *".
2673 * error.c (print_instantiation_partial_context): Change second
2674 parameter to a "struct tinst_level *". Replace accessor macros
2676 (print_instantiation_full_context): Likewise.
2677 * lex.c (in_main_input_context): Likewise.
2679 * pt.c (struct pending_templates): New.
2680 (pending_templates, last_pending_template): Use it as a type.
2681 (current_tinst_level): Change typo to "struct tinst_level *"
2682 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
2683 (add_pending_template): Construct a "struct pending_template".
2684 Replace TINST_LEVEL accessor macros with field access.
2685 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
2686 (pop_tinst_level): Likewise.
2687 (instantiate_pending_templates): Likewise. Factor common code used
2688 when an instantiation has been done.
2689 (outermost_tinst_level): Replace tree_last with loop.
2690 (current_instantiation): Return a "struct tinst_level *".
2692 2007-08-24 Ollie Wild <aaw@google.com>
2694 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
2695 * name-lookup.h (cp_binding_level): Remove vtables member.
2697 2007-08-24 Richard Guenther <rguenther@suse.de>
2699 * tree.c (cp_cannot_inline_tree_fn): Remove.
2700 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
2701 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
2704 2007-08-24 Jakub Jelinek <jakub@redhat.com>
2707 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
2708 error_mark_node right away if build_expr_type_conversion
2712 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
2713 is error_mark_node rather than NULL_TREE.
2714 * pt.c (check_explicit_specialization): Likewise.
2717 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
2718 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
2720 2007-08-22 Jason Merrill <jason@redhat.com>
2723 * pt.c (outermost_tinst_level): New function.
2724 * lex.c (in_main_input_context): New function.
2725 * cp-tree.h: Declare it.
2726 * decl2.c (constrain_class_visibility): Use it to avoid warning
2727 about uses of the anonymous namespace in the main input file.
2729 2007-08-21 Jakub Jelinek <jakub@redhat.com>
2731 * init.c (build_new_1): Use get_target_expr instead of save_expr.
2733 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
2736 * class.c (finish_struct_1): Warn when a class has virtual
2737 functions and accessible non-virtual destructor.
2739 2007-08-20 Richard Guenther <rguenther@suse.de>
2743 * call.c (build_new_method_call): Convert initializer to
2745 * init.c (build_aggr_init): Do not fiddle with types.
2746 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
2747 * except.c (build_throw): Do not drop qualifiers for the
2749 * typeck.c (get_member_function_from_ptrfunc): Do not
2750 fiddle with types, instead convert.
2751 (build_ptrmemfunc1): Convert to the target type for
2753 (gfc_trans_allocate): Convert result to target type.
2754 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
2755 pointer-to-member structures shall have alias set zero as well.
2757 2007-08-20 Richard Guenther <rguenther@suse.de>
2759 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
2761 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
2762 (nonstatic_local_decl_p): Likewise.
2763 * tree.c (cp_auto_var_in_fn_p): Remove.
2764 * decl.c (nonstatic_local_decl_p): Remove.
2766 2007-08-20 Richard Guenther <rguenther@suse.de>
2768 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
2770 * tree.h (cp_walk_tree): New define to walk_tree_1 with
2771 cp_walk_subtrees lh parameter.
2772 (cp_walk_tree_without_duplicates): New define to
2773 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
2774 * tree.c (count_trees): Call
2775 cp_walk_tree_without_duplicates.
2776 (verify_stmt_tree): Call cp_walk_tree.
2777 (break_out_target_exprs): Likewise.
2778 (WALK_SUBTREE): Likewise.
2779 * cp-gimplify.c (cp_genericize): Likewise.
2780 * cp-pt.c (find_parameter_packs_r): Likewise.
2781 (uses_parameter_packs): Likewise.
2782 (make_pack_expansion): Likewise.
2783 (check_for_bare_parameter_packs): Likewise.
2784 (for_each_template_parm): Likewise.
2785 * decl.c (check_default_argument): Call
2786 cp_walk_tree_without_duplicates.
2787 * except.c (build_throw): Likewise.
2788 * decl2.c (type_visibility): Likewise.
2789 * semantics.c (expand_or_defer_fn): Likewise.
2790 (finalize_nrv): Call cp_walk_tree.
2792 2007-08-20 Jakub Jelinek <jakub@redhat.com>
2795 * init.c (build_new_1): Rename placement_var variable to placement_expr.
2796 Initialize it with save_expr rather than get_temp_regvar.
2798 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
2801 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
2804 2007-08-17 Ollie Wild <aaw@google.com>
2807 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
2808 declarations into appropriate slots for comparison. Fix type
2811 2007-08-17 Paolo Carlini <pcarlini@suse.de>
2814 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
2815 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
2817 2007-08-17 Paolo Carlini <pcarlini@suse.de>
2820 * parser.c (cp_parser_class_head): Improve error message.
2822 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
2824 * pt.c (instantiate_decl): Set input_location
2825 for the function end.
2827 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2829 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
2831 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
2832 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
2833 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
2834 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
2835 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
2836 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
2837 * typeck.c (cp_type_quals): Likewise.
2838 * typeck2.c (cxx_incomplete_type_diagnostic,
2839 cxx_incomplete_type_error): Likewise.
2841 2007-08-16 Paolo Carlini <pcarlini@suse.de>
2844 * pt.c (tsubst_friend_function): When check_classfn
2845 returns error_mark_node likewise return it.
2847 2007-08-15 Jakub Jelinek <jakub@redhat.com>
2850 * typeck.c (check_return_expr): Don't NRV optimize vars in
2852 * decl.c (finish_function): Comment fix.
2854 2007-08-15 Paolo Carlini <pcarlini@suse.de>
2857 * pt.c (push_template_decl_real): Depending on TYPE_P
2858 use either TYPE_CONTEXT or DECL_CONTEXT.
2860 2007-08-14 Mark Mitchell <mark@codesourcery.com>
2862 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
2863 constructors and destructors return this.
2865 2007-08-14 Paolo Carlini <pcarlini@suse.de>
2868 * decl2.c (check_classfn): Return error_mark_node in case of error;
2869 in that case, do not call add_method.
2870 * decl.c (start_decl): Deal with check_classfn returning
2872 (grokfndecl): Likewise.
2873 * pt.c (tsubst_friend_function): Likewise.
2875 2007-08-14 Andrew Pinski <pinskia@gmail.com>
2878 * typeck.c (build_binary_op): Disallow vector float types with
2879 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
2881 2007-08-11 Ian Lance Taylor <iant@google.com>
2883 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
2885 * cp-tree.h (cxx_get_alias_set): Update declaration.
2887 2007-08-10 Ollie Wild <aaw@google.com>
2889 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
2891 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
2893 (unqualified_namespace_lookup): Fix ambiguous_decl call.
2894 (lookup_using_namespace): Fix ambiguous_decl call.
2895 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
2897 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2899 * call.c (name_as_c_string): Use CONST_CAST.
2900 * decl.c (build_decl): Likewise.
2901 * parser.c (cp_parser_string_literal): Likewise.
2903 2007-08-10 Paolo Carlini <pcarlini@suse.de>
2906 * error.c (dump_expr): Consistently use the *_cxx_*
2907 variants of the pretty-print functions.
2909 2007-08-10 Paolo Carlini <pcarlini@suse.de>
2912 * decl.c (check_special_function_return_type): Just error
2913 on return type specified for conversion operator.
2915 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
2917 * typeck2.c (readonly_error): Handle general expressions.
2918 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
2920 2007-08-06 Dan Hipschman <dsh@google.com>
2922 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
2923 access function name.
2925 2007-08-04 Alfred Minarik <a.minarik@aon.at>
2928 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
2929 * g++spec.c (lang_specific_driver): Check them.
2931 2007-08-06 Paolo Carlini <pcarlini@suse.de>
2934 * pt.c (inline_needs_template_parms): Fix comment; change return type
2937 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
2940 2007-03-26 Dirk Mueller <dmueller@suse.de>
2942 * parser.c (cp_parser_member_declaration): Pedwarn
2943 about stray semicolons after member declarations.
2945 2007-08-02 Lee Millward <lee.millward@gmail.com>
2950 * parser.c (cp_parser_asm_definition): Detect and discard asm
2951 statements with invalid inputs or outputs.
2952 (cp_parser_asm_operand_list): Return error mark node if any
2953 of the operands are invalid. Adjust documentation.
2955 2007-08-02 Nick Clifton <nickc@redhat.com>
2957 * typeck.c: Change copyright header to refer to version 3 of the
2958 GNU General Public License and to point readers at the COPYING3
2959 file and the FSF's license web page.
2960 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
2961 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
2962 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
2963 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
2964 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
2965 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
2966 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
2967 name-lookup.h, parser.c: Likewise.
2969 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2972 * call.c (magic_varargs_p): Honor the "type generic" attribute.
2974 2007-07-30 Paolo Carlini <pcarlini@suse.de>
2977 * semantics.c (finish_label_stmt): Reject the __label__
2978 extension outside function scopes.
2980 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2982 * parser.c (eof_token): Un-constify.
2983 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
2984 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
2987 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
2989 * pt.c, tree.c, typeck2.c: Fix comment typos.
2991 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
2992 Mark Mitchell <mark@codesourcery.com>
2995 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
2996 hidden due to friend declarations in local classes.
2998 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
3000 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
3001 * cp-tree.def (DECLTYPE_TYPE): New.
3002 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
3003 (dump_type_prefix): Ditto.
3004 (dump_type_suffix): Ditto.
3005 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
3006 * mangle.c (write_type): Handle DECLTYPE_TYPE.
3007 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
3009 (DECLTYPE_TYPE_EXPR): New.
3010 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
3011 (finish_declared_type): Declare.
3012 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
3013 DECLTYPE_TYPE nodes.
3014 (pp_cxx_type_id): Ditto.
3015 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
3016 (tsubst): Substitute into a DECLTYPE_TYPE node.
3017 (tsubst_copy): Ditto.
3018 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
3020 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
3021 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
3022 structural equality (because we can't hash the expressions).
3023 (finish_declared_type): New.
3024 * lex.c (reswords): Add "decltype" keyword.
3025 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
3026 (cp_parser_postfix_expression): Add member_access_only_p to
3027 restrict postfix expression to member access expressions.
3028 (cp_parser_unary_expression): Update call to
3029 cp_parser_postfix_expression to reflect new parameter.
3030 (cp_parser_declared_type): New.
3031 (cp_parser_simple_type_specifier): Parse decltype types.
3033 2007-07-27 Mark Mitchell <mark@codesourcery.com>
3036 * call.c (convert_for_arg_passing): Only widen bitfields to their
3037 declared types if necessary.
3039 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3041 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
3044 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3046 * decl.c (typename_hash, typename_compare): Constify.
3047 * mangle.c (hash_type, compare_type): Likewise.
3048 * pt.c (eq_local_specializations, hash_local_specialization):
3050 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
3051 list_hash): Likewise.
3052 * typeck2.c (pat_compare): Likewise.
3054 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
3056 * method.c (implicitly_declare_fn): Increase alignment if member
3057 function pointer format requires it.
3059 2007-07-24 Paolo Carlini <pcarlini@suse.de>
3062 * typeck.c (check_return_expr): Do not pass a null argument
3065 2007-07-24 Paolo Carlini <pcarlini@suse.de>
3068 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
3071 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
3074 * typeck.c (convert_arguments): Only use default args if we have
3078 * typeck.c (structural_comptypes): No need to check
3079 resolve_typename_type return value here.
3080 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
3081 * pt.c (resolve_typename_type): Follow typename typedefs. Return
3082 original type rather than error_mark_node in case of failure.
3083 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
3084 resolve_typename_type result check.
3085 (cp_parser_direct_declarator, cp_parser_head,
3086 cp_parser_constructor_declarator_p): Likewise.
3088 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
3090 * pt.c (template_parms_variadic_p): Remove.
3091 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
3093 2007-07-12 Jakub Jelinek <jakub@redhat.com>
3096 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
3097 argument to dump_aggr_init_expr_args instead of false.
3099 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
3101 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
3102 canonical types; otherwise, fall back to structural type
3103 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
3104 internal compiler error if the canonical types are wrong.
3106 2007-07-11 Paolo Carlini <pcarlini@suse.de>
3109 * parser.c (cp_parser_make_indirect_declarator): When the
3110 the code argument is ERROR_MARK return cp_error_declarator.
3112 2007-07-09 Geoffrey Keating <geoffk@apple.com>
3115 * decl.c (cxx_init_decl_processing): Don't set
3116 force_align_functions_log.
3117 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
3118 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
3119 FUNCTION_DECL, return its alignment.
3121 2007-07-09 Richard Guenther <rguenther@suse.de>
3123 * decl.c (start_preparsed_function): Do not promote return type.
3125 2007-07-08 Paolo Carlini <pcarlini@suse.de>
3128 * pt.c (unify): Never pass error_mark_node to template_decl_level.
3130 2007-07-07 Mark Mitchell <mark@codesourcery.com>
3133 * pt.c (resolve_overloaded_unification): Robustify. Return a
3135 (type_unification_real): Adjust accordingly.
3137 2007-07-06 Richard Guenther <rguenther@suse.de>
3139 * init.c (build_new_1): Use the correct pointer type.
3140 * typeck2.c (build_m_component_ref): Likewise.
3142 2007-07-05 Mark Mitchell <mark@codesourcery.com>
3145 * init.c (build_zero_init): Always build an initializer for
3147 * typeck2.c (build_functional_cast): Use build_zero_init.
3150 * init.c (build_new_1): Always pass the allocation function to
3151 build_op_delete_call.
3152 * call.c (build_op_delete_call): Handle operator delete with a
3153 variable-argument list. Do not issue an error when no matching
3154 deallocation function is available for a new operator.
3157 * cp-tree.h (any_value_dependent_elements_p): Declare it.
3158 * decl.c (value_dependent_init_p): New function.
3159 (cp_finish_decl): Use it.
3160 * pt.c (value_dependent_expression_p): Use
3161 any_value_dependent_elements_p.
3162 * parser.c (cp_parser_primary_expression): Add comment about
3163 treating dependent qualified names as integral
3164 constant-expressions.
3166 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
3168 * decl.c (build_ptrmemfunc_type): Always use structural equality
3169 tests when comparing pointer-to-member-function types, because the
3170 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
3173 2007-07-03 Mark Mitchell <mark@codesourcery.com>
3175 * init.c (build_new): Tweak comment.
3177 2007-06-29 Dave Brolley <brolley@redhat.com>
3180 * parser.c (cp_parser_new_type_id): Don't reduce a named array
3181 type to its base type and number of elements here.
3182 * init.c (build_new): Call complete_type_or_else to ensure that the
3183 type is complete and to issue a diagnostic if it is not.
3184 (build_new_1): Don't call complete_type_or_else here.
3186 2007-07-03 Richard Guenther <rguenther@suse.de>
3189 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
3192 2007-07-02 Simon Baldwin <simonb@google.com>
3194 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
3195 for inner-style nested forward declarations that don't declare
3198 2007-07-02 Jakub Jelinek <jakub@redhat.com>
3201 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
3202 DECL_P in not a variable and appears more than once error messages.
3204 2007-07-01 Ollie Wild <aaw@google.com>
3206 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
3207 (select_decl): Remove function.
3208 (unqualified_namespace_lookup): Populate binding by calling
3209 ambiguous_decl. Remove select_decl call.
3210 (lookup_qualified_name): Remove select_decl call.
3211 * decl.c (lookup_and_check_tag): Check for ambiguous references.
3212 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
3213 generation when name lookup is ambiguous.
3215 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
3218 * init.c (build_new_1): Use structural equality on the copy of the
3221 2007-06-28 Geoffrey Keating <geoffk@apple.com>
3223 * decl2.c (determine_visibility): Implement
3224 flag_visibility_ms_compat effect on type info.
3225 * decl.c (cxx_init_decl_processing): Implement
3226 global effect of flag_visibility_ms_compat.
3228 2007-06-28 Geoffrey Keating <geoffk@apple.com>
3230 * decl2.c (start_objects): Mark constructor-running function
3233 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
3236 * decl.c (grokdeclarator): Reset friendp for member functions declared
3237 friend of their own class.
3239 2007-06-23 Mark Mitchell <mark@codesourcery.com>
3241 * decl2.c (determine_visibility): Don't look for dllexport here.
3242 (determine_visibility_from_class): Tidy.
3244 2007-06-18 Simon Baldwin <simonb@google.com>
3247 * parser.c (cp_parser_single_declaration): Added check for storage
3248 class other than sc_none in parsed declaration, and a flag to indicate
3249 if the call is part of an explicit template specialization parse.
3250 * (cp_parser_explicit_specialization): Specialization check flag added
3251 to call to cp_parser_single_declaration(), set true.
3252 * (cp_parser_template_declaration_after_export): Specialization check
3253 flag added to call to cp_parser_single_declaration(), set false.
3254 * pt.c (check_explicit_specialization): Added code to copy visiblity
3255 and linkage from the templated function to the explicit specialization.
3257 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
3259 * typeck.c (build_binary_op): For templates build the
3260 expression in pieces to avoid the assert in build2_stat.
3261 (get_member_function_from_ptrfunc):
3262 Change over to using POINTER_PLUS_EXPR and convert
3263 the second operand to sizetype.
3264 * typeck2.c (build_m_component_ref): Likewise.
3265 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
3266 instead of PLUS_EXPR for pointers.
3267 (build_new_1): Likewise.
3268 (build_vec_delete_1): Likewise.
3269 (build_vec_delete): Likewise.
3270 * class.c (build_base_path): Likewise.
3271 (build_base_path): Likewise.
3272 (convert_to_base_statically): Likewise.
3273 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
3274 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
3275 instead of PLUS_EXPR.
3276 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
3277 instead of PLUS_EXPR for pointers.
3278 * call.c (build_special_member_call): Likewise.
3279 * rtti.c (build_headof): Likewise.
3280 Use sizetype instead of ptrdiff_type_node.
3281 (tinfo_base_init): Create a POINTER_PLUS_EXPR
3282 instead of PLUS_EXPR for pointers.
3283 * except.c (expand_start_catch_block): Do a
3284 NEGATIVE and then a POINTER_PLUS_EXPR instead
3286 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
3287 PLUS_EXPR on pointer types over to use
3288 POINTER_PLUS_EXPR and remove the conversion
3289 to the pointer types.
3290 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
3291 adding to a pointer type. Use size_int instead of
3292 ssize_int. Convert the index to sizetype before
3293 adding it to the pointer.
3295 2007-06-15 Mark Mitchell <mark@codesourcery.com>
3297 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
3298 (DECL_ANON_UNION_VAR_P): New macro.
3299 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
3300 than DECL_VAR_MARKED_P, to keep track of which variables we have
3302 * decl.c (redeclaration_error_message): Complain about redeclaring
3303 anonymous union members at namespace scope.
3304 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
3306 2007-06-14 Geoff Keating <geoffk@apple.com>
3308 * decl2.c (determine_visibility): Ensure that functions with
3309 hidden types as parameters are hidden.
3312 * decl2.c (determine_visibility): Remove duplicate code for
3315 2007-06-12 Ian Lance Taylor <iant@google.com>
3318 * init.c (avoid_placement_new_aliasing): New static function.
3319 (build_new_1): Call it.
3321 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
3323 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
3324 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
3326 2007-06-08 Jakub Jelinek <jakub@redhat.com>
3329 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
3330 on init, the non-decl cond operand and increment value.
3332 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
3335 * decl.c (check_initializer): Report an error when a brace enclosed
3336 initializer is used for a non-aggregate type in C++98.
3337 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
3339 (grokdeclarator): Likewise.
3340 (move_fn_p): Likewise.
3341 * typeck.c (check_return_expr): Likewise.
3342 * call.c (reference_binding): Likewise.
3343 * error.c (cp_cpp_error): Likewise.
3344 * pt.c (check_default_tmpl_args): Likewise.
3346 * lex.c (init_reswords): Likewise.
3347 * parser.c (p_parser_primary_expression): Likewise.
3348 (TOKEN_PRECEDENCE): Likewise.
3349 (cp_parser_init_declarator): Likewise.
3350 (cp_parser_ptr_operator): Likewise.
3351 (cp_parser_parameter_declaration): Likewise.
3352 (cp_parser_enclosed_template_argument_list): Likewise.
3353 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
3354 (cp_parser_next_token_ends_template_argument_p): Likewise.
3356 2007-06-04 Simon Baldwin <simonb@google.com>
3358 * decl.c (grokdeclarator): Readability change. Moved case labels
3359 into direct switch statement scope.
3361 2007-06-04 Paolo Carlini <pcarlini@suse.de>
3363 * call.c (convert_like_real): Remove pointless code.
3365 2007-05-31 Mark Mitchell <mark@codesourcery.com>
3367 * decl.c (get_atexit_fn_ptr_type): New function.
3368 (get_atexit_node): Use it.
3369 (start_cleanup_fn): Likewise.
3370 (register_dtor_fn): Use the object's destructor, instead of a
3371 separate cleanup function, where possible.
3372 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
3373 (atexit_fn_ptr_type_node): New macro.
3374 * decl2.c (build_cleanup): Use build_address.
3376 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
3378 * typeck.c (build_binary_op): Include types in error.
3380 2007-05-31 Jakub Jelinek <jakub@redhat.com>
3383 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
3384 needs runtime initialization.
3386 2007-05-31 Paolo Carlini <pcarlini@suse.de>
3389 * semantics.c (finish_trait_expr): Complete the types.
3391 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
3392 Douglas Gregor <doug.gregor@gmail.com>
3393 Pedro Lamarao <pedro.lamarao@mndfck.org>
3394 Howard Hinnant <howard.hinnant@gmail.com>
3398 * typeck.c (comptypes): Don't consider rvalue and lvalue
3399 reference types to be equivalent.
3400 (check_return_expr): Move from certain lvalues when returning
3402 * decl.c (grokdeclarator): Implement reference collapsing.
3403 (copy_fn_p): Don't consider constructors taking rvalue references
3404 to be copy constructors.
3406 * call.c (conversion): New "rvaluedness_matches_p" member.
3407 (convert_class_to_reference): Require reference type as first
3408 parameter instead of base type.
3409 (reference_binding): Add logic to handle rvalue references.
3410 (implicit_conversion): Update inaccurate comment.
3411 (convert_like_real): Disable creation of temporaries that are
3412 impossible to initialize for types with move constructors.
3413 (build_over_call): Elide move constructors when possible.
3414 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
3415 (maybe_handle_ref_bind): Return conversion instead of type node.
3416 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
3417 determine preferred conversion sequences.
3418 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
3419 (LOOKUP_PREFER_RVALUE): New.
3420 (DECL_MOVE_CONSTRUCTOR_P): New.
3421 (struct cp_declarator): Add "reference" member for reference
3422 types, with new "rvalue_ref" flag.
3423 (cp_build_reference_type): Declare.
3424 (move_fn_p): Declare.
3425 * error.c (dump_type_prefix): Format rvalue reference types
3426 correctly in error messages.
3427 * except.c (build_throw): Move from certain lvalues when
3429 * mangle.c (write_type): Mangle rvalue references differently
3430 than regular references.
3431 * parser.c (make_reference_declarator): Add boolean parameter for
3433 (cp_parser_make_indirect_declarator): New.
3434 (cp_parser_new_declarator_opt): Call
3435 cp_parser_make_indirect_declarator.
3436 (cp_parser_conversion_declarator_opt): Ditto.
3437 (cp_parser_declarator): Ditto.
3438 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
3440 * pt.c (tsubst): Implement reference collapsing.
3441 (maybe_adjust_types_for_deduction): Implement special template
3442 parameter deduction rule for rvalue references.
3443 (type_unification_real): Update calls to
3444 maybe_adjust_types_for_deduction.
3445 (try_one_overload): Ditto.
3446 (unify_pack_expansion): Ditto.
3447 * tree.c (lvalue_p_1): Handle rvalue reference types.
3448 (cp_build_reference_type): New.
3450 2007-05-30 Jakub Jelinek <jakub@redhat.com>
3453 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
3454 variables that need runtime initialization.
3456 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
3459 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
3460 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
3461 case POSTDECREMENT_EXPR>): Return the error_mark_node
3462 if either the real or imaginary parts would an
3465 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
3466 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3469 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
3470 token is a closing brace, false if there are no tokens left.
3471 (cp_parser_namespace_alias_definition): Only consume the next token if
3472 it is a closing brace.
3474 * parser.c (cp_parser_class_specifier): Likewise.
3476 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
3478 * semantics.c (finish_member_declaration): Fix a typo in the
3481 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
3493 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
3494 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
3495 * pt.c (check_for_bare_parameter_packs): Return bool indicated
3496 whether everything was okay. Fix indentation.
3497 (push_template_decl_real): Check for bare parameter packs in
3498 function parameters; where errors occur, mark the parameter types
3499 with ERROR_MARK_NODEs to avert ICEs.
3500 (coerce_template_parameter_pack): New.
3501 (coerce_template_parms): Moved parameter pack coercion into
3502 coerce_template_parameter_pack, and permit it anywhere in the
3503 template parameter list (not just at the end). Parameter and
3504 argument indices can vary (somewhat) separately now, so add
3505 PARM_IDX and ARG_IDX.
3506 (fn_type_unification): Don't set an argument pack as incomplete if
3507 no argument pack was deduced.
3508 (type_unification_real): If a type parameter is a parameter pack
3509 and has not otherwise been deduced, it will be deduced to an empty
3511 (more_specialized_fn): Use the actual lengths of the argument
3512 lists when comparing against expansions.
3513 * semantics.c (finish_member_declaration): If a field's type has
3514 bare parameter packs, error and set its type to ERROR_MARK_NODE.
3516 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
3519 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
3521 2007-05-22 Ollie Wild <aaw@google.com>
3523 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
3524 (unqualified_namespace_lookup): Adds check for hidden types.
3526 2007-05-22 Ollie Wild <aaw@google.com>
3528 * decl.c (duplicate_decls): Verify namespace names are unique.
3530 2007-05-21 Mark Mitchell <mark@codesourcery.com>
3532 * decl.c (cxx_maybe_build_cleanup): Handle
3533 __attribute__((cleanup)).
3535 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3537 * cvt.c (cp_convert_and_check): Don't check warnings if the
3540 2007-05-18 Geoffrey Keating <geoffk@apple.com>
3542 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
3544 2007-05-14 Paolo Carlini <pcarlini@suse.de>
3547 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
3548 type only if is a class type (5.2.8/4).
3550 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
3552 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
3553 * decl.c (grokdeclarator): Use unsigned_type_for instead of
3554 c_common_unsigned_type.
3556 2007-05-11 Silvius Rus <rus@google.com>
3558 * typeck.c (build_indirect_ref): Add call to
3559 strict_aliasing_warning.
3560 (build_reinterpret_cast_1): Condition call to
3561 strict_aliasing_warning.
3563 2007-05-11 Jan Hubicka <jh@suse.cz>
3565 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
3566 * decl2.c (start_objects): ctors and dtors are no longer public.
3567 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
3569 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
3571 * typeck.c (build_unary_op): Remove code that used to
3572 handle non lvalue increments/decrements.
3574 2007-05-07 Mike Stump <mrs@apple.com>
3576 * parser.c (check_empty_body): Add.
3577 (cp_parser_iteration_statement): Add call to check_empty_body.
3579 2007-05-05 Geoffrey Keating <geoffk@apple.com>
3582 * mangle.c (write_mangled_name): Mangle static variable names.
3583 (write_unqualified_name): Use local-source-name for
3584 namespace-scope static variables.
3586 2007-05-04 Dirk Mueller <dmueller@suse.de>
3588 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
3591 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
3594 * decl2.c (constrain_class_visibility):
3595 Use strip_pointer_or_array_types instead of strip_array_types.
3597 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
3600 * decl.c (reshape_init_r): Don't reshape the first element if it
3601 is a pointer to member function.
3603 2007-04-27 Simon Baldwin <simonb@google.com>
3605 * decl.c (grokparms): Changed message format from %qD to %qE.
3607 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
3609 * error.c (maybe_warn_variadic_templates): Variadic templates are
3610 now in C++0x, so only warn about them in C++98 mode.
3612 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
3615 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
3616 integeral types from vectors types.
3618 2007-04-26 Jakub Jelinek <jakub@redhat.com>
3621 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
3622 for type dependent OMP_CLAUSE_DECLs.
3624 2007-04-24 Mark Mitchell <mark@codesourcery.com>
3627 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
3628 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
3629 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
3630 * init.c (build_zero_init): Adjust, as
3631 COMPLEX_TYPE is now a SCALAR_TYPE.
3632 * typeck2.c (digest_init): Allow brace-enclosed initializers for
3633 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
3635 2007-04-25 Paolo Carlini <pcarlini@suse.de>
3637 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
3638 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
3639 (trait_expr_value): Adjust.
3641 2007-04-23 Simon Baldwin <simonb@google.com>
3643 * decl.c (grokparms): Added new error for duplicate function
3644 parameters names in function prototypes, to match gcc behavior.
3646 2007-04-23 Jan Hubicka <jh@suse.cz>
3648 * decl2.c (finish_objects): Do not call target constructor/destructor
3651 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
3653 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
3654 instead of checking GIMPLE_STMT_P in chain_next.
3656 2007-04-17 Mark Mitchell <mark@codesourcery.com>
3659 * call.c (convert_for_arg_passing): Convert bitfields to their
3662 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
3665 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
3667 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
3670 * decl2.c (constrain_class_visibility):
3671 Do not warn about the use of anonymous namespace in the main input file.
3673 2007-04-15 Mark Mitchell <mark@codesourcery.com>
3675 * cp-tree.h (current_template_parms): Fix typo in comment.
3677 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
3679 * cp-tree.h, error.c: Fix comment typos.
3681 2007-04-13 Jason Merrill <jason@redhat.com>
3684 * call.c (reference_binding): Add c_cast_p parm. If true,
3685 add quals to TO as needed to make it reference-compatible.
3687 2007-04-11 Jan Hubicka <jh@suse.cz>
3689 * class.c (convert_to_base_statically): Fold produced tree; verify
3690 that we are not processing template_decl.
3692 2007-04-09 Mark Mitchell <mark@codesourcery.com>
3695 * class.c (build_base_path): Ensure that the converted pointer has
3696 the same cv-qualification as the input.
3698 2007-04-09 Paolo Carlini <pcarlini@suse.de>
3700 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
3702 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
3704 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
3706 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
3707 * tree.c (cp_add_pending_fn_decls): Remove.
3708 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
3710 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
3712 Revert change removing staticp.
3714 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
3716 * cp-objcp-common.c (cxx_staticp): Remove.
3717 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
3718 * cp-tree.h (cxx_staticp):
3720 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
3722 * class.c (check_for_override): Don't remove dllmport attribute
3725 2007-04-03 Jakub Jelinek <jakub@redhat.com>
3728 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
3729 type issue error and return early.
3731 2007-03-30 Jason Merrill <jason@redhat.com>
3734 * typeck.c (cp_type_readonly): New fn.
3735 * cp-tree.h: Declare it.
3736 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
3737 (cp_finish_decl): Not here.
3739 2007-03-31 Richard Guenther <rguenther@suse.de>
3741 * optimize.c (maybe_clone_body): Replace splay-tree usage by
3744 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
3749 * parser.c (declarator_can_be_parameter_pack): New.
3750 (cp_parser_template_parameter): Only parse the `...' if the
3751 declarator can be a parameter pack.
3752 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
3754 * pt.c (find_parameter_packs_r): Look into the bounds on integer
3755 types (they could be used as array bounds).
3756 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
3757 (tsubst_pack_expansion): Handle failure to expand parameter
3760 2007-03-30 Paolo Carlini <pcarlini@suse.de>
3763 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
3764 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
3765 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
3766 (CLASS_TYPE_NON_UNION_P): Add.
3767 (struct lang_type_class): Add has_complex_dflt.
3768 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
3769 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
3770 * cp-tree.def: Add TRAIT_EXPR.
3771 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
3772 * lex.c (struct resword): Add __has_nothrow_assign,
3773 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
3774 __has_trivial_constructor, __has_trivial_copy,
3775 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
3776 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
3777 __is_pod, __is_polymorphic, __is_union.
3778 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
3779 (cp_parser_trait_expr): New.
3780 * semantics.c (finish_trait_expr, trait_expr_value
3781 classtype_has_nothrow_copy_or_assign_p): New.
3782 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
3784 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
3785 * class.c (check_bases, check_field_decl, check_bases_and_members):
3786 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
3787 * pt.c (uses_template_parms, tsubst_copy_and_build,
3788 value_dependent_expression_p, type_dependent_expression_p): Deal with
3790 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
3792 2007-03-29 Richard Guenther <rguenther@suse.de>
3794 * tree.c (cp_walk_subtrees): Do not set input_location.
3796 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
3799 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
3802 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
3804 * parser.c (struct cp_parser): Update comment for
3805 greater_than_is_operator_p.
3806 (cp_parser_primary_expression): In C++0x mode, a cast operator can
3807 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
3808 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
3809 !GREATER_THAN_IS_OPERATOR_P.
3810 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
3811 `>>' operators that will become two `>' tokens in C++0x.
3812 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
3813 mode, allowing it to terminate default arguments.
3814 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
3815 `>>' like two consecutive `>' tokens.
3816 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
3817 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
3818 ends a template argument.
3820 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
3822 * decl.c (redeclaration_error_message): Complain when redeclaring
3823 a friend function with default template arguments (C++0x mode only).
3824 * cp-tree.h (check_default_tmpl_args): Declare.
3825 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
3826 template arguments in function templates. Add support for checking
3827 the default template arguments of friend templates.
3828 (push_template_decl_real): Fix call to check_default_tmpl_args.
3829 (type_unification_real): If a template parameter has not been
3830 deduced but provides a default template argument, substitute into
3831 that default template argument.
3832 * parser.c (cp_parser_init_declarator): When declaring (but not
3833 defining!) a function template in C++0x mode, check for default
3836 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
3839 * decl.c (grokdeclarator): Deal with cv-qualified function type
3840 typedefs in the same way for member and non-member functions.
3842 2007-03-26 Dirk Mueller <dmueller@suse.de>
3844 * parser.c (cp_parser_member_declaration): Pedwarn
3845 about stray semicolons after member declarations.
3847 2007-03-26 Paolo Carlini <pcarlini@suse.de>
3850 * pt.c (instantiate_decl): Set in_system_header.
3852 2007-03-22 Mark Mitchell <mark@codesourcery.com>
3854 * cp-tree.h (current_tempalte_parms): Improve documentation.
3855 * pt.c (current_template_args): Likewise.
3858 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
3859 not consume tokens when failing.
3861 2007-03-22 Jim Wilson <wilson@specifix.com>
3862 Mark Mitchell <mark@codesourcery.com>
3865 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
3866 consistent with FROM.
3868 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
3870 * error.c (dump_expr): Handle dependent names that designate types.
3871 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
3873 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
3875 * cp-tree.def, parser.c, pt.c: Fix comment typos.
3877 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3879 * cvt.c (cp_convert_and_check) : Define.
3880 * cp-tree.h (cp_convert_and_check): Declare.
3881 * call.c (convert_conversion_warnings): Rename to
3882 conversion_null_warnings. The warning for floating-point to
3883 integer is handled by convert_and_check in convert_like_real.
3884 (convert_like_real): convert_conversion_warnings was renamed as
3885 conversion_null_warnings.
3886 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
3887 overflow and changes of value during conversion.
3889 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3892 * parser.c (cp_parser_statement): If 'namespace' is found, this
3893 only can be a namespace alias definition, so parse it now.
3894 (cp_parser_namespace_alias_definition): if we find an open brace
3895 instead of '=', then this is actually a misplaced namespace
3898 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3901 * decl.c (cxx_init_decl_processing): Move command-line options
3902 processing to c-opts.c.
3904 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
3906 * ptree.c (cxx_print_type): Use formatting markup for integers
3907 when printing template parameter index/level/orig level.
3908 (cxx_print_xnode): Ditto.
3909 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
3910 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
3911 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
3913 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
3914 rather than a HOST_WIDE_INT.
3915 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
3916 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
3918 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
3919 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
3920 IN_BASE_INITIALIZER bool bitfields.
3921 (struct cp_declarator): Make KIND a 4-bit field. Make
3922 PARAMETER_PACK_P a bool bitfield just after KIND.
3923 * pt.c (uses_parameter_packs): Destroy the pointer set.
3924 (make_pack_expansion): Ditto.
3925 (check_for_bare_parameter_packs): Ditto.
3926 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
3928 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
3931 * call.c (convert_default_arg): Instead of copying the node,
3934 2007-03-15 Dirk Mueller <dmueller@suse.de>
3937 * call.c (convert_conversion_warnings): New..
3938 (convert_like_real): .. factored out from here.
3939 (convert_conversion_warnings): Add warning about
3940 false being converted to NULL in argument passing.
3942 2007-03-14 Dirk Mueller <dmueller@suse.de>
3944 * semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
3945 (finish_do_body): Warn about empty body in do/while statement.
3947 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3949 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
3951 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3954 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
3957 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
3959 * repo.c (init_repo): Initialize random_seed saved options.
3960 (finish_repo): Adjust.
3962 2007-03-13 Mark Mitchell <mark@codesourcery.com>
3965 * Make-lang.in (doc/g++.1): Use $< to specify the location from
3968 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
3970 * decl.c (compute_array_index_type): New warning flag warn_vla.
3972 2007-03-12 Mark Mitchell <mark@codesourcery.com>
3975 * call.c (convert_default_arg): Copy non-constant arguments.
3977 2007-03-11 Mark Mitchell <mark@codesourcery.com>
3980 * parser.c (cp_parser_postfix_expression): Disallow compound
3981 literals in constant expressions.
3984 * semantics.c (finish_typeof): Use unlowered_expr_type.
3986 2007-03-10 Mark Mitchell <mark@codesourcery.com>
3989 * cp-tree.h (unlowered_expr_type): New function.
3990 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
3991 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
3992 (unlowered_expr_type): New function.
3993 (build_unary_op): Disallow predecrements of bool bitfields.
3994 * call.c (build_conditional_expr): Use unlowered_expr_type.
3995 * pt.c (type_unification_real): Likewise.
3997 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
4000 * typeck.c (check_return_expr): Check for bare parameter packs.
4001 (comptypes): Compare template parameter packs and
4002 type pack expansions.
4003 * decl.c (grokdeclarator): Deal with the declaration of function
4005 (grokparms): Verify that the (optional) function parameter pack is
4006 at the end of the parameter list.
4007 (xref_basetypes): Handle pack expansions in the base class.
4008 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
4009 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
4010 (NONTYPE_ARGUMENT_PACK): New.
4011 (TYPE_PACK_EXPANSION): New.
4012 (EXPR_PACK_EXPANSION): New.
4013 (ARGUMENT_PACK_SELECT): New.
4014 * cp-objcp-common.c (cp_tree_size): Compute size of
4015 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
4016 ARGUMENT_PACK_SELECT.
4017 * error.c (dump_template_argument): Print template argument packs.
4018 (dump_template_argument_list): Ditto.
4019 (dump_template_parameter): Dump `...' for template type parameter
4021 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
4022 (dump_parameters): Print function parameter packs.
4023 (dump_template_parms): Print template argument packs.
4024 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
4025 (maybe_warn_variadic_templates): New.
4026 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
4027 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
4028 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
4030 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
4031 (write_template_arg): Write argument packs as separate arguments.
4032 * cp-tree.h (struct template_parm_index_s): Add flag that
4033 indicates that the template parameter is actually a parameter
4035 (struct tree_argument_pack_select): New.
4036 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
4037 (union lang_tree_node): Add argument_pack_select.
4038 (FUNCTION_PARAMETER_PACK_P): New.
4039 (PACK_EXPANSION_P): New.
4040 (PACK_EXPANSION_PATTERN): New.
4041 (SET_PACK_EXPANSION_PATTERN): New.
4042 (PACK_EXPANSION_PARAMETER_PACKS): New.
4043 (ARGUMENT_PACK_P): New.
4044 (ARGUMENT_PACK_ARGS): New.
4045 (SET_ARGUMENT_PACK_ARGS): New.
4046 (ARGUMENT_PACK_INCOMPLETE_P): New.
4047 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
4048 (TEMPLATE_PARM_PARAMETER_PACK): New.
4049 (TEMPLATE_TYPE_PARAMETER_PACK): New.
4050 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
4051 (ARGUMENT_PACK_SELECT_INDEX): New.
4052 (ARGUMENT_PACK_SELECT_ARG): New.
4053 (struct cp_declarator): Add parameter_pack_p flag.
4054 (maybe_warn_variadic_templates): Declare.
4055 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
4056 indicate a template parameter pack.
4057 (uses_parameter_packs): Declare.
4058 (template_parameter_pack_p): Declare.
4059 (template_parms_variadic_p): Declare.
4060 (make_pack_expansion): Declare.
4061 (check_for_bare_parameter_packs): Declare.
4062 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
4063 sizeof... expressions.
4064 (pp_cxx_expression): Print pack expansions and non-type argument
4066 (pp_cxx_exception_specification): Print pack expansions.
4067 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
4068 (pp_cxx_ctor_initializer): Print pack expansions.
4069 (pp_cxx_type_id): Print pack expansions.
4070 (pp_cxx_template_argument_list): Print argument packs.
4071 (pp_cxx_template_parameter): Print ellipsis for template parameter
4073 * pt.c (comp_template_parms): Compare template parameter packs.
4074 (template_parameter_pack_p): New.
4075 (template_parms_variadic_p): New.
4076 (template_args_variadic_p): New.
4077 (make_ith_pack_parameter_name): New.
4078 (struct find_parameter_pack_data): New.
4079 (find_parameter_packs_r): New.
4080 (uses_parameter_packs): New.
4081 (make_pack_expansion): New.
4082 (check_for_bare_parameter_packs): New.
4083 (expand_template_argument_pack): New.
4084 (reduce_template_parm_level): Propagate parameter pack flag.
4085 (process_template_parm): Add is_parameter_pack parameter to state
4086 when the parameter is actually a parameter pack. Create template
4087 parameter packs when is_parameter_pack is true.
4088 (current_template_args): The argument for a template parameter
4089 pack is an argument pack containing a single pack expansion.
4090 (process_partial_specialization): When checking that non-type
4091 argument expressions do not involve template parameters, loop over
4092 the arguments in argument packs separately.
4093 (push_template_decl_real): Check that the type of the declaration
4094 does not have any bare parameter packs. Check that primary
4095 templates have no more than one parameter pack, and that it comes
4096 at the end of the template parameter list.
4097 (convert_template_argument): Handle coercions for pack expansion
4098 expressions by coercing the pattern then rebuilding the expansion.
4099 (coerce_template_parms): When coercing the arguments for a
4100 variadic template, pack "extra" arguments into an argument pack.
4101 (coerce_template_template_parms): Cannot coerce between parameter
4102 packs and non-pack parameters.
4103 (template_args_equal): Compare PACK_EXPANSION_P expressions.
4104 (comp_template_args): Expand all template arguments packs before
4105 comparing template argument lists.
4106 (mangle_class_name_for_template): Make argument packs as separate
4108 (for_each_template_parm_r): No need to handle BASELINK.
4109 (instantiate_class_template): Handle pack expansions in the base
4111 (tsubst_pack_expansion): New.
4112 (tsubst_template_args): Handle substitutions of argument packs and
4113 pack expansion into template argument lists.
4114 (tsubst_decl): Expand function parameter packs into separate
4115 function parameters.
4116 (tsubst_arg_types): Expand a type pack expansion into separate
4118 (tsubst_exception_specification): Handle pack expansions in
4119 exception specifiers.
4120 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
4121 replacing a template parameter with its argument. If we encounter
4122 a substitution for an argument pack, just return the parameter
4124 (tsubst_copy): sizeof(X...) returns the number of elements in
4125 parameter pack X. See through ARGUMENT_PACK_SELECT when the
4126 PARM_DECL is a parameter pack.
4127 (tsubst_expr): Expression pack expansions and argument packs
4128 cannot show up here; they will all be handled through function
4129 calls, sizeof, and template argument lists.
4130 (tsubst_copy_and_build): sizeof(X...) returns the number of
4131 elements in parameter pack X. Handle pack expansions in TREE_LIST
4132 and CONSTRUCTOR nodes.
4133 (fn_type_unification): Handle "incomplete" explicit template
4134 argument lists that specify some of the arguments for a template
4136 (type_unification_real): Unify arguments against pack expansions.
4137 (template_parm_level_and_index): New, helper function.
4138 (unify_pack_expansion): New.
4139 (unify): Unify argument packs on an argument-by-argument basis,
4140 handling variadic argument packs as well.
4141 (more_specialized_fn): Handle unification of function parameter
4142 packs. All things being equal, prefer non-variadic function
4143 templates to variadic function templates.
4144 (more_specialized_class): Prefer the variadic class template
4145 partial specialization that binds fewer arguments to a parameter
4147 (regenerate_decl_from_template): Expand function parameter packs
4148 into separate parameters.
4149 (instantiate_decl): Ditto.
4150 (tsubst_initializer_list): Handle pack expansions for base-class
4152 (dependent_type_p_r): Determine dependent types in argument packs
4153 and pack expansions.
4154 (value_dependent_expression_p): Determine value-dependence of
4155 non-type argument packs.
4156 (dependent_template_arg_p): Handle argument packs.
4157 * semantics.c (finish_cond): Check for bare parameter packs.
4158 (finish_expr_stmt): Ditto.
4159 (finish_for_expr): Ditto.
4160 (finish_switch_cond): Ditto.
4161 (finish_mem_initializers): Ditto.
4162 * name-lookup.c (arg_assoc_type): Handle pack expansions and
4164 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
4165 * parser.c (make_declarator): Declarator is not an expansion.
4166 (make_pointer_declarator): Transfer parameter pack flag to outer
4168 (make_reference_declarator): Ditto.
4169 (make_ptrmem_declarator): Ditto.
4170 (make_call_declarator): Ditto.
4171 (make_array_declarator): Ditto.
4172 (cp_parser_postfix_expression): Allow pack expansion expressions
4173 in the argument list for a call expression.
4174 (cp_parser_parenthesized_expression_list): Add new parameter
4175 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
4176 into separate arguments."
4177 (cp_parser_new_placement): Allow pack expansion expressions.
4178 (cp_parser_new_initializer): Ditto.
4179 (cp_parser_mem_initializer_list): Allow ellipsis to create a
4180 base-class initializer expansion.
4181 (cp_parser_mem_initializer): Ditto.
4182 (cp_parser_template_parameter_list): Keep track of whether the
4183 template parameter is a template parameter pack.
4184 (cp_parser_template_parameter): Parse the ellipsis to indicate a
4185 template parameter pack.
4186 (cp_parser_type_parameter): Ditto.
4187 (cp_parser_template_argument_list): Parse the ellipsis to indicate
4189 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
4190 this declarator is a parameter pack.
4191 (cp_parser_parameter_declaration): The ellipsis does not end the
4192 parameter declaration, because it might be a parameter pack. Parse
4193 the ellipsis to indicate a parameter pack.
4194 (cp_parser_initializer): Allow pack expansions.
4195 (cp_parser_initializer_list): Allow ellipsis to create an
4196 initializer expansion.
4197 (cp_parser_base_clause): Allow ellipsis to create a base specifier
4199 (cp_parser_type_id_list): Allow ellipsis to create an exception
4200 specifier expansion.
4201 (cp_parser_attribute_list): Don't allow pack expansions.
4202 (cp_parser_functional_cast): Allow pack expansions.
4203 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
4204 compute the length of a parameter pack.
4205 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
4206 end a template argument.
4207 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
4208 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
4211 2007-03-09 Dirk Mueller <dmueller@suse.de>
4213 * call.c (build_new_op): Call warn_logical_operator.
4215 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
4218 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
4221 * pt.c (any_template_arguments_need_structural_equality_p):
4224 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
4226 * decl.c (grokdeclarator): Disable warnings for anonymous
4229 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
4231 * typeck2.c (readonly_error): Always emit a hard error.
4232 Remove last argument.
4233 * cp-tree.h (readonly_error): Adjust prototype.
4234 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
4235 * typeck.c (build_unary_op): Likewise.
4236 (build_modify_expr): Likewise.
4238 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
4241 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
4243 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4246 * parser.c (struct cp_parser): New IN_IF_STMT.
4247 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
4248 returning if parsing the body of an 'if' statement or issuing an
4249 error and continuing.
4250 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
4252 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
4254 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
4257 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
4260 2007-03-02 Geoffrey Keating <geoffk@apple.com>
4262 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
4263 Objective-C++. Don't exit early if -shared-libgcc needs to be
4266 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4268 * typeck.c (common_base_type): Delete unused function.
4270 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
4272 * Make-lang.in: Add dummy lang.install-pdf target.
4274 2007-03-01 Simon Baldwin <simonb@google.com>
4277 * decl.c (check_tag_decl): Added new warning for typedef ignored
4278 when it precedes an otherwise valid non-typedef declaration.
4280 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
4282 * typeck.c (build_function_call): Store converted arguments
4283 in a stack-allocated array instead of building a list.
4284 (convert_arguments): Store arguments in the array passed in as an
4285 argument, and return the actual number of arguments.
4286 * call.c (build_call): Delete, and replace with...
4287 (build_call_n, build_call_a): New.
4288 (build_op_delete_call): Rewrite to avoid constructing argument lists.
4289 (build_over_call): Store converted arguments in a stack-allocated
4290 array instead of building a list.
4291 (build_cxx_call): Pass arguments in an array instead of as a list.
4292 (build_java_interface_fn_ref): Rewrite to avoid constructing
4294 * tree.h: Update declarations to reflect above changes.
4295 * method.c (use_thunk): Use a stack-allocated array to hold
4296 the arguments instead of a list.
4297 * rtti.c (throw_bad_cast): Update call to cxx_call.
4298 (throw_bad_typeid): Likewise.
4299 (build_dynamic_cast_1): Likewise.
4300 * init.c (build_builtin_delete_call): Use build_call_n.
4301 * decl.c (expand_static_init): Likewise.
4302 * except.c (cp_protect_cleanup_actions): Likewise.
4303 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
4304 (gimplify_must_not_throw_expr): Likewise.
4305 (cxx_omp_apply_fn): Use build_call_a.
4307 2007-02-26 Mark Mitchell <mark@codesourcery.com>
4309 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
4310 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
4312 2007-02-25 Mark Mitchell <mark@codesourcery.com>
4314 * cp-tree.h (static_ctors): Remove.
4315 * cp-tree.h (static_dtors): Likewise.
4316 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
4317 refactoring of tree_map hierarchy.
4318 (decl_shadowed_for_var_insert): Likewise.
4319 * semantics.c (expand_body): Use c_expand_body.
4320 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
4321 * decl2.c (static_ctors): Remove.
4322 (static_dtors): Likewise.
4323 (generate_ctor_or_dtor_function): Pass NULL_TREE to
4324 objc_generate_static_init_call. Do not call static_[cd]tors.
4325 (generate_ctor_and_dtor_functions_for_priority): Do not check for
4327 (cp_write_global_declarations): Likewise.
4329 2007-02-23 Richard Guenther <rguenther@suse.de>
4331 * class.c (note_name_declared_in_class): Make declaration
4332 changes meaning a pedwarn.
4334 2007-02-22 Michael Matz <matz@suse.de>
4337 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
4338 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
4339 dump_function_decl): Guard emitting outer scopes by new flag.
4340 * cp-lang.c (cxx_dwarf_name): New function.
4341 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
4342 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
4344 (push_template_decl_real, lookup_template_class): Remove calls
4347 2007-02-19 Mark Mitchell <mark@codesourcery.com>
4349 * call.c (build_new_method_call): Ensure that explicit calls of
4350 destructors have type "void".
4352 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4354 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
4355 and -Walways-true with -Waddress.
4356 * cvt.c (convert_to_void): Replace unconditional warning with
4359 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
4361 * decl.c, tree.c: Fix comment typos.
4363 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
4366 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
4367 statement expression if we had an error mark node.
4369 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
4370 Brooks Moses <brooks.moses@codesourcery.com>
4371 Lee Millward <lee.millward@codesourcery.com>
4373 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
4374 Change class to tcc_vl_exp.
4376 * call.c (build_call): Use build_call_list instead
4378 (build_over_call): Likewise.
4379 (build_new_method_call): Use build_min_non_dep_call_list
4380 instead of build_min_non_dep.
4382 * error.c (dump_call_expr_args): New function.
4383 (dump_aggr_init_expr_args): New function.
4384 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
4385 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
4387 * cvt.c (convert_to_void): Use build_call_array instead
4388 of build3; use new AGGR_INIT_EXPR accessor macros.
4390 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
4391 instead of TREE_CODE_LENGTH.
4393 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
4394 AGGR_INIT_EXPR accessor macros.
4396 * cp-gimplify.c (cp_gimplify_init_expr): Use
4397 AGGR_INIT_EXPR_SLOT to set the slot operand.
4399 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
4400 (AGGR_INIT_EXPR_SLOT): New macro.
4401 (AGGR_INIT_EXPR_ARG): New macro.
4402 (aggr_init_expr_nargs): New macro.
4403 (AGGR_INIT_EXPR_ARGP): New macro.
4404 (aggr_init_expr_arg_iterator): New.
4405 (init_aggr_init_expr_arg_iterator): New.
4406 (next_aggr_init_expr_arg): New.
4407 (first_aggr_init_expr_arg): New.
4408 (more_aggr_init_expr_args_p): New.
4409 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
4410 (stabilize_aggr_init): New declaration.
4411 (build_min_non_dep_call_list): Likewise.
4413 * tree.c (process_aggr_init_operands): New function.
4414 (build_aggr_init_array) New function.
4415 (build_cplus_new): Update to use new CALL_EXPR and
4416 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
4417 build_aggr_init_array.
4418 (build_min_non_dep_call_list) New function.
4419 (build_min_nt): Assert input code parameter is not a variable
4420 length expression class.
4421 (build_min, build_min_non_dep): Likewise.
4422 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
4423 to check for equality instead of recursing. Handle tcc_vl_exp
4425 (stabilize_call): Update to only handle CALL_EXPRs, not
4426 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
4427 (stabilize_aggr_init): New function.
4428 (stabilize_init): Use it.
4430 * cxx-pretty-print.c (pp_cxx_postfix_expression)
4431 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
4432 AGGR_INIT_EXPR accessor macros and argument iterators.
4434 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
4435 build_vl_exp. Iterate through the operands, recursively
4436 processing each one.
4437 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
4438 CALL_EXPR accessor macros.
4439 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
4440 tree code classes. Use TREE_OPERAND_LENGTH instead of
4443 * semantics.c (finish_call_expr): Use build_nt_call_list
4444 instead of build_nt.
4445 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
4446 accessor macros. Use build_call_array to construct the
4447 CALL_EXPR node instead of build3
4449 * decl2.c (build_offset_ref_call_from_tree): Use
4450 build_nt_call_list and build_min_non_dep_call_list instead
4451 of build_min_nt and build_min_non_dep.
4453 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
4454 Use build_nt_call_list instead of build_min_nt.
4456 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4459 * call.c (build_conditional_expr): Improve error message.
4461 2007-02-13 Dirk Mueller <dmueller@suse.de>
4463 * friend.c (do_friend): Annotate warning about friend
4464 declarations in templates with OPT_Wnon_template_friend.
4465 Convert informal message from warning() to inform().
4467 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
4468 Mark Mitchell <mark@codesourcery.com>
4471 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
4472 instantiations for variables.
4474 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4477 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
4478 Check warn_unused_value just once.
4480 2007-02-11 Mark Mitchell <mark@codesourcery.com>
4483 * pt.c (determine_specialization): Use skip_artificial_parms_for.
4484 (fn_type_unificiation): Likewise.
4485 (get_bindings): Likewise.
4487 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
4490 * decl.c (finish_function): Use DECL_REPLACEABLE.
4491 * tree.c (cp_cannot_inline_tree_fn): Likewise.
4493 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
4495 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
4497 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
4499 * decl.c (grokvardecl): Don't error if !have_tls.
4500 (grokdeclarator): Likewise.
4501 * parser.c (cp_parser_omp_threadprivate): Likewise.
4503 2007-02-07 Jakub Jelinek <jakub@redhat.com>
4506 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
4507 parameters and result decls in omp clauses.
4508 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
4511 2007-02-05 Dirk Mueller <dmueller@suse.de>
4514 * parser.c (cp_parser_class_specifier): Always initialize bases.
4516 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
4518 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
4519 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
4520 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
4522 * semantics.c (finish_omp_atomic): Store a whole expression node
4523 in operand 1, and integer_zero_node in operand 0, for dependent
4524 OMP_ATOMIC. Rewrite to make flow easier to understand.
4526 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
4528 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
4530 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
4532 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
4533 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
4535 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
4537 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
4538 keyword warning to -Wc++0x-compat.
4540 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
4542 * decl.c (grokdeclarator): Update documentation.
4544 2007-02-02 Jakub Jelinek <jakub@redhat.com>
4547 * decl.c (grokdeclarator): If __thread is used together with
4548 a storage class other than extern and static, clear thread_p
4549 after issuing diagnostics and fall through to checking the
4552 2007-01-30 Roger Sayle <roger@eyesopen.com>
4554 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
4555 calculating the size of an array (to avoid recursive errors).
4557 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4560 * typeck.c (build_binary_op): Fix logic for warning. Move warning
4562 * call.c (convert_like_real): Don't warn when converting to
4565 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4567 * decl.c (pop_label): Replace warning with call to
4568 warn_for_unused_label.
4570 2007-01-28 Andrew Pinski <pinskia@gmail.com>
4573 * semantics.c (finish_pseudo_destructor_expr): Check the
4574 destrutor name by calling check_dtor_name.
4576 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
4578 * lex.c (D_CPP0X): Rename.
4580 (reswords): D_CPP0X -> D_CXX0X.
4581 (init_reswords): Ditto.
4582 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
4583 of C++0x keywords as identifiers.
4585 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
4588 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
4591 2007-01-23 Ian Lance Taylor <iant@google.com>
4593 * typeck.c (convert_for_assignment): Only warn about a = b = c
4594 when converting to bool.
4596 2007-01-23 Roger Sayle <roger@eyesopen.com>
4598 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
4600 * typeck.c (ignore_overflows): Remove the remaining uses of
4601 TREE_CONSTANT_OVERFLOW.
4603 2007-01-20 Jan Hubicka <jh@suse.cz>
4605 * decl2.c (start_objects, start_static_storage_duration_function):
4606 Do not make the functions uninlinable.
4608 2007-01-17 Ian Lance Taylor <iant@google.com>
4610 * class.c (add_method): Call VEC_reserve_exact rather than passing
4611 a negative size to VEC_reserve.
4613 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
4616 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
4618 2007-01-10 Mark Mitchell <mark@codesourcery.com>
4621 * decl.c (make_typename_type): If the qualified name is not a
4622 type, issue an error.
4623 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
4626 2007-01-08 Geoffrey Keating <geoffk@apple.com>
4628 * rtti.c: Include target.h.
4629 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
4630 don't emit typeinfo for fundamental types as weak.
4631 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
4633 2007-01-08 Richard Guenther <rguenther@suse.de>
4635 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
4637 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
4639 * call.c (standard_conversion): Pass flag to
4640 vector_types_convertible_p to disallow emission of note.
4641 * typeck.c (convert_for_assignment): Pass flag to
4642 vector_types_convertible_p to allow emission of note.
4643 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
4644 to disallow emission of note.
4646 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4649 * typeck.c (build_binary_op): Call overflow_warning if
4650 TREE_OVERFLOW_P is true for the result and not for any of the
4653 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
4656 * class.c (add_method): Don't wait until template
4657 instantiation time to complain about duplicate methods.
4659 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4662 * semantics.c (finish_unary_op_expr): Warn only if result
4663 overflowed and operands did not.
4665 2007-01-05 Ian Lance Taylor <iant@google.com>
4667 * typeck.c (build_binary_op): Warn about comparing a non-weak
4670 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
4672 * pt.c (tsubst): Propagate the need for structural equality checks
4673 when reducing the level of template parameters.
4675 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
4677 * pt.c: Fix a comment typo.
4679 2007-01-02 Ian Lance Taylor <iant@google.com>
4681 * semantics.c (maybe_convert_cond): Optionally warn when using an
4682 assignment as a condition.
4683 * typeck.c (convert_for_assignment): Optionally warn about
4684 assigning the result of an assignment to a bool.
4686 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
4688 * pt.c (canonical_template_parms): Correct typo in comment.
4690 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
4692 * typeck.c (structural_comptypes): Renamed from "comptypes".
4693 (comptypes): Use canonical type information to perform fast type
4694 comparison. When VERIFY_CANONICAL_TYPES, verify that the
4695 canonical type comparison returns the same results as we would see
4696 from the current, structural check. Support COMPARE_STRUCTURAL
4697 when we need structural checks.
4698 * decl.c (typename_compare): Fix comment.
4699 (build_typename_type): TYPENAME_TYPE nodes require structural
4700 equality checks, because they resolve different based on the
4702 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
4703 require structural equality checks (for now).
4704 (build_ptrmemfunc_type): Build the canonical pointer to member
4706 (compute_array_index_type): Whenever we build a new index type
4707 to represent the size of an array in a template, we need to mark
4708 this index type as requiring structural equality. This goes for
4709 arrays with value-dependent sizes with the current ABI, or all
4711 * tree.c (cplus_array_hash): New.
4712 (struct cplus_array_info): New.
4713 (cplus_array_compare): New.
4714 (cplus_array_htab): New.
4715 (build_cplus_array_type_1): Use a hash table to cache the array
4716 types we build. Build the canonical array type for each array
4718 (cp_build_qualified_type_real): When building a cv-qualified array
4719 type, use the hash table of array types and build canonical array
4721 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
4722 use structural equality (for now).
4723 * cp-tree.h (COMPARE_STRUCTURAL): New.
4724 * pt.c (canonical_template_parms): New.
4725 (canonical_type_parameter): New.
4726 (process_template_parm): Find the canonical type parameter.
4727 (lookup_template_class): When we have named the primary template
4728 type, set the canonical type for our template class to the primary
4729 template type. If any of the template arguments need structural
4730 equality checks, the template class needs structural equality
4732 (tsubst): When reducing the level of a template template
4733 parameter, we require structural equality tests for the resulting
4734 parameter because its template parameters have not had their types
4735 canonicalized. When reducing a template type parameter, find the
4736 canonical reduced type parameter.
4737 (any_template_arguments_need_structural_equality_p): New.