1 2010-10-10 Jason Merrill <jason@redhat.com>
3 * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
4 (tsubst_default_arguments): Only do this once for cloned fns.
5 (tsubst): Use typedef_variant_p. Handle LANG_TYPE. Don't
7 (tsubst_expr): Avoid calling tsubst_expr for non-expressions.
8 (tsubst_copy_and_build): Likewise.
9 (tsubst_initializer_list): Likewise.
10 (tsubst_copy): Change default to gcc_unreachable. Handle
11 OVERLOAD and PTRMEM_CST.
13 2010-10-10 Jason Merrill <jason@redhat.com>
17 * pt.c (tsubst_copy) [INTEGER_CST]: Instantiate the type.
19 2010-10-07 Andi Kleen <ak@linux.intel.com>
21 * Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
22 (cc1plus-dummy): Remove.
23 (cc1plus-checksum): Change to run checksum over object files
26 2010-10-08 Joseph Myers <joseph@codesourcery.com>
28 * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
30 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
32 * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to
34 * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for
36 * error.c (dump_expr): Added case for AT_ENCODE_EXPR.
37 * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR.
38 (value_dependent_expression_p): Added case for AT_ENCODE_EXPR.
39 (type_dependent_expression_p): Added case for AT_ENCODE_EXPR.
40 * parser.c (cp_parser_objc_encode_expression): Updated comment.
42 2010-10-07 Nicola Pero <nicola@nicola.brainstorm.co.uk>
44 Merge from apple/trunk branch on FSF servers.
46 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
49 * parser.c (cp_parser_objc_interstitial_code): Recognize
50 and parse RID_NAMESPACE keyword.
52 2010-10-07 Iain Sandoe <iains@gcc.gnu.org>
54 * parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
55 finding ellipsis, before checking for attributes.
57 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
59 Merge from apple/trunk branch on FSF servers.
60 * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
61 longer existing gcc/c-common.def.
63 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
66 * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
67 * parser.c (cp_parser_objc_encode_expression): Build a templatized
68 parse tree for @encode(T).
70 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
73 * c-common.def: Add new expression code AT_ENCODE_EXPR.
75 2010-10-06 Eric Botcazou <ebotcazou@adacore.com>
78 * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
79 code folding offsetof-like computations.
81 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
84 * parser.c (cp_parser_objc_class_interface): If no identifier
85 follows an @interface token, stop parsing the interface after
87 (cp_parser_objc_class_implementation): If no identifier follows an
88 @implementation token, stop parsing the implementation after
91 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
94 * parser.c (cp_parser_objc_method_keyword_params): If the required
95 colon is not found while parsing parameters, stop parsing them.
97 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
100 * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
101 @end after detecting it. Print an error if @end is found without
103 (cp_parser_objc_method_prototype_list): Do not eat the EOF after
104 detecting it. Fixed reading the next token when continuing
105 because of an error in a method signature. Print an error if EOF
106 is found without an '@end'.
107 (cp_parser_objc_method_definition_list): Same change.
109 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
111 Merge from apple/trunk branch on FSF servers:
113 2005-10-17 Fariborz Jahanian <fjahanian@apple.com>
116 * parser.c (cp_parser_objc_method_keyword_params): Check for valid
117 method parameters and issue error.
118 (cp_parser_objc_method_definition_list): Check for invalid tokens
119 which cannot start a function definition.
121 2005-10-14 Fariborz Jahanian <fjahanian@apple.com>
124 * parser.c (cp_parser_objc_message_args): Check for missing message
125 arguments and syntax error.
127 2005-10-13 Fariborz Jahanian <fjahanian@apple.com>
130 * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
133 2005-08-15 Ziemowit Laski <zlaski@apple.com>
136 * parser.c (cp_parser_objc_interstitial_code): Catch stray
137 '{' and '}' tokens and issue appropriate errors.
139 2005-08-02 Ziemowit Laski <zlaski@apple.com>
142 (cp_parser_statement_seq_opt): In addition to '}' and
143 end-of-file, a statement sequence may also be terminated
146 2010-10-05 Joseph Myers <joseph@codesourcery.com>
148 * cp-tree.h (cxx_print_error_function,
149 cxx_initialize_diagnostics): Declare using diagnostic_context
152 2010-10-04 Andi Kleen <ak@linux.intel.com>
154 * Make-lang.in (g++, cc1plus): Add + to build rule.
156 2010-10-04 Jason Merrill <jason@redhat.com>
158 * tree.c (decl_storage_duration): New.
159 * cp-tree.h: Declare it.
160 (duration_kind): Return values.
162 2010-10-03 Jason Merrill <jason@redhat.com>
164 * typeck.c (require_complete_type_sfinae): Add complain parm to...
165 (require_complete_type): ...this function.
166 (cp_build_array_ref, convert_arguments): Use it.
167 (convert_for_initialization, cp_build_modify_expr): Likewise.
168 * cp-tree.h: Declare it.
169 * call.c (build_over_call): Use it.
171 2010-09-30 Iain Sandoe <iains@gcc.gnu.org>
173 merge from FSF 'apple/trunk' branch.
174 2006-01-30 Fariborz Jahanian <fjahanian@apple.com>
177 * cp/parser.c (cp_parser_objc_interstitial_code): For
178 @optional/@required set the optional/required flag.
180 2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>
182 * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
183 and indentation when finding an Objective-C++ CPP_AT_NAME token.
185 2010-09-29 Richard Guenther <rguenther@suse.de>
187 * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
188 (CP_TYPE_CONTEXT): Similar.
189 (FROB_CONTEXT): Frob global_namespace to the global
190 TRANSLATION_UNIT_DECL.
191 * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
192 set DECL_CONTEXT of global_namespace to it.
193 (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
194 instead of zeroing context.
195 (cp_finish_decl): Use DECL_FILE_SCOPE_P.
196 (grokfndecl): Likewise.
197 (start_preparsed_function): Likewise.
198 * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
199 (namespace_binding): Use SCOPE_FILE_SCOPE_P.
200 * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
201 (is_specialization_of_friend): Use CP_DECL_CONTEXT.
202 (push_template_decl_real): Likewise.
203 (tsubst_friend_class): Likewise. Adjust context comparisons.
204 (instantiate_class_template): Use CP_TYPE_CONTEXT.
205 (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
206 * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
209 2010-09-29 Yao Qi <yao@codesourcery.com>
211 * decl.c (get_atexit_node): Fix typo.
213 2010-09-28 Jason Merrill <jason@redhat.com>
215 * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
216 (real_lvalue_p): Take const_tree.
218 * typeck.c (lvalue_or_else): Make temporary arg a permerror.
219 (cp_build_addr_expr_1): Likewise.
221 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
223 Partially merged from apple/trunk branch on FSF servers:
224 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
225 Radar 3803157 (method attributes)
227 * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
228 (cp_parser_objc_method_tail_params_opt): Likewise.
229 (cp_parser_objc_method_signature): Likewise.
230 (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
231 (cp_parser_objc_method_prototype_list): Handle attributes.
232 (cp_parser_objc_method_definition_list): Likewise.
234 2010-09-28 Richard Henderson <rth@redhat.com>
236 * cp-lang.c: Include "target.h".
237 (cp_eh_personality): Use targetm.except_unwind_info.
238 * Make-lang.in (cp-lang.o): Update deps.
240 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
242 * parser.c (cp_parser_objc_valid_prefix_attributes): New.
243 (cp_parser_declaration): Parse prefix attributes for ObjC++.
244 (cp_parser_objc_protocol_declaration): Handle attributes.
245 (cp_parser_objc_class_interface): Likewise.
246 (cp_parser_objc_declaration): Likewise.
248 2010-09-27 Jason Merrill <jason@redhat.com>
250 Require lvalues as specified by the standard.
251 * typeck.c (lvalue_or_else): Use real_lvalue_p.
252 (cp_build_addr_expr_1): Split out of cp_build_unary_op.
253 (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
254 (decay_conversion, get_member_function_from_ptrfunc): Adjust.
255 (build_x_unary_op, build_reinterpret_cast_1): Adjust.
256 (build_const_cast_1): Adjust.
257 * cp-tree.h: Declare new fns.
258 * call.c (build_this, convert_like_real, build_over_call): Adjust.
259 (initialize_reference): Adjust.
260 * class.c (build_base_path, convert_to_base_statically): Adjust.
261 (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
262 * cvt.c (build_up_reference, convert_to_reference): Adjust.
263 * decl.c (register_dtor_fn): Adjust.
264 * decl2.c (build_offset_ref_call_from_tree): Adjust.
265 * except.c (initialize_handler_parm): Adjust.
266 * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
267 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
268 * tree.c (stabilize_expr): Adjust.
270 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
272 Merge from apple/trunk branch on FSF servers:
274 2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
277 * typeck.c (composite_pointer_type): Call objc_have_common_type
278 when comparing two objective-c pointer types.
280 2005-07-18 Ziemowit Laski <zlaski@apple.com>
283 * call.c (standard_conversion): Do not issue warnings when
284 comparing ObjC pointer types.
286 2005-06-22 Ziemowit Laski <zlaski@apple.com>
289 * call.c (standard_conversion): Allow for a pointer conversion
290 between any two ObjC pointer types.
291 * typeck.c (composite_pointer_type): Determine common type
292 for two ObjC pointer types.
294 2010-09-24 Jan Hubicka <jh@suse.cz>
296 * decl.c (finish_function): Use decl_replaceable_p
297 * method.c (make_alias_for_thunk): Update call of cgraph_same_body_alias.
299 2010-09-24 Jason Merrill <jason@redhat.com>
301 * decl.c (compute_array_index_type): Remember type dependence of
303 * pt.c (dependent_type_p_r): Don't recompute it here.
305 * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
306 reference and pointer to the same type as "*" or "&".
308 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
310 * typeck.c (warn_args_num): Use warning 'too many arguments to
311 method [methodname]' for an Objective-C method instead of the less
312 satisfactory 'too many arguments to function' (with no method
315 2010-09-21 Jason Merrill <jason@redhat.com>
317 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
318 special handling if we know the member.
320 2010-09-18 Jason Merrill <jason@redhat.com>
322 * call.c (compare_ics): Do lvalue/rvalue reference binding
323 comparison for ck_list, too.
325 2010-09-15 Jason Merrill <jason@redhat.com>
327 * semantics.c (finish_id_expression): Diagnose use of function
328 parms in evaluated context outside function body.
330 * decl2.c (grokbitfield): Diagnose non-integral width.
332 * call.c (convert_like_real): Use the underlying type of the
333 reference for the temporary.
335 2010-09-15 Jakub Jelinek <jakub@redhat.com>
338 * class.c (build_vtbl_initializer): Use fn instead of init's operand
339 as first argument to FDESC_EXPR.
341 2010-09-15 Paolo Carlini <paolo.carlini@oracle.com>
344 * decl.c (grokdeclarator): Check build_memfn_type return value
347 2010-09-13 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
349 * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
350 (begin_range_for_stmt): Likewise.
352 2010-09-11 Rodrigo Rivas <rodrigorivascosta@gmail.com>
354 Implement range-based for-statements.
355 * cp-tree.def (RANGE_FOR_STMT): New.
356 * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
357 (cp_convert_range_for): Declare.
358 * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
359 (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
360 * semantics.c (begin_range_for_stmt): New.
361 (finish_range_for_decl): New.
362 (finish_for_stmt): Accept also RANGE_FOR_STMT.
363 (perform_koenig_lookup): Add extra argument include_std.
364 * parser.c (cp_parser_c_for): New with code from
365 cp_parser_iteration_statement().
366 (cp_parser_range_for): New.
367 (cp_convert_range_for): New.
368 (cp_parser_iteration_statement): Add range-for support.
369 (cp_parser_condition): Adjust comment.
370 (cp_parser_postfix_expression): perform_koenig_lookup takes extra
372 * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
373 * cxx-pretty-print.c: Likewise.
374 * lex.c (cxx_init): Likewise.
375 * name-lookup.c (lookup_function_nonclass): Add extra argument
377 (lookup_arg_dependent): Likewise.
378 * name-lookup.h: Likewise.
380 2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
383 * error.c (maybe_warn_cpp0x): Add new warning
384 CPP0X_INLINE_NAMESPACES.
385 * parser.c (cp_parser_namespace_definition): Likewise.
386 * cp-tree.h (cpp0x_warn_str): Likewise.
388 2010-09-10 Richard Guenther <rguenther@suse.de>
390 * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
391 TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
393 2010-09-10 Jan Hubicka <jh@suse.cz>
395 PR tree-optimization/45605
396 * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
399 2010-09-08 Jakub Jelinek <jakub@redhat.com>
402 * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
403 before calling fold_decl_constant_value.
405 2010-09-07 Arnaud Charlet <charlet@adacore.com>
407 * cp-tree.h (build_enumerator): Add new location_t parameter.
408 (build_lang_decl_loc): New function.
409 * decl.c (build_enumerator): New parameter loc. Use it when calling
410 build_decl. Replace build_lang_decl with build_lang_decl_loc.
411 * pt.c (tsubst_enum): Adjust call to build_enumerator.
412 * parser.c (cp_parser_enumerator_definition): Ditto.
413 * lex.c (build_lang_decl_loc): New function.
415 2010-09-06 Dodji Seketeli <dodji@redhat.com>
420 * tree.c (strip_typedefs): Strip typedefs from the context of
423 2010-09-06 Mark Mitchell <mark@codesourcery.com>
425 * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
426 * call.c (build_conditional_expr): Likewise.
427 (convert_arg_to_ellipsis): Likewise.
429 2010-09-06 Arnaud Charlet <charlet@adacore.com>
431 * parser.c (make_pointer_declarator, make_reference_declarator,
432 make_call_declarator, make_array_declarator): Set declarator->id_loc.
433 (cp_parser_init_declarator): Adjust location of decl if appropriate.
435 2010-09-06 Jason Merrill <jason@redhat.com>
437 * call.c (implicit_conversion): Fix value-init of enums.
438 (convert_like_real): Likewise.
440 * decl.c (cp_finish_decl): Don't change init for auto deduction.
442 * pt.c (fold_non_dependent_expr_sfinae): Split out from...
443 (fold_non_dependent_expr): ...here.
444 (convert_nontype_argument): Use it. Take complain parm.
445 Use perform_implicit_conversion instead of ocp_convert.
446 Allow cv-qual changes.
447 (convert_template_argument): Pass complain down.
448 (tsubst_template_arg): Suppress constant expression warnings.
451 * method.c (synthesized_method_walk): In constructors, also check
452 subobject destructors.
454 * semantics.c (finish_compound_literal): Always build a
457 2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
460 * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
462 2010-08-30 Jakub Jelinek <jakub@redhat.com>
465 * parser.c (cp_parser_omp_atomic): Handle boolean
466 {PRE,POST}_INCREMENT.
468 2010-08-29 Jason Merrill <jason@redhat.com>
471 * parser.c (cp_parser_parameter_declaration): Pop parameter decls
472 after tentative parsing.
474 2010-08-22 Joseph Myers <joseph@codesourcery.com>
476 * Make-lang.in (g++spec.o): Update dependencies.
477 * g++spec.c: Include opts.h
478 (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
479 (lang_specific_driver): Use cl_decoded_option structures.
481 2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
483 * call.c: Use FOR_EACH_VEC_ELT.
488 * except.c: Likewise.
489 * mangle.c: Likewise.
490 * method.c: Likewise.
491 * name-lookup.c: Likewise.
492 * parser.c: Likewise.
495 * semantics.c: Likewise.
496 * typeck2.c: Likewise.
498 2010-08-19 Jason Merrill <jason@redhat.com>
500 * call.c (reference_related_p): Check for error_mark_node.
501 (add_function_candidate): Check it instead of
502 same_type_ignoring_top_level_qualifiers_p.
505 * init.c (build_new_1): Don't use build_value_init in a template.
506 (build_value_init): Make sure we don't.
509 * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
510 of empty class CONSTRUCTOR.
512 * except.c (pending_noexcept, pending_noexcept_checks): New.
513 (perform_deferred_noexcept_checks): New.
514 (maybe_noexcept_warning): Split from...
515 (finish_noexcept_expr): ...here. Adjust.
516 * decl2.c (cp_write_global_declarations): Call
517 perform_deferred_noexcept_checks.
518 * cp-tree.h: And declare it.
520 2010-08-18 Nathan Froyd <froydnj@codesourcery.com>
523 * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
526 2010-08-17 Kai Tietz <kai.tietz@onevision.com>
528 * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
529 or if -fms-extensions is enabled check, check permissive.
531 2010-08-09 Jason Merrill <jason@redhat.com>
534 * pt.c (lookup_template_class): Don't re-coerce outer parms.
536 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
538 * call.c (add_builtin_candidates): Use VECs for local variable
539 `types'. Adjust remainder of function accordingly.
541 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
543 * name-lookup.c (is_associated_namespace): Convert local variables
544 to be VECs instead of TREE_LISTs.
546 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
548 * tree.c (varargs_function_p): Use stdarg_p.
550 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
552 * parser.c (cp_default_arg_entry): Declare. Declare a VEC of it.
553 (cp_unparsed_functions_entry): Declare. Declare a VEC of it.
554 (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
555 Change type to a VEC.
556 (unparsed_funs_with_default_args): Define.
557 (unparsed_funs_with_definitions): Define.
558 (push_unparsed_function_queues): New function.
559 (cp_parser_new): Call it.
560 (pop_unparsed_function_queues): New function.
561 (cp_parser_class_specifier): Adjust processing of unparsed functions.
562 (cp_parser_template_declaration_after_export): Use VEC_safe_push.
563 (cp_parser_save_member_function_body): Likewise.
564 (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
565 and pop_unparsed_function_queues.
566 (cp_parser_late_parsing_default_args): Likewise.
567 (cp_parser_save_default_args): Use VEC_safe_push.
569 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
571 * name-lookup.h (cp_label_binding): Declare. Declare a VEC type
573 (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
575 * decl.c (poplevel): Adjust for type changes.
576 (declare_local_label): Likewise.
578 2010-08-06 Jason Merrill <jason@redhat.com>
580 * typeck.c (complete_type_or_maybe_complain): Split out from...
581 (complete_type_or_else): Here.
582 (build_class_member_access_expr): Call it.
583 (finish_class_member_access_expr): Likewise.
584 * call.c (build_special_member_call): Likewise.
585 * cvt.c (build_expr_type_conversion): Likewise.
586 * init.c (build_new): Likewise.
587 * typeck2.c (build_functional_cast): Likewise.
588 * cp-tree.h: Declare it.
590 * init.c (build_value_init): Add complain parm.
591 (build_value_init_noctor): Likewise.
592 (perform_member_init): Pass it.
593 (expand_aggr_init_1): Likewise.
594 (build_new_1): Likewise.
595 (build_vec_init): Likewise.
596 * pt.c (tsubst_expr): Likewise.
597 * typeck2.c (build_functional_cast): Likewise.
599 * tree.c (build_target_expr_with_type): Handle error_mark_node.
601 * typeck.c (decay_conversion): Any expression with type nullptr_t
604 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
607 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
609 2010-07-27 Jason Merrill <jason@redhat.com>
611 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
612 from build_value_init.
613 * init.c (build_value_init_noctor): Give error for unknown array
616 2010-07-27 Joseph Myers <joseph@codesourcery.com>
618 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
620 2010-07-27 Joseph Myers <joseph@codesourcery.com>
622 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
623 c_common_initialize_diagnostics.
624 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
625 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
627 2010-07-21 Jason Merrill <jason@redhat.com>
629 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
631 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
634 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
637 * pt.c (instantiate_class_template): Propagate the template's
638 location to its instance.
640 2010-07-20 Jason Merrill <jason@redhat.com>
643 * pt.c (tsubst_copy_and_build): Rework last change.
646 * pt.c (tsubst_copy_and_build): Handle partial substitution of
649 2010-07-19 Jason Merrill <jason@redhat.com>
652 * semantics.c (finish_decltype_type): Correct decltype
653 of parenthesized rvalue reference variable.
656 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
657 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
659 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
662 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
664 * cp-tree.h: Adjust declaration.
665 * init.c (perform_member_init): Adjust caller.
666 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
667 * typeck2.c (store_init_value): Likewise.
668 (build_functional_cast): Pass complain argument to
669 build_x_compound_expr_from_list.
671 2010-07-16 Jason Merrill <jason@redhat.com>
674 * pt.c (process_partial_specialization): Diagnose partial
675 specialization after instantiation.
676 (most_specialized_class): Add complain parm.
678 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
680 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
682 * init.c (build_new_1): Use cp_build_function_call_nary instead of
683 cp_build_function_call.
685 2010-07-15 Jason Merrill <jason@redhat.com>
688 * call.c (add_function_candidate): If we're working on an implicit
689 declaration, don't consider candidates that won't match.
690 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
691 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
694 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
695 (TYPE_HAS_USER_OPEQ): New.
696 * decl.c (grok_special_member_properties): Set it.
697 * class.c (add_implicitly_declared_members): Don't lazily declare
698 constructors/operator= if a base or member has a user-declared one.
699 (check_bases_and_members, check_bases): Adjust.
700 (check_field_decls, check_field_decl): Adjust.
702 2010-07-15 Anatoly Sokolov <aesok@post.ru>
704 * decl.c (integer_three_node): Remove.
705 (cxx_init_decl_processing): Do not initialize the integer_three_node.
706 * cp-tree.h (integer_three_node): Remove.
708 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
710 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
713 * cp-gimplify.c: Likewise.
717 * mangle.c: Likewise.
718 * name-lookup.c: Likewise.
719 * optimize.c: Likewise.
720 * parser.c: Likewise.
723 * search.c: Likewise.
724 * semantics.c: Likewise.
725 * typeck.c: Likewise.
726 * typeck2.c: Likewise.
728 2010-07-14 Jason Merrill <jason@redhat.com>
730 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
731 (build_field_list): Cache field type.
733 Implement C++0x unrestricted unions (N2544)
734 * class.c (check_field_decl): Loosen union handling in C++0x.
735 * method.c (walk_field_subobs): Split out from...
736 (synthesized_method_walk): ...here. Set msg before loops.
737 (process_subob_fn): Check for triviality in union members.
738 * init.c (sort_mem_initializers): Splice out uninitialized
739 anonymous unions and union members.
740 (push_base_cleanups): Don't automatically destroy anonymous unions
743 2010-07-13 Jason Merrill <jason@redhat.com>
746 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
747 (TYPE_HAS_USER_OPEQ): New.
748 * decl.c (grok_special_member_properties): Set it.
749 * class.c (add_implicitly_declared_members): Don't lazily declare
750 constructors/operator= if a base or member has a user-declared one.
751 (check_bases_and_members, check_bases): Adjust.
752 (check_field_decls, check_field_decl): Adjust.
753 * method.c (synthesized_method_walk): Initialize check_vdtor.
756 * mangle.c (write_type): Canonicalize.
757 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
758 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
760 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
763 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
765 * typeck.c (get_delta_difference): Update prototype, add a
766 tsubst_flags_t parameter; update get_delta_difference_1 calls and
767 add checks for error_mark_node.
768 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
769 parameter; update lookup_base call.
770 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
771 parameter; update get_delta_difference call and add check for
773 (convert_ptrmem): Update prototype, add a tsubst_flags_t
774 parameter; update get_delta_difference call and add check for
775 error_mark_node; update build_ptrmemfunc call.
776 (build_static_cast_1): Adjust convert_ptrmem call.
777 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
778 (cp_build_unary_op): Adjust build_ptrmemfunc call.
779 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
780 and build_ptrmemfunc calls.
781 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
783 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
786 * call.c (build_temp): Add tsubst_flags_t complain parameter;
787 adjust build_special_member_call call, pass complain.
788 (convert_like_real): Adjust build_temp call, pass complain.
790 2010-07-09 Jason Merrill <jason@redhat.com>
793 * cp-tree.h (BV_LOST_PRIMARY): New macro.
794 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
796 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
798 2010-07-08 Jason Merrill <jason@redhat.com>
801 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
802 virtual bases for covariant thunks.
804 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
806 * cp-tree.h: Do not include toplev.h.
808 2010-07-06 Jason Merrill <jason@redhat.com>
811 * call.c (is_std_init_list): Look through typedefs.
814 * init.c (build_offset_ref): If scope isn't dependent,
815 don't exit early. Look at TYPE_MAIN_VARIANT.
816 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
818 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
820 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
822 * cp-tree.h (impl_conv_void): New type.
823 (convert_to_void): Adjust prototype.
824 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
825 diagnostic for easy translation. Change caller.
826 * typeck.c: Update call to convert_to_void.
827 * semantics.c: Likewise.
830 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
832 * decl.c (cp_finish_decl): Call add_local_decl.
833 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
835 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
837 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
840 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
843 * parser.c (cp_parser_primary_expression): Error if local template is
846 2010-07-02 Le-Chun Wu <lcwu@google.com>
849 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
850 (variable or type) shadows another type.
852 2010-07-02 Jakub Jelinek <jakub@redhat.com>
855 * typeck.c (convert_for_assignment): When converting a convertible
856 vector type or objc++ types, call mark_rvalue_use.
857 * typeck2.c (build_m_component_ref): Use return values from
858 mark_rvalue_use or mark_lvalue_use.
859 * class.c (build_base_path): Likewise.
860 * call.c (build_conditional_expr): Likewise.
862 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
865 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
868 2010-07-01 Richard Guenther <rguenther@suse.de>
870 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
871 predicate we are looking for, allow non-gimplified
874 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
877 * typeck.c (cp_build_unary_op): Early return error_mark_node when
878 arg is NULL_TREE too.
879 * call.c (convert_class_to_reference): Return error_mark_node when
882 2010-06-30 Michael Matz <matz@suse.de>
884 * repo.c (finish_repo): Fix typo.
886 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
888 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
890 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
892 * repo.c (pending_repo): Change type to a VEC.
893 (finish_repo): Adjust for new type of pending_repo.
894 (repo_emit_p): Likewise.
896 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
898 * tree.c: Include gimple.h. Do not include tree-flow.h
899 * decl.c: Do not include tree-flow.h
900 * Make-lang.in: Adjust dependencies.
902 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
904 * decl.c (incomplete_var): Declare. Declare VECs containing them.
905 (incomplete_vars): Adjust comment. Change type to a VEC.
906 (maybe_register_incomplete_var): Adjust for new type.
907 (complete_vars): Adjust iteration over incomplete_vars.
909 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
911 * decl.c (struct named_label_entry): Change type of bad_decls field
913 (poplevel_named_label_1): Adjust for new type of bad_decls.
914 (check_goto): Likewise.
916 2010-06-29 Jason Merrill <jason@redhat.com>
918 Enable implicitly declared move constructor/operator= (N3053).
919 * class.c (add_implicitly_declared_members): A class with no
920 explicitly declared copy or move constructor gets both declared
921 implicitly, and similarly for operator=.
922 (check_bases): A type with no copy ctor does not inhibit
923 a const copy ctor in a derived class. It does mean the derived
925 (check_field_decl): Likewise.
926 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
927 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
928 (trivially_copyable_p): Likewise.
929 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
930 * class.c (finish_struct_bits): Likewise.
931 * tree.c (build_target_expr_with_type): Likewise.
932 * typeck2.c (store_init_value): Likewise.
934 Enable implicitly deleted functions (N2346)
935 * class.c (check_bases_and_members): Adjust lambda flags.
936 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
938 * decl2.c (mark_used): Adjust error for use of deleted function.
940 Machinery to support implicit delete/move.
941 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
942 has_complex_move_ctor, has_complex_move_assign bitfields.
943 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
944 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
945 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
946 (enum special_function_kind): Add sfk_move_assignment.
947 (LOOKUP_SPECULATIVE): New.
948 * call.c (build_over_call): Return early if it's set.
949 (build_over_call): Use trivial_fn_p.
950 * class.c (check_bases): If the base has no default constructor,
951 the derived one is non-trivial. Handle move ctor/op=.
952 (check_field_decl): Likewise.
953 (check_bases_and_members): Handle move ctor/op=.
954 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
955 (type_has_move_constructor, type_has_move_assign): New.
956 * decl.c (grok_special_member_properties): Handle move ctor/op=.
957 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
959 (do_build_copy_constructor): Use it.
960 (do_build_assign_ref): Likewise. Handle move assignment.
961 (build_stub_type, build_stub_object, locate_fn_flags): New.
962 (locate_ctor): Use locate_fn_flags.
963 (locate_copy, locate_dtor): Remove.
964 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
965 (process_subob_fn, synthesized_method_walk): New.
966 (maybe_explain_implicit_delete): New.
967 (implicitly_declare_fn): Use synthesized_method_walk,
968 type_has_trivial_fn, and type_set_nontrivial_flag.
969 (defaulted_late_check): Set DECL_DELETED_FN.
970 (defaultable_fn_check): Handle sfk_move_assignment.
971 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
972 implicitly deleted move ctor/op=.
973 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
974 (lookup_fnfields_slot): New.
975 * semantics.c (omp_clause_info_fndecl): Remove.
976 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
977 get_copy_assign, trivial_fn_p.
978 (trait_expr_value): Adjust call to locate_ctor.
979 * tree.c (special_function_p): Handle sfk_move_assignment.
981 * class.c (type_has_virtual_destructor): New.
982 * cp-tree.h: Declare it.
983 * semantics.c (trait_expr_value): Use it.
985 * call.c (build_over_call): Only give warnings with tf_warning.
987 * name-lookup.c (pop_scope): Handle NULL_TREE.
989 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
990 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
991 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
992 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
993 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
994 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
995 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
996 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
997 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
998 (sfk_assignment_operator): Rename to sfk_copy_assignment.
999 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
1000 * search.c, semantics.c, tree.c: Adjust.
1002 * pt.c (dependent_scope_ref_p): Remove.
1003 (value_dependent_expression_p): Don't call it.
1004 (type_dependent_expression_p): Here either.
1005 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
1006 if the scope isn't dependent.
1008 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
1012 * pt.c (has_value_dependent_address): New.
1013 (value_dependent_expression_p): Check it.
1014 (convert_nontype_argument): Likewise. Call decay_conversion before
1015 folding if we want a pointer.
1016 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
1017 scope is the current instantiation.
1019 2010-06-28 Jakub Jelinek <jakub@redhat.com>
1022 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
1025 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
1027 * init.c: Do not include except.h.
1030 * cp-lang.c: Likewise.
1032 * semantics.c: Likewise.
1033 * decl2.c: Likewise.
1034 * except.c: Likewise.
1035 (init_exception_processing): Do not set the removed
1036 lang_protect_cleanup_actions here.
1037 (cp_protect_cleanup_actions): Make non-static and remove prototype.
1038 (doing_eh): New, moved from except.c but removed the do_warning flag.
1039 (expand_start_catch_block): Update doing_eh call.
1040 (expand_end_catch_block): Likewise.
1041 (build_throw): Likewise.
1042 * cp-tree.h: Prototype cp_protect_cleanup_actions.
1043 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
1044 cp_protect_cleanup_actions.
1045 * Make-lang.in: Update dependencies.
1047 2010-06-26 Jason Merrill <jason@redhat.com>
1049 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
1050 constructor called with a single argument that takes a reference
1051 to the constructor's class.
1052 (BAD_CONVERSION_RANK): New.
1053 (compare_ics): Use it to compare bad ICSes.
1055 2010-06-25 Joseph Myers <joseph@codesourcery.com>
1057 * lang-specs.h: Remove +e handling.
1059 2010-06-24 Andi Kleen <ak@linux.intel.com>
1061 * parser.c: (cp_parser_question_colon_clause):
1062 Switch to use cp_lexer_peek_token.
1063 Call warn_for_omitted_condop. Call pedwarn for omitted
1066 2010-06-22 Jakub Jelinek <jakub@redhat.com>
1069 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
1070 datum and mark_rvalue_use on component.
1073 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
1074 the CALL_EXPR has no arguments.
1076 2010-06-21 Jason Merrill <jason@redhat.com>
1078 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
1080 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
1083 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
1085 * name-lookup.c (struct arg_lookup): Convert namespaces and
1086 classes fields to VEC.
1087 (arg_assoc_namespace): Adjust for new type of namespaces.
1088 (arg_assoc_class): Adjust for new type of classes.
1089 (lookup_arg_dependent): Use make_tree_vector and
1090 release_tree_vector.
1091 * typeck2.c (build_x_arrow): Use vec_member.
1093 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
1096 * error.c (dump_decl): Better wording for anonymous namespace.
1098 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
1100 * class.c (build_vtbl_initializer): Adjust computation of new_position
1101 and which entry to add padding for.
1103 2010-06-16 Jason Merrill <jason@redhat.com>
1105 * except.c (check_noexcept_r): Return the problematic function.
1106 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
1107 * pt.c (tsubst_copy_and_build): Pass it.
1108 * parser.c (cp_parser_unary_expression): Likewise.
1109 * cp-tree.h: Adjust prototype.
1111 * method.c (defaulted_late_check): Give the defaulted method
1112 the same exception specification as the implicit declaration.
1114 2010-06-15 Jason Merrill <jason@redhat.com>
1116 * class.c (add_implicitly_declared_members): Implicit assignment
1117 operators can also be virtual overriders.
1118 * method.c (lazily_declare_fn): Likewise.
1120 * call.c (convert_like_real): Give "initializing argument of"
1121 information for ambiguous conversion. Give source position
1124 * call.c (print_z_candidates): Do print viable deleted candidates.
1125 (joust): Don't choose a deleted function just because its worst
1126 conversion is better than another candidate's worst.
1128 * call.c (convert_like_real): Don't complain about
1129 list-value-initialization from an explicit constructor.
1131 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
1132 DECL_SOURCE_LOCATION directly.
1134 * class.c (type_has_user_provided_default_constructor): Use
1137 * call.c (is_subseq): Handle ck_aggr, ck_list.
1138 (compare_ics): Treat an aggregate or ambiguous conversion to the
1139 same type as involving the same function.
1141 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
1143 * typeck.c (convert_for_assignment): Fix comment. Change message
1144 format from %d to %qP.
1145 (convert_for_initialization): Fix comment.
1147 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
1149 * cp-tree.h (expr_list_kind): New type.
1150 (impl_conv_rhs): New type.
1151 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
1153 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
1154 diagnostics for easy translation. Change caller.
1155 (convert_for_initialization): Use impl_conv_rhs and change caller.
1156 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
1157 diagnostics for easy translation. Change caller.
1158 * decl.c (bad_spec_place): New enum.
1159 (bad_specifiers): Use it and emit the diagnostics for easy
1160 translation. Change caller.
1161 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
1163 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1165 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
1167 * decl2.c (cp_write_global_declarations): Adjust for new type of
1168 decl_namespace_list.
1169 * name-lookup.c (current_decl_namespace): Likewise.
1170 (push_decl_namespace): Likewise.
1171 (pop_decl_namespace): Likewise.
1173 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1175 * call.c (build_java_interface_fn_ref): Call build_function_type_list
1176 instead of build_function_type.
1177 * decl.c (cxx_init_decl_processing): Likewise.
1178 (declare_global_var): Likewise.
1179 (get_atexit_node): Likewise.
1180 (expand_static_init): Likewise.
1181 * decl2.c (start_objects): Likewise.
1182 (start_static_storage_duration_function): Likewise.
1183 * except.c (init_exception_processing): Likewise.
1184 (build_exc_ptr): Likewise.
1185 (build_throw): Likewise.
1186 * rtti.c (throw_bad_cast): Likewise.
1187 (throw_bad_typeid): Likewise.
1188 (build_dynamic_cast_1): Likewise.
1190 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1192 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
1193 (build_op_delete_call): Likewise.
1194 (build_over_call): Likewise.
1195 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1196 * pt.c (process_partial_specialization): Likewise.
1197 (tsubst_template_args): Likewise.
1198 * semantics.c (finish_asm_stmt): Likewise.
1200 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
1202 * decl.c (record_key_method_defined): New, broken out of ...
1203 (finish_function): ... here. Call it.
1204 (start_decl): Treat aliases as definitions.
1206 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1208 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
1210 * pt.c (maybe_process_partial_specialization): Likewise.
1211 (register_specialization): Likewise.
1212 (add_pending_template): Likewise.
1213 (lookup_template_class): Likewise.
1214 (push_tinst_level): Likewise.
1216 * parser.c (cp_lexer_new_main): Likewise.
1217 (cp_lexer_new_from_tokens): Likewise.
1218 (cp_token_cache_new): Likewise.
1219 (cp_parser_context_new): Likewise.
1220 (cp_parser_new): Likewise.
1221 (cp_parser_nested_name_specifier_opt): Likewise.
1222 (cp_parser_template_id): Likewise.
1224 * name-lookup.c (binding_entry_make): Likewise.
1225 (binding_table_construct): Likewise.
1226 (binding_table_new): Likewise.
1227 (cxx_binding_make): Likewise.
1228 (pushdecl_maybe_friend): Likewise.
1229 (begin_scope): Likewise.
1230 (push_to_top_level): Likewise.
1232 * lex.c (init_reswords): Likewise.
1233 (retrofit_lang_decl): Likewise.
1234 (cxx_dup_lang_specific_decl): Likewise.
1235 (copy_lang_type): Likewise.
1236 (cxx_make_type): Likewise.
1238 * decl.c (make_label_decl): Likewise.
1239 (check_goto): Likewise.
1240 (start_preparsed_function): Likewise.
1241 (save_function_data): Likewise.
1243 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
1245 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1247 * class.c (finish_struct_1): Likewise.
1249 * cp-tree.h (struct lang_type): Add variable_size GTY option.
1250 (struct lang_decl): Likewise.
1252 * parser.c (cp_parser_new): Update comment to not reference
1255 2010-06-07 Jason Merrill <jason@redhat.com>
1258 * error.c (dump_parameters): Mask out TFF_SCOPE.
1259 (dump_simple_decl): Don't print the scope of a PARM_DECL.
1260 (dump_scope): Remove no-op mask.
1263 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
1265 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
1266 * init.c (build_offset_ref): Use it.
1267 * pt.c (maybe_process_partial_specialization): Use it.
1268 (instantiate_class_template): Use it.
1269 * search.c (lookup_base): Use it.
1271 2010-06-07 Jakub Jelinek <jakub@redhat.com>
1274 * expr.c (mark_exp_read): Handle INDIRECT_REF.
1275 * cvt.c (convert_to_void): Handle INDIRECT_REF like
1276 handled_component_p.
1279 * decl.c (initialize_local_var): If TREE_USED is set on the type,
1280 set also DECL_READ_P on the decl.
1282 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1285 * cp-tree.h (typedef_variant_p): Move this declaration to
1287 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1288 * decl.c (grokdeclarator): Do not rename debug info of an
1289 anonymous tagged type named by a typedef.
1291 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
1294 * class.c (check_field_decls): Move the call to
1295 check_bitfield_decl before trying to set the
1296 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
1298 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
1300 * typeck.c: Update include path for moved files.
1303 * cp-gimplify.c: Likewise.
1304 * cp-lang.c: Likewise.
1306 * semantics.c: Likewise.
1307 * cxx-pretty-print.h: Likewise.
1308 * decl2.c: Likewise.
1309 * parser.c: Likewise.
1310 * cp-objcp-common.c: Likewise.
1311 * cp-tree.h: Likewise.
1312 * name-lookup.c: Likewise.
1314 * name-lookup.h: Likewise.
1315 * config-lang.in: Update paths in gtfiles for files in c-family/.
1316 * Make-lang.in: Likewise.
1318 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
1320 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
1321 * typeck.c (build_ptrmemfunc): Likewise.
1323 2010-06-04 Jason Merrill <jason@redhat.com>
1325 * typeck2.c (merge_exception_specifiers): Adjust merging of
1326 throw() and noexcept(true).
1328 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
1329 using an uninitialized variable.
1331 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
1332 (pp_cxx_expression): Likewise.
1334 Implement noexcept-specification (15.4)
1335 * parser.c (cp_parser_exception_specification_opt): Parse it.
1336 Give -Wdeprecated warning about throw() specs.
1337 * pt.c (tsubst_exception_specification): Handle it.
1338 * error.c (dump_exception_spec): Handle it.
1339 (dump_expr): Handle NOEXCEPT_EXPR.
1340 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
1341 * typeck.c (comp_except_specs): Handle compatibility rules.
1342 Change exact parm to take an enum.
1343 * typeck2.c (merge_exception_specifiers): Handle noexcept.
1344 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
1345 (type_throw_all_p, build_noexcept_spec): New fns.
1346 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
1347 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
1348 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
1349 (noexcept_true_spec, noexcept_false_spec): New macros.
1350 * name-lookup.c (pushdecl_maybe_friend): Adjust.
1351 * search.c (check_final_overrider): Adjust.
1352 * decl.c (check_redeclaration_exception_specification): Adjust.
1353 (use_eh_spec_block): Use type_throw_all_p.
1354 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
1355 Give operator new a noexcept-specification in C++0x mode.
1356 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
1357 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
1359 Implement noexcept operator (5.3.7)
1360 * cp-tree.def (NOEXCEPT_EXPR): New.
1361 * except.c (check_noexcept_r, finish_noexcept_expr): New.
1362 * cp-tree.h: Declare finish_noexcept_expr.
1363 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
1364 * pt.c (tsubst_copy_and_build): And tsubst it.
1365 (type_dependent_expression_p): Handle it.
1366 (value_dependent_expression_p): Handle it.
1368 * call.c (build_conditional_expr): Never fold in unevaluated context.
1369 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
1370 * semantics.c (simplify_aggr_init_expr): Likewise.
1371 * typeck.c (merge_types): Call merge_exception_specifiers.
1372 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
1373 DECL_ANTICIPATED for preferring new type.
1375 2010-06-04 Joseph Myers <joseph@codesourcery.com>
1377 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
1380 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1383 * typeck.c (build_class_member_access_expr): Call mark_exp_read
1384 on object for static data members.
1386 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1387 Jason Merrill <jason@redhat.com>
1390 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
1391 with the same type, call mark_lvalue_use on both.
1393 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
1395 * class.c (struct vtbl_init_data_s): Remove last_init field.
1396 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
1398 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
1400 (build_vtt): Likewise.
1401 (initialize_vtable): Take a VEC instead of a tree.
1402 (build_vtt_inits): Change return type to void. Take a VEC **
1403 instead of a tree *; accumulate results into said VEC.
1404 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
1405 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
1406 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
1408 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
1409 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
1411 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
1412 rather than tree_cons.
1413 (build_vbase_offset_vtbl_entries): Likewise.
1414 (add_vcall_offset): Likewise.
1415 (build_rtti_vtbl_entries): Likewise.
1416 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
1417 * decl.c (initialize_artificial_var): Use build_constructor instead
1418 of build_constructor_from_list.
1420 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
1423 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
1426 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
1428 * parser.c (cp_parser_mem_initializer_list): Change error text.
1430 2010-06-02 Jakub Jelinek <jakub@redhat.com>
1432 * cp-objcp-common.c (shadowed_var_for_decl): Change into
1433 tree_decl_map hashtab from tree_map.
1434 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
1435 (init_shadowed_var_for_decl): Adjust initialization.
1438 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
1439 instead of calling mark_exp_read only when not an assignment.
1442 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
1443 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
1444 Set DECL_VALUE_EXPR on var.
1446 2010-06-02 Jason Merrill <jason@redhat.com>
1448 * error.c (dump_type): Improve typedef handling.
1453 * name-lookup.c (same_entity_p): New.
1454 (ambiguous_decl): Multiple declarations of the same entity
1457 2010-06-01 Jason Merrill <jason@redhat.com>
1460 * call.c (add_list_candidates): Prefer the default constructor.
1461 (build_aggr_conv): Treat missing initializers like { }.
1462 * typeck2.c (process_init_constructor_record): Likewise.
1463 * init.c (expand_default_init): Use digest_init for
1464 direct aggregate initialization, too.
1466 * call.c (add_list_candidates): Split out...
1467 (build_user_type_conversion_1): ...from here.
1468 (build_new_method_call): And here.
1469 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
1472 * call.c (build_list_conv): Set list-initialization flags properly.
1474 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
1476 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
1478 2010-06-01 Arnaud Charlet <charlet@adacore.com>
1479 Matthew Gingell <gingell@adacore.com>
1481 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
1482 * decl2.c: Include langhooks.h and c-ada-spec.h.
1483 (cpp_check, collect_source_refs, collect_ada_namespace,
1484 collect_all_refs): New functions.
1485 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
1486 * lang-specs.h: Ditto.
1488 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
1490 * cp-tree.h (cp_build_function_call_nary): Declare.
1491 * typeck.c (cp_build_function_call_nary): Define.
1492 * decl.c (register_dtor_fn): Use it instead of
1493 cp_build_function_call.
1494 (cxx_maybe_build_cleanup): Likewise.
1495 * decl2.c (generate_ctor_or_dtor_function): Likewise.
1496 * except.c (do_get_exception_ptr): Likewise.
1497 (do_begin_catch): Likewise.
1498 (do_allocate_exception): Likewise.
1499 (do_free_exception): Likewise.
1500 (build_throw): Likewise. Use cp_build_function_call_vec instead
1501 of cp_build_function_call.
1502 (do_end_catch): Likewise.
1504 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
1506 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
1507 (struct cp_declarator): Move id_loc field up.
1509 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
1511 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
1512 this file is included before c-common.h. Define GCC_DIAG_STYLE
1513 before including diagnostic-core.h and toplev.h.
1514 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
1515 * pt.c: Include cp-tree.h before c-common.h.
1517 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
1519 * tree.c (c_register_addr_space): Add stub.
1521 2010-05-28 Joseph Myers <joseph@codesourcery.com>
1523 * g++spec.c (lang_specific_driver): Use fatal_error instead of
1526 2010-05-28 Dodji Seketeli <dodji@redhat.com>
1528 Revert fix of PR c++/44188
1529 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
1531 * tree.c (typedef_variant_p): Revert moving this definition to
1533 * decl.c (grokdeclarator): Revert naming typedef handling.
1535 2010-05-27 Joseph Myers <joseph@codesourcery.com>
1537 * call.c: Include diagnostic-core.h instead of diagnostic.h.
1538 * cp-lang.c: Don't include diagnostic.h
1539 * name-lookup.c: Include diagnostic-core.h instead of
1541 (cp_emit_debug_info_for_using): Use seen_error.
1542 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
1543 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
1544 * pt.c (iterative_hash_template_arg): Use seen_error.
1545 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
1546 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
1547 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
1548 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
1551 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1554 * cp-tree.h (typedef_variant_p): Move this declaration to
1556 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1557 * decl.c (grokdeclarator): Do not rename debug info of an
1558 anonymous tagged type named by a typedef.
1560 2010-05-27 Jason Merrill <jason@redhat.com>
1563 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
1566 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
1569 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
1570 * class.c (layout_class_type): Likewise.
1571 * decl.c (finish_enum): Likewise.
1572 * mangle.c (write_builitin_type): Likewise.
1574 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
1576 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
1578 * decl.c (grokdeclarator): Handle __int128.
1579 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
1580 (cp_parser_simple_type_specifier): Likewise.
1581 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
1582 * typeck.c (cp_common_type): Handle __int128.
1583 * mangle.c (integer_type_codes): Add itk_int128 and
1584 itk_unsigned_int128.
1586 2010-05-26 Jason Merrill <jason@redhat.com>
1589 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
1592 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
1594 * cp-lang.c: Do not include expr.h.
1596 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
1598 * decl.c: Do not include rtl.h
1599 * semantics.c: Likewise.
1601 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
1603 * cp-tree.h: Do not include splay-tree.h.
1604 (struct prtmem_cst): Remove unused field and false comment.
1605 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
1606 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
1607 * init.c: Do not include rtl.h and expr.h.
1608 * class.c: Do not include rtl.h. Include splay-tree.h.
1609 (build_clone): Use plain NULL instead of NULL_RTX.
1610 * decl.c: Do not include expr.h. Explain why rtl.h has to be
1611 included. Include splay-tree.h.
1612 * method.c: Do not include rtl.h and expr.h.
1613 (use_thunk): Use plain NULL instead of NULL_RTX.
1614 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
1615 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
1616 and target.h. Include splay-tree.h.
1617 * expr.c: Do not include rtl.h and expr.h.
1618 * pt.c: Do not include obstack.h and rtl.h.
1619 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
1620 (tsubst_decl): Likewise.
1621 (instantiate_decl): Likewise.
1622 * semantics.c: Do not include exprt.h and debug.h. Explain why
1623 rtl.h has to be included.
1624 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
1625 * call.c: Do not include rtl.h and expr.h.
1626 * search.c: Do not include obstack.h and rtl.h.
1627 * friend.c: Do not include rtl.h and expr.h.
1628 * Make-lang.in: Update dependencies.
1630 2010-05-25 Jakub Jelinek <jakub@redhat.com>
1633 * parser.c (non_integral_constant): Add NIC_NONE.
1634 (required_token): Add RT_NONE.
1635 (cp_parser_unary_expression): Initialize non_constant_p
1637 (cp_parser_asm_definition): Initialize missing to RT_NONE.
1638 (cp_parser_primary_expression, cp_parser_postfix_expression,
1639 cp_parser_cast_expression, cp_parser_binary_expression,
1640 cp_parser_functional_cast): Fix formatting.
1642 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
1645 * parser.c: Remove inclusion of dyn-string.h.
1646 (non_integral_constant): New enum.
1647 (name_lookup_error): New enum.
1648 (required_token): New enum.
1649 (cp_parser_required_error): New function.
1650 (cp_parser_require): Change the type of variable token_desc to
1651 required_token and use cp_parser_required_error.
1652 (cp_parser_require_keyword): Likewise.
1653 (cp_parser_error): Use gmsgid as parameter.
1654 (cp_parser_name_lookup_error): Change the type of variable desired to
1655 name_lookup_error and put the diagnostic in the full sentences. Change
1657 (cp_parser_non_integral_constant_expression): Change the type of the
1658 variable thing to non_integral_constant and put the diagnostics in
1659 full sentences. Change caller.
1661 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
1664 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
1666 2010-05-24 Joseph Myers <joseph@codesourcery.com>
1668 * error.c (cp_diagnostic_starter): Update call to
1669 diagnostic_build_prefix.
1670 (cp_print_error_function,
1671 print_instantiation_partial_context_line): Check show_column flag
1674 2010-05-24 Jason Merrill <jason@redhat.com>
1677 * decl.c (check_initializer): Don't wrap an init-list in a
1679 * init.c (build_aggr_init): Don't assume copy-initialization if
1680 init has CONSTRUCTOR_IS_DIRECT_INIT.
1681 * call.c (build_new_method_call): Sanity check.
1683 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
1685 * rtti.c (tinfo_base_init): Use build_constructor instead of
1686 build_constructor_from_list. Don't cons a tree node for
1688 (generic_initializer): Use build_constructor_single instead of
1689 build_constructor_from_list.
1690 (ptr_initializer): Use build_constructor instead of
1691 build_constructor_from_list
1692 (ptm_initializer): Likewise.
1693 (class_initializer): Likewise. Take varargs instead of TRAIL.
1694 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
1695 build_constructor instead of build_constructor_from_list.
1697 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
1699 * semantics.c: Include bitmap.h.
1700 * Make-lang.in: Update dependencies.
1702 2010-05-22 Jan Hubicka <jh@suse.cz>
1704 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
1706 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
1708 2010-05-21 Joseph Myers <joseph@codesourcery.com>
1710 * cxx-pretty-print.c: Correct merge error.
1712 2010-05-21 Joseph Myers <joseph@codesourcery.com>
1714 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
1715 (cp_print_error_function): Use diagnostic_abstract_origin macro.
1716 (cp_printer): Handle %K here using percent_K_format.
1717 * cxx-pretty-print.c: Include tree-pretty-print.h.
1718 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
1721 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
1723 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
1724 Clean up redundant includes.
1726 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1729 * decl.c (xref_basetypes): Return false in case of ill-formed
1732 2010-05-19 Jason Merrill <jason@redhat.com>
1734 * call.c (reference_binding): Use cp_build_qualified_type_real
1735 and cp_type_quals consistently.
1736 (add_function_candidate): Likewise.
1737 (build_conditional_expr): Likewise.
1738 (convert_like_real): Likewise.
1739 (type_passed_as): Likewise.
1740 * class.c (add_method): Likewise.
1741 (same_signature_p): Likewise.
1742 (layout_class_type): Likewise.
1743 * decl.c (cxx_init_decl_processing): Likewise.
1744 (cp_fname_init): Likewise.
1745 (grokdeclarator): Likewise.
1746 * decl2.c (cp_reconstruct_complex_type): Likewise.
1747 * init.c (build_new_1): Likewise.
1748 * method.c (do_build_copy_constructor): Likewise.
1749 (implicitly_declare_fn): Likewise.
1750 * pt.c (tsubst_aggr_type): Likewise.
1752 * rtti.c (init_rtti_processing): Likewise.
1753 (build_headof): Likewise.
1754 (build_dynamic_cast_1): Likewise.
1755 (tinfo_base_init): Likewise.
1756 (emit_support_tinfos): Likewise.
1757 * semantics.c (capture_decltype): Likewise.
1758 * tree.c (cv_unqualified): Likewise.
1759 * typeck.c (composite_pointer_type): Likewise.
1760 (string_conv_p): Likewise.
1762 * mangle.c (write_CV_qualifiers_for_type): Tweak.
1764 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
1765 * decl.c (start_decl): Likewise.
1766 * semantics.c (finish_compound_literal): Likewise.
1767 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
1768 (cp_type_readonly): Remove.
1769 * cp-tree.h: Remove declaration.
1771 * typeck.c (merge_types): Preserve memfn quals.
1773 * decl.c (grokdeclarator): Don't check quals on fn type.
1774 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
1775 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
1778 * typeck.c (type_memfn_quals): New fn.
1779 (apply_memfn_quals): New fn.
1780 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
1781 (cp_type_readonly): Use cp_type_quals.
1782 * cp-tree.h: Add declarations.
1783 * tree.c (cp_build_qualified_type_real): Don't set, but do
1784 preserve, quals on FUNCTION_TYPE.
1785 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
1786 * decl.c (build_ptrmem_type): Likewise.
1787 (grokdeclarator): Likewise.
1788 (static_fn_type): Likewise.
1789 * decl2.c (change_return_type): Likewise.
1790 (cp_reconstruct_complex_type): Likewise.
1791 * pt.c (tsubst_function_type): Likewise.
1793 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
1795 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
1797 * tree.c (build_min_non_dep_call_vec): Update comment.
1799 2010-05-17 Jason Merrill <jason@redhat.com>
1801 * call.c (struct z_candidate): Add explicit_targs field.
1802 (add_template_candidate_real): Set it.
1803 (build_over_call): Use it to control init-list warning.
1806 * call.c (build_over_call): Limit init-list deduction warning to
1807 cases where the argument is actually an init-list.
1810 * call.c (build_over_call): Don't do bitwise copy for move ctor.
1812 2010-05-17 Dodji Seketeli <dodji@redhat.com>
1813 Jason Merrill <jason@redhat.com>
1816 * decl.c (compute_array_index_type): Call mark_rvalue_use.
1818 2010-05-15 Jason Merrill <jason@redhat.com>
1820 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
1821 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
1823 (finish_eh_spec_block): Adjust.
1825 2010-05-15 Jakub Jelinek <jakub@redhat.com>
1828 * pt.c (tsubst): Unshare template argument.
1830 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
1832 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
1833 * Make-lang.in: Fix dependencies accordingly.
1835 2010-05-14 Jason Merrill <jason@redhat.com>
1838 * except.c (build_throw): Simplify, adjust for DR 475.
1841 * except.c (dtor_nothrow): Return nonzero for type with
1845 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
1846 gimple_build_eh_must_not_throw.
1848 2010-05-14 Martin Jambor <mjambor@suse.cz>
1850 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
1853 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
1855 * call.c (build_new_method_call): Change warning text.
1856 * typeck2.c (build_functional_cast): Change error text.
1858 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
1861 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
1862 shadowing the outer parameter or variables by the declaration of
1863 nested function in nested structure or class. Warn the shadowing by
1864 the declaration of nested lambda expression.
1866 2010-05-13 Jason Merrill <jason@redhat.com>
1868 * typeck.c (cp_build_array_ref): Factor out from...
1869 (build_array_ref): ...here. Drop complain parm.
1870 (build_new_op): Adjust.
1871 * class.c (build_vtbl_ref_1): Adjust.
1872 * decl2.c (grok_array_decl): Adjust.
1873 * cp-tree.h: Adjust prototypes.
1875 2010-05-13 Jan Hubicka <jh@suse.cz>
1877 * decl.c (cp_finish_decl): Do not worry about used attribute.
1879 2010-05-12 Jason Merrill <jason@redhat.com>
1881 * typeck.c (build_array_ref): Take complain parm.
1882 * cp-tree.h: Add it to prototype.
1883 * call.c (build_new_op): Pass it.
1884 * class.c (build_vtbl_ref): Pass it.
1885 * decl2.c (grok_array_decl): Pass it.
1889 * cp-tree.def (NULLPTR_TYPE): Remove.
1890 * cp-tree.h (NULLPTR_TYPE_P): New.
1891 (SCALAR_TYPE_P): Use it.
1892 (nullptr_type_node): New.
1893 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
1894 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
1896 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
1897 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
1898 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
1899 * mangle.c (write_type): Likewise.
1900 * name-lookup.c (arg_assoc_type): Likewise.
1901 * typeck.c (build_reinterpret_cast_1): Likewise.
1902 * rtti.c (typeinfo_in_lib_p): Likewise.
1903 (emit_support_tinfos): Remove local nullptr_type_node.
1905 * cp-tree.h (UNKNOWN_TYPE): Remove.
1906 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
1907 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
1908 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
1909 * class.c (instantiate_type): Check unknown_type_node rather than
1911 * name-lookup.c (maybe_push_decl): Likewise.
1912 * rtti.c (get_tinfo_decl_dynamic): Likewise.
1913 (get_typeid): Likewise.
1914 * semantics.c (finish_offsetof): Likewise.
1917 * call.c (add_template_candidate_real): If deduction fails, still
1918 add the template as a non-viable candidate.
1919 (equal_functions): Handle template candidates.
1920 (print_z_candidate): Likewise.
1921 (print_z_candidates): Likewise.
1922 (build_new_function_call): Likewise.
1924 * cp-tree.h (LOOKUP_LIST_ONLY): New.
1925 * call.c (add_candidates): Enforce it.
1926 (build_new_method_call): Try non-list ctor if no viable list ctor.
1927 (build_user_type_conversion_1): Likewise.
1929 * call.c (add_candidates): Distinguish between type(x) and
1931 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
1932 (build_new_method_call): Give better error for conversion op.
1934 * call.c (add_candidates): Add first_arg and return_type parms.
1935 Add special constructor/conversion op handling.
1936 (convert_class_to_reference): Use it.
1937 (build_user_type_conversion_1): Likewise.
1938 (build_op_call): Likewise.
1939 (build_new_method_call): Likewise.
1940 (build_new_op): Adjust.
1941 (perform_overload_resolution): Adjust.
1943 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
1948 * pt.c (process_partial_specialization): Return error_mark_node
1949 in case of unused template parameters in partial specialization.
1951 2010-05-11 Jakub Jelinek <jakub@redhat.com>
1954 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
1955 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
1956 look at its second operand.
1958 2010-05-10 Jason Merrill <jason@redhat.com>
1961 * semantics.c (baselink_for_fns): Revert earlier change.
1964 * typeck.c (cp_build_modify_expr): Complain about assignment to
1965 array from init list.
1967 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
1970 * decl.c (check_initializer): strip array type before checking for
1971 uninitialized const or ref members.
1973 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
1976 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
1977 error count. Emit errors only if compain is true.
1978 (build_new_1): Do not return error_mark_node if
1979 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
1980 errors. Delay the check for user-provided constructor.
1981 (perform_member_init): Adjust.
1982 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
1985 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
1986 Jason Merrill <jason@redhat.com>
1988 Add support for C++0x nullptr.
1989 * cp-tree.def: Add NULLPTR_TYPE.
1990 * cp-tree.h: Add nullptr_node.
1991 (cp_tree_index): Add CPTI_NULLPTR.
1992 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
1993 * call.c (null_ptr_cst_p): Handle nullptr.
1994 (standard_conversion): Likewise.
1995 (convert_arg_to_ellipsis): Likewise.
1996 * mangle.c (write_type): Likewise.
1997 * name-lookup.c (arg_assoc_type): Likewise.
1998 * parser.c (cp_parser_primary_expression): Likewise.
1999 * typeck.c (cp_build_binary_op): Likewise.
2000 (build_reinterpret_cast_1): Likewise.
2001 * error.c (dump_type): Likewise.
2002 (dump_type_prefix, dump_type_suffix): Likewise.
2003 * decl.c (cxx_init_decl_processing): Likewise.
2004 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2005 * cvt.c (ocp_convert): Likewise.
2006 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
2007 nullptr_t tinfo in libsupc++.
2009 2010-05-06 Jason Merrill <jason@redhat.com>
2011 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
2013 2010-04-22 Jakub Jelinek <jakub@redhat.com>
2014 Dodji Seketeli <dodji@redhat.com>
2017 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
2019 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
2020 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
2021 (decay_conversion, perform_integral_promotions): Call rvalue_use.
2022 (cp_build_unary_op): Call lvalue_use.
2023 * decl.c (unused_but_set_errorcount): New variable.
2024 (poplevel): Issue -Wunused-but-set-variable diagnostics.
2025 (duplicate_decls): Merge DECL_READ_P flags.
2026 (start_cleanup_fn): Set DECL_READ_P flag.
2027 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
2028 * tree.c (rvalue): Call rvalue_use.
2029 * pt.c (convert_nontype_argument): Likewise.
2030 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
2031 finish_decltype_type): Likewise.
2032 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
2033 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
2034 or rvalue_use depending on the expr.
2035 * init.c (build_new, build_delete): Likewise.
2036 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
2038 2010-05-05 Jason Merrill <jason@redhat.com>
2041 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
2042 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
2044 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2047 * pt.c (unify): Check each elt for error_mark_node.
2049 2010-05-04 Jason Merrill <jason@redhat.com>
2052 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
2054 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2057 * call.c (build_new_method_call): Return error_mark_node if fns is
2060 2010-05-03 Dodji Seketeli <dodji@redhat.com>
2063 * pt.c (most_specialized_class): Pretend we are processing
2064 a template decl during the call to coerce_template_parms.
2066 2010-05-03 Jason Merrill <jason@redhat.com>
2070 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
2071 from the selected underlying type unless -fstrict-enums. Set
2072 ENUM_UNDERLYING_TYPE to have the restricted range.
2073 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
2074 * class.c (check_bitfield_decl): Likewise.
2076 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
2079 * init.c (build_new_1): Revert the accidental checkin in
2082 2010-04-30 Jason Merrill <jason@redhat.com>
2085 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
2086 (pp_cxx_type_specifier_seq): ...here.
2088 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
2090 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
2091 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
2093 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
2096 * typeck.c (warn_args_num): New function.
2097 (convert_arguments): Use warn_args_num to print the diagnostic
2100 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
2103 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
2104 user-provided constructor while recursing.
2106 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
2109 * error.c (print_instantiation_partial_context_line): Handle
2110 recursive instantiation.
2111 (print_instantiation_partial_context): Likewise.
2113 2010-04-27 Jason Merrill <jason@redhat.com>
2115 * init.c (perform_member_init): Check CLASS_TYPE_P.
2117 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2120 * init.c (perform_member_init): check for uninitialized const or
2121 reference members, including array types.
2123 2010-04-24 Jason Merrill <jason@redhat.com>
2125 * tree.c (get_fns): Split out from get_first_fn.
2126 * cp-tree.h: Declare it.
2127 * search.c (shared_member_p): Use it.
2128 * semantics.c (finish_qualified_id_expr): Simplify.
2129 (finish_id_expression): Simplify.
2131 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
2132 whenever object is NULL_TREE. Don't do 'this' capture here.
2133 (finish_qualified_id_expr): Pass NULL_TREE.
2134 (finish_id_expression): Likewise.
2135 (lambda_expr_this_capture): Likewise.
2137 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
2138 rather than checking current_class_ref directly.
2139 (finish_call_expr): Likewise.
2142 * name-lookup.c (qualify_lookup): Disqualify lambda op().
2143 * class.c (current_nonlambda_class_type): New fn.
2144 * semantics.c (nonlambda_method_basetype): New.
2145 * cp-tree.h: Declare them.
2146 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
2148 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
2151 * semantics.c (lambda_return_type): Complain about
2155 * tree.c (cv_unqualified): Handle error_mark_node.
2158 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
2159 if we don't want errors.
2162 * class.c (convert_to_base): Add complain parameter. Pass
2163 ba_quiet to lookup_base if we don't want errors.
2164 (build_vfield_ref): Pass complain to convert_to_base.
2165 * call.c (convert_like_real): Likewise.
2166 (initialize_reference): Likewise.
2167 (perform_direct_initialization_if_possible): Pass complain to
2169 * cp-tree.h: Adjust.
2171 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2172 Jason Merrill <jason@redhat.com>
2175 * decl.c (check_for_uninitialized_const_var): Handle classes that need
2177 (check_initializer): Call it for classes that need constructing, too.
2178 * class.c (in_class_defaulted_default_constructor): New.
2179 * cp-tree.h: Declare it.
2181 2010-04-20 Jason Merrill <jason@redhat.com>
2184 * init.c (constant_value_1): Treat error_mark_node as a constant
2185 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
2186 * cvt.c (ocp_convert): Handle getting error_mark_node from
2187 integral_constant_value.
2188 * decl.c (compute_array_index_type): Likewise.
2190 2010-04-20 Dodji Seketeli <dodji@redhat.com>
2194 * typeck.c (incompatible_dependent_types_p): If one of the
2195 compared types if not a typedef then honour their main variant
2198 2010-04-20 Jakub Jelinek <jakub@redhat.com>
2200 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
2202 2010-04-19 Dodji Seketeli <dodji@redhat.com>
2205 * typeck.c (structural_comptypes): Test dependent typedefs
2206 incompatibility before testing for their main variant based
2209 2010-04-19 Jakub Jelinek <jakub@redhat.com>
2211 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
2212 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
2214 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
2216 * decl.c (cxx_init_decl_processing): Remove second argument in call to
2217 build_common_tree_nodes.
2219 2010-04-14 Jason Merrill <jason@redhat.com>
2222 * parser.c (cp_parser_parenthesized_expression_list): Change
2223 is_attribute_list parm to int to indicate whether or not to
2224 handle initial identifier specially.
2225 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
2227 2010-04-13 Jason Merrill <jason@redhat.com>
2229 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
2231 * parser.c (cp_parser_lambda_expression): Complain about lambda in
2232 unevaluated context.
2233 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
2235 2010-04-12 Jason Merrill <jason@redhat.com>
2238 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
2239 return value directly.
2241 * call.c (type_decays_to): Call cv_unqualified for non-class type.
2243 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
2246 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2247 * init.c (build_new_1): Check for uninitialized const members and
2248 uninitialized reference members, when using new without
2249 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
2250 (diagnose_uninitialized_cst_or_ref_member): Define, call
2251 diagnose_uninitialized_cst_or_ref_member_1.
2252 (diagnose_uninitialized_cst_or_ref_member_1): New function.
2254 2010-04-12 Richard Guenther <rguenther@suse.de>
2257 * semantics.c (expand_or_defer_fn_1): Do not keep extern
2258 template inline functions.
2260 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2263 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
2266 2010-04-07 Jason Merrill <jason@redhat.com>
2269 * decl.c (start_preparsed_function): Do defer nested functions.
2271 PR c++/11094, DR 408
2272 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
2273 * decl2.c (finish_static_data_member_decl): Set it.
2274 * decl.c (duplicate_decls): Propagate it.
2275 * pt.c (tsubst_decl): Don't substitute the domain of an array
2276 VAR_DECL if it's set.
2277 (regenerate_decl_from_template): Substitute it here.
2278 (type_dependent_expression_p): Return true if it's set.
2279 * semantics.c (finish_decltype_type): Instantiate such a variable.
2280 * typeck.c (cxx_sizeof_expr): Likewise.
2281 (strip_array_domain): New.
2284 * name-lookup.c (current_decl_namespace): Non-static.
2285 (pop_nested_namespace): Sanity check.
2286 * cp-tree.h: Declare current_decl_namespace.
2287 * decl.c (grokvardecl): Use it instead of current_namespace.
2288 (grokfndecl): Likewise.
2291 * pt.c (tsubst_friend_function): Instatiate a friend that has already
2294 * pt.c (print_template_statistics): New.
2295 * cp-tree.h: Declare it.
2296 * tree.c (cxx_print_statistics): Call it.
2299 * decl.c (grokvardecl): Tweak warning message.
2300 (grokfndecl): Likewise.
2302 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2305 *pt.c (tsubst_decl): Get the arguments of a specialization from
2306 the specialization template, not from the most general template.
2308 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2311 * typeck2.c (process_init_constructor_record):
2312 value-initialize members that are are not explicitely
2315 2010-04-07 Jie Zhang <jie@codesourcery.com>
2318 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
2319 when all of its elements are non-constant and have been split out.
2321 2010-04-06 Taras Glek <taras@mozilla.com>
2322 Jason Merrill <jason@redhat.com>
2324 * parser.c (cp_parser_class_specifier): Set class location to that
2325 of IDENTIFIER_NODE instead of '{' when possible.
2326 * semantics.c (begin_class_definition): Do not overide locations
2327 with less precise ones.
2329 2010-04-06 Jason Merrill <jason@redhat.com>
2332 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
2335 * pt.c (maybe_update_decl_type): Check the return value from
2338 2010-04-01 Jason Merrill <jason@redhat.com>
2340 * decl.c (next_initializable_field): No longer static.
2341 * cp-tree.h: Declare it.
2342 * call.c (build_aggr_conv): Fail if there are more initializers
2343 than initializable fields.
2345 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
2346 instead of void_zero_node.
2348 2010-03-31 Dodji Seketeli <dodji@redhat.com>
2351 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
2352 * pt.c (end_template_parm_list): Store sibling template parms of
2353 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2354 (push_template_decl_real): Don't store the containing template decl
2355 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
2356 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
2357 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2360 2010-03-30 Jason Merrill <jason@redhat.com>
2363 * pt.c (push_template_decl_real): Deal better with running out of
2364 scopes before running out of template parms.
2368 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
2369 function parameter context. Don't print an error if parsing
2373 * pt.c (more_specialized_fn): Don't control cv-qualifier check
2376 2010-03-26 Jason Merrill <jason@redhat.com>
2379 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
2380 c++0x mode, but not other type-names.
2382 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2385 * pt.c (add_to_template_args): Support NULL ARGS;
2386 (most_specialized_class): call coerce_template_parms on
2387 template arguments passed to get_class_bindings. Use
2388 add_to_template_args.
2389 (unify): Handle VAR_DECLs.
2391 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2393 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
2395 * pt.c (get_template_parms_at_level): Adjust.
2397 2010-03-25 Dodji Seketeli <dodji@redhat.com>
2400 * cp-tree.h (get_template_parms_at_level): Declare ...
2401 * pt.c (get_template_parms_at_level): ... new function.
2402 * typeck.c (get_template_parms_of_dependent_type): If a template
2403 type parm's DECL_CONTEXT isn't yet set, get its siblings from
2404 current_template_parms. Use get_template_parms_at_level. Remove
2406 (incompatible_dependent_types_p): If we get empty parms from just one
2407 of the template type parms we are comparing then the template parms are
2410 2010-03-24 Jason Merrill <jason@redhat.com>
2413 * parser.c (make_declarator): Initialize id_loc.
2414 (cp_parser_lambda_declarator_opt): And set it.
2416 2010-03-23 Jason Merrill <jason@redhat.com>
2418 Make lambda conversion op and op() non-static.
2419 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
2420 Also add the thunk function returned by the conversion op.
2421 Mark the conversion deleted if the op() is variadic.
2422 * decl2.c (mark_used): Give helpful message about deleted conversion.
2423 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
2424 * semantics.c (finish_this_expr): Adjust.
2425 * mangle.c (write_closure_type_name): Adjust.
2426 * decl.c (grok_op_properties): Don't allow it.
2427 * call.c (build_user_type_conversion_1): No static conversion ops.
2428 (build_op_call): Or op().
2430 * decl2.c (change_return_type): Fix 'this' quals.
2432 2010-03-22 Jason Merrill <jason@redhat.com>
2435 * tree.c (pod_type_p): Use old meaning in C++98 mode.
2438 * pt.c (contains_auto_r): New fn.
2439 (do_auto_deduction): Use it.
2440 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
2442 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
2445 * decl2.c (grokfield): Handle invalid initializers for member
2448 2010-03-20 Dodji Seketeli <dodji@redhat.com>
2451 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
2453 * decl2.c (vague_linkage_p): Likewise.
2455 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
2458 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
2459 false, in the cp_parser_expression_statement call.
2461 2010-03-05 Jason Merrill <jason@redhat.com>
2463 * mangle.c (mangle_decl): Give name collision error even without
2466 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
2468 * pt.c (process_partial_specialization): Use error_n instead of
2471 2010-03-03 Jason Merrill <jason@redhat.com>
2474 * mangle.c (mangle_decl): Handle VAR_DECL, too.
2476 2010-03-03 Jason Merrill <jason@redhat.com>
2479 * mangle.c: Include cgraph.h.
2480 (mangle_decl): If the mangled name will change in a later
2481 ABI version, make the later mangled name an alias.
2482 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
2483 * Make-lang.in (mangle.o): Depend on cgraph.h.
2484 * method.c (make_alias_for): Handle VAR_DECL, too.
2485 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
2486 * tree.c (no_linkage_check): Adjust.
2487 * decl.c (maybe_commonize_var): Adjust.
2488 * cp-tree.h: Adjust.
2490 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
2492 * pt.c (redeclare_class_template): Use error_n and inform_n.
2494 2010-02-27 Mark Mitchell <mark@codesourcery.com>
2497 * cp-tree.h (push_tinst_level): Declare.
2498 (pop_tinst_level): Likewise.
2499 * pt.c (push_tinst_level): Give it external linkage.
2500 (pop_tinst_level): Likewise.
2501 * mangle.c (mangle_decl_string): Set the source location to that
2502 of the decl while mangling.
2504 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
2507 * pt.c (redeclare_class_template): Return false if there are erroneous
2508 template parameters.
2510 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
2512 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
2515 2010-02-24 Jason Merrill <jason@redhat.com>
2518 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
2520 * class.c (layout_class_type): Don't give -Wabi warning for a bug
2521 in a previous ABI version.
2523 2010-02-23 Jason Merrill <jason@redhat.com>
2526 * typeck2.c (digest_init_r): Accept value init of array.
2528 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
2531 * typeck.c (convert_arguments): Update error message.
2533 2010-02-22 Mike Stump <mikestump@comcast.net>
2536 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
2538 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
2541 * error.c (print_instantiation_partial_context_line): New.
2542 (print_instantiation_partial_context): Print at most 12 contexts,
2543 skip the rest with a message.
2545 2010-02-21 Dodji Seketeli <dodji@redhat.com>
2548 * pt.c (lookup_template_class): Better support of specialization
2549 of member of class template implicit instantiation.
2551 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
2554 * call.c (conversion_null_warnings): Replace -Wconversion with
2556 * cvt.c (build_expr_type_conversion): Likewise.
2558 2010-02-18 Jason Merrill <jason@redhat.com>
2561 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
2564 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
2566 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
2567 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
2570 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
2574 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
2575 (maybe_update_decl_type): New fn.
2576 * parser.c (cp_parser_init_declarator): Use it.
2579 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
2581 2010-02-17 Jason Merrill <jason@redhat.com>
2584 * call.c (build_over_call): Don't create zero-sized assignments.
2585 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
2586 * cp-objcp-common.c (cp_expr_size): Remove.
2587 * cp-tree.h: Remove prototype.
2590 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
2591 decl we looked up doesn't match.
2594 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
2595 have an INIT_EXPR anymore.
2598 * pt.c (convert_nontype_argument): Change assert to test.
2600 2010-02-16 Jason Merrill <jason@redhat.com>
2602 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
2605 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
2606 VIEW_CONVERT_EXPR for conversions between structural equality types
2607 that the back end can't tell are the same.
2610 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
2611 cv-quals from element here.
2612 (cp_build_qualified_type_real): Not here. Preserve typedef name.
2614 2010-02-14 Jason Merrill <jason@redhat.com>
2617 * semantics.c (finish_compound_literal): Use
2618 cp_apply_type_quals_to_decl when creating a static variable.
2620 2010-02-12 Jason Merrill <jason@redhat.com>
2623 * name-lookup.h (current_binding_level): Check for null
2626 2010-02-12 Jason Merrill <jason@redhat.com>
2629 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
2631 2010-02-12 Jakub Jelinek <jakub@redhat.com>
2634 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
2637 2010-02-10 Jason Merrill <jason@redhat.com>
2640 * semantics.c (outer_lambda_capture_p): Revert.
2641 (add_capture): Only finish_member_declaration if
2642 we're in the lambda class.
2643 (register_capture_members): New.
2644 * cp-tree.h: Declare it.
2645 * parser.c (cp_parser_lambda_expression): Call it.
2647 2010-02-10 Jason Merrill <jason@redhat.com>
2650 * semantics.c (outer_lambda_capture_p): Use current_function_decl
2651 instead of current_class_type.
2653 2010-02-10 Jason Merrill <jason@redhat.com>
2655 PR c++/42983, core issue 906
2656 * method.c (defaultable_fn_check): Check virtualness.
2658 2010-02-10 Jason Merrill <jason@redhat.com>
2661 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
2663 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
2665 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
2666 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
2668 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
2669 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
2670 (cp_parser_parameter_declaration)
2671 (cp_parser_exception_specification_opt)
2672 (cp_parser_exception_declaration): Likewise.
2673 * pt.c (check_default_tmpl_args): Likewise.
2674 * search.c (lookup_field_r): Likewise.
2676 2010-02-09 Jason Merrill <jason@redhat.com>
2679 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
2681 2010-02-09 Jason Merrill <jason@redhat.com>
2684 * decl2.c (change_return_type): New fn.
2685 * semantics.c (apply_lambda_return_type): Use it.
2686 * cp-tree.h: Declare it.
2688 2010-02-05 Richard Guenther <rguenther@suse.de>
2690 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
2691 * cp-lang.c: Include gt-cp-cp-lang.h.
2692 * config-lang.in (gtfiles): Add cp/cp-lang.c.
2694 2010-02-05 Dodji Seketeli <dodji@redhat.com>
2697 * typeck.c (get_template_parms_of_dependent_type): Try getting
2698 the template parameters fromt the type itself first.
2700 2010-02-03 Jason Merrill <jason@redhat.com>
2704 * mangle.c (write_unqualified_id): Split out from write_expression.
2705 (write_unqualified_name): Call it.
2706 (write_member_name): Likewise.
2707 (write_expression): Support TEMPLATE_ID_EXPR.
2708 Disambiguate operator names.
2711 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
2714 2010-02-02 Jason Merrill <jason@redhat.com>
2717 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
2718 * optimize.c (clone_body): Remap their initializers when making base
2720 (maybe_clone_body): Complain if multiple clones aren't safe.
2722 2010-01-29 Dodji Seketeli <dodji@redhat.com>
2729 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
2730 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
2731 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
2732 * pt.c (coerce_template_parms, type_unification_real,
2733 expand_template_argument_pack, coerce_template_parameter_pack):
2734 Set the non default template args count.
2735 (current_template_args): Always set non defaulted
2736 template args count when compiled with --enable-checking
2737 (tsubst_template_args, type_unification_real): Propagate the non
2738 defaulted template args count.
2739 * error.c (get_non_default_template_args_count): Renamed
2740 count_non_default_template_args into this. Don't calculate the
2741 non default template argument count anymore. Use the new
2742 accessor macros above to get it.
2743 (dump_template_argument_list, dump_type, dump_decl,
2744 dump_template_parms): Adjust.
2745 * parser.c (cp_parser_template_argument_list): Always set defaulted
2746 template args count when compiled with --enable-checking.
2748 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
2750 * decl.c (redeclaration_error_message): Wrap the return messages into
2751 G_() for easy translation.
2753 2010-01-28 Jason Merrill <jason@redhat.com>
2756 * semantics.c (begin_class_definition): Don't use type_as_string.
2758 2010-01-28 Dodji Seketeli <dodji@redhat.com>
2762 * typeck.c (get_template_parms_of_dependent_type): Factorized
2763 this out of incompatible_template_type_parms_p
2764 (incompatible_dependent_types_p): Renamed
2765 incompatible_template_type_parms_p into this. Make it detect
2766 two incompatible dependent typedefs too.
2767 (structural_comptypes): Use incompatible_dependent_types_p.
2768 * pt.c (get_template_info):
2769 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
2771 2010-01-20 Janis Johnson <janis187@us.ibm.com>
2772 Jason Merrill <jason@redhat.com>
2774 * mangle.c (write_type): Mangle transparent record as member type.
2775 * semantics.c (begin_class_definition): Recognize decimal classes
2776 and set TYPE_TRANSPARENT_AGGR.
2778 2010-01-20 Jason Merrill <jason@redhat.com>
2781 * mangle.c (write_expression): Handle tree codes that have extra
2782 arguments in the middle-end.
2784 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
2787 * except.c (expand_start_catch_block): Deal correctly with
2788 do_begin_catch returning error_mark_node.
2790 2010-01-20 Jason Merrill <jason@redhat.com>
2793 * class.c (layout_class_type): Set packed_maybe_necessary for packed
2797 * semantics.c (build_lambda_object): Call mark_used on captured
2801 * decl.c (grokdeclarator): Clear type_quals for a member function
2802 declared using a typedef. Don't complain about adding cv-quals
2803 to a function typedef in C++0x mode.
2805 2010-01-20 Jakub Jelinek <jakub@redhat.com>
2807 * decl.c (create_array_type_for_decl): Remove set but not used
2808 variable error_msg. Remove break stmts after return stmts.
2810 2010-01-19 Dodji Seketeli <dodji@redhat.com>
2812 * error.c (dump_template_parms, count_non_default_template_args):
2813 Revert fix of PR c++/42634.
2815 2010-01-18 Dodji Seketeli <dodji@redhat.com>
2818 * error.c (dump_template_parms): Use innermost template
2819 arguments before calling count_non_default_template_args.
2820 (count_non_default_template_args): We are being called with
2821 template innermost arguments now. There is no need to ensure
2824 2010-01-18 Dodji Seketeli <dodji@redhat.com>
2827 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
2829 2010-01-17 Dodji Seketeli <dodji@redhat.com>
2832 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
2834 2010-01-17 Dodji Seketeli <dodji@redhat.com>
2837 *pt.c (tsubst_decl): Get the arguments of a specialization from
2838 the specialization template, not from the most general template.
2840 2010-01-16 Jason Merrill <jason@redhat.com>
2843 * semantics.c (finish_decltype_type): Within a template, treat
2844 unresolved CALL_EXPR as dependent.
2846 2010-01-15 Dodji Seketeli <dodji@redhat.com>
2848 * error.c (dump_template_parms,count_non_default_template_args):
2849 Revert changes of PR c++/42634.
2851 2010-01-14 Jakub Jelinek <jakub@redhat.com>
2854 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
2855 functions with noreturn attribute.
2857 2010-01-14 Jason Merrill <jason@redhat.com>
2860 * call.c (build_new_method_call): Don't free the vec here.
2863 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
2865 2010-01-13 Dodji Seketeli <dodji@redhat.com>
2868 * error.c (dump_template_parms): Use innermost template
2869 arguments before calling count_non_default_template_args.
2870 (count_non_default_template_args): We are being called with
2871 template innermost arguments now. There is no need to ensure
2874 2010-01-07 Dodji Seketeli <dodji@redhat.com>
2877 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
2878 arguments that were previously deduced.
2880 2010-01-05 Jason Merrill <jason@redhat.com>
2882 * pt.c (unify_pack_expansion): Handle deduction from init-list.
2883 * call.c (build_over_call): Don't complain about it.
2885 2010-01-04 Jason Merrill <jason@redhat.com>
2888 * pt.c (tsubst_decl): Don't apply type attributes in place.
2891 * semantics.c (describable_type): Remove decltype comment and
2896 Copyright (C) 2010 Free Software Foundation, Inc.
2898 Copying and distribution of this file, with or without modification,
2899 are permitted in any medium without royalty provided the copyright
2900 notice and this notice are preserved.