1 2009-06-24 Jason Merrill <jason@redhat.com>
3 * pt.c (lookup_template_class): Use currently_open_class,
4 compare template args later.
7 * decl.c (decls_match): Check DECL_TI_TEMPLATE too.
8 * class.c (resolve_address_of_overloaded_function): Fix typo.
10 2009-06-18 Aldy Hernandez <aldyh@redhat.com>
12 * class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.
13 * decl.c (finish_decl): Remove.
14 (declare_global_var): Replace finish_decl with cp_finish_decl.
16 * rtti.c (emit_tinfo_decl): Same.
17 * pt.c (tsubst_expr): Same.
18 (instantiate_decl): Same.
19 * decl2.c (grokbitfield): Same.
20 * name-lookup.c (pushdecl_top_level_1): Same.
21 * cp-tree.h: Remove finish_decl.
23 2009-06-16 David Edelsohn <edelsohn@gnu.org>
25 * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL.
26 (lang_specific_driver): Always allocate extra argument.
27 Add LIBSTDCXX_STATIC to arglist if defined and linking
30 2009-06-16 Ian Lance Taylor <iant@google.com>
32 * Make-lang.in (cp/class.o): Depend upon gt-cp-class.h.
33 (cp/semantics.o): Depend upon gt-cp-semantics.h.
35 2009-06-16 Ian Lance Taylor <iant@google.com>
37 * parser.c (cp_unevaluated_operand): Define global variable.
38 (cp_parser_question_colon_clause): Increment
39 c_inhibit_evaluation_warnings when evaluating an expression which
40 will never be executed.
41 (cp_parser_decltype): Increment cp_unevaluated_operand and
42 c_inhibit_evaluation_warnings, not skip_evaluation.
43 (cp_parser_sizeof_operand): Likewise.
44 (cp_parser_enclosed_template_argument_list): Save
45 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
47 * cp-tree.h (struct saved_scope): Remove skip_evaluation field.
48 Add unevaluated_operand and inhibit_evaluation_warnings fields.
49 (cp_unevaluated_operand): Declare.
50 * name-lookup.c (push_to_top_level): Save cp_unevaluated_operand
51 and c_inhibit_evaluation_warnings rather than skip_evaluation.
52 (pop_from_top_level): Restore cp_unevaluated_operand and
53 c_inhibit_evaluation_warnings rather than skip_evaluation.
54 * class.c (build_base_path): Check cp_unevaluated_operand rather
56 * typeck.c (build_class_member_access_expr): Likewise.
57 (cp_build_binary_op): Don't warn about bad shift counts if
58 c_inhibit_evaluation_warnings is non-zero.
59 * pt.c (coerce_template_parms): Save state of
60 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
62 (tsubst_aggr_type): Likewise.
63 (tsubst_pack_expansion): Check cp_unevaluated_operand rather than
65 (tsubst_copy): Likewise.
66 (tsubst): Set cp_unevaluated_operand and
67 c_inhibit_evaluation_warnings, not skip_evaluation.
68 (tsubst_copy_and_build): Likewise.
69 * call.c (convert_arg_to_ellipsis): Check cp_unevaluated_operand
70 rather than skip_evaluation.
71 * decl2.c (mark_used): Likewise.
72 * semantics.c (finish_non_static_data_member): Likewise.
73 * cvt.c (cp_convert_and_check): Check
74 c_inhibit_evaluation_warnings rather than skip_evaluation.
75 * mangle.c (write_type): Set cp_unevaluated_operand rather than
78 2009-06-15 Ian Lance Taylor <iant@google.com>
80 * parser.c (cp_parser_direct_declarator): Add braces around
81 variables declared before label.
83 2009-06-15 Rafael Avila de Espindola <espindola@google.com>
85 * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove.
86 * cp-tree.h (cxx_comdat_group): Change signature.
87 * decl.c (duplicate_decls): Use DECL_COMDAT_GROUP.
88 (cxx_comdat_group): Change signature.
89 * decl2.c (comdat_linkage, maybe_make_one_only): Update call to
91 (constrain_visibility, get_guard): Use DECL_COMDAT_GROUP.
92 * method.c (use_thunk): Update call to make_decl_one_only.
93 * optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP
95 2009-06-12 Aldy Hernandez <aldyh@redhat.com>
97 * typeck.c (cp_build_binary_op): Pass location to overflow_warning.
98 (build_modify_expr): New arg.
99 * semantics.c (finish_unary_op_expr): Pass location to
101 (handle_omp_for_class_iterator): Pass location to build_modify_expr.
102 * typeck.c (cxx_sizeof_or_alignof_type): Pass location to
103 c_sizeof_or_alignof_type.
104 (build_array_ref): New argument.
105 (build_compound_expr): Same.
106 (build_const_cast): Same.
107 (build_ptrmemfunc): Pass location to build_c_cast.
108 * init.c (avoid_placement_new_aliasing): Pass location to
110 (build_vec_delete_1): Pass location to cp_build_modify_expr,
112 * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
113 * decl.c (poplevel): Pass location to c_build_bind_expr.
114 (finish_case_label): Pass location to build_case_label.
115 (finish_constructor_body): Same.
116 (finish_destructor_body): Pass location to build_stmt.
117 (cxx_maybe_build_cleanup): Same, but to build_compound_expr.
118 * call.c (build_new_op): Pass location to build_array_ref.
119 (build_x_va_arg): Pass location to build_va_arg.
120 * except.c (expand_end_catch_block): Pass location to
122 * cp-tree.h (build_array_ref): New argument.
123 (build_compound_expr): Same.
124 (build_c_cast): Same.
125 * cp-gimplify.c (gimplify_if_stmt): Pass location on down.
126 (gimplify_switch_stmt): Same.
127 * typeck2.c (split_nonconstant_init_1): Same.
128 * pt.c (tsubst_copy): Same.
129 * semantics.c (add_decl_expr): Same.
131 (push_cleanup): Same.
132 (finish_goto_stmt): Same.
133 (finish_expr_stmt): Same.
134 (begin_if_stmt): Same.
135 (begin_while_stmt): Same.
136 (begin_do_stmt): Same.
137 (finish_return_stmt): Same.
138 (begin_for_stmt): Same.
139 (finish_break_stmt): Same.
140 (finish_continue_stmt): Same.
141 (begin_switch_stmt): Same.
142 (begin_try_block): Same.
143 (begin_handler): Same.
144 (finish_asm_stmt): Same.
145 (finish_label_stmt): Same.
146 (finish_stmt_expr_expr): Same.
147 (finalize_nrv_r): Same.
148 (finish_omp_atomic): Same.
149 * name-lookup.c (do_using_directive): Same.
150 * decl2.c (grok_array_decl): Same.
151 * parser.c (cp_parser_cast_expression): Same.
152 (cp_parser_selection_statement): Same.
153 (cp_parser_implicitly_scoped_statement): Same.
154 (cp_parser_objc_selector_expression): Same.
155 (cp_parser_objc_synchronized_statement): Same.
156 (cp_parser_objc_throw_statement): Same.
157 (cp_parser_omp_critical): Same.
158 (cp_parser_omp_master): Same.
159 * typeck.c (build_function_call): Add location argument.
160 * init.c: Add location argument to all build_decl calls.
169 * cp-gimplify.c: Same.
171 (cp_make_fname_decl): Add location argument. Pass location ot
173 (finish_case_label): Same.
174 * cp-tree.h (finish_case_label): Add location argument.
175 * parser.c (cp_parser_label_for_labeled_statement): Pass location to
178 2009-06-09 Jason Merrill <jason@redhat.com>
181 * decl2.c (mark_used): Return after complaining about deleted fn.
183 2009-06-08 Jason Merrill <jason@redhat.com>
185 * parser.c (cp_parser_type_id_1): 'auto' type is ok with a
186 late-specified return type.
188 2009-06-08 Jakub Jelinek <jakub@redhat.com>
191 * call.c (check_dtor_name): Return false even if
192 get_type_value (name) is error_mark_node.
196 * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
197 on error_mark_node. Check for VLAs outside of function context
198 before check whether to wrap bounds into a NOP_EXPR with
201 2009-06-08 Alexandre Oliva <aoliva@redhat.com>
203 * repo.c (get_base_filename): Use aux_base_name rather than
204 alternate temporary file during second compare debug compilation.
205 (finish_repo): Skip during -fcompare-debug-second.
207 2009-06-06 Ian Lance Taylor <iant@google.com>
209 * parser.c (cp_parser_label_for_labeled_statement): Support
210 attribute on labels if immediately followed by semicolon.
211 * semantics.c (finish_label_stmt): Return new label.
212 * pt.c (tsubst_expr): Handle attributes for LABEL_EXPR.
214 2009-06-03 Ian Lance Taylor <iant@google.com>
216 * Make-lang.in (cc1plus-checksum.o): Depend upon $(CONFIG_H) and
219 2009-06-02 Mark Mitchell <mark@codesourcery.com>
221 * decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
223 2009-06-02 Jason Merrill <jason@redhat.com>
227 * typeck.c (cp_build_modify_expr): Always pass init-lists to the
229 * call.c (implicit_conversion): Allow init-list conversion to scalar
230 during direct-initialization, too. Mark the conversion bad if it
231 has too many levels of braces.
232 (convert_like_real): And give a helpful error.
236 * decl.c (cp_finish_decl): Handle auto deduction from ().
237 * typeck.c (build_x_indirect_ref): Handle dereferencing an operand
238 with dependent type that is known to be a pointer.
240 2009-06-02 Simon Martin <simartin@users.sourceforge.net>
243 * pt.c (register_specialization): Properly setup DECL_CONTEXT for
244 specializations in an invalid namespace.
246 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
248 * error.c (print_instantiation_partial_context): Print column
251 2009-05-29 Ian Lance Taylor <iant@google.com>
253 * error.c (cp_printer): Don't use va_arg with enum type.
255 2009-05-28 Dodji Seketeli <dodji@redhat.com>
258 * cp-tree.h (canonical_type_variant): Remove this function declaration.
259 (strip_typedefs): New function declaration.
260 * tree.c (strip_typedefs): New function definition.
261 (canonical_type_variant): Remove function definition.
262 * cvt.c (convert_from_reference): No need to use
263 canonical_type_variant.
264 * typeck.c (cp_build_indirect_ref): Likewise.
265 * error.c (dump_template_bindings): Use strip_typedefs instead of
266 canonical_type_variant.
267 * pt.c (convert_template_argument, unify): Likewise.
268 * mangle.c (canonicalize_for_substitution): Don't use
269 canonical_type_variant.
271 2009-05-27 Jason Merrill <jason@redhat.com>
273 * call.c (implicit_conversion): Handle conversion from
274 initializer-list to scalar.
275 (convert_like_real): Likewise. Avoid crashing on list
276 initialization with bad conversions.
277 (can_convert): Use LOOKUP_EXPLICIT.
278 (can_convert_arg_bad): Add flags parm.
280 * typeck.c (convert_for_assignment): Pass flags.
282 2009-05-27 Ian Lance Taylor <iant@google.com>
284 * Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
285 (cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
287 2009-05-26 Ian Lance Taylor <iant@google.com>
289 * Make-lang.in (g++spec.o): Use $(COMPILER).
290 (g++$(exeext), cc1plus-dummy$(exeext)): Likewise.
291 (cc1plus$(exeext)): Likewise.
293 2009-05-26 Dodji Seketeli <dodji@redhat.com>
296 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Remove this accessor.
297 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): New accessor.
298 (get_types_needing_access_check): Declare new entry point.
299 * pt.c (append_type_to_template_for_access_check_1,
300 get_types_needing_access_check): New functions.
301 (perform_typedefs_access_check): Accept FUNCTION_DECLs and
302 RECORD_TYPEs rather than TEMPLATE_DECLs. Use the new
303 get_types_needing_access_check, no more
304 MEMBER_TYPES_NEEDING_ACCESS_CHECK.
305 (instantiate_class_template): Set input_location to the source
306 location of the most specialized template definition.
307 Perform access check using the RECORD_TYPE of the template, not its
308 associated most generic TEMPLATE_DECL.
309 (append_type_to_template_for_access_check): Augment function
310 comments. Use the new get_types_needing_access_check, not
311 MEMBER_TYPE_NEEDING_ACCESS_CHECK. Use the new
312 append_type_to_template_for_access_check_1 subroutine.
314 2009-05-22 Jason Merrill <jason@redhat.com>
317 * typeck.c (cp_build_binary_op): Allow ENUMERAL_TYPE in
318 arithmetic comparisons.
319 (cp_common_type): Handle scoped enums.
321 * call.c (promoted_arithmetic_type_p): Don't use INTEGRAL_TYPE_P.
322 (add_builtin_candidate, add_builtin_candidates): Likewise.
323 (convert_like_real): Likewise.
324 * class.c (check_bitfield_decl): Likewise.
325 * decl.c (check_static_variable_definition): Likewise.
326 (compute_array_index_type): Likewise.
327 * decl2.c (grokbitfield): Likewise.
328 * init.c (build_new_1): Likewise.
329 * pt.c (convert_nontype_argument): Likewise.
330 (current_instantiation): Likewise.
331 * tree.c (pod_type_p): Likewise.
332 * typeck.c (build_static_cast_1): Likewise.
333 (build_reinterpret_cast_1): Likewise.
335 2009-05-22 Richard Guenther <rguenther@suse.de>
338 * init.c (avoid_placement_new_aliasing): Remove.
339 (build_new_1): Do not call it.
341 2009-05-22 Mark Mitchell <mark@codesourcery.com>
343 * decl2.c (decl_needed_p): Consider dllexport'd functions needed.
344 * semantics.c (expand_or_defer_fn): Similarly.
346 2009-05-20 Ian Lance Taylor <iant@google.com>
348 * parser.c (cp_parser_postfix_expression): Change args to a vec.
349 Release it when done.
350 (tree_vector): Define typedef. Define VEC functions.
351 (cp_parser_parenthesized_expression_list): Change return type to
352 vec. Change all callers.
353 (cp_parser_new_expression): Change placement and initializer to
354 vecs. Release them when done.
355 (cp_parser_new_placement): Change return type to vec. Change all
357 (cp_parser_new_initializer): Likewise.
358 * typeck.c (build_function_call_vec): Just call
359 cp_build_function_call_vec.
360 (cp_build_function_call): Just build a vec and call
361 cp_build_function_call_vec.
362 (cp_build_function_call_vec): New function based on old
363 cp_build_function_call.
364 (convert_arguments): Remove nargs and argarray parameters. Change
365 values to a vec. Change caller.
366 (build_x_compound_expr_from_vec): New function.
367 (cp_build_modify_expr): Build vec to pass to
368 build_special_member_call.
369 * call.c (struct z_candidate): Add first_arg field. Change args
371 (convert_class_to_reference): Handle first argument separately.
372 (add_candidate): Add first_arg parameter. Change args parameter
373 to vec. Change all callers.
374 (add_function_candidate, add_conv_candidate): Likewise.
375 (add_template_candidate_real, add_template_candidate): Likewise.
376 (add_template_conv_candidate): Likewise.
377 (build_user_type_conversion_1): Handle first argument separately.
378 (resolve_args): Change return type and parameter type to vecs.
380 (perform_overload_resolution): Change args parameter to vec.
382 (build_new_function_call, build_operator_new_call): Likewise.
383 (add_candidates): Likewise.
384 (build_op_call): New globally visible function, built from and
385 replacing static function build_object_call.
386 (build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
388 (build_op_delete_call): Build vec to pass to
389 cp_build_function_call_vec.
390 (build_temp): Build vec to pass to build_special_member_call.
391 (convert_like_real): Likewise.
392 (perform_direct_initialization_if_possible): Likewise.
393 (build_over_call): Handle first_arg field. Use build_call_array
394 rather than build_call_list.
395 (build_special_member_call): Change args parameter to vec. Change
397 (build_new_method_call): Likewise.
398 * init.c (expand_default_init): Change parms to vec.
399 (build_raw_new_expr): Change placement and init to vecs. Change
401 (build_new_1, build_new): Likewise.
402 * class.c (resolve_address_of_overloaded_function): Build array to
403 pass to fn_type_unification.
404 * pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
405 build_new. For CALL_EXPR create a vec rather than a tree_list;
406 expand a pack if necessary.
407 (fn_type_unification): Change args parameter to const tree *. Add
408 nargs parameter. Change all callers.
409 (type_unification_real): Likewise.
410 (unify): Build array to pass to type_unification_real.
411 (get_bindings): Build array to pass to fn_type_unification.
412 (any_type_dependent_arguments_p): Change args parameter to a vec.
414 (make_args_non_dependent): Renamed from build_non_dependent_args.
415 Change return type to void. Change parameter type to vec. Change
417 (do_auto_deduction): Pass an array to type_unification_real.
418 * semantics.c (perform_koenig_lookup): Change args to vec. Change
420 (finish_call_expr): Change args to vec. Change all callers. Call
421 build_op_call instead of passing CALL_EXPR to build_new_op.
422 (cxx_omp_create_clause_info): Allocate vec to pass to
423 build_special_member_call.
424 * decl2.c (build_offset_ref_call_from_tree): Change args parameter
425 to vec. Change all callers.
426 * name-lookup.c (lookup_function_nonclass): Likewise.
427 (struct arg_lookup): Change args to vec.
428 (arg_assoc_namespace): Handle args as a vec.
429 (arg_assoc_args_vec): New static function.
430 (lookup_arg_dependent): Change args parameter to vec. Change all
432 * method.c (do_build_assign_ref): Allocate vec to pass to
433 build_special_member_call.
434 * except.c (build_throw): Likewise.
435 * typeck2.c (build_functional_cast): Likewise.
436 * cvt.c (ocp_convert): Likewise.
437 * tree.c (build_min_non_dep_call_vec): Change last parameter to
438 vec. Change all callers.
439 * cp-tree.h: Update declarations.
440 * name-lookup.h: Update declarations.
442 2009-05-20 Sandra Loosemore <sandra@codesourcery.com>
444 * typeck.c (default_conversion): Check targetm.promoted_type.
445 * decl.c (grokdeclarator): Check targetm.invalid_return_type.
446 (grokparms): Check targetm.invalid_parameter_type.
447 * cvt.c (ocp_convert): Check targetm.convert_to_type.
448 (build_expr_type_conversion): Check targetm.promoted_type.
450 2009-05-19 Andrew Pinski <andrew_pinski@playstation.sony.com>
452 * typeck.c (build_binary_op): Allow % on integal vectors.
454 2009-05-18 Jason Merrill <jason@redhat.com>
456 Implement explicit conversions ops as specified in N2437.
457 * decl.c (grokdeclarator): Handle explicit conversion ops.
458 (check_initializer): Pass flags to store_init_value.
459 * decl2.c (maybe_emit_vtables): Likewise.
460 * init.c (expand_aggr_init_1): Likewise.
461 * call.c (convert_class_to_reference): Take flags parm,
462 check DECL_NONCONVERTING_P.
463 (build_user_type_conversion_1): Check DECL_NONCONVERTING_P.
464 (add_builtin_candidates): Simplify getting type of conversion.
465 (build_object_call): Likewise. Check DECL_NONCONVERTING_P.
466 (implicit_conversion): Pass through LOOKUP_ONLYCONVERTING.
467 (reference_binding): Take flags parm. Direct-initialize copy parm.
468 (add_function_candidate): Direct-initialize the copy parm.
469 (add_conv_candidate): Use LOOKUP_IMPLICIT, not LOOKUP_NORMAL.
470 (build_builtin_candidate): Add LOOKUP_ONLYCONVERTING.
471 (conditional_conversion): Likewise.
472 (convert_like_real): Only complain about DECL_NONCONVERTING_P
474 (perform_implicit_conversion_flags): Add flags parm to
475 perform_implicit_conversion. Improve diagnostics.
476 * cp-tree.h (LOOKUP_IMPLICIT): New macro.
477 (LOOKUP_COPY_PARM): New bit macro.
478 * cvt.c (build_expr_type_conversion): Check DECL_NONCONVERTING_P.
479 * typeck.c (convert_for_assignment): Take flags parm, pass it to
480 perform_implicit_conversion_flags.
481 (cp_build_modify_expr): Pass flags to convert_for_assignment.
482 (convert_for_initialization): Likewise.
483 * typeck2.c (store_init_value): Take flags parm, pass to
485 (digest_init_flags): Add flags parm to digest_init.
486 (digest_init_r): Take flags parm, pass to convert_for_initialization.
487 (process_init_constructor_array): Pass it.
488 (process_init_constructor_record): Likewise.
489 (process_init_constructor_union): Likewise.
491 2009-05-16 Jason Merrill <jason@redhat.com>
494 * pt.c (tsubst_qualified_id): Retain the type if we aren't dealing
495 with a dependent type. Actually look up the destructor.
496 * semantics.c (finish_id_expression): Fix logic.
497 (finish_qualified_id_expr): Don't try to use 'this' if we aren't in
499 * typeck.c (build_x_unary_op): Diagnose taking the address of a
500 constructor or destructor.
501 * tree.c (get_first_fn): Handle OFFSET_REF.
503 2009-05-17 Joseph Myers <joseph@codesourcery.com>
505 * tree.c (cxx_printable_name_internal): Allow consecutive
506 translated and untranslated cached copies of the name of the
509 2009-05-15 Ian Lance Taylor <iant@google.com>
511 * cp-tree.h (enum cp_lvalue_kind_flags): Rename from
512 cp_lvalue_kind. Change all uses.
513 (enum base_access_flags): Rename from enum base_access. Change
515 * parser.c (enum cp_parser_flags): Remove enum tag.
517 2009-05-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
520 * call.c (build_new_op): Update calls to warn_logical_operator.
522 2009-05-14 Ian Lance Taylor <iant@google.com>
524 * class.c (layout_class_type): Change itk to unsigned int.
525 * decl.c (finish_enum): Change itk to unsigned int.
526 * parser.c (cp_parser_check_decl_spec): Change ds to int. Remove
529 2009-05-13 David Mandelin <dmandelin@mozilla.com>:
531 * decl.c (duplicate_decls): Preserve parameter attributes.
533 2009-05-10 Jan Hubicka <jh@suse.cz>
535 * decl2.c (cxx_callgraph_analyze_expr): Use
536 cgraph_mark_address_taken.
538 2009-05-10 Joseph Myers <joseph@codesourcery.com>
540 * call.c (name_as_c_string): Call type_as_string_translate.
541 Translate identifiers to locale character set.
542 * cp-tree.h (lang_decl_name): Update prototype.
543 (type_as_string_translate, decl_as_string_translate,
544 cxx_printable_name_translate): Declare.
545 * cxx-pretty-print.c (M_): Define.
546 (pp_cxx_unqualified_id, pp_cxx_canonical_template_parameter): Mark
547 English fragments for conditional translation with M_.
548 * decl.c (grokdeclarator): Translate identifiers to locale
549 character set for diagnostics.
550 * error.c (M_): Define.
551 (dump_template_bindings, dump_type, dump_aggr_type,
552 dump_type_prefix, dump_global_iord, dump_simple_decl, dump_decl,
553 dump_function_decl, dump_template_parms, dump_expr,
554 dump_binary_op, op_to_string, assop_to_string): Mark English
555 fragments for conditional translation with M_.
556 (type_as_string): Disable translation of identifiers.
557 (type_as_string_translate): New.
558 (expr_as_string): Disable translation of identifiers.
559 (decl_as_string): Disable translation of identifiers.
560 (decl_as_string_translate): New.
561 (lang_decl_name): Add parameter translate.
562 (args_to_string): Call type_as_string_translate.
563 (cp_print_error_function): Call cxx_printable_name_translate.
564 (print_instantiation_full_context,
565 print_instantiation_partial_context): Call
566 decl_as_string_translate.
567 * parser.c (cp_lexer_get_preprocessor_token): Use %qE for
568 identifier in diagnostic.
569 * tree.c (cxx_printable_name): Change to
570 cxx_printable_name_internal. Add parameter translate.
571 (cxx_printable_name, cxx_printable_name_translate): New wrappers
572 round cxx_printable_name_internal.
574 2009-05-08 H.J. Lu <hongjiu.lu@intel.com>
577 * call.c (build_call_a): Updated warn_deprecated_use call.
578 (build_over_call): Likewise.
579 * decl.c (grokdeclarator): Likewise.
580 (grokparms): Likewise.
581 * semantics.c (finish_id_expression): Likewise.
582 * typeck.c (build_class_member_access_expr): Likewise.
583 (finish_class_member_access_expr): Likewise.
585 2009-05-06 Dodji Seketeli <dodji@redhat.com>
588 * pt.c (tsubst_copy) <case PARM_DECL>: We don't want to tsubst the
589 whole list of PARM_DECLs, just the current one.
591 2009-05-05 Shujing Zhao <pearly.zhao@oracle.com>
594 (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
595 mangle_compound_literal): Remove unused declarations.
596 (build_vfield_ref, cxx_print_statistics, clone_function_decl,
597 adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
598 pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
599 check_for_out_of_scope_variable, print_other_binding_stack,
600 maybe_push_decl, cxx_mark_addressable, force_target_expr,
601 build_target_expr_with_type, finish_case_label,
602 cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
603 check_template_keyword, cxx_omp_predetermined_sharing,
604 cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
605 cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
606 cxx_omp_privatize_by_reference): Rearrange the declarations line to
607 match the comment that indicates the .c file which the functions are
609 (cxx_print_xnode, cxx_print_decl, cxx_print_type,
610 cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
612 2009-05-05 Nathan Sidwell <nathan@codesourcery.com>
614 * typeck.c (cp_build_compound_expr): Require RHS to have a known
616 * class.c (resolve_address_of_overloaded_function): Use
617 OVL_CURRENT for error message.
618 (instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
619 with them. Do not copy the node.
621 2009-05-05 Jakub Jelinek <jakub@redhat.com>
624 * pt.c (tsubst): If magic NOP_EXPR with side-effects has no type,
625 set it from its operand's type after tsubst_expr.
627 2009-05-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
630 * parser.c (cp_lexer_get_preprocessor_token): Do not store the
631 canonical spelling for keywords.
632 (cp_parser_attribute_list): Use the canonical spelling for
633 keywords in attributes.
635 2009-05-01 Joseph Myers <joseph@codesourcery.com>
637 * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
638 pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression,
639 pp_cxx_new_expression, pp_cxx_delete_expression,
640 pp_cxx_unary_expression, pp_cxx_assignment_operator,
641 pp_cxx_assignment_expression, pp_cxx_expression,
642 pp_cxx_function_specifier, pp_cxx_decl_specifier_seq,
643 pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq,
644 pp_cxx_exception_specification, pp_cxx_direct_declarator,
645 pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement,
646 pp_cxx_namespace_alias_definition, pp_cxx_template_parameter,
647 pp_cxx_canonical_template_parameter, pp_cxx_template_declaration,
648 pp_cxx_declaration, pp_cxx_typeid_expression,
649 pp_cxx_va_arg_expression, pp_cxx_offsetof_expression,
650 pp_cxx_trait_expression): Mostly use pp_string and
651 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
652 for non-identifiers. Mark English strings for translation.
653 * cxx-pretty-print.h (pp_cxx_ws_string): Define.
654 * error.c (dump_template_parameter, dump_template_bindings,
655 dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl,
656 dump_decl, dump_template_decl, dump_function_decl,
657 dump_parameters, dump_exception_spec, dump_template_parms,
658 dump_expr, dump_binary_op, dump_unary_op, op_to_string,
659 assop_to_string, args_to_string, cp_print_error_function,
660 print_instantiation_full_context,
661 print_instantiation_partial_context): Mostly use pp_string and
662 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
663 for non-identifiers. Mark English strings for translation.
664 (dump_global_iord): Mark strings for translation; use longer
665 strings instead of substituting single words.
666 (function_category): Return a format string marked for
667 translation, not a single word or phrase to substitute in a longer
670 2009-04-28 Ben Elliston <bje@au.ibm.com>
675 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
677 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
679 2009-04-27 Ian Lance Taylor <iant@google.com>
681 * semantics.c (finish_omp_clauses): Change type of c_kind to enum
684 2009-04-27 Jakub Jelinek <jakub@redhat.com>
687 * cvt.c (convert_to_void) <case INDIRECT_REF>: Only warn about
688 -Wunused-value if implicit.
690 2009-04-24 Ian Lance Taylor <iant@google.com>
692 * call.c (build_temp): Change 0 to enum constant.
693 * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
695 * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
696 * decl2.c (constrain_visibility): Likewise.
697 * parser.c (cp_lexer_get_preprocessor_token): Likewise.
698 (cp_parser_flags): Typedef to int rather than enum type.
699 (cp_parser_expression_stack_entry): Change prec field to enum
702 * typeck.c (build_modify_expr): Add lhs_origtype parameter.
705 2009-04-22 Dodji Seketeli <dodji@redhat.com>
708 * parser.c (cp_parser_template_argument_list): Display an error
709 when an ellipsis is not preceded by a parameter pack. Also, warn
710 about variadic templates usage without -std=c++0x.
712 2009-04-21 Taras Glek <tglek@mozilla.com>
714 * cp-tree.h: Update GTY annotations to new syntax.
716 * mangle.c: Likewise.
717 * name-lookup.c: Likewise.
718 * name-lookup.h: Likewise.
719 * parser.c: Likewise.
722 * semantics.c: Likewise.
723 * typeck2.c: Likewise.
725 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
728 * parser.c (cp_parser_error): Pass token->flags to c_parse_error.
730 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
733 * typeck.c (check_for_casting_away_constness): We diagnose casting
734 away any qualifiers not just constness.
735 (casts_away_constness): Mention that it handles more than just
738 2009-04-21 Joseph Myers <joseph@codesourcery.com>
740 * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
741 ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
742 ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
743 ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
744 ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
745 cfns.gperf: Add copyright and license notices.
746 * cfns.h: Regenerate.
747 * ChangeLog, ChangeLog-2004: Correct dates.
749 2009-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
752 * tree.c (lvalue_p_1): Use const_tree.
753 Use CONST_CAST_TREE to avoid warning.
754 (lvalue_p): Returns bool, receives const_tree.
756 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
759 * parser.c (cp_parser_check_decl_spec): Drop redundant flags.
760 * error.c (pedwarn_cxx98): New.
761 * cp-tree.h (pedwarn_cxx98): Declare.
763 2009-04-20 Le-Chun Wu <lcwu@google.com>
766 * init.c (build_vec_init): Set TREE_NO_WARNING on the
767 compiler-generated INDIRECT_REF expression.
769 2009-04-20 Ian Lance Taylor <iant@google.com>
771 * typeck.c (build_function_call_vec): New function.
772 (cp_build_function_call): Only pass first parameter to
773 objc_rewrite_function_call.
774 (build_modify_expr): Add rhs_origtype parameter. Change all
776 * decl.c (finish_decl): Add origtype parameter. Change all
778 * semantics.c (finish_call_expr): Pass VEC to
779 resolve_overloaded_builtin.
781 2009-04-20 Ian Lance Taylor <iant@google.com>
783 * cp-tree.h (base_access): Change typedef to int.
784 * parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
785 (cp_parser_omp_threadprivate): Likewise.
786 * pt.c (unify_pack_expansion): Add casts to enum type.
788 2009-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
792 * call.c (build_new_op): Save the original codes of operands
795 2009-04-18 Kazu Hirata <kazu@codesourcery.com>
797 * cp-tree.h: Remove the prototype for insert_block.
798 * decl.c (insert_block): Remove.
800 2009-04-16 Ian Lance Taylor <iant@google.com>
802 * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t.
803 (tsubst_flags_t): Change typedef from enum type to int.
805 2009-04-16 Paolo Bonzini <bonzini@gnu.org>
807 * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE
808 instead of targetm.vector_opaque_p.
810 2009-04-15 Le-Chun Wu <lcwu@google.com>
813 * call.c (build_over_call): Set TREE_NO_WARNING on the
814 compiler-generated INDIRECT_REF expression.
815 * cvt.c (convert_to_void): Emit warning when stripping off
818 2009-04-14 Diego Novillo <dnovillo@google.com>
820 * parser.c (cp_parser_type_specifier_seq): Move call to
821 invoke_plugin_callbacks ...
822 (cp_parser_type_specifier_seq): ... here.
824 2009-04-14 Le-Chun Wu <lcwu@google.com>
826 * Make-lang.in: Modify dependencies of files including plugin.h.
827 * decl.c (finish_function): Call invoke_plugin_callbacks.
828 * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
830 2009-04-14 Jason Merrill <jason@redhat.com>
833 * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
834 about shadowing by tentative parms.
836 2009-04-13 Jason Merrill <jason@redhat.com>
839 * call.c (build_over_call): Don't call memcpy if the target is
840 the same as the source.
842 2009-04-13 Jason Merrill <jason@redhat.com>
845 * pt.c (uses_template_parms): Handle CONSTRUCTOR.
847 2009-04-12 Jason Merrill <jason@redhat.com>
850 * call.c (joust): Don't crash on variadic fn.
852 2009-04-10 Jason Merrill <jason@redhat.com>
855 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return
856 if we see a close brace without an open brace.
858 2009-04-10 H.J. Lu <hongjiu.lu@intel.com>
860 * parser.c (cp_parser_class_specifier): Remove the unused
861 has_trailing_semicolon.
863 2009-04-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
866 * parser.c (cp_parser_check_template_parameters): Take a
867 cp_declarator parameter.
868 (cp_parser_elaborated_type_specifier): Update to
869 cp_parser_check_template_parameters.
870 (cp_parser_class_head): Likewise.
871 (cp_parser_check_declarator_template_parameters): Likewise.
872 (cp_parser_check_template_parameters): Handle first the non-error
873 conditions. Give more accurate diagnostics if a declarator is
876 2009-04-08 Jason Merrill <jason@redhat.com>
879 * error.c (dump_aggr_type): Chase template typedefs if
880 -fno-pretty-templates.
882 2009-04-08 Dodji Seketeli <dodji@redhat.com>
885 * parser.c (cp_parser_enumerator_definition): Make sure the
886 initializer of the enumerator doesn't contain any bare parameter pack.
888 2009-04-07 Jason Merrill <jason@redhat.com>
891 * name-lookup.c (merge_functions): Keep multiple extern "C" functions.
892 * call.c (joust): Complain about mismatched default arguments
893 in extern "C" functions.
894 * class.c (resolve_address_of_overloaded_function): Handle multiple
895 extern "C" functions.
896 * pt.c (resolve_overloaded_unification): Likewise.
898 2009-04-07 Jason Merrill <jason@redhat.com>
901 * error.c (dump_function_decl): Don't pretty-print templates
902 if -fno-pretty-templates.
903 (count_non_default_template_args): Print all args if
904 -fno-pretty-templates.
906 2009-04-06 Jason Merrill <jason@redhat.com>
909 * pt.c (fn_type_unification): For DEDUCE_EXACT check that
910 the deduced template arguments give us the parameter types
913 2009-04-05 Giovanni Bajo <giovannibajo@libero.it>
914 Jason Merrill <jason@redhat.com>
917 * error.c (count_non_default_template_args): New fn.
918 (dump_template_parms): Call it.
919 (dump_template_argument_list): Call it. Add parms parm.
920 (dump_template_argument): Adjust call to dump_template_argument_list.
921 (dump_type, dump_decl): Likewise.
922 (dump_template_bindings): Refactor logic.
924 2009-04-03 Jason Merrill <jason@redhat.com>
927 * error.c (dump_template_bindings): Look through typedefs in
929 (dump_type) [TYPENAME_TYPE]: Print the typedef name if any.
930 (find_typenames_r): Also collect typedefs.
931 * pt.c (unify): Strip typedefs.
934 * semantics.c (finish_id_expression): Don't assume a dependent
935 member of the current instantiation isn't a valid integral
936 constant expression. Check dependent_scope_p.
937 * pt.c (dependent_scope_p): Check TYPE_P.
938 (tsubst_copy): If args is null, just return.
940 2009-04-02 Jason Merrill <jason@redhat.com>
943 * error.c (find_typenames, find_typenames_r): New fns.
944 (dump_function_decl): Call find_typenames.
945 (dump_template_bindings): Print typenames as well.
946 * pt.c (tsubst): Non-static.
947 * cp-tree.h: Declare it.
949 2009-04-02 Dodji Seketeli <dodji@redhat.com>
952 * decl2.c (grokfield): when a typedef appears in a
953 class, create the typedef variant type node for it.
954 (save_template_attributes): Creating typedef variant type node
956 * decl.c (grokdeclarator): If the typedef'ed struct/class was
957 anonymous, set the proper type name to all its type variants.
958 (xref_basetypes) : Fixup the variant types after setting
960 * name-lookup.c (pushdecl_maybe_friend): Reuse the
961 set_underlying_type function to install typedef variant types.
962 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
964 (append_type_to_template_for_access_check): New entry points.
965 * semantics.c (check_accessibility_of_qualified_id):
966 When a typedef that is a member of a class appears in a template,
967 add it to the template. It will be ...
968 * class.c (finish_struct_bits): Split type variant fixup into ...
969 (fixup_type_variants): A new entry point.
970 * pt.c (instantiate_class_template, instantiate_template ): ... access
971 checked at template instantiation time.
972 (resolve_type_name_type): The type name should be the name of the
974 (retrieve_specialization): Specializations of template typedefs aren't
975 to looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
976 (append_type_to_template_for_access_check): New entry point.
977 (tsubst_decl): For typedefs, build the variant type from the correct
979 (get_class_bindings): Fix function comment.
980 (perform_typedefs_access_check): New entry point.
982 2009-03-31 Jason Merrill <jason@redhat.com>
985 * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
986 extern "C" declarations.
989 * semantics.c (finish_non_static_data_member): Allow such references
990 without an associated object in sizeof/decltype/alignof.
992 * ptree.c (cxx_print_decl): Pretty-print full name of
994 (cxx_print_type): Pretty-print full name of class.
996 * decl.c (grokdeclarator): Reject pointer to qualified function
999 PR c++/37806, core issue 547
1000 * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
1002 * tree.c (cp_build_qualified_type_real): Don't apply restrict to a
1004 * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
1005 * decl.c (groktypename): Add is_template_arg parameter.
1006 (grokdeclarator): Allow function cv-quals on a template type arg.
1007 * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
1008 is_template_arg argument in calls to groktypename.
1009 * cp-tree.h: Adjust prototype.
1010 * error.c (dump_type_prefix, dump_type_suffix): Fix plain
1011 FUNCTION_TYPE printing.
1013 * mangle.c (write_expression): Mangle dependent name as
1016 PR c++/38030, 38850, 39070
1017 * pt.c (type_dependent_expression_p_push): New fn.
1018 (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
1019 substitution makes the call non-dependent. Preserve koenig_p.
1020 * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
1021 for non-dependent calls.
1022 * semantics.c (finish_call_expr): Revert earlier changes.
1023 * cp-tree.h: Revert change to finish_call_expr prototype.
1025 2009-03-29 Joseph Myers <joseph@codesourcery.com>
1027 PR preprocessor/34695
1028 * cp-tree.h (cp_cpp_error): Remove.
1029 * error.c (cp_cpp_error): Remove.
1030 * parser.c (cp_lexer_new_main): Set done_lexing instead of
1031 client_diagnostic and error callback.
1033 2009-03-28 Paolo Bonzini <bonzini@gnu.org>
1035 * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1036 * cp/cp-objcp-common.c (cxx_staticp): Remove.
1037 * cp/cp-tree.h (cxx_staticp): Remove.
1039 2009-03-28 Jakub Jelinek <jakub@redhat.com>
1042 * parser.c (cp_parser_postfix_expression): Don't call
1043 warning_if_disallowed_function_p.
1045 2009-03-27 Jan Hubicka <jh@suse.cz>
1047 * except.c (choose_personality_routine): Set terminate_node to abort
1048 for java exceptions.
1050 2009-03-27 Dodji Seketeli <dodji@redhat.com>
1051 Jakub Jelinek <jakub@redhat.com>
1054 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
1055 (cp_function_decl_explicit_p): New prototype.
1056 * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
1058 2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
1061 * parser.c (cp_parser_elaborated_type_specifier): If we have a
1062 typename tag and don't have either a TYPE_DECL or a
1063 TEMPLATE_ID_EXPR, set the type to NULL.
1065 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
1068 * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
1071 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
1074 * decl.c (check_array_designated_initializer): Handle error_mark_node.
1076 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1079 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
1081 2009-03-26 Andrew Haley <aph@redhat.com>
1084 * decl2.c (possibly_inlined_p): If java exceptions are in use
1085 don't inline a decl unless it is explicitly marked inline.
1086 * lex.c: (pragma_java_exceptions): New variable.
1087 (handle_pragma_java_exceptions): Set pragma_java_exceptions.
1088 * cp-tree.h (pragma_java_exceptions): Declare new variable.
1090 2009-03-24 Jason Merrill <jason@redhat.com>
1093 * name-lookup.c (pushdecl_maybe_friend): Check default args later.
1095 2009-03-23 Jakub Jelinek <jakub@redhat.com>
1098 * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
1099 code if iter is the second operand.
1100 * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
1101 argument. If it is set, don't build the toplevel expression with
1102 build_x_binary_op, but build2.
1103 (cp_parser_assignment_expression, cp_parser_omp_for_incr): Adjust
1105 (cp_parser_omp_for_cond): Don't assume the first operand of the
1106 comparison must be decl.
1108 2009-03-23 Jason Merrill <jason@redhat.com>
1111 * pt.c (make_fnparm_pack): Split out from...
1112 (instantiate_decl): ...here.
1113 (tsubst_pack_expansion): Handle being called in a late-specified
1117 * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
1120 2009-03-20 Jason Merrill <jason@redhat.com>
1123 * parser.c (cp_parser_direct_declarator): In a template, wrap
1124 non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
1125 * pt.c (tsubst): Preserve it in a partial instantiation.
1126 (dependent_type_p_r): Don't check value_dependent_expression_p.
1127 * decl.c (compute_array_index_type): Don't check
1128 value_dependent_expression_p if TREE_SIDE_EFFECTS.
1131 * typeck2.c (check_narrowing): Don't complain about loss of
1132 precision when converting a floating-point constant.
1134 2009-03-19 Jakub Jelinek <jakub@redhat.com>
1137 * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
1138 (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
1140 2009-03-18 Jakub Jelinek <jakub@redhat.com>
1142 * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
1143 (eof_token): Adjust.
1145 2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
1148 * parser.c (cp_parser_explicit_specialization): Don't skip the
1149 rest of the specialization when begin_specialization returns
1152 2009-03-17 Jason Merrill <jason@redhat.com>
1154 * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
1155 (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
1156 * pt.c (check_explicit_specialization): Likewise.
1157 (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
1158 local specialization.
1159 * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
1160 * decl2.c (parm_index): New fn.
1161 * semantics.c (finish_decltype_type): Don't use describable_type.
1162 * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR.
1163 Give a sorry for unsupported codes rather than crash. Mangle
1164 conversions with other than 1 operand. New mangling for PARM_DECL.
1165 * operators.def (ALIGNOF_EXPR): Mangle as "az".
1167 2009-03-17 Jing Yu <jingyu@google.com>
1170 * method.c (use_thunk): Change is_thunk from crtl to cfun.
1172 2009-03-17 Paolo Carlini <paolo.carlini@oracle.com>
1175 * semantics.c (check_trait_type): New.
1176 (finish_trait_expr): Use it.
1178 2009-03-17 Jakub Jelinek <jakub@redhat.com>
1180 * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
1181 instead of calling imported_module_or_decl debug hook if
1182 building_stmt_tree ().
1183 * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
1184 is a NAMESPACE_DECL.
1187 * name-lookup.c (do_namespace_alias): Don't call global_decl debug
1188 hook at function scope.
1191 * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
1194 2009-03-09 Jakub Jelinek <jakub@redhat.com>
1197 * semantics.c (finish_switch_cond): Don't call get_unwidened.
1198 * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
1199 instead of TREE_TYPE (cond).
1201 2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
1204 * parser.c (cp_parser_late_parsing_default_args): Continue
1205 the loop when cp_parser_assignment_expression returns
1208 2009-03-07 Jason Merrill <jason@redhat.com>
1211 * init.c (build_new_1): Don't use a VLA type.
1212 (build_vec_init): Handle getting a pointer for BASE.
1214 2009-03-06 H.J. Lu <hongjiu.lu@intel.com>
1217 * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
1218 when mangling symbols.
1220 2009-03-06 Paolo Carlini <paolo.carlini@oracle.com>
1223 * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
1225 2009-03-06 Alexandre Oliva <aoliva@redhat.com>
1227 * decl.c (record_builtin_java_type): Use canonicalized integer
1230 2009-03-04 Jason Merrill <jason@redhat.com>
1233 * class.c (is_really_empty_class): New fn.
1234 * cp-tree.h: Declare it.
1235 * cp-objcp-common.c (cp_expr_size): Use it.
1238 * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
1239 * parser.c (cp_parser_postfix_expression): Call it for
1241 * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
1242 (get_first_fn): Likewise.
1248 * decl.c (make_typename_type): Do look inside currently open classes.
1249 * parser.c (cp_parser_lookup_name): Likewise.
1250 (cp_parser_template_name): Likewise.
1251 * pt.c (dependent_scope_p): New function.
1252 * cp-tree.h: Declare it.
1253 * class.c (currently_open_class): Return fast if T isn't a class.
1255 2009-02-26 H.J. Lu <hongjiu.lu@intel.com>
1258 * parser.c (cp_parser_mem_initializer): Return error_mark_node
1259 if cp_parser_mem_initializer_id returns error_mark_node.
1261 2009-02-24 Richard Guenther <rguenther@suse.de>
1264 * pt.c (instantiate_decl): Do not instantiate extern, non-inline
1267 2009-02-23 H.J. Lu <hongjiu.lu@intel.com>
1270 * pt.c (coerce_template_template_parms): Return 0 if parameter
1273 2009-02-23 Jason Merrill <jason@redhat.com>
1275 * pt.c (unify): Call maybe_adjust_types_for_deduction when
1276 deducing from an initializer list.
1278 2009-02-20 Jason Merrill <jason@redhat.com>
1281 * decl.c (grokdeclarator): Handle ~identifier.
1283 2009-02-19 Jakub Jelinek <jakub@redhat.com>
1286 * decl2.c (determine_visibility): If visibility changed and
1287 DECL_RTL has been already set, call make_decl_rtl to update symbol
1290 2009-02-19 H.J. Lu <hongjiu.lu@intel.com>
1293 * cp-tree.h (maybe_commonize_var): New.
1295 * decl.c (maybe_commonize_var): Make it extern.
1297 * decl2.c (finish_anon_union): Call maybe_commonize_var.
1299 2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
1302 * parser.c (cp_parser_enum_specifier): Apply all attributes.
1304 2009-02-18 Jason Merrill <jason@redhat.com>
1306 * cfns.h: Tweak pathname for cfns.gperf.
1308 2009-02-13 Jason Merrill <jason@redhat.com>
1311 * semantics.c (finish_call_expr): Change koenig_p parm to int.
1312 If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
1313 * cp-tree.h: Adjust prototype.
1314 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
1316 2009-02-12 Jason Merrill <jason@redhat.com>
1319 * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
1321 2009-02-11 Jason Merrill <jason@redhat.com>
1324 * decl2.c (cp_write_global_declarations):
1325 Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
1328 * init.c (build_value_init_noctor): Split out from...
1329 (build_value_init): ...here.
1330 (expand_aggr_init_1): Handle value-initialization.
1331 * cp-tree.h: Add declaration.
1332 * class.c (type_has_user_provided_constructor):
1333 Handle non-class arguments.
1335 2009-02-10 Jason Merrill <jason@redhat.com>
1338 * class.c (defaultable_fn_p): Handle ... properly.
1341 * tree.c (lvalue_p_1): Condition rvalue ref handling on
1342 treat_class_rvalues_as_lvalues, too.
1344 2009-02-10 Paolo Carlini <paolo.carlini@oracle.com>
1347 * typeck.c (build_x_array_ref): New.
1348 * cp-tree.h: Declare it.
1349 * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
1351 2009-02-09 Jason Merrill <jason@redhat.com>
1354 * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
1355 * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
1356 * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
1357 * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
1358 for build_value_init TARGET_EXPR.
1359 * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
1361 2009-02-06 Paolo Carlini <paolo.carlini@oracle.com>
1365 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
1367 2009-02-04 Jakub Jelinek <jakub@redhat.com>
1370 * operators.def: Use COMPONENT_REF code for ->/pt operator again,
1371 remove ./dt operator.
1372 * mangle.c (write_expression): Handle COMPONENT_REF after handling
1373 ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
1374 write_string ("dt") instead of using operators.def.
1376 2009-02-03 Jason Merrill <jason@redhat.com>
1378 * typeck.c (cp_build_unary_op): Only complain about taking address
1379 of main if pedantic.
1381 2009-02-03 Jakub Jelinek <jakub@redhat.com>
1384 * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
1387 * typeck2.c (digest_init_r): Don't call process_init_constructor
1390 2009-02-03 Paolo Bonzini <bonzini@gnu.org>
1393 * pt.c (convert_nontype_argument_function): Expect expr to be an
1397 * typeck.c (merge_types): Call resolve_typename_type if only
1398 one type is a typename.
1400 2009-02-02 Jason Merrill <jason@redhat.com>
1403 * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node
1406 2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
1409 * parser.c (cp_parser_pure_specifier): If there are no tokens left
1410 do not call cp_lexer_consume_token.
1412 2009-01-30 Jakub Jelinek <jakub@redhat.com>
1415 * parser.c (cp_parser_already_scoped_statement): Handle __label__
1418 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
1421 * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
1423 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
1426 * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
1428 2009-01-29 Paolo Carlini <paolo.carlini@oracle.com>
1430 * typeck.c (invalid_nonstatic_memfn_p): Use
1431 DECL_NONSTATIC_MEMBER_FUNCTION_P.
1433 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com>
1436 * call.c (build_over_call): If convert_for_arg_passing returns
1437 error_mark_node unconditionally return it.
1439 2009-01-22 Adam Nemet <anemet@caviumnetworks.com>
1441 * class.c (check_field_decls): Also inherit packed for bitfields
1442 regardless of their type.
1444 2009-01-22 Dodji Seketeli <dodji@redhat.com>
1447 * decl2.c (grokfield): Reverting changes of PR c++/26693
1448 (save_template_attributes): Likewise.
1449 * decl.c (grokdeclarator): Likewise.
1450 * name-lookup.c (pushdecl_maybe_friend): Likewise.
1451 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
1452 (append_type_to_template_for_access_check): Likewise.
1453 * semantics.c (check_accessibility_of_qualified_id): Likewise.
1454 * pt.c (instantiate_class_template, instantiate_template ): Likewise.
1456 (resolve_type_name_type): Likewise.
1457 (append_type_to_template_for_access_check): Likewise.
1459 2009-01-21 Dodji Seketeli <dodji@redhat.com>
1462 * decl2.c (grokfield): when a typedef appears in a
1463 class, create the typedef variant type node for it.
1464 (save_template_attributes): Creating typedef variant type node
1465 here is now useless.
1466 * decl.c (grokdeclarator): If the typedef'ed struct/class was
1467 anonymous, set the proper type name to all its type variants.
1468 * name-lookup.c (pushdecl_maybe_friend): Reuse the
1469 set_underlying_type function to install typedef variant types.
1470 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
1472 (append_type_to_template_for_access_check): New entry points.
1473 * semantics.c (check_accessibility_of_qualified_id):
1474 When a typedef that is a member of a class appears in a template,
1475 add it to the template. It will be ...
1476 * pt.c (instantiate_class_template, instantiate_template ): ... access
1477 checked at template instantiation time.
1478 (tsubst): Handle the case of being called with NULL args.
1479 (resolve_type_name_type): The type name should be the name of the
1481 (append_type_to_template_for_access_check): New entry point.
1483 2009-01-19 Jason Merrill <jason@redhat.com>
1486 * parser.c (cp_parser_unqualified_id): In a template,
1488 * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
1490 2009-01-16 Jason Merrill <jason@redhat.com>
1493 * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
1494 * init.c (build_new): Don't call describable_type unless we
1498 * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
1501 * search.c (protected_accessible_p): N doesn't vary.
1503 2009-01-15 Jason Merrill <jason@redhat.com>
1506 * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
1507 accept hidden friends.
1509 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1512 * decl.c (grokdeclarator): Check for a non namespace/class context.
1514 2009-01-15 Jason Merrill <jason@redhat.com>
1518 * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to
1519 a function isn't necessarily an lvalue. Take tree, not const_tree.
1520 (lvalue_p, real_lvalue_p): Take tree, not const_tree.
1521 * typeck.c (lvalue_or_else): Likewise.
1522 * cp-tree.h: Adjust prototypes.
1524 2009-01-15 Steve Ellcey <sje@cup.hp.com>
1527 * pt.c (tsubst): Check for NULL args.
1529 2009-01-15 Dodji Seketeli <dodji@redhat.com>
1532 * name-lookup.c (pushtag): Don't create members to types that are not
1535 2009-01-14 Nick Clifton <nickc@redhat.com>
1538 * parser.c: Pass cp_id_kind computed in
1539 cp_parser_postfix_dot_deref_expression to
1540 cp_parser_primary_expression.
1542 2009-01-13 Jakub Jelinek <jakub@redhat.com>
1545 * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
1546 STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
1549 2009-01-12 Jason Merrill <jason@redhat.com>
1550 Steve Ellcey <sje@cup.hp.com>
1553 * name-lookup.c (lookup_name_real): Keep looking past a hidden
1556 2009-01-12 Dodji Seketeli <dodji@redhat.com>
1559 * pt.c (parameter_of_template_p): New function.
1560 * cp-tree.h: Declare it.
1561 * name-lookup.c (binding_to_template_parms_of_scope_p): New
1563 (outer_binding): Take template parameters in account when looking for
1566 2009-01-12 Jason Merrill <jason@redhat.com>
1569 * tree.c (pod_type_p): Return 1 for structs created by the back end.
1571 2009-01-12 Jakub Jelinek <jakub@redhat.com>
1574 * parser.c (cp_parser_builtin_offsetof): Allow `->' in
1575 offsetof member-designator, handle it as `[0].'.
1578 * decl.c (start_function): If grokdeclarator hasn't returned
1579 FUNCTION_DECL nor error_mark_node, issue diagnostics.
1581 2009-01-11 Jakub Jelinek <jakub@redhat.com>
1584 * cp-gimplify.c (genericize_if_stmt): Renamed from ...
1585 (gimplify_if_stmt): ... this.
1586 (cp_gimplify_expr): Don't handle IF_STMT here.
1587 (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
1589 2009-01-10 Andrew Pinski <pinskia@gmail.com>
1592 * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
1595 * typeck2.c (build_functional_cast): Check for reference type and NULL
1598 2009-01-09 Steve Ellcey <sje@cup.hp.com>
1600 * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
1602 2009-01-09 Jakub Jelinek <jakub@redhat.com>
1605 * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
1607 2009-01-09 John F. Carr <jfc@mit.edu>
1610 * parser.c (cp_parser_class_specifier): Clear
1611 parser->in_unbraced_linkage_specification_p while parsing class
1614 2009-01-07 Jakub Jelinek <jakub@redhat.com>
1617 * semantics.c (finish_goto_stmt): Convert destination to
1620 2009-01-06 Jason Merrill <jason@redhat.com>
1627 * pt.c (check_default_tmpl_args): Don't complain about
1628 out-of-order parameter packs in the enclosing class
1629 or parameter packs after default args.
1630 (coerce_template_parms): If we have more than one
1631 parameter pack, don't flatten argument packs.
1632 (template_args_equal): Handle argument packs.
1633 (comp_template_args): Don't flatten argument packs.
1634 (check_instantiated_arg): Split out from...
1635 (check_instantiated_args): Here. Handle arg packs.
1636 (convert_template_argument): Just check that nontype argument
1637 packs have the right type.
1639 2009-01-05 Dodji Seketeli <dodji@redhat.com>
1642 * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
1644 2009-01-05 Jason Merrill <jason@redhat.com>
1647 * typeck2.c (process_init_constructor_union): Handle union with
1650 * mangle.c (write_expression): Remove mangling for zero-operand
1654 * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
1658 * class.c (defaultable_fn_p): Only operator== can be a copy
1659 assignment operator.
1661 2009-01-02 Jason Merrill <jason@redhat.com>
1664 * typeck2.c (process_init_constructor_union): Handle excess
1666 (process_init_constructor_record): Likewise.
1669 * typeck2.c (digest_init_r): Don't use process_init_constructor
1670 for non-aggregate classes.
1673 Copyright (C) 2009 Free Software Foundation, Inc.
1675 Copying and distribution of this file, with or without modification,
1676 are permitted in any medium without royalty provided the copyright
1677 notice and this notice are preserved.