1 2009-07-04 Jason Merrill <jason@redhat.com>
3 * pt.c (retrieve_specialization): Don't get confused by a
4 using-declaration that brings in another instance of this template
7 * ptree.c (cxx_print_type): Fix logic.
9 * cp-tree.h (LANG_DECL_FN_CHECK): Fix non-checking version.
12 * cp-tree.h (struct lang_decl_parm): New.
13 (struct lang_decl): Add it.
14 (LANG_DECL_PARM_CHECK): New.
15 (DECL_PARM_INDEX): New.
16 * decl2.c (parm_index): Remove.
17 * lex.c (retrofit_lang_decl): Handle parms.
18 (cxx_dup_lang_specific_decl): Likewise.
19 * mangle.c (write_expression): Adjust.
20 * tree.c (cp_tree_equal): Adjust.
21 (decl_linkage): Only check DECL_COMDAT for functions and variables.
22 * parser.c (cp_parser_parameter_declaration_list): Set
24 * pt.c (iterative_hash_template_arg): Hash it.
26 2009-07-03 Jason Merrill <jason@redhat.com>
28 * cp-tree.h (struct lang_decl): Overhaul.
29 (struct lang_decl_flags): Remove.
30 (struct lang_decl_base): New.
31 (struct lang_decl_min): New.
32 (struct lang_decl_fn): New.
33 (struct lang_decl_ns): New.
34 (CAN_HAVE_FULL_LANG_DECL_P): Replace with LANG_DECL_HAS_MIN.
35 (LANG_DECL_MIN_CHECK): New.
36 (LANG_DECL_FN_CHECK): New.
37 (LANG_DECL_NS_CHECK): New.
38 (STRIP_TEMPLATE): New.
39 (NON_THUNK_FUNCTION_CHECK): Remove.
40 (DECL_DECLARES_FUNCTION_P): New.
42 * lex.c (retrofit_lang_decl, cxx_dup_lang_specific_decl): Adjust.
43 * decl.c (push_local_name, duplicate_decls): Adjust.
44 * decl2.c (start_objects): Don't set u2sel.
45 * semantics.c (finish_omp_threadprivate): Adjust.
46 * class.c (build_clone): Don't do much on TEMPLATE_DECLs.
47 (decl_cloned_function_p): Out-of-line implementation of macros.
48 (clone_function_decl, adjust_clone_args): Use DECL_CLONED_FUNCTION_P.
49 * mangle.c (write_unqualified_name): Don't check function flags
51 * method.c (make_alias_for): Don't set DECL_CLONED_FUNCTION.
52 * pt.c (build_template_decl): Don't set function flags.
53 (check_default_tmpl_args): Check that it's a function.
54 (instantiate_template): Use DECL_ABSTRACT_ORIGIN to find the
57 * pt.c (tsubst_decl) [FUNCTION_DECL]: Don't tsubst
60 * cp-tree.h (struct lang_type_class): Move sorted_fields here.
61 * class.c (finish_struct_1): Adjust.
62 * ptree.c (cxx_print_decl, cxx_print_type): Adjust.
63 * search.c (lookup_field_1): Adjust.
65 * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Remove.
66 * decl.c (finish_method): Don't add to it.
67 * class.c (fixup_pending_inline): Remove.
68 (fixup_inline_methods): Remove.
69 (finish_struct_1): Don't call it.
71 * error.c (dump_function_name): Handle null name.
73 2009-07-02 Mark Mitchell <mark@codesourcery.com>
75 * typeck.c (cp_build_binary_op): Move warnings about use of NULL
76 in arithmetic earlier and allow comparisions of NULL with
79 2009-07-02 Jason Merrill <jason@redhat.com>
81 Use hash tables for template specialization lookup.
82 * pt.c (struct spec_entry): New type.
83 (decl_specializations, type_specializations): New hash tables.
84 (register_specialization, retrieve_specialization): Use them.
85 (reregister_specialization, lookup_template_class): Use them.
86 (eq_specializations, hash_tmpl_and_args, hash_specialization): New.
87 (iterative_hash_template_arg): New.
88 (init_template_processing): New
89 (process_partial_specialization): Don't look to see if we already
90 have this partial specialization.
91 (maybe_process_partial_specialization): Handle reassigning
92 full specializations when we get an explicit specialization
93 of the partial instantiation.
94 (tsubst_friend_function): Adjust specialization reassignment code.
95 (instantiate_template): Only do one lookup.
96 (instantiate_decl): Don't do any lookup.
97 * cp-tree.h: Declare init_template_processing.
98 * decl.c (duplicate_decls): Pass args to reregister_specialization.
100 2009-07-01 Jason Merrill <jason@redhat.com>
102 * cp-tree.h (DECL_CLASS_TEMPLATE_P): Use DECL_IMPLICIT_TYPEDEF_P.
104 * pt.c (register_specialization): Use duplicate_decls to merge
105 the argument with a previous specialization.
106 (check_explicit_specialization): Call register_specialization to
107 merge the TEMPLATE_DECL with a previous version.
108 (determine_specialization): Return the args even if fn is a template.
110 2009-07-01 Ian Lance Taylor <iant@google.com>
112 * g++spec.c (lang_specific_driver): Bump num_args by 1.
114 2009-06-30 Jason Merrill <jason@redhat.com>
117 * pt.c (tsubst_pack_expansion): Handle unexpanded packs in an
120 2009-06-29 Jason Merrill <jason@redhat.com>
123 * error.c (dump_template_parms): Pass all args to
124 count_non_default_template_args.
125 (count_non_default_template_args): Pull out the inner ones.
127 2009-06-26 H.J. Lu <hongjiu.lu@intel.com>
129 * decl.c (duplicate_decls): Re-indent.
131 2009-06-25 Ian Lance Taylor <iant@google.com>
133 * call.c (avoid_sign_compare_warnings): New static function.
134 (build_new_op): Call it.
135 * typeck.c (cp_build_binary_op): Don't call warn_sign_compare if
136 TREE_NO_WARNING is set on either operand.
138 2009-06-25 Ian Lance Taylor <iant@google.com>
140 * g++spec.c (SKIPOPT): define.
141 (lang_specific_driver): Handle -static-libstdc++. Only add
142 LIBSTDCXX_STATIC if we add LIBSTDCXX.
144 2009-06-25 Ian Lance Taylor <iant@google.com>
146 * cvt.c (convert_to_void): Only warn about COND_EXPR if neither
147 the second nor third operand has side effects.
149 2009-06-25 Ian Lance Taylor <iant@google.com>
151 * parser.c (cp_parser_binary_expression): Increment
152 c_inhibit_evaluation_warnings while parsing the right hand side of
153 "true || x" or "false && x".
154 * typeck.c (cp_build_binary_op): Only call warn_for_sign_compare
155 if c_inhibit_evaluation_warnings is zero.
157 2009-06-24 Jason Merrill <jason@redhat.com>
159 * error.c (dump_decl): Do say "typedef" for the injected class name.
161 * pt.c (lookup_template_class): Use currently_open_class,
162 compare template args later.
165 * decl.c (decls_match): Check DECL_TI_TEMPLATE too.
166 * class.c (resolve_address_of_overloaded_function): Fix typo.
168 2009-06-18 Aldy Hernandez <aldyh@redhat.com>
170 * class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.
171 * decl.c (finish_decl): Remove.
172 (declare_global_var): Replace finish_decl with cp_finish_decl.
173 (start_method): Same.
174 * rtti.c (emit_tinfo_decl): Same.
175 * pt.c (tsubst_expr): Same.
176 (instantiate_decl): Same.
177 * decl2.c (grokbitfield): Same.
178 * name-lookup.c (pushdecl_top_level_1): Same.
179 * cp-tree.h: Remove finish_decl.
181 2009-06-16 David Edelsohn <edelsohn@gnu.org>
183 * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL.
184 (lang_specific_driver): Always allocate extra argument.
185 Add LIBSTDCXX_STATIC to arglist if defined and linking
188 2009-06-16 Ian Lance Taylor <iant@google.com>
190 * Make-lang.in (cp/class.o): Depend upon gt-cp-class.h.
191 (cp/semantics.o): Depend upon gt-cp-semantics.h.
193 2009-06-16 Ian Lance Taylor <iant@google.com>
195 * parser.c (cp_unevaluated_operand): Define global variable.
196 (cp_parser_question_colon_clause): Increment
197 c_inhibit_evaluation_warnings when evaluating an expression which
198 will never be executed.
199 (cp_parser_decltype): Increment cp_unevaluated_operand and
200 c_inhibit_evaluation_warnings, not skip_evaluation.
201 (cp_parser_sizeof_operand): Likewise.
202 (cp_parser_enclosed_template_argument_list): Save
203 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
205 * cp-tree.h (struct saved_scope): Remove skip_evaluation field.
206 Add unevaluated_operand and inhibit_evaluation_warnings fields.
207 (cp_unevaluated_operand): Declare.
208 * name-lookup.c (push_to_top_level): Save cp_unevaluated_operand
209 and c_inhibit_evaluation_warnings rather than skip_evaluation.
210 (pop_from_top_level): Restore cp_unevaluated_operand and
211 c_inhibit_evaluation_warnings rather than skip_evaluation.
212 * class.c (build_base_path): Check cp_unevaluated_operand rather
213 than skip_evaluation.
214 * typeck.c (build_class_member_access_expr): Likewise.
215 (cp_build_binary_op): Don't warn about bad shift counts if
216 c_inhibit_evaluation_warnings is non-zero.
217 * pt.c (coerce_template_parms): Save state of
218 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
220 (tsubst_aggr_type): Likewise.
221 (tsubst_pack_expansion): Check cp_unevaluated_operand rather than
223 (tsubst_copy): Likewise.
224 (tsubst): Set cp_unevaluated_operand and
225 c_inhibit_evaluation_warnings, not skip_evaluation.
226 (tsubst_copy_and_build): Likewise.
227 * call.c (convert_arg_to_ellipsis): Check cp_unevaluated_operand
228 rather than skip_evaluation.
229 * decl2.c (mark_used): Likewise.
230 * semantics.c (finish_non_static_data_member): Likewise.
231 * cvt.c (cp_convert_and_check): Check
232 c_inhibit_evaluation_warnings rather than skip_evaluation.
233 * mangle.c (write_type): Set cp_unevaluated_operand rather than
236 2009-06-15 Ian Lance Taylor <iant@google.com>
238 * parser.c (cp_parser_direct_declarator): Add braces around
239 variables declared before label.
241 2009-06-15 Rafael Avila de Espindola <espindola@google.com>
243 * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove.
244 * cp-tree.h (cxx_comdat_group): Change signature.
245 * decl.c (duplicate_decls): Use DECL_COMDAT_GROUP.
246 (cxx_comdat_group): Change signature.
247 * decl2.c (comdat_linkage, maybe_make_one_only): Update call to
249 (constrain_visibility, get_guard): Use DECL_COMDAT_GROUP.
250 * method.c (use_thunk): Update call to make_decl_one_only.
251 * optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP
253 2009-06-12 Aldy Hernandez <aldyh@redhat.com>
255 * typeck.c (cp_build_binary_op): Pass location to overflow_warning.
256 (build_modify_expr): New arg.
257 * semantics.c (finish_unary_op_expr): Pass location to
259 (handle_omp_for_class_iterator): Pass location to build_modify_expr.
260 * typeck.c (cxx_sizeof_or_alignof_type): Pass location to
261 c_sizeof_or_alignof_type.
262 (build_array_ref): New argument.
263 (build_compound_expr): Same.
264 (build_const_cast): Same.
265 (build_ptrmemfunc): Pass location to build_c_cast.
266 * init.c (avoid_placement_new_aliasing): Pass location to
268 (build_vec_delete_1): Pass location to cp_build_modify_expr,
270 * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
271 * decl.c (poplevel): Pass location to c_build_bind_expr.
272 (finish_case_label): Pass location to build_case_label.
273 (finish_constructor_body): Same.
274 (finish_destructor_body): Pass location to build_stmt.
275 (cxx_maybe_build_cleanup): Same, but to build_compound_expr.
276 * call.c (build_new_op): Pass location to build_array_ref.
277 (build_x_va_arg): Pass location to build_va_arg.
278 * except.c (expand_end_catch_block): Pass location to
280 * cp-tree.h (build_array_ref): New argument.
281 (build_compound_expr): Same.
282 (build_c_cast): Same.
283 * cp-gimplify.c (gimplify_if_stmt): Pass location on down.
284 (gimplify_switch_stmt): Same.
285 * typeck2.c (split_nonconstant_init_1): Same.
286 * pt.c (tsubst_copy): Same.
287 * semantics.c (add_decl_expr): Same.
289 (push_cleanup): Same.
290 (finish_goto_stmt): Same.
291 (finish_expr_stmt): Same.
292 (begin_if_stmt): Same.
293 (begin_while_stmt): Same.
294 (begin_do_stmt): Same.
295 (finish_return_stmt): Same.
296 (begin_for_stmt): Same.
297 (finish_break_stmt): Same.
298 (finish_continue_stmt): Same.
299 (begin_switch_stmt): Same.
300 (begin_try_block): Same.
301 (begin_handler): Same.
302 (finish_asm_stmt): Same.
303 (finish_label_stmt): Same.
304 (finish_stmt_expr_expr): Same.
305 (finalize_nrv_r): Same.
306 (finish_omp_atomic): Same.
307 * name-lookup.c (do_using_directive): Same.
308 * decl2.c (grok_array_decl): Same.
309 * parser.c (cp_parser_cast_expression): Same.
310 (cp_parser_selection_statement): Same.
311 (cp_parser_implicitly_scoped_statement): Same.
312 (cp_parser_objc_selector_expression): Same.
313 (cp_parser_objc_synchronized_statement): Same.
314 (cp_parser_objc_throw_statement): Same.
315 (cp_parser_omp_critical): Same.
316 (cp_parser_omp_master): Same.
317 * typeck.c (build_function_call): Add location argument.
318 * init.c: Add location argument to all build_decl calls.
327 * cp-gimplify.c: Same.
329 (cp_make_fname_decl): Add location argument. Pass location ot
331 (finish_case_label): Same.
332 * cp-tree.h (finish_case_label): Add location argument.
333 * parser.c (cp_parser_label_for_labeled_statement): Pass location to
336 2009-06-09 Jason Merrill <jason@redhat.com>
339 * decl2.c (mark_used): Return after complaining about deleted fn.
341 2009-06-08 Jason Merrill <jason@redhat.com>
343 * parser.c (cp_parser_type_id_1): 'auto' type is ok with a
344 late-specified return type.
346 2009-06-08 Jakub Jelinek <jakub@redhat.com>
349 * call.c (check_dtor_name): Return false even if
350 get_type_value (name) is error_mark_node.
354 * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
355 on error_mark_node. Check for VLAs outside of function context
356 before check whether to wrap bounds into a NOP_EXPR with
359 2009-06-08 Alexandre Oliva <aoliva@redhat.com>
361 * repo.c (get_base_filename): Use aux_base_name rather than
362 alternate temporary file during second compare debug compilation.
363 (finish_repo): Skip during -fcompare-debug-second.
365 2009-06-06 Ian Lance Taylor <iant@google.com>
367 * parser.c (cp_parser_label_for_labeled_statement): Support
368 attribute on labels if immediately followed by semicolon.
369 * semantics.c (finish_label_stmt): Return new label.
370 * pt.c (tsubst_expr): Handle attributes for LABEL_EXPR.
372 2009-06-03 Ian Lance Taylor <iant@google.com>
374 * Make-lang.in (cc1plus-checksum.o): Depend upon $(CONFIG_H) and
377 2009-06-02 Mark Mitchell <mark@codesourcery.com>
379 * decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
381 2009-06-02 Jason Merrill <jason@redhat.com>
385 * typeck.c (cp_build_modify_expr): Always pass init-lists to the
387 * call.c (implicit_conversion): Allow init-list conversion to scalar
388 during direct-initialization, too. Mark the conversion bad if it
389 has too many levels of braces.
390 (convert_like_real): And give a helpful error.
394 * decl.c (cp_finish_decl): Handle auto deduction from ().
395 * typeck.c (build_x_indirect_ref): Handle dereferencing an operand
396 with dependent type that is known to be a pointer.
398 2009-06-02 Simon Martin <simartin@users.sourceforge.net>
401 * pt.c (register_specialization): Properly setup DECL_CONTEXT for
402 specializations in an invalid namespace.
404 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
406 * error.c (print_instantiation_partial_context): Print column
409 2009-05-29 Ian Lance Taylor <iant@google.com>
411 * error.c (cp_printer): Don't use va_arg with enum type.
413 2009-05-28 Dodji Seketeli <dodji@redhat.com>
416 * cp-tree.h (canonical_type_variant): Remove this function declaration.
417 (strip_typedefs): New function declaration.
418 * tree.c (strip_typedefs): New function definition.
419 (canonical_type_variant): Remove function definition.
420 * cvt.c (convert_from_reference): No need to use
421 canonical_type_variant.
422 * typeck.c (cp_build_indirect_ref): Likewise.
423 * error.c (dump_template_bindings): Use strip_typedefs instead of
424 canonical_type_variant.
425 * pt.c (convert_template_argument, unify): Likewise.
426 * mangle.c (canonicalize_for_substitution): Don't use
427 canonical_type_variant.
429 2009-05-27 Jason Merrill <jason@redhat.com>
431 * call.c (implicit_conversion): Handle conversion from
432 initializer-list to scalar.
433 (convert_like_real): Likewise. Avoid crashing on list
434 initialization with bad conversions.
435 (can_convert): Use LOOKUP_EXPLICIT.
436 (can_convert_arg_bad): Add flags parm.
438 * typeck.c (convert_for_assignment): Pass flags.
440 2009-05-27 Ian Lance Taylor <iant@google.com>
442 * Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
443 (cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
445 2009-05-26 Ian Lance Taylor <iant@google.com>
447 * Make-lang.in (g++spec.o): Use $(COMPILER).
448 (g++$(exeext), cc1plus-dummy$(exeext)): Likewise.
449 (cc1plus$(exeext)): Likewise.
451 2009-05-26 Dodji Seketeli <dodji@redhat.com>
454 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Remove this accessor.
455 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): New accessor.
456 (get_types_needing_access_check): Declare new entry point.
457 * pt.c (append_type_to_template_for_access_check_1,
458 get_types_needing_access_check): New functions.
459 (perform_typedefs_access_check): Accept FUNCTION_DECLs and
460 RECORD_TYPEs rather than TEMPLATE_DECLs. Use the new
461 get_types_needing_access_check, no more
462 MEMBER_TYPES_NEEDING_ACCESS_CHECK.
463 (instantiate_class_template): Set input_location to the source
464 location of the most specialized template definition.
465 Perform access check using the RECORD_TYPE of the template, not its
466 associated most generic TEMPLATE_DECL.
467 (append_type_to_template_for_access_check): Augment function
468 comments. Use the new get_types_needing_access_check, not
469 MEMBER_TYPE_NEEDING_ACCESS_CHECK. Use the new
470 append_type_to_template_for_access_check_1 subroutine.
472 2009-05-22 Jason Merrill <jason@redhat.com>
475 * typeck.c (cp_build_binary_op): Allow ENUMERAL_TYPE in
476 arithmetic comparisons.
477 (cp_common_type): Handle scoped enums.
479 * call.c (promoted_arithmetic_type_p): Don't use INTEGRAL_TYPE_P.
480 (add_builtin_candidate, add_builtin_candidates): Likewise.
481 (convert_like_real): Likewise.
482 * class.c (check_bitfield_decl): Likewise.
483 * decl.c (check_static_variable_definition): Likewise.
484 (compute_array_index_type): Likewise.
485 * decl2.c (grokbitfield): Likewise.
486 * init.c (build_new_1): Likewise.
487 * pt.c (convert_nontype_argument): Likewise.
488 (current_instantiation): Likewise.
489 * tree.c (pod_type_p): Likewise.
490 * typeck.c (build_static_cast_1): Likewise.
491 (build_reinterpret_cast_1): Likewise.
493 2009-05-22 Richard Guenther <rguenther@suse.de>
496 * init.c (avoid_placement_new_aliasing): Remove.
497 (build_new_1): Do not call it.
499 2009-05-22 Mark Mitchell <mark@codesourcery.com>
501 * decl2.c (decl_needed_p): Consider dllexport'd functions needed.
502 * semantics.c (expand_or_defer_fn): Similarly.
504 2009-05-20 Ian Lance Taylor <iant@google.com>
506 * parser.c (cp_parser_postfix_expression): Change args to a vec.
507 Release it when done.
508 (tree_vector): Define typedef. Define VEC functions.
509 (cp_parser_parenthesized_expression_list): Change return type to
510 vec. Change all callers.
511 (cp_parser_new_expression): Change placement and initializer to
512 vecs. Release them when done.
513 (cp_parser_new_placement): Change return type to vec. Change all
515 (cp_parser_new_initializer): Likewise.
516 * typeck.c (build_function_call_vec): Just call
517 cp_build_function_call_vec.
518 (cp_build_function_call): Just build a vec and call
519 cp_build_function_call_vec.
520 (cp_build_function_call_vec): New function based on old
521 cp_build_function_call.
522 (convert_arguments): Remove nargs and argarray parameters. Change
523 values to a vec. Change caller.
524 (build_x_compound_expr_from_vec): New function.
525 (cp_build_modify_expr): Build vec to pass to
526 build_special_member_call.
527 * call.c (struct z_candidate): Add first_arg field. Change args
529 (convert_class_to_reference): Handle first argument separately.
530 (add_candidate): Add first_arg parameter. Change args parameter
531 to vec. Change all callers.
532 (add_function_candidate, add_conv_candidate): Likewise.
533 (add_template_candidate_real, add_template_candidate): Likewise.
534 (add_template_conv_candidate): Likewise.
535 (build_user_type_conversion_1): Handle first argument separately.
536 (resolve_args): Change return type and parameter type to vecs.
538 (perform_overload_resolution): Change args parameter to vec.
540 (build_new_function_call, build_operator_new_call): Likewise.
541 (add_candidates): Likewise.
542 (build_op_call): New globally visible function, built from and
543 replacing static function build_object_call.
544 (build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
546 (build_op_delete_call): Build vec to pass to
547 cp_build_function_call_vec.
548 (build_temp): Build vec to pass to build_special_member_call.
549 (convert_like_real): Likewise.
550 (perform_direct_initialization_if_possible): Likewise.
551 (build_over_call): Handle first_arg field. Use build_call_array
552 rather than build_call_list.
553 (build_special_member_call): Change args parameter to vec. Change
555 (build_new_method_call): Likewise.
556 * init.c (expand_default_init): Change parms to vec.
557 (build_raw_new_expr): Change placement and init to vecs. Change
559 (build_new_1, build_new): Likewise.
560 * class.c (resolve_address_of_overloaded_function): Build array to
561 pass to fn_type_unification.
562 * pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
563 build_new. For CALL_EXPR create a vec rather than a tree_list;
564 expand a pack if necessary.
565 (fn_type_unification): Change args parameter to const tree *. Add
566 nargs parameter. Change all callers.
567 (type_unification_real): Likewise.
568 (unify): Build array to pass to type_unification_real.
569 (get_bindings): Build array to pass to fn_type_unification.
570 (any_type_dependent_arguments_p): Change args parameter to a vec.
572 (make_args_non_dependent): Renamed from build_non_dependent_args.
573 Change return type to void. Change parameter type to vec. Change
575 (do_auto_deduction): Pass an array to type_unification_real.
576 * semantics.c (perform_koenig_lookup): Change args to vec. Change
578 (finish_call_expr): Change args to vec. Change all callers. Call
579 build_op_call instead of passing CALL_EXPR to build_new_op.
580 (cxx_omp_create_clause_info): Allocate vec to pass to
581 build_special_member_call.
582 * decl2.c (build_offset_ref_call_from_tree): Change args parameter
583 to vec. Change all callers.
584 * name-lookup.c (lookup_function_nonclass): Likewise.
585 (struct arg_lookup): Change args to vec.
586 (arg_assoc_namespace): Handle args as a vec.
587 (arg_assoc_args_vec): New static function.
588 (lookup_arg_dependent): Change args parameter to vec. Change all
590 * method.c (do_build_assign_ref): Allocate vec to pass to
591 build_special_member_call.
592 * except.c (build_throw): Likewise.
593 * typeck2.c (build_functional_cast): Likewise.
594 * cvt.c (ocp_convert): Likewise.
595 * tree.c (build_min_non_dep_call_vec): Change last parameter to
596 vec. Change all callers.
597 * cp-tree.h: Update declarations.
598 * name-lookup.h: Update declarations.
600 2009-05-20 Sandra Loosemore <sandra@codesourcery.com>
602 * typeck.c (default_conversion): Check targetm.promoted_type.
603 * decl.c (grokdeclarator): Check targetm.invalid_return_type.
604 (grokparms): Check targetm.invalid_parameter_type.
605 * cvt.c (ocp_convert): Check targetm.convert_to_type.
606 (build_expr_type_conversion): Check targetm.promoted_type.
608 2009-05-19 Andrew Pinski <andrew_pinski@playstation.sony.com>
610 * typeck.c (build_binary_op): Allow % on integal vectors.
612 2009-05-18 Jason Merrill <jason@redhat.com>
614 Implement explicit conversions ops as specified in N2437.
615 * decl.c (grokdeclarator): Handle explicit conversion ops.
616 (check_initializer): Pass flags to store_init_value.
617 * decl2.c (maybe_emit_vtables): Likewise.
618 * init.c (expand_aggr_init_1): Likewise.
619 * call.c (convert_class_to_reference): Take flags parm,
620 check DECL_NONCONVERTING_P.
621 (build_user_type_conversion_1): Check DECL_NONCONVERTING_P.
622 (add_builtin_candidates): Simplify getting type of conversion.
623 (build_object_call): Likewise. Check DECL_NONCONVERTING_P.
624 (implicit_conversion): Pass through LOOKUP_ONLYCONVERTING.
625 (reference_binding): Take flags parm. Direct-initialize copy parm.
626 (add_function_candidate): Direct-initialize the copy parm.
627 (add_conv_candidate): Use LOOKUP_IMPLICIT, not LOOKUP_NORMAL.
628 (build_builtin_candidate): Add LOOKUP_ONLYCONVERTING.
629 (conditional_conversion): Likewise.
630 (convert_like_real): Only complain about DECL_NONCONVERTING_P
632 (perform_implicit_conversion_flags): Add flags parm to
633 perform_implicit_conversion. Improve diagnostics.
634 * cp-tree.h (LOOKUP_IMPLICIT): New macro.
635 (LOOKUP_COPY_PARM): New bit macro.
636 * cvt.c (build_expr_type_conversion): Check DECL_NONCONVERTING_P.
637 * typeck.c (convert_for_assignment): Take flags parm, pass it to
638 perform_implicit_conversion_flags.
639 (cp_build_modify_expr): Pass flags to convert_for_assignment.
640 (convert_for_initialization): Likewise.
641 * typeck2.c (store_init_value): Take flags parm, pass to
643 (digest_init_flags): Add flags parm to digest_init.
644 (digest_init_r): Take flags parm, pass to convert_for_initialization.
645 (process_init_constructor_array): Pass it.
646 (process_init_constructor_record): Likewise.
647 (process_init_constructor_union): Likewise.
649 2009-05-16 Jason Merrill <jason@redhat.com>
652 * pt.c (tsubst_qualified_id): Retain the type if we aren't dealing
653 with a dependent type. Actually look up the destructor.
654 * semantics.c (finish_id_expression): Fix logic.
655 (finish_qualified_id_expr): Don't try to use 'this' if we aren't in
657 * typeck.c (build_x_unary_op): Diagnose taking the address of a
658 constructor or destructor.
659 * tree.c (get_first_fn): Handle OFFSET_REF.
661 2009-05-17 Joseph Myers <joseph@codesourcery.com>
663 * tree.c (cxx_printable_name_internal): Allow consecutive
664 translated and untranslated cached copies of the name of the
667 2009-05-15 Ian Lance Taylor <iant@google.com>
669 * cp-tree.h (enum cp_lvalue_kind_flags): Rename from
670 cp_lvalue_kind. Change all uses.
671 (enum base_access_flags): Rename from enum base_access. Change
673 * parser.c (enum cp_parser_flags): Remove enum tag.
675 2009-05-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
678 * call.c (build_new_op): Update calls to warn_logical_operator.
680 2009-05-14 Ian Lance Taylor <iant@google.com>
682 * class.c (layout_class_type): Change itk to unsigned int.
683 * decl.c (finish_enum): Change itk to unsigned int.
684 * parser.c (cp_parser_check_decl_spec): Change ds to int. Remove
687 2009-05-13 David Mandelin <dmandelin@mozilla.com>:
689 * decl.c (duplicate_decls): Preserve parameter attributes.
691 2009-05-10 Jan Hubicka <jh@suse.cz>
693 * decl2.c (cxx_callgraph_analyze_expr): Use
694 cgraph_mark_address_taken.
696 2009-05-10 Joseph Myers <joseph@codesourcery.com>
698 * call.c (name_as_c_string): Call type_as_string_translate.
699 Translate identifiers to locale character set.
700 * cp-tree.h (lang_decl_name): Update prototype.
701 (type_as_string_translate, decl_as_string_translate,
702 cxx_printable_name_translate): Declare.
703 * cxx-pretty-print.c (M_): Define.
704 (pp_cxx_unqualified_id, pp_cxx_canonical_template_parameter): Mark
705 English fragments for conditional translation with M_.
706 * decl.c (grokdeclarator): Translate identifiers to locale
707 character set for diagnostics.
708 * error.c (M_): Define.
709 (dump_template_bindings, dump_type, dump_aggr_type,
710 dump_type_prefix, dump_global_iord, dump_simple_decl, dump_decl,
711 dump_function_decl, dump_template_parms, dump_expr,
712 dump_binary_op, op_to_string, assop_to_string): Mark English
713 fragments for conditional translation with M_.
714 (type_as_string): Disable translation of identifiers.
715 (type_as_string_translate): New.
716 (expr_as_string): Disable translation of identifiers.
717 (decl_as_string): Disable translation of identifiers.
718 (decl_as_string_translate): New.
719 (lang_decl_name): Add parameter translate.
720 (args_to_string): Call type_as_string_translate.
721 (cp_print_error_function): Call cxx_printable_name_translate.
722 (print_instantiation_full_context,
723 print_instantiation_partial_context): Call
724 decl_as_string_translate.
725 * parser.c (cp_lexer_get_preprocessor_token): Use %qE for
726 identifier in diagnostic.
727 * tree.c (cxx_printable_name): Change to
728 cxx_printable_name_internal. Add parameter translate.
729 (cxx_printable_name, cxx_printable_name_translate): New wrappers
730 round cxx_printable_name_internal.
732 2009-05-08 H.J. Lu <hongjiu.lu@intel.com>
735 * call.c (build_call_a): Updated warn_deprecated_use call.
736 (build_over_call): Likewise.
737 * decl.c (grokdeclarator): Likewise.
738 (grokparms): Likewise.
739 * semantics.c (finish_id_expression): Likewise.
740 * typeck.c (build_class_member_access_expr): Likewise.
741 (finish_class_member_access_expr): Likewise.
743 2009-05-06 Dodji Seketeli <dodji@redhat.com>
746 * pt.c (tsubst_copy) <case PARM_DECL>: We don't want to tsubst the
747 whole list of PARM_DECLs, just the current one.
749 2009-05-05 Shujing Zhao <pearly.zhao@oracle.com>
752 (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
753 mangle_compound_literal): Remove unused declarations.
754 (build_vfield_ref, cxx_print_statistics, clone_function_decl,
755 adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
756 pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
757 check_for_out_of_scope_variable, print_other_binding_stack,
758 maybe_push_decl, cxx_mark_addressable, force_target_expr,
759 build_target_expr_with_type, finish_case_label,
760 cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
761 check_template_keyword, cxx_omp_predetermined_sharing,
762 cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
763 cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
764 cxx_omp_privatize_by_reference): Rearrange the declarations line to
765 match the comment that indicates the .c file which the functions are
767 (cxx_print_xnode, cxx_print_decl, cxx_print_type,
768 cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
770 2009-05-05 Nathan Sidwell <nathan@codesourcery.com>
772 * typeck.c (cp_build_compound_expr): Require RHS to have a known
774 * class.c (resolve_address_of_overloaded_function): Use
775 OVL_CURRENT for error message.
776 (instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
777 with them. Do not copy the node.
779 2009-05-05 Jakub Jelinek <jakub@redhat.com>
782 * pt.c (tsubst): If magic NOP_EXPR with side-effects has no type,
783 set it from its operand's type after tsubst_expr.
785 2009-05-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
788 * parser.c (cp_lexer_get_preprocessor_token): Do not store the
789 canonical spelling for keywords.
790 (cp_parser_attribute_list): Use the canonical spelling for
791 keywords in attributes.
793 2009-05-01 Joseph Myers <joseph@codesourcery.com>
795 * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
796 pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression,
797 pp_cxx_new_expression, pp_cxx_delete_expression,
798 pp_cxx_unary_expression, pp_cxx_assignment_operator,
799 pp_cxx_assignment_expression, pp_cxx_expression,
800 pp_cxx_function_specifier, pp_cxx_decl_specifier_seq,
801 pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq,
802 pp_cxx_exception_specification, pp_cxx_direct_declarator,
803 pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement,
804 pp_cxx_namespace_alias_definition, pp_cxx_template_parameter,
805 pp_cxx_canonical_template_parameter, pp_cxx_template_declaration,
806 pp_cxx_declaration, pp_cxx_typeid_expression,
807 pp_cxx_va_arg_expression, pp_cxx_offsetof_expression,
808 pp_cxx_trait_expression): Mostly use pp_string and
809 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
810 for non-identifiers. Mark English strings for translation.
811 * cxx-pretty-print.h (pp_cxx_ws_string): Define.
812 * error.c (dump_template_parameter, dump_template_bindings,
813 dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl,
814 dump_decl, dump_template_decl, dump_function_decl,
815 dump_parameters, dump_exception_spec, dump_template_parms,
816 dump_expr, dump_binary_op, dump_unary_op, op_to_string,
817 assop_to_string, args_to_string, cp_print_error_function,
818 print_instantiation_full_context,
819 print_instantiation_partial_context): Mostly use pp_string and
820 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
821 for non-identifiers. Mark English strings for translation.
822 (dump_global_iord): Mark strings for translation; use longer
823 strings instead of substituting single words.
824 (function_category): Return a format string marked for
825 translation, not a single word or phrase to substitute in a longer
828 2009-04-28 Ben Elliston <bje@au.ibm.com>
833 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
835 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
837 2009-04-27 Ian Lance Taylor <iant@google.com>
839 * semantics.c (finish_omp_clauses): Change type of c_kind to enum
842 2009-04-27 Jakub Jelinek <jakub@redhat.com>
845 * cvt.c (convert_to_void) <case INDIRECT_REF>: Only warn about
846 -Wunused-value if implicit.
848 2009-04-24 Ian Lance Taylor <iant@google.com>
850 * call.c (build_temp): Change 0 to enum constant.
851 * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
853 * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
854 * decl2.c (constrain_visibility): Likewise.
855 * parser.c (cp_lexer_get_preprocessor_token): Likewise.
856 (cp_parser_flags): Typedef to int rather than enum type.
857 (cp_parser_expression_stack_entry): Change prec field to enum
860 * typeck.c (build_modify_expr): Add lhs_origtype parameter.
863 2009-04-22 Dodji Seketeli <dodji@redhat.com>
866 * parser.c (cp_parser_template_argument_list): Display an error
867 when an ellipsis is not preceded by a parameter pack. Also, warn
868 about variadic templates usage without -std=c++0x.
870 2009-04-21 Taras Glek <tglek@mozilla.com>
872 * cp-tree.h: Update GTY annotations to new syntax.
874 * mangle.c: Likewise.
875 * name-lookup.c: Likewise.
876 * name-lookup.h: Likewise.
877 * parser.c: Likewise.
880 * semantics.c: Likewise.
881 * typeck2.c: Likewise.
883 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
886 * parser.c (cp_parser_error): Pass token->flags to c_parse_error.
888 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
891 * typeck.c (check_for_casting_away_constness): We diagnose casting
892 away any qualifiers not just constness.
893 (casts_away_constness): Mention that it handles more than just
896 2009-04-21 Joseph Myers <joseph@codesourcery.com>
898 * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
899 ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
900 ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
901 ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
902 ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
903 cfns.gperf: Add copyright and license notices.
904 * cfns.h: Regenerate.
905 * ChangeLog, ChangeLog-2004: Correct dates.
907 2009-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
910 * tree.c (lvalue_p_1): Use const_tree.
911 Use CONST_CAST_TREE to avoid warning.
912 (lvalue_p): Returns bool, receives const_tree.
914 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
917 * parser.c (cp_parser_check_decl_spec): Drop redundant flags.
918 * error.c (pedwarn_cxx98): New.
919 * cp-tree.h (pedwarn_cxx98): Declare.
921 2009-04-20 Le-Chun Wu <lcwu@google.com>
924 * init.c (build_vec_init): Set TREE_NO_WARNING on the
925 compiler-generated INDIRECT_REF expression.
927 2009-04-20 Ian Lance Taylor <iant@google.com>
929 * typeck.c (build_function_call_vec): New function.
930 (cp_build_function_call): Only pass first parameter to
931 objc_rewrite_function_call.
932 (build_modify_expr): Add rhs_origtype parameter. Change all
934 * decl.c (finish_decl): Add origtype parameter. Change all
936 * semantics.c (finish_call_expr): Pass VEC to
937 resolve_overloaded_builtin.
939 2009-04-20 Ian Lance Taylor <iant@google.com>
941 * cp-tree.h (base_access): Change typedef to int.
942 * parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
943 (cp_parser_omp_threadprivate): Likewise.
944 * pt.c (unify_pack_expansion): Add casts to enum type.
946 2009-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
950 * call.c (build_new_op): Save the original codes of operands
953 2009-04-18 Kazu Hirata <kazu@codesourcery.com>
955 * cp-tree.h: Remove the prototype for insert_block.
956 * decl.c (insert_block): Remove.
958 2009-04-16 Ian Lance Taylor <iant@google.com>
960 * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t.
961 (tsubst_flags_t): Change typedef from enum type to int.
963 2009-04-16 Paolo Bonzini <bonzini@gnu.org>
965 * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE
966 instead of targetm.vector_opaque_p.
968 2009-04-15 Le-Chun Wu <lcwu@google.com>
971 * call.c (build_over_call): Set TREE_NO_WARNING on the
972 compiler-generated INDIRECT_REF expression.
973 * cvt.c (convert_to_void): Emit warning when stripping off
976 2009-04-14 Diego Novillo <dnovillo@google.com>
978 * parser.c (cp_parser_type_specifier_seq): Move call to
979 invoke_plugin_callbacks ...
980 (cp_parser_type_specifier_seq): ... here.
982 2009-04-14 Le-Chun Wu <lcwu@google.com>
984 * Make-lang.in: Modify dependencies of files including plugin.h.
985 * decl.c (finish_function): Call invoke_plugin_callbacks.
986 * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
988 2009-04-14 Jason Merrill <jason@redhat.com>
991 * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
992 about shadowing by tentative parms.
994 2009-04-13 Jason Merrill <jason@redhat.com>
997 * call.c (build_over_call): Don't call memcpy if the target is
998 the same as the source.
1000 2009-04-13 Jason Merrill <jason@redhat.com>
1003 * pt.c (uses_template_parms): Handle CONSTRUCTOR.
1005 2009-04-12 Jason Merrill <jason@redhat.com>
1008 * call.c (joust): Don't crash on variadic fn.
1010 2009-04-10 Jason Merrill <jason@redhat.com>
1013 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return
1014 if we see a close brace without an open brace.
1016 2009-04-10 H.J. Lu <hongjiu.lu@intel.com>
1018 * parser.c (cp_parser_class_specifier): Remove the unused
1019 has_trailing_semicolon.
1021 2009-04-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
1024 * parser.c (cp_parser_check_template_parameters): Take a
1025 cp_declarator parameter.
1026 (cp_parser_elaborated_type_specifier): Update to
1027 cp_parser_check_template_parameters.
1028 (cp_parser_class_head): Likewise.
1029 (cp_parser_check_declarator_template_parameters): Likewise.
1030 (cp_parser_check_template_parameters): Handle first the non-error
1031 conditions. Give more accurate diagnostics if a declarator is
1034 2009-04-08 Jason Merrill <jason@redhat.com>
1037 * error.c (dump_aggr_type): Chase template typedefs if
1038 -fno-pretty-templates.
1040 2009-04-08 Dodji Seketeli <dodji@redhat.com>
1043 * parser.c (cp_parser_enumerator_definition): Make sure the
1044 initializer of the enumerator doesn't contain any bare parameter pack.
1046 2009-04-07 Jason Merrill <jason@redhat.com>
1049 * name-lookup.c (merge_functions): Keep multiple extern "C" functions.
1050 * call.c (joust): Complain about mismatched default arguments
1051 in extern "C" functions.
1052 * class.c (resolve_address_of_overloaded_function): Handle multiple
1053 extern "C" functions.
1054 * pt.c (resolve_overloaded_unification): Likewise.
1056 2009-04-07 Jason Merrill <jason@redhat.com>
1059 * error.c (dump_function_decl): Don't pretty-print templates
1060 if -fno-pretty-templates.
1061 (count_non_default_template_args): Print all args if
1062 -fno-pretty-templates.
1064 2009-04-06 Jason Merrill <jason@redhat.com>
1067 * pt.c (fn_type_unification): For DEDUCE_EXACT check that
1068 the deduced template arguments give us the parameter types
1071 2009-04-05 Giovanni Bajo <giovannibajo@libero.it>
1072 Jason Merrill <jason@redhat.com>
1075 * error.c (count_non_default_template_args): New fn.
1076 (dump_template_parms): Call it.
1077 (dump_template_argument_list): Call it. Add parms parm.
1078 (dump_template_argument): Adjust call to dump_template_argument_list.
1079 (dump_type, dump_decl): Likewise.
1080 (dump_template_bindings): Refactor logic.
1082 2009-04-03 Jason Merrill <jason@redhat.com>
1085 * error.c (dump_template_bindings): Look through typedefs in
1087 (dump_type) [TYPENAME_TYPE]: Print the typedef name if any.
1088 (find_typenames_r): Also collect typedefs.
1089 * pt.c (unify): Strip typedefs.
1092 * semantics.c (finish_id_expression): Don't assume a dependent
1093 member of the current instantiation isn't a valid integral
1094 constant expression. Check dependent_scope_p.
1095 * pt.c (dependent_scope_p): Check TYPE_P.
1096 (tsubst_copy): If args is null, just return.
1098 2009-04-02 Jason Merrill <jason@redhat.com>
1101 * error.c (find_typenames, find_typenames_r): New fns.
1102 (dump_function_decl): Call find_typenames.
1103 (dump_template_bindings): Print typenames as well.
1104 * pt.c (tsubst): Non-static.
1105 * cp-tree.h: Declare it.
1107 2009-04-02 Dodji Seketeli <dodji@redhat.com>
1110 * decl2.c (grokfield): when a typedef appears in a
1111 class, create the typedef variant type node for it.
1112 (save_template_attributes): Creating typedef variant type node
1113 here is now useless.
1114 * decl.c (grokdeclarator): If the typedef'ed struct/class was
1115 anonymous, set the proper type name to all its type variants.
1116 (xref_basetypes) : Fixup the variant types after setting
1118 * name-lookup.c (pushdecl_maybe_friend): Reuse the
1119 set_underlying_type function to install typedef variant types.
1120 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
1122 (append_type_to_template_for_access_check): New entry points.
1123 * semantics.c (check_accessibility_of_qualified_id):
1124 When a typedef that is a member of a class appears in a template,
1125 add it to the template. It will be ...
1126 * class.c (finish_struct_bits): Split type variant fixup into ...
1127 (fixup_type_variants): A new entry point.
1128 * pt.c (instantiate_class_template, instantiate_template ): ... access
1129 checked at template instantiation time.
1130 (resolve_type_name_type): The type name should be the name of the
1132 (retrieve_specialization): Specializations of template typedefs aren't
1133 to looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
1134 (append_type_to_template_for_access_check): New entry point.
1135 (tsubst_decl): For typedefs, build the variant type from the correct
1137 (get_class_bindings): Fix function comment.
1138 (perform_typedefs_access_check): New entry point.
1140 2009-03-31 Jason Merrill <jason@redhat.com>
1143 * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
1144 extern "C" declarations.
1147 * semantics.c (finish_non_static_data_member): Allow such references
1148 without an associated object in sizeof/decltype/alignof.
1150 * ptree.c (cxx_print_decl): Pretty-print full name of
1152 (cxx_print_type): Pretty-print full name of class.
1154 * decl.c (grokdeclarator): Reject pointer to qualified function
1157 PR c++/37806, core issue 547
1158 * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
1160 * tree.c (cp_build_qualified_type_real): Don't apply restrict to a
1162 * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
1163 * decl.c (groktypename): Add is_template_arg parameter.
1164 (grokdeclarator): Allow function cv-quals on a template type arg.
1165 * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
1166 is_template_arg argument in calls to groktypename.
1167 * cp-tree.h: Adjust prototype.
1168 * error.c (dump_type_prefix, dump_type_suffix): Fix plain
1169 FUNCTION_TYPE printing.
1171 * mangle.c (write_expression): Mangle dependent name as
1174 PR c++/38030, 38850, 39070
1175 * pt.c (type_dependent_expression_p_push): New fn.
1176 (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
1177 substitution makes the call non-dependent. Preserve koenig_p.
1178 * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
1179 for non-dependent calls.
1180 * semantics.c (finish_call_expr): Revert earlier changes.
1181 * cp-tree.h: Revert change to finish_call_expr prototype.
1183 2009-03-29 Joseph Myers <joseph@codesourcery.com>
1185 PR preprocessor/34695
1186 * cp-tree.h (cp_cpp_error): Remove.
1187 * error.c (cp_cpp_error): Remove.
1188 * parser.c (cp_lexer_new_main): Set done_lexing instead of
1189 client_diagnostic and error callback.
1191 2009-03-28 Paolo Bonzini <bonzini@gnu.org>
1193 * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1194 * cp/cp-objcp-common.c (cxx_staticp): Remove.
1195 * cp/cp-tree.h (cxx_staticp): Remove.
1197 2009-03-28 Jakub Jelinek <jakub@redhat.com>
1200 * parser.c (cp_parser_postfix_expression): Don't call
1201 warning_if_disallowed_function_p.
1203 2009-03-27 Jan Hubicka <jh@suse.cz>
1205 * except.c (choose_personality_routine): Set terminate_node to abort
1206 for java exceptions.
1208 2009-03-27 Dodji Seketeli <dodji@redhat.com>
1209 Jakub Jelinek <jakub@redhat.com>
1212 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
1213 (cp_function_decl_explicit_p): New prototype.
1214 * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
1216 2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
1219 * parser.c (cp_parser_elaborated_type_specifier): If we have a
1220 typename tag and don't have either a TYPE_DECL or a
1221 TEMPLATE_ID_EXPR, set the type to NULL.
1223 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
1226 * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
1229 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
1232 * decl.c (check_array_designated_initializer): Handle error_mark_node.
1234 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1237 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
1239 2009-03-26 Andrew Haley <aph@redhat.com>
1242 * decl2.c (possibly_inlined_p): If java exceptions are in use
1243 don't inline a decl unless it is explicitly marked inline.
1244 * lex.c: (pragma_java_exceptions): New variable.
1245 (handle_pragma_java_exceptions): Set pragma_java_exceptions.
1246 * cp-tree.h (pragma_java_exceptions): Declare new variable.
1248 2009-03-24 Jason Merrill <jason@redhat.com>
1251 * name-lookup.c (pushdecl_maybe_friend): Check default args later.
1253 2009-03-23 Jakub Jelinek <jakub@redhat.com>
1256 * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
1257 code if iter is the second operand.
1258 * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
1259 argument. If it is set, don't build the toplevel expression with
1260 build_x_binary_op, but build2.
1261 (cp_parser_assignment_expression, cp_parser_omp_for_incr): Adjust
1263 (cp_parser_omp_for_cond): Don't assume the first operand of the
1264 comparison must be decl.
1266 2009-03-23 Jason Merrill <jason@redhat.com>
1269 * pt.c (make_fnparm_pack): Split out from...
1270 (instantiate_decl): ...here.
1271 (tsubst_pack_expansion): Handle being called in a late-specified
1275 * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
1278 2009-03-20 Jason Merrill <jason@redhat.com>
1281 * parser.c (cp_parser_direct_declarator): In a template, wrap
1282 non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
1283 * pt.c (tsubst): Preserve it in a partial instantiation.
1284 (dependent_type_p_r): Don't check value_dependent_expression_p.
1285 * decl.c (compute_array_index_type): Don't check
1286 value_dependent_expression_p if TREE_SIDE_EFFECTS.
1289 * typeck2.c (check_narrowing): Don't complain about loss of
1290 precision when converting a floating-point constant.
1292 2009-03-19 Jakub Jelinek <jakub@redhat.com>
1295 * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
1296 (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
1298 2009-03-18 Jakub Jelinek <jakub@redhat.com>
1300 * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
1301 (eof_token): Adjust.
1303 2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
1306 * parser.c (cp_parser_explicit_specialization): Don't skip the
1307 rest of the specialization when begin_specialization returns
1310 2009-03-17 Jason Merrill <jason@redhat.com>
1312 * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
1313 (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
1314 * pt.c (check_explicit_specialization): Likewise.
1315 (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
1316 local specialization.
1317 * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
1318 * decl2.c (parm_index): New fn.
1319 * semantics.c (finish_decltype_type): Don't use describable_type.
1320 * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR.
1321 Give a sorry for unsupported codes rather than crash. Mangle
1322 conversions with other than 1 operand. New mangling for PARM_DECL.
1323 * operators.def (ALIGNOF_EXPR): Mangle as "az".
1325 2009-03-17 Jing Yu <jingyu@google.com>
1328 * method.c (use_thunk): Change is_thunk from crtl to cfun.
1330 2009-03-17 Paolo Carlini <paolo.carlini@oracle.com>
1333 * semantics.c (check_trait_type): New.
1334 (finish_trait_expr): Use it.
1336 2009-03-17 Jakub Jelinek <jakub@redhat.com>
1338 * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
1339 instead of calling imported_module_or_decl debug hook if
1340 building_stmt_tree ().
1341 * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
1342 is a NAMESPACE_DECL.
1345 * name-lookup.c (do_namespace_alias): Don't call global_decl debug
1346 hook at function scope.
1349 * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
1352 2009-03-09 Jakub Jelinek <jakub@redhat.com>
1355 * semantics.c (finish_switch_cond): Don't call get_unwidened.
1356 * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
1357 instead of TREE_TYPE (cond).
1359 2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
1362 * parser.c (cp_parser_late_parsing_default_args): Continue
1363 the loop when cp_parser_assignment_expression returns
1366 2009-03-07 Jason Merrill <jason@redhat.com>
1369 * init.c (build_new_1): Don't use a VLA type.
1370 (build_vec_init): Handle getting a pointer for BASE.
1372 2009-03-06 H.J. Lu <hongjiu.lu@intel.com>
1375 * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
1376 when mangling symbols.
1378 2009-03-06 Paolo Carlini <paolo.carlini@oracle.com>
1381 * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
1383 2009-03-06 Alexandre Oliva <aoliva@redhat.com>
1385 * decl.c (record_builtin_java_type): Use canonicalized integer
1388 2009-03-04 Jason Merrill <jason@redhat.com>
1391 * class.c (is_really_empty_class): New fn.
1392 * cp-tree.h: Declare it.
1393 * cp-objcp-common.c (cp_expr_size): Use it.
1396 * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
1397 * parser.c (cp_parser_postfix_expression): Call it for
1399 * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
1400 (get_first_fn): Likewise.
1406 * decl.c (make_typename_type): Do look inside currently open classes.
1407 * parser.c (cp_parser_lookup_name): Likewise.
1408 (cp_parser_template_name): Likewise.
1409 * pt.c (dependent_scope_p): New function.
1410 * cp-tree.h: Declare it.
1411 * class.c (currently_open_class): Return fast if T isn't a class.
1413 2009-02-26 H.J. Lu <hongjiu.lu@intel.com>
1416 * parser.c (cp_parser_mem_initializer): Return error_mark_node
1417 if cp_parser_mem_initializer_id returns error_mark_node.
1419 2009-02-24 Richard Guenther <rguenther@suse.de>
1422 * pt.c (instantiate_decl): Do not instantiate extern, non-inline
1425 2009-02-23 H.J. Lu <hongjiu.lu@intel.com>
1428 * pt.c (coerce_template_template_parms): Return 0 if parameter
1431 2009-02-23 Jason Merrill <jason@redhat.com>
1433 * pt.c (unify): Call maybe_adjust_types_for_deduction when
1434 deducing from an initializer list.
1436 2009-02-20 Jason Merrill <jason@redhat.com>
1439 * decl.c (grokdeclarator): Handle ~identifier.
1441 2009-02-19 Jakub Jelinek <jakub@redhat.com>
1444 * decl2.c (determine_visibility): If visibility changed and
1445 DECL_RTL has been already set, call make_decl_rtl to update symbol
1448 2009-02-19 H.J. Lu <hongjiu.lu@intel.com>
1451 * cp-tree.h (maybe_commonize_var): New.
1453 * decl.c (maybe_commonize_var): Make it extern.
1455 * decl2.c (finish_anon_union): Call maybe_commonize_var.
1457 2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
1460 * parser.c (cp_parser_enum_specifier): Apply all attributes.
1462 2009-02-18 Jason Merrill <jason@redhat.com>
1464 * cfns.h: Tweak pathname for cfns.gperf.
1466 2009-02-13 Jason Merrill <jason@redhat.com>
1469 * semantics.c (finish_call_expr): Change koenig_p parm to int.
1470 If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
1471 * cp-tree.h: Adjust prototype.
1472 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
1474 2009-02-12 Jason Merrill <jason@redhat.com>
1477 * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
1479 2009-02-11 Jason Merrill <jason@redhat.com>
1482 * decl2.c (cp_write_global_declarations):
1483 Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
1486 * init.c (build_value_init_noctor): Split out from...
1487 (build_value_init): ...here.
1488 (expand_aggr_init_1): Handle value-initialization.
1489 * cp-tree.h: Add declaration.
1490 * class.c (type_has_user_provided_constructor):
1491 Handle non-class arguments.
1493 2009-02-10 Jason Merrill <jason@redhat.com>
1496 * class.c (defaultable_fn_p): Handle ... properly.
1499 * tree.c (lvalue_p_1): Condition rvalue ref handling on
1500 treat_class_rvalues_as_lvalues, too.
1502 2009-02-10 Paolo Carlini <paolo.carlini@oracle.com>
1505 * typeck.c (build_x_array_ref): New.
1506 * cp-tree.h: Declare it.
1507 * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
1509 2009-02-09 Jason Merrill <jason@redhat.com>
1512 * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
1513 * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
1514 * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
1515 * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
1516 for build_value_init TARGET_EXPR.
1517 * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
1519 2009-02-06 Paolo Carlini <paolo.carlini@oracle.com>
1523 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
1525 2009-02-04 Jakub Jelinek <jakub@redhat.com>
1528 * operators.def: Use COMPONENT_REF code for ->/pt operator again,
1529 remove ./dt operator.
1530 * mangle.c (write_expression): Handle COMPONENT_REF after handling
1531 ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
1532 write_string ("dt") instead of using operators.def.
1534 2009-02-03 Jason Merrill <jason@redhat.com>
1536 * typeck.c (cp_build_unary_op): Only complain about taking address
1537 of main if pedantic.
1539 2009-02-03 Jakub Jelinek <jakub@redhat.com>
1542 * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
1545 * typeck2.c (digest_init_r): Don't call process_init_constructor
1548 2009-02-03 Paolo Bonzini <bonzini@gnu.org>
1551 * pt.c (convert_nontype_argument_function): Expect expr to be an
1555 * typeck.c (merge_types): Call resolve_typename_type if only
1556 one type is a typename.
1558 2009-02-02 Jason Merrill <jason@redhat.com>
1561 * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node
1564 2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
1567 * parser.c (cp_parser_pure_specifier): If there are no tokens left
1568 do not call cp_lexer_consume_token.
1570 2009-01-30 Jakub Jelinek <jakub@redhat.com>
1573 * parser.c (cp_parser_already_scoped_statement): Handle __label__
1576 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
1579 * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
1581 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
1584 * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
1586 2009-01-29 Paolo Carlini <paolo.carlini@oracle.com>
1588 * typeck.c (invalid_nonstatic_memfn_p): Use
1589 DECL_NONSTATIC_MEMBER_FUNCTION_P.
1591 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com>
1594 * call.c (build_over_call): If convert_for_arg_passing returns
1595 error_mark_node unconditionally return it.
1597 2009-01-22 Adam Nemet <anemet@caviumnetworks.com>
1599 * class.c (check_field_decls): Also inherit packed for bitfields
1600 regardless of their type.
1602 2009-01-22 Dodji Seketeli <dodji@redhat.com>
1605 * decl2.c (grokfield): Reverting changes of PR c++/26693
1606 (save_template_attributes): Likewise.
1607 * decl.c (grokdeclarator): Likewise.
1608 * name-lookup.c (pushdecl_maybe_friend): Likewise.
1609 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
1610 (append_type_to_template_for_access_check): Likewise.
1611 * semantics.c (check_accessibility_of_qualified_id): Likewise.
1612 * pt.c (instantiate_class_template, instantiate_template ): Likewise.
1614 (resolve_type_name_type): Likewise.
1615 (append_type_to_template_for_access_check): Likewise.
1617 2009-01-21 Dodji Seketeli <dodji@redhat.com>
1620 * decl2.c (grokfield): when a typedef appears in a
1621 class, create the typedef variant type node for it.
1622 (save_template_attributes): Creating typedef variant type node
1623 here is now useless.
1624 * decl.c (grokdeclarator): If the typedef'ed struct/class was
1625 anonymous, set the proper type name to all its type variants.
1626 * name-lookup.c (pushdecl_maybe_friend): Reuse the
1627 set_underlying_type function to install typedef variant types.
1628 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
1630 (append_type_to_template_for_access_check): New entry points.
1631 * semantics.c (check_accessibility_of_qualified_id):
1632 When a typedef that is a member of a class appears in a template,
1633 add it to the template. It will be ...
1634 * pt.c (instantiate_class_template, instantiate_template ): ... access
1635 checked at template instantiation time.
1636 (tsubst): Handle the case of being called with NULL args.
1637 (resolve_type_name_type): The type name should be the name of the
1639 (append_type_to_template_for_access_check): New entry point.
1641 2009-01-19 Jason Merrill <jason@redhat.com>
1644 * parser.c (cp_parser_unqualified_id): In a template,
1646 * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
1648 2009-01-16 Jason Merrill <jason@redhat.com>
1651 * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
1652 * init.c (build_new): Don't call describable_type unless we
1656 * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
1659 * search.c (protected_accessible_p): N doesn't vary.
1661 2009-01-15 Jason Merrill <jason@redhat.com>
1664 * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
1665 accept hidden friends.
1667 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1670 * decl.c (grokdeclarator): Check for a non namespace/class context.
1672 2009-01-15 Jason Merrill <jason@redhat.com>
1676 * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to
1677 a function isn't necessarily an lvalue. Take tree, not const_tree.
1678 (lvalue_p, real_lvalue_p): Take tree, not const_tree.
1679 * typeck.c (lvalue_or_else): Likewise.
1680 * cp-tree.h: Adjust prototypes.
1682 2009-01-15 Steve Ellcey <sje@cup.hp.com>
1685 * pt.c (tsubst): Check for NULL args.
1687 2009-01-15 Dodji Seketeli <dodji@redhat.com>
1690 * name-lookup.c (pushtag): Don't create members to types that are not
1693 2009-01-14 Nick Clifton <nickc@redhat.com>
1696 * parser.c: Pass cp_id_kind computed in
1697 cp_parser_postfix_dot_deref_expression to
1698 cp_parser_primary_expression.
1700 2009-01-13 Jakub Jelinek <jakub@redhat.com>
1703 * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
1704 STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
1707 2009-01-12 Jason Merrill <jason@redhat.com>
1708 Steve Ellcey <sje@cup.hp.com>
1711 * name-lookup.c (lookup_name_real): Keep looking past a hidden
1714 2009-01-12 Dodji Seketeli <dodji@redhat.com>
1717 * pt.c (parameter_of_template_p): New function.
1718 * cp-tree.h: Declare it.
1719 * name-lookup.c (binding_to_template_parms_of_scope_p): New
1721 (outer_binding): Take template parameters in account when looking for
1724 2009-01-12 Jason Merrill <jason@redhat.com>
1727 * tree.c (pod_type_p): Return 1 for structs created by the back end.
1729 2009-01-12 Jakub Jelinek <jakub@redhat.com>
1732 * parser.c (cp_parser_builtin_offsetof): Allow `->' in
1733 offsetof member-designator, handle it as `[0].'.
1736 * decl.c (start_function): If grokdeclarator hasn't returned
1737 FUNCTION_DECL nor error_mark_node, issue diagnostics.
1739 2009-01-11 Jakub Jelinek <jakub@redhat.com>
1742 * cp-gimplify.c (genericize_if_stmt): Renamed from ...
1743 (gimplify_if_stmt): ... this.
1744 (cp_gimplify_expr): Don't handle IF_STMT here.
1745 (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
1747 2009-01-10 Andrew Pinski <pinskia@gmail.com>
1750 * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
1753 * typeck2.c (build_functional_cast): Check for reference type and NULL
1756 2009-01-09 Steve Ellcey <sje@cup.hp.com>
1758 * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
1760 2009-01-09 Jakub Jelinek <jakub@redhat.com>
1763 * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
1765 2009-01-09 John F. Carr <jfc@mit.edu>
1768 * parser.c (cp_parser_class_specifier): Clear
1769 parser->in_unbraced_linkage_specification_p while parsing class
1772 2009-01-07 Jakub Jelinek <jakub@redhat.com>
1775 * semantics.c (finish_goto_stmt): Convert destination to
1778 2009-01-06 Jason Merrill <jason@redhat.com>
1785 * pt.c (check_default_tmpl_args): Don't complain about
1786 out-of-order parameter packs in the enclosing class
1787 or parameter packs after default args.
1788 (coerce_template_parms): If we have more than one
1789 parameter pack, don't flatten argument packs.
1790 (template_args_equal): Handle argument packs.
1791 (comp_template_args): Don't flatten argument packs.
1792 (check_instantiated_arg): Split out from...
1793 (check_instantiated_args): Here. Handle arg packs.
1794 (convert_template_argument): Just check that nontype argument
1795 packs have the right type.
1797 2009-01-05 Dodji Seketeli <dodji@redhat.com>
1800 * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
1802 2009-01-05 Jason Merrill <jason@redhat.com>
1805 * typeck2.c (process_init_constructor_union): Handle union with
1808 * mangle.c (write_expression): Remove mangling for zero-operand
1812 * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
1816 * class.c (defaultable_fn_p): Only operator== can be a copy
1817 assignment operator.
1819 2009-01-02 Jason Merrill <jason@redhat.com>
1822 * typeck2.c (process_init_constructor_union): Handle excess
1824 (process_init_constructor_record): Likewise.
1827 * typeck2.c (digest_init_r): Don't use process_init_constructor
1828 for non-aggregate classes.
1831 Copyright (C) 2009 Free Software Foundation, Inc.
1833 Copying and distribution of this file, with or without modification,
1834 are permitted in any medium without royalty provided the copyright
1835 notice and this notice are preserved.