1 2010-10-11 Martin Jambor <mjambor@suse.cz>
4 * cp-tree.h (current_class_ref): Check that cp_function_chain is
6 * call.c (build_cxx_call): Likewise.
8 2010-10-10 Jason Merrill <jason@redhat.com>
10 * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
11 (tsubst_default_arguments): Only do this once for cloned fns.
12 (tsubst): Use typedef_variant_p. Handle LANG_TYPE. Don't
14 (tsubst_expr): Avoid calling tsubst_expr for non-expressions.
15 (tsubst_copy_and_build): Likewise.
16 (tsubst_initializer_list): Likewise.
17 (tsubst_copy): Change default to gcc_unreachable. Handle
18 OVERLOAD and PTRMEM_CST.
20 2010-10-10 Jason Merrill <jason@redhat.com>
24 * pt.c (tsubst_copy) [INTEGER_CST]: Instantiate the type.
26 2010-10-07 Andi Kleen <ak@linux.intel.com>
28 * Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
29 (cc1plus-dummy): Remove.
30 (cc1plus-checksum): Change to run checksum over object files
33 2010-10-08 Joseph Myers <joseph@codesourcery.com>
35 * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
37 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
39 * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to
41 * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for
43 * error.c (dump_expr): Added case for AT_ENCODE_EXPR.
44 * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR.
45 (value_dependent_expression_p): Added case for AT_ENCODE_EXPR.
46 (type_dependent_expression_p): Added case for AT_ENCODE_EXPR.
47 * parser.c (cp_parser_objc_encode_expression): Updated comment.
49 2010-10-07 Nicola Pero <nicola@nicola.brainstorm.co.uk>
51 Merge from apple/trunk branch on FSF servers.
53 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
56 * parser.c (cp_parser_objc_interstitial_code): Recognize
57 and parse RID_NAMESPACE keyword.
59 2010-10-07 Iain Sandoe <iains@gcc.gnu.org>
61 * parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
62 finding ellipsis, before checking for attributes.
64 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
66 Merge from apple/trunk branch on FSF servers.
67 * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
68 longer existing gcc/c-common.def.
70 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
73 * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
74 * parser.c (cp_parser_objc_encode_expression): Build a templatized
75 parse tree for @encode(T).
77 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
80 * c-common.def: Add new expression code AT_ENCODE_EXPR.
82 2010-10-06 Eric Botcazou <ebotcazou@adacore.com>
85 * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
86 code folding offsetof-like computations.
88 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
91 * parser.c (cp_parser_objc_class_interface): If no identifier
92 follows an @interface token, stop parsing the interface after
94 (cp_parser_objc_class_implementation): If no identifier follows an
95 @implementation token, stop parsing the implementation after
98 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
101 * parser.c (cp_parser_objc_method_keyword_params): If the required
102 colon is not found while parsing parameters, stop parsing them.
104 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
107 * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
108 @end after detecting it. Print an error if @end is found without
110 (cp_parser_objc_method_prototype_list): Do not eat the EOF after
111 detecting it. Fixed reading the next token when continuing
112 because of an error in a method signature. Print an error if EOF
113 is found without an '@end'.
114 (cp_parser_objc_method_definition_list): Same change.
116 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
118 Merge from apple/trunk branch on FSF servers:
120 2005-10-17 Fariborz Jahanian <fjahanian@apple.com>
123 * parser.c (cp_parser_objc_method_keyword_params): Check for valid
124 method parameters and issue error.
125 (cp_parser_objc_method_definition_list): Check for invalid tokens
126 which cannot start a function definition.
128 2005-10-14 Fariborz Jahanian <fjahanian@apple.com>
131 * parser.c (cp_parser_objc_message_args): Check for missing message
132 arguments and syntax error.
134 2005-10-13 Fariborz Jahanian <fjahanian@apple.com>
137 * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
140 2005-08-15 Ziemowit Laski <zlaski@apple.com>
143 * parser.c (cp_parser_objc_interstitial_code): Catch stray
144 '{' and '}' tokens and issue appropriate errors.
146 2005-08-02 Ziemowit Laski <zlaski@apple.com>
149 (cp_parser_statement_seq_opt): In addition to '}' and
150 end-of-file, a statement sequence may also be terminated
153 2010-10-05 Joseph Myers <joseph@codesourcery.com>
155 * cp-tree.h (cxx_print_error_function,
156 cxx_initialize_diagnostics): Declare using diagnostic_context
159 2010-10-04 Andi Kleen <ak@linux.intel.com>
161 * Make-lang.in (g++, cc1plus): Add + to build rule.
163 2010-10-04 Jason Merrill <jason@redhat.com>
165 * tree.c (decl_storage_duration): New.
166 * cp-tree.h: Declare it.
167 (duration_kind): Return values.
169 2010-10-03 Jason Merrill <jason@redhat.com>
171 * typeck.c (require_complete_type_sfinae): Add complain parm to...
172 (require_complete_type): ...this function.
173 (cp_build_array_ref, convert_arguments): Use it.
174 (convert_for_initialization, cp_build_modify_expr): Likewise.
175 * cp-tree.h: Declare it.
176 * call.c (build_over_call): Use it.
178 2010-09-30 Iain Sandoe <iains@gcc.gnu.org>
180 merge from FSF 'apple/trunk' branch.
181 2006-01-30 Fariborz Jahanian <fjahanian@apple.com>
184 * cp/parser.c (cp_parser_objc_interstitial_code): For
185 @optional/@required set the optional/required flag.
187 2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>
189 * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
190 and indentation when finding an Objective-C++ CPP_AT_NAME token.
192 2010-09-29 Richard Guenther <rguenther@suse.de>
194 * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
195 (CP_TYPE_CONTEXT): Similar.
196 (FROB_CONTEXT): Frob global_namespace to the global
197 TRANSLATION_UNIT_DECL.
198 * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
199 set DECL_CONTEXT of global_namespace to it.
200 (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
201 instead of zeroing context.
202 (cp_finish_decl): Use DECL_FILE_SCOPE_P.
203 (grokfndecl): Likewise.
204 (start_preparsed_function): Likewise.
205 * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
206 (namespace_binding): Use SCOPE_FILE_SCOPE_P.
207 * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
208 (is_specialization_of_friend): Use CP_DECL_CONTEXT.
209 (push_template_decl_real): Likewise.
210 (tsubst_friend_class): Likewise. Adjust context comparisons.
211 (instantiate_class_template): Use CP_TYPE_CONTEXT.
212 (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
213 * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
216 2010-09-29 Yao Qi <yao@codesourcery.com>
218 * decl.c (get_atexit_node): Fix typo.
220 2010-09-28 Jason Merrill <jason@redhat.com>
222 * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
223 (real_lvalue_p): Take const_tree.
225 * typeck.c (lvalue_or_else): Make temporary arg a permerror.
226 (cp_build_addr_expr_1): Likewise.
228 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
230 Partially merged from apple/trunk branch on FSF servers:
231 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
232 Radar 3803157 (method attributes)
234 * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
235 (cp_parser_objc_method_tail_params_opt): Likewise.
236 (cp_parser_objc_method_signature): Likewise.
237 (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
238 (cp_parser_objc_method_prototype_list): Handle attributes.
239 (cp_parser_objc_method_definition_list): Likewise.
241 2010-09-28 Richard Henderson <rth@redhat.com>
243 * cp-lang.c: Include "target.h".
244 (cp_eh_personality): Use targetm.except_unwind_info.
245 * Make-lang.in (cp-lang.o): Update deps.
247 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
249 * parser.c (cp_parser_objc_valid_prefix_attributes): New.
250 (cp_parser_declaration): Parse prefix attributes for ObjC++.
251 (cp_parser_objc_protocol_declaration): Handle attributes.
252 (cp_parser_objc_class_interface): Likewise.
253 (cp_parser_objc_declaration): Likewise.
255 2010-09-27 Jason Merrill <jason@redhat.com>
257 Require lvalues as specified by the standard.
258 * typeck.c (lvalue_or_else): Use real_lvalue_p.
259 (cp_build_addr_expr_1): Split out of cp_build_unary_op.
260 (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
261 (decay_conversion, get_member_function_from_ptrfunc): Adjust.
262 (build_x_unary_op, build_reinterpret_cast_1): Adjust.
263 (build_const_cast_1): Adjust.
264 * cp-tree.h: Declare new fns.
265 * call.c (build_this, convert_like_real, build_over_call): Adjust.
266 (initialize_reference): Adjust.
267 * class.c (build_base_path, convert_to_base_statically): Adjust.
268 (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
269 * cvt.c (build_up_reference, convert_to_reference): Adjust.
270 * decl.c (register_dtor_fn): Adjust.
271 * decl2.c (build_offset_ref_call_from_tree): Adjust.
272 * except.c (initialize_handler_parm): Adjust.
273 * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
274 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
275 * tree.c (stabilize_expr): Adjust.
277 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
279 Merge from apple/trunk branch on FSF servers:
281 2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
284 * typeck.c (composite_pointer_type): Call objc_have_common_type
285 when comparing two objective-c pointer types.
287 2005-07-18 Ziemowit Laski <zlaski@apple.com>
290 * call.c (standard_conversion): Do not issue warnings when
291 comparing ObjC pointer types.
293 2005-06-22 Ziemowit Laski <zlaski@apple.com>
296 * call.c (standard_conversion): Allow for a pointer conversion
297 between any two ObjC pointer types.
298 * typeck.c (composite_pointer_type): Determine common type
299 for two ObjC pointer types.
301 2010-09-24 Jan Hubicka <jh@suse.cz>
303 * decl.c (finish_function): Use decl_replaceable_p
304 * method.c (make_alias_for_thunk): Update call of cgraph_same_body_alias.
306 2010-09-24 Jason Merrill <jason@redhat.com>
308 * decl.c (compute_array_index_type): Remember type dependence of
310 * pt.c (dependent_type_p_r): Don't recompute it here.
312 * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
313 reference and pointer to the same type as "*" or "&".
315 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
317 * typeck.c (warn_args_num): Use warning 'too many arguments to
318 method [methodname]' for an Objective-C method instead of the less
319 satisfactory 'too many arguments to function' (with no method
322 2010-09-21 Jason Merrill <jason@redhat.com>
324 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
325 special handling if we know the member.
327 2010-09-18 Jason Merrill <jason@redhat.com>
329 * call.c (compare_ics): Do lvalue/rvalue reference binding
330 comparison for ck_list, too.
332 2010-09-15 Jason Merrill <jason@redhat.com>
334 * semantics.c (finish_id_expression): Diagnose use of function
335 parms in evaluated context outside function body.
337 * decl2.c (grokbitfield): Diagnose non-integral width.
339 * call.c (convert_like_real): Use the underlying type of the
340 reference for the temporary.
342 2010-09-15 Jakub Jelinek <jakub@redhat.com>
345 * class.c (build_vtbl_initializer): Use fn instead of init's operand
346 as first argument to FDESC_EXPR.
348 2010-09-15 Paolo Carlini <paolo.carlini@oracle.com>
351 * decl.c (grokdeclarator): Check build_memfn_type return value
354 2010-09-13 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
356 * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
357 (begin_range_for_stmt): Likewise.
359 2010-09-11 Rodrigo Rivas <rodrigorivascosta@gmail.com>
361 Implement range-based for-statements.
362 * cp-tree.def (RANGE_FOR_STMT): New.
363 * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
364 (cp_convert_range_for): Declare.
365 * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
366 (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
367 * semantics.c (begin_range_for_stmt): New.
368 (finish_range_for_decl): New.
369 (finish_for_stmt): Accept also RANGE_FOR_STMT.
370 (perform_koenig_lookup): Add extra argument include_std.
371 * parser.c (cp_parser_c_for): New with code from
372 cp_parser_iteration_statement().
373 (cp_parser_range_for): New.
374 (cp_convert_range_for): New.
375 (cp_parser_iteration_statement): Add range-for support.
376 (cp_parser_condition): Adjust comment.
377 (cp_parser_postfix_expression): perform_koenig_lookup takes extra
379 * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
380 * cxx-pretty-print.c: Likewise.
381 * lex.c (cxx_init): Likewise.
382 * name-lookup.c (lookup_function_nonclass): Add extra argument
384 (lookup_arg_dependent): Likewise.
385 * name-lookup.h: Likewise.
387 2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
390 * error.c (maybe_warn_cpp0x): Add new warning
391 CPP0X_INLINE_NAMESPACES.
392 * parser.c (cp_parser_namespace_definition): Likewise.
393 * cp-tree.h (cpp0x_warn_str): Likewise.
395 2010-09-10 Richard Guenther <rguenther@suse.de>
397 * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
398 TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
400 2010-09-10 Jan Hubicka <jh@suse.cz>
402 PR tree-optimization/45605
403 * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
406 2010-09-08 Jakub Jelinek <jakub@redhat.com>
409 * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
410 before calling fold_decl_constant_value.
412 2010-09-07 Arnaud Charlet <charlet@adacore.com>
414 * cp-tree.h (build_enumerator): Add new location_t parameter.
415 (build_lang_decl_loc): New function.
416 * decl.c (build_enumerator): New parameter loc. Use it when calling
417 build_decl. Replace build_lang_decl with build_lang_decl_loc.
418 * pt.c (tsubst_enum): Adjust call to build_enumerator.
419 * parser.c (cp_parser_enumerator_definition): Ditto.
420 * lex.c (build_lang_decl_loc): New function.
422 2010-09-06 Dodji Seketeli <dodji@redhat.com>
427 * tree.c (strip_typedefs): Strip typedefs from the context of
430 2010-09-06 Mark Mitchell <mark@codesourcery.com>
432 * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
433 * call.c (build_conditional_expr): Likewise.
434 (convert_arg_to_ellipsis): Likewise.
436 2010-09-06 Arnaud Charlet <charlet@adacore.com>
438 * parser.c (make_pointer_declarator, make_reference_declarator,
439 make_call_declarator, make_array_declarator): Set declarator->id_loc.
440 (cp_parser_init_declarator): Adjust location of decl if appropriate.
442 2010-09-06 Jason Merrill <jason@redhat.com>
444 * call.c (implicit_conversion): Fix value-init of enums.
445 (convert_like_real): Likewise.
447 * decl.c (cp_finish_decl): Don't change init for auto deduction.
449 * pt.c (fold_non_dependent_expr_sfinae): Split out from...
450 (fold_non_dependent_expr): ...here.
451 (convert_nontype_argument): Use it. Take complain parm.
452 Use perform_implicit_conversion instead of ocp_convert.
453 Allow cv-qual changes.
454 (convert_template_argument): Pass complain down.
455 (tsubst_template_arg): Suppress constant expression warnings.
458 * method.c (synthesized_method_walk): In constructors, also check
459 subobject destructors.
461 * semantics.c (finish_compound_literal): Always build a
464 2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
467 * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
469 2010-08-30 Jakub Jelinek <jakub@redhat.com>
472 * parser.c (cp_parser_omp_atomic): Handle boolean
473 {PRE,POST}_INCREMENT.
475 2010-08-29 Jason Merrill <jason@redhat.com>
478 * parser.c (cp_parser_parameter_declaration): Pop parameter decls
479 after tentative parsing.
481 2010-08-22 Joseph Myers <joseph@codesourcery.com>
483 * Make-lang.in (g++spec.o): Update dependencies.
484 * g++spec.c: Include opts.h
485 (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
486 (lang_specific_driver): Use cl_decoded_option structures.
488 2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
490 * call.c: Use FOR_EACH_VEC_ELT.
495 * except.c: Likewise.
496 * mangle.c: Likewise.
497 * method.c: Likewise.
498 * name-lookup.c: Likewise.
499 * parser.c: Likewise.
502 * semantics.c: Likewise.
503 * typeck2.c: Likewise.
505 2010-08-19 Jason Merrill <jason@redhat.com>
507 * call.c (reference_related_p): Check for error_mark_node.
508 (add_function_candidate): Check it instead of
509 same_type_ignoring_top_level_qualifiers_p.
512 * init.c (build_new_1): Don't use build_value_init in a template.
513 (build_value_init): Make sure we don't.
516 * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
517 of empty class CONSTRUCTOR.
519 * except.c (pending_noexcept, pending_noexcept_checks): New.
520 (perform_deferred_noexcept_checks): New.
521 (maybe_noexcept_warning): Split from...
522 (finish_noexcept_expr): ...here. Adjust.
523 * decl2.c (cp_write_global_declarations): Call
524 perform_deferred_noexcept_checks.
525 * cp-tree.h: And declare it.
527 2010-08-18 Nathan Froyd <froydnj@codesourcery.com>
530 * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
533 2010-08-17 Kai Tietz <kai.tietz@onevision.com>
535 * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
536 or if -fms-extensions is enabled check, check permissive.
538 2010-08-09 Jason Merrill <jason@redhat.com>
541 * pt.c (lookup_template_class): Don't re-coerce outer parms.
543 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
545 * call.c (add_builtin_candidates): Use VECs for local variable
546 `types'. Adjust remainder of function accordingly.
548 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
550 * name-lookup.c (is_associated_namespace): Convert local variables
551 to be VECs instead of TREE_LISTs.
553 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
555 * tree.c (varargs_function_p): Use stdarg_p.
557 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
559 * parser.c (cp_default_arg_entry): Declare. Declare a VEC of it.
560 (cp_unparsed_functions_entry): Declare. Declare a VEC of it.
561 (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
562 Change type to a VEC.
563 (unparsed_funs_with_default_args): Define.
564 (unparsed_funs_with_definitions): Define.
565 (push_unparsed_function_queues): New function.
566 (cp_parser_new): Call it.
567 (pop_unparsed_function_queues): New function.
568 (cp_parser_class_specifier): Adjust processing of unparsed functions.
569 (cp_parser_template_declaration_after_export): Use VEC_safe_push.
570 (cp_parser_save_member_function_body): Likewise.
571 (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
572 and pop_unparsed_function_queues.
573 (cp_parser_late_parsing_default_args): Likewise.
574 (cp_parser_save_default_args): Use VEC_safe_push.
576 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
578 * name-lookup.h (cp_label_binding): Declare. Declare a VEC type
580 (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
582 * decl.c (poplevel): Adjust for type changes.
583 (declare_local_label): Likewise.
585 2010-08-06 Jason Merrill <jason@redhat.com>
587 * typeck.c (complete_type_or_maybe_complain): Split out from...
588 (complete_type_or_else): Here.
589 (build_class_member_access_expr): Call it.
590 (finish_class_member_access_expr): Likewise.
591 * call.c (build_special_member_call): Likewise.
592 * cvt.c (build_expr_type_conversion): Likewise.
593 * init.c (build_new): Likewise.
594 * typeck2.c (build_functional_cast): Likewise.
595 * cp-tree.h: Declare it.
597 * init.c (build_value_init): Add complain parm.
598 (build_value_init_noctor): Likewise.
599 (perform_member_init): Pass it.
600 (expand_aggr_init_1): Likewise.
601 (build_new_1): Likewise.
602 (build_vec_init): Likewise.
603 * pt.c (tsubst_expr): Likewise.
604 * typeck2.c (build_functional_cast): Likewise.
606 * tree.c (build_target_expr_with_type): Handle error_mark_node.
608 * typeck.c (decay_conversion): Any expression with type nullptr_t
611 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
614 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
616 2010-07-27 Jason Merrill <jason@redhat.com>
618 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
619 from build_value_init.
620 * init.c (build_value_init_noctor): Give error for unknown array
623 2010-07-27 Joseph Myers <joseph@codesourcery.com>
625 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
627 2010-07-27 Joseph Myers <joseph@codesourcery.com>
629 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
630 c_common_initialize_diagnostics.
631 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
632 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
634 2010-07-21 Jason Merrill <jason@redhat.com>
636 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
638 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
641 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
644 * pt.c (instantiate_class_template): Propagate the template's
645 location to its instance.
647 2010-07-20 Jason Merrill <jason@redhat.com>
650 * pt.c (tsubst_copy_and_build): Rework last change.
653 * pt.c (tsubst_copy_and_build): Handle partial substitution of
656 2010-07-19 Jason Merrill <jason@redhat.com>
659 * semantics.c (finish_decltype_type): Correct decltype
660 of parenthesized rvalue reference variable.
663 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
664 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
666 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
669 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
671 * cp-tree.h: Adjust declaration.
672 * init.c (perform_member_init): Adjust caller.
673 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
674 * typeck2.c (store_init_value): Likewise.
675 (build_functional_cast): Pass complain argument to
676 build_x_compound_expr_from_list.
678 2010-07-16 Jason Merrill <jason@redhat.com>
681 * pt.c (process_partial_specialization): Diagnose partial
682 specialization after instantiation.
683 (most_specialized_class): Add complain parm.
685 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
687 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
689 * init.c (build_new_1): Use cp_build_function_call_nary instead of
690 cp_build_function_call.
692 2010-07-15 Jason Merrill <jason@redhat.com>
695 * call.c (add_function_candidate): If we're working on an implicit
696 declaration, don't consider candidates that won't match.
697 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
698 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
701 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
702 (TYPE_HAS_USER_OPEQ): New.
703 * decl.c (grok_special_member_properties): Set it.
704 * class.c (add_implicitly_declared_members): Don't lazily declare
705 constructors/operator= if a base or member has a user-declared one.
706 (check_bases_and_members, check_bases): Adjust.
707 (check_field_decls, check_field_decl): Adjust.
709 2010-07-15 Anatoly Sokolov <aesok@post.ru>
711 * decl.c (integer_three_node): Remove.
712 (cxx_init_decl_processing): Do not initialize the integer_three_node.
713 * cp-tree.h (integer_three_node): Remove.
715 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
717 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
720 * cp-gimplify.c: Likewise.
724 * mangle.c: Likewise.
725 * name-lookup.c: Likewise.
726 * optimize.c: Likewise.
727 * parser.c: Likewise.
730 * search.c: Likewise.
731 * semantics.c: Likewise.
732 * typeck.c: Likewise.
733 * typeck2.c: Likewise.
735 2010-07-14 Jason Merrill <jason@redhat.com>
737 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
738 (build_field_list): Cache field type.
740 Implement C++0x unrestricted unions (N2544)
741 * class.c (check_field_decl): Loosen union handling in C++0x.
742 * method.c (walk_field_subobs): Split out from...
743 (synthesized_method_walk): ...here. Set msg before loops.
744 (process_subob_fn): Check for triviality in union members.
745 * init.c (sort_mem_initializers): Splice out uninitialized
746 anonymous unions and union members.
747 (push_base_cleanups): Don't automatically destroy anonymous unions
750 2010-07-13 Jason Merrill <jason@redhat.com>
753 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
754 (TYPE_HAS_USER_OPEQ): New.
755 * decl.c (grok_special_member_properties): Set it.
756 * class.c (add_implicitly_declared_members): Don't lazily declare
757 constructors/operator= if a base or member has a user-declared one.
758 (check_bases_and_members, check_bases): Adjust.
759 (check_field_decls, check_field_decl): Adjust.
760 * method.c (synthesized_method_walk): Initialize check_vdtor.
763 * mangle.c (write_type): Canonicalize.
764 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
765 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
767 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
770 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
772 * typeck.c (get_delta_difference): Update prototype, add a
773 tsubst_flags_t parameter; update get_delta_difference_1 calls and
774 add checks for error_mark_node.
775 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
776 parameter; update lookup_base call.
777 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
778 parameter; update get_delta_difference call and add check for
780 (convert_ptrmem): Update prototype, add a tsubst_flags_t
781 parameter; update get_delta_difference call and add check for
782 error_mark_node; update build_ptrmemfunc call.
783 (build_static_cast_1): Adjust convert_ptrmem call.
784 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
785 (cp_build_unary_op): Adjust build_ptrmemfunc call.
786 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
787 and build_ptrmemfunc calls.
788 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
790 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
793 * call.c (build_temp): Add tsubst_flags_t complain parameter;
794 adjust build_special_member_call call, pass complain.
795 (convert_like_real): Adjust build_temp call, pass complain.
797 2010-07-09 Jason Merrill <jason@redhat.com>
800 * cp-tree.h (BV_LOST_PRIMARY): New macro.
801 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
803 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
805 2010-07-08 Jason Merrill <jason@redhat.com>
808 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
809 virtual bases for covariant thunks.
811 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
813 * cp-tree.h: Do not include toplev.h.
815 2010-07-06 Jason Merrill <jason@redhat.com>
818 * call.c (is_std_init_list): Look through typedefs.
821 * init.c (build_offset_ref): If scope isn't dependent,
822 don't exit early. Look at TYPE_MAIN_VARIANT.
823 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
825 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
827 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
829 * cp-tree.h (impl_conv_void): New type.
830 (convert_to_void): Adjust prototype.
831 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
832 diagnostic for easy translation. Change caller.
833 * typeck.c: Update call to convert_to_void.
834 * semantics.c: Likewise.
837 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
839 * decl.c (cp_finish_decl): Call add_local_decl.
840 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
842 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
844 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
847 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
850 * parser.c (cp_parser_primary_expression): Error if local template is
853 2010-07-02 Le-Chun Wu <lcwu@google.com>
856 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
857 (variable or type) shadows another type.
859 2010-07-02 Jakub Jelinek <jakub@redhat.com>
862 * typeck.c (convert_for_assignment): When converting a convertible
863 vector type or objc++ types, call mark_rvalue_use.
864 * typeck2.c (build_m_component_ref): Use return values from
865 mark_rvalue_use or mark_lvalue_use.
866 * class.c (build_base_path): Likewise.
867 * call.c (build_conditional_expr): Likewise.
869 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
872 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
875 2010-07-01 Richard Guenther <rguenther@suse.de>
877 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
878 predicate we are looking for, allow non-gimplified
881 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
884 * typeck.c (cp_build_unary_op): Early return error_mark_node when
885 arg is NULL_TREE too.
886 * call.c (convert_class_to_reference): Return error_mark_node when
889 2010-06-30 Michael Matz <matz@suse.de>
891 * repo.c (finish_repo): Fix typo.
893 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
895 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
897 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
899 * repo.c (pending_repo): Change type to a VEC.
900 (finish_repo): Adjust for new type of pending_repo.
901 (repo_emit_p): Likewise.
903 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
905 * tree.c: Include gimple.h. Do not include tree-flow.h
906 * decl.c: Do not include tree-flow.h
907 * Make-lang.in: Adjust dependencies.
909 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
911 * decl.c (incomplete_var): Declare. Declare VECs containing them.
912 (incomplete_vars): Adjust comment. Change type to a VEC.
913 (maybe_register_incomplete_var): Adjust for new type.
914 (complete_vars): Adjust iteration over incomplete_vars.
916 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
918 * decl.c (struct named_label_entry): Change type of bad_decls field
920 (poplevel_named_label_1): Adjust for new type of bad_decls.
921 (check_goto): Likewise.
923 2010-06-29 Jason Merrill <jason@redhat.com>
925 Enable implicitly declared move constructor/operator= (N3053).
926 * class.c (add_implicitly_declared_members): A class with no
927 explicitly declared copy or move constructor gets both declared
928 implicitly, and similarly for operator=.
929 (check_bases): A type with no copy ctor does not inhibit
930 a const copy ctor in a derived class. It does mean the derived
932 (check_field_decl): Likewise.
933 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
934 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
935 (trivially_copyable_p): Likewise.
936 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
937 * class.c (finish_struct_bits): Likewise.
938 * tree.c (build_target_expr_with_type): Likewise.
939 * typeck2.c (store_init_value): Likewise.
941 Enable implicitly deleted functions (N2346)
942 * class.c (check_bases_and_members): Adjust lambda flags.
943 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
945 * decl2.c (mark_used): Adjust error for use of deleted function.
947 Machinery to support implicit delete/move.
948 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
949 has_complex_move_ctor, has_complex_move_assign bitfields.
950 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
951 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
952 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
953 (enum special_function_kind): Add sfk_move_assignment.
954 (LOOKUP_SPECULATIVE): New.
955 * call.c (build_over_call): Return early if it's set.
956 (build_over_call): Use trivial_fn_p.
957 * class.c (check_bases): If the base has no default constructor,
958 the derived one is non-trivial. Handle move ctor/op=.
959 (check_field_decl): Likewise.
960 (check_bases_and_members): Handle move ctor/op=.
961 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
962 (type_has_move_constructor, type_has_move_assign): New.
963 * decl.c (grok_special_member_properties): Handle move ctor/op=.
964 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
966 (do_build_copy_constructor): Use it.
967 (do_build_assign_ref): Likewise. Handle move assignment.
968 (build_stub_type, build_stub_object, locate_fn_flags): New.
969 (locate_ctor): Use locate_fn_flags.
970 (locate_copy, locate_dtor): Remove.
971 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
972 (process_subob_fn, synthesized_method_walk): New.
973 (maybe_explain_implicit_delete): New.
974 (implicitly_declare_fn): Use synthesized_method_walk,
975 type_has_trivial_fn, and type_set_nontrivial_flag.
976 (defaulted_late_check): Set DECL_DELETED_FN.
977 (defaultable_fn_check): Handle sfk_move_assignment.
978 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
979 implicitly deleted move ctor/op=.
980 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
981 (lookup_fnfields_slot): New.
982 * semantics.c (omp_clause_info_fndecl): Remove.
983 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
984 get_copy_assign, trivial_fn_p.
985 (trait_expr_value): Adjust call to locate_ctor.
986 * tree.c (special_function_p): Handle sfk_move_assignment.
988 * class.c (type_has_virtual_destructor): New.
989 * cp-tree.h: Declare it.
990 * semantics.c (trait_expr_value): Use it.
992 * call.c (build_over_call): Only give warnings with tf_warning.
994 * name-lookup.c (pop_scope): Handle NULL_TREE.
996 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
997 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
998 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
999 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
1000 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
1001 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
1002 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
1003 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
1004 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
1005 (sfk_assignment_operator): Rename to sfk_copy_assignment.
1006 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
1007 * search.c, semantics.c, tree.c: Adjust.
1009 * pt.c (dependent_scope_ref_p): Remove.
1010 (value_dependent_expression_p): Don't call it.
1011 (type_dependent_expression_p): Here either.
1012 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
1013 if the scope isn't dependent.
1015 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
1019 * pt.c (has_value_dependent_address): New.
1020 (value_dependent_expression_p): Check it.
1021 (convert_nontype_argument): Likewise. Call decay_conversion before
1022 folding if we want a pointer.
1023 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
1024 scope is the current instantiation.
1026 2010-06-28 Jakub Jelinek <jakub@redhat.com>
1029 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
1032 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
1034 * init.c: Do not include except.h.
1037 * cp-lang.c: Likewise.
1039 * semantics.c: Likewise.
1040 * decl2.c: Likewise.
1041 * except.c: Likewise.
1042 (init_exception_processing): Do not set the removed
1043 lang_protect_cleanup_actions here.
1044 (cp_protect_cleanup_actions): Make non-static and remove prototype.
1045 (doing_eh): New, moved from except.c but removed the do_warning flag.
1046 (expand_start_catch_block): Update doing_eh call.
1047 (expand_end_catch_block): Likewise.
1048 (build_throw): Likewise.
1049 * cp-tree.h: Prototype cp_protect_cleanup_actions.
1050 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
1051 cp_protect_cleanup_actions.
1052 * Make-lang.in: Update dependencies.
1054 2010-06-26 Jason Merrill <jason@redhat.com>
1056 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
1057 constructor called with a single argument that takes a reference
1058 to the constructor's class.
1059 (BAD_CONVERSION_RANK): New.
1060 (compare_ics): Use it to compare bad ICSes.
1062 2010-06-25 Joseph Myers <joseph@codesourcery.com>
1064 * lang-specs.h: Remove +e handling.
1066 2010-06-24 Andi Kleen <ak@linux.intel.com>
1068 * parser.c: (cp_parser_question_colon_clause):
1069 Switch to use cp_lexer_peek_token.
1070 Call warn_for_omitted_condop. Call pedwarn for omitted
1073 2010-06-22 Jakub Jelinek <jakub@redhat.com>
1076 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
1077 datum and mark_rvalue_use on component.
1080 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
1081 the CALL_EXPR has no arguments.
1083 2010-06-21 Jason Merrill <jason@redhat.com>
1085 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
1087 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
1090 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
1092 * name-lookup.c (struct arg_lookup): Convert namespaces and
1093 classes fields to VEC.
1094 (arg_assoc_namespace): Adjust for new type of namespaces.
1095 (arg_assoc_class): Adjust for new type of classes.
1096 (lookup_arg_dependent): Use make_tree_vector and
1097 release_tree_vector.
1098 * typeck2.c (build_x_arrow): Use vec_member.
1100 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
1103 * error.c (dump_decl): Better wording for anonymous namespace.
1105 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
1107 * class.c (build_vtbl_initializer): Adjust computation of new_position
1108 and which entry to add padding for.
1110 2010-06-16 Jason Merrill <jason@redhat.com>
1112 * except.c (check_noexcept_r): Return the problematic function.
1113 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
1114 * pt.c (tsubst_copy_and_build): Pass it.
1115 * parser.c (cp_parser_unary_expression): Likewise.
1116 * cp-tree.h: Adjust prototype.
1118 * method.c (defaulted_late_check): Give the defaulted method
1119 the same exception specification as the implicit declaration.
1121 2010-06-15 Jason Merrill <jason@redhat.com>
1123 * class.c (add_implicitly_declared_members): Implicit assignment
1124 operators can also be virtual overriders.
1125 * method.c (lazily_declare_fn): Likewise.
1127 * call.c (convert_like_real): Give "initializing argument of"
1128 information for ambiguous conversion. Give source position
1131 * call.c (print_z_candidates): Do print viable deleted candidates.
1132 (joust): Don't choose a deleted function just because its worst
1133 conversion is better than another candidate's worst.
1135 * call.c (convert_like_real): Don't complain about
1136 list-value-initialization from an explicit constructor.
1138 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
1139 DECL_SOURCE_LOCATION directly.
1141 * class.c (type_has_user_provided_default_constructor): Use
1144 * call.c (is_subseq): Handle ck_aggr, ck_list.
1145 (compare_ics): Treat an aggregate or ambiguous conversion to the
1146 same type as involving the same function.
1148 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
1150 * typeck.c (convert_for_assignment): Fix comment. Change message
1151 format from %d to %qP.
1152 (convert_for_initialization): Fix comment.
1154 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
1156 * cp-tree.h (expr_list_kind): New type.
1157 (impl_conv_rhs): New type.
1158 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
1160 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
1161 diagnostics for easy translation. Change caller.
1162 (convert_for_initialization): Use impl_conv_rhs and change caller.
1163 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
1164 diagnostics for easy translation. Change caller.
1165 * decl.c (bad_spec_place): New enum.
1166 (bad_specifiers): Use it and emit the diagnostics for easy
1167 translation. Change caller.
1168 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
1170 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1172 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
1174 * decl2.c (cp_write_global_declarations): Adjust for new type of
1175 decl_namespace_list.
1176 * name-lookup.c (current_decl_namespace): Likewise.
1177 (push_decl_namespace): Likewise.
1178 (pop_decl_namespace): Likewise.
1180 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1182 * call.c (build_java_interface_fn_ref): Call build_function_type_list
1183 instead of build_function_type.
1184 * decl.c (cxx_init_decl_processing): Likewise.
1185 (declare_global_var): Likewise.
1186 (get_atexit_node): Likewise.
1187 (expand_static_init): Likewise.
1188 * decl2.c (start_objects): Likewise.
1189 (start_static_storage_duration_function): Likewise.
1190 * except.c (init_exception_processing): Likewise.
1191 (build_exc_ptr): Likewise.
1192 (build_throw): Likewise.
1193 * rtti.c (throw_bad_cast): Likewise.
1194 (throw_bad_typeid): Likewise.
1195 (build_dynamic_cast_1): Likewise.
1197 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1199 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
1200 (build_op_delete_call): Likewise.
1201 (build_over_call): Likewise.
1202 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1203 * pt.c (process_partial_specialization): Likewise.
1204 (tsubst_template_args): Likewise.
1205 * semantics.c (finish_asm_stmt): Likewise.
1207 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
1209 * decl.c (record_key_method_defined): New, broken out of ...
1210 (finish_function): ... here. Call it.
1211 (start_decl): Treat aliases as definitions.
1213 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1215 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
1217 * pt.c (maybe_process_partial_specialization): Likewise.
1218 (register_specialization): Likewise.
1219 (add_pending_template): Likewise.
1220 (lookup_template_class): Likewise.
1221 (push_tinst_level): Likewise.
1223 * parser.c (cp_lexer_new_main): Likewise.
1224 (cp_lexer_new_from_tokens): Likewise.
1225 (cp_token_cache_new): Likewise.
1226 (cp_parser_context_new): Likewise.
1227 (cp_parser_new): Likewise.
1228 (cp_parser_nested_name_specifier_opt): Likewise.
1229 (cp_parser_template_id): Likewise.
1231 * name-lookup.c (binding_entry_make): Likewise.
1232 (binding_table_construct): Likewise.
1233 (binding_table_new): Likewise.
1234 (cxx_binding_make): Likewise.
1235 (pushdecl_maybe_friend): Likewise.
1236 (begin_scope): Likewise.
1237 (push_to_top_level): Likewise.
1239 * lex.c (init_reswords): Likewise.
1240 (retrofit_lang_decl): Likewise.
1241 (cxx_dup_lang_specific_decl): Likewise.
1242 (copy_lang_type): Likewise.
1243 (cxx_make_type): Likewise.
1245 * decl.c (make_label_decl): Likewise.
1246 (check_goto): Likewise.
1247 (start_preparsed_function): Likewise.
1248 (save_function_data): Likewise.
1250 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
1252 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1254 * class.c (finish_struct_1): Likewise.
1256 * cp-tree.h (struct lang_type): Add variable_size GTY option.
1257 (struct lang_decl): Likewise.
1259 * parser.c (cp_parser_new): Update comment to not reference
1262 2010-06-07 Jason Merrill <jason@redhat.com>
1265 * error.c (dump_parameters): Mask out TFF_SCOPE.
1266 (dump_simple_decl): Don't print the scope of a PARM_DECL.
1267 (dump_scope): Remove no-op mask.
1270 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
1272 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
1273 * init.c (build_offset_ref): Use it.
1274 * pt.c (maybe_process_partial_specialization): Use it.
1275 (instantiate_class_template): Use it.
1276 * search.c (lookup_base): Use it.
1278 2010-06-07 Jakub Jelinek <jakub@redhat.com>
1281 * expr.c (mark_exp_read): Handle INDIRECT_REF.
1282 * cvt.c (convert_to_void): Handle INDIRECT_REF like
1283 handled_component_p.
1286 * decl.c (initialize_local_var): If TREE_USED is set on the type,
1287 set also DECL_READ_P on the decl.
1289 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1292 * cp-tree.h (typedef_variant_p): Move this declaration to
1294 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1295 * decl.c (grokdeclarator): Do not rename debug info of an
1296 anonymous tagged type named by a typedef.
1298 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
1301 * class.c (check_field_decls): Move the call to
1302 check_bitfield_decl before trying to set the
1303 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
1305 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
1307 * typeck.c: Update include path for moved files.
1310 * cp-gimplify.c: Likewise.
1311 * cp-lang.c: Likewise.
1313 * semantics.c: Likewise.
1314 * cxx-pretty-print.h: Likewise.
1315 * decl2.c: Likewise.
1316 * parser.c: Likewise.
1317 * cp-objcp-common.c: Likewise.
1318 * cp-tree.h: Likewise.
1319 * name-lookup.c: Likewise.
1321 * name-lookup.h: Likewise.
1322 * config-lang.in: Update paths in gtfiles for files in c-family/.
1323 * Make-lang.in: Likewise.
1325 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
1327 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
1328 * typeck.c (build_ptrmemfunc): Likewise.
1330 2010-06-04 Jason Merrill <jason@redhat.com>
1332 * typeck2.c (merge_exception_specifiers): Adjust merging of
1333 throw() and noexcept(true).
1335 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
1336 using an uninitialized variable.
1338 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
1339 (pp_cxx_expression): Likewise.
1341 Implement noexcept-specification (15.4)
1342 * parser.c (cp_parser_exception_specification_opt): Parse it.
1343 Give -Wdeprecated warning about throw() specs.
1344 * pt.c (tsubst_exception_specification): Handle it.
1345 * error.c (dump_exception_spec): Handle it.
1346 (dump_expr): Handle NOEXCEPT_EXPR.
1347 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
1348 * typeck.c (comp_except_specs): Handle compatibility rules.
1349 Change exact parm to take an enum.
1350 * typeck2.c (merge_exception_specifiers): Handle noexcept.
1351 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
1352 (type_throw_all_p, build_noexcept_spec): New fns.
1353 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
1354 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
1355 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
1356 (noexcept_true_spec, noexcept_false_spec): New macros.
1357 * name-lookup.c (pushdecl_maybe_friend): Adjust.
1358 * search.c (check_final_overrider): Adjust.
1359 * decl.c (check_redeclaration_exception_specification): Adjust.
1360 (use_eh_spec_block): Use type_throw_all_p.
1361 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
1362 Give operator new a noexcept-specification in C++0x mode.
1363 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
1364 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
1366 Implement noexcept operator (5.3.7)
1367 * cp-tree.def (NOEXCEPT_EXPR): New.
1368 * except.c (check_noexcept_r, finish_noexcept_expr): New.
1369 * cp-tree.h: Declare finish_noexcept_expr.
1370 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
1371 * pt.c (tsubst_copy_and_build): And tsubst it.
1372 (type_dependent_expression_p): Handle it.
1373 (value_dependent_expression_p): Handle it.
1375 * call.c (build_conditional_expr): Never fold in unevaluated context.
1376 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
1377 * semantics.c (simplify_aggr_init_expr): Likewise.
1378 * typeck.c (merge_types): Call merge_exception_specifiers.
1379 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
1380 DECL_ANTICIPATED for preferring new type.
1382 2010-06-04 Joseph Myers <joseph@codesourcery.com>
1384 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
1387 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1390 * typeck.c (build_class_member_access_expr): Call mark_exp_read
1391 on object for static data members.
1393 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1394 Jason Merrill <jason@redhat.com>
1397 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
1398 with the same type, call mark_lvalue_use on both.
1400 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
1402 * class.c (struct vtbl_init_data_s): Remove last_init field.
1403 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
1405 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
1407 (build_vtt): Likewise.
1408 (initialize_vtable): Take a VEC instead of a tree.
1409 (build_vtt_inits): Change return type to void. Take a VEC **
1410 instead of a tree *; accumulate results into said VEC.
1411 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
1412 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
1413 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
1415 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
1416 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
1418 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
1419 rather than tree_cons.
1420 (build_vbase_offset_vtbl_entries): Likewise.
1421 (add_vcall_offset): Likewise.
1422 (build_rtti_vtbl_entries): Likewise.
1423 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
1424 * decl.c (initialize_artificial_var): Use build_constructor instead
1425 of build_constructor_from_list.
1427 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
1430 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
1433 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
1435 * parser.c (cp_parser_mem_initializer_list): Change error text.
1437 2010-06-02 Jakub Jelinek <jakub@redhat.com>
1439 * cp-objcp-common.c (shadowed_var_for_decl): Change into
1440 tree_decl_map hashtab from tree_map.
1441 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
1442 (init_shadowed_var_for_decl): Adjust initialization.
1445 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
1446 instead of calling mark_exp_read only when not an assignment.
1449 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
1450 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
1451 Set DECL_VALUE_EXPR on var.
1453 2010-06-02 Jason Merrill <jason@redhat.com>
1455 * error.c (dump_type): Improve typedef handling.
1460 * name-lookup.c (same_entity_p): New.
1461 (ambiguous_decl): Multiple declarations of the same entity
1464 2010-06-01 Jason Merrill <jason@redhat.com>
1467 * call.c (add_list_candidates): Prefer the default constructor.
1468 (build_aggr_conv): Treat missing initializers like { }.
1469 * typeck2.c (process_init_constructor_record): Likewise.
1470 * init.c (expand_default_init): Use digest_init for
1471 direct aggregate initialization, too.
1473 * call.c (add_list_candidates): Split out...
1474 (build_user_type_conversion_1): ...from here.
1475 (build_new_method_call): And here.
1476 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
1479 * call.c (build_list_conv): Set list-initialization flags properly.
1481 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
1483 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
1485 2010-06-01 Arnaud Charlet <charlet@adacore.com>
1486 Matthew Gingell <gingell@adacore.com>
1488 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
1489 * decl2.c: Include langhooks.h and c-ada-spec.h.
1490 (cpp_check, collect_source_refs, collect_ada_namespace,
1491 collect_all_refs): New functions.
1492 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
1493 * lang-specs.h: Ditto.
1495 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
1497 * cp-tree.h (cp_build_function_call_nary): Declare.
1498 * typeck.c (cp_build_function_call_nary): Define.
1499 * decl.c (register_dtor_fn): Use it instead of
1500 cp_build_function_call.
1501 (cxx_maybe_build_cleanup): Likewise.
1502 * decl2.c (generate_ctor_or_dtor_function): Likewise.
1503 * except.c (do_get_exception_ptr): Likewise.
1504 (do_begin_catch): Likewise.
1505 (do_allocate_exception): Likewise.
1506 (do_free_exception): Likewise.
1507 (build_throw): Likewise. Use cp_build_function_call_vec instead
1508 of cp_build_function_call.
1509 (do_end_catch): Likewise.
1511 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
1513 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
1514 (struct cp_declarator): Move id_loc field up.
1516 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
1518 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
1519 this file is included before c-common.h. Define GCC_DIAG_STYLE
1520 before including diagnostic-core.h and toplev.h.
1521 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
1522 * pt.c: Include cp-tree.h before c-common.h.
1524 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
1526 * tree.c (c_register_addr_space): Add stub.
1528 2010-05-28 Joseph Myers <joseph@codesourcery.com>
1530 * g++spec.c (lang_specific_driver): Use fatal_error instead of
1533 2010-05-28 Dodji Seketeli <dodji@redhat.com>
1535 Revert fix of PR c++/44188
1536 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
1538 * tree.c (typedef_variant_p): Revert moving this definition to
1540 * decl.c (grokdeclarator): Revert naming typedef handling.
1542 2010-05-27 Joseph Myers <joseph@codesourcery.com>
1544 * call.c: Include diagnostic-core.h instead of diagnostic.h.
1545 * cp-lang.c: Don't include diagnostic.h
1546 * name-lookup.c: Include diagnostic-core.h instead of
1548 (cp_emit_debug_info_for_using): Use seen_error.
1549 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
1550 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
1551 * pt.c (iterative_hash_template_arg): Use seen_error.
1552 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
1553 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
1554 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
1555 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
1558 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1561 * cp-tree.h (typedef_variant_p): Move this declaration to
1563 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1564 * decl.c (grokdeclarator): Do not rename debug info of an
1565 anonymous tagged type named by a typedef.
1567 2010-05-27 Jason Merrill <jason@redhat.com>
1570 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
1573 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
1576 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
1577 * class.c (layout_class_type): Likewise.
1578 * decl.c (finish_enum): Likewise.
1579 * mangle.c (write_builitin_type): Likewise.
1581 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
1583 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
1585 * decl.c (grokdeclarator): Handle __int128.
1586 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
1587 (cp_parser_simple_type_specifier): Likewise.
1588 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
1589 * typeck.c (cp_common_type): Handle __int128.
1590 * mangle.c (integer_type_codes): Add itk_int128 and
1591 itk_unsigned_int128.
1593 2010-05-26 Jason Merrill <jason@redhat.com>
1596 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
1599 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
1601 * cp-lang.c: Do not include expr.h.
1603 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
1605 * decl.c: Do not include rtl.h
1606 * semantics.c: Likewise.
1608 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
1610 * cp-tree.h: Do not include splay-tree.h.
1611 (struct prtmem_cst): Remove unused field and false comment.
1612 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
1613 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
1614 * init.c: Do not include rtl.h and expr.h.
1615 * class.c: Do not include rtl.h. Include splay-tree.h.
1616 (build_clone): Use plain NULL instead of NULL_RTX.
1617 * decl.c: Do not include expr.h. Explain why rtl.h has to be
1618 included. Include splay-tree.h.
1619 * method.c: Do not include rtl.h and expr.h.
1620 (use_thunk): Use plain NULL instead of NULL_RTX.
1621 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
1622 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
1623 and target.h. Include splay-tree.h.
1624 * expr.c: Do not include rtl.h and expr.h.
1625 * pt.c: Do not include obstack.h and rtl.h.
1626 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
1627 (tsubst_decl): Likewise.
1628 (instantiate_decl): Likewise.
1629 * semantics.c: Do not include exprt.h and debug.h. Explain why
1630 rtl.h has to be included.
1631 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
1632 * call.c: Do not include rtl.h and expr.h.
1633 * search.c: Do not include obstack.h and rtl.h.
1634 * friend.c: Do not include rtl.h and expr.h.
1635 * Make-lang.in: Update dependencies.
1637 2010-05-25 Jakub Jelinek <jakub@redhat.com>
1640 * parser.c (non_integral_constant): Add NIC_NONE.
1641 (required_token): Add RT_NONE.
1642 (cp_parser_unary_expression): Initialize non_constant_p
1644 (cp_parser_asm_definition): Initialize missing to RT_NONE.
1645 (cp_parser_primary_expression, cp_parser_postfix_expression,
1646 cp_parser_cast_expression, cp_parser_binary_expression,
1647 cp_parser_functional_cast): Fix formatting.
1649 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
1652 * parser.c: Remove inclusion of dyn-string.h.
1653 (non_integral_constant): New enum.
1654 (name_lookup_error): New enum.
1655 (required_token): New enum.
1656 (cp_parser_required_error): New function.
1657 (cp_parser_require): Change the type of variable token_desc to
1658 required_token and use cp_parser_required_error.
1659 (cp_parser_require_keyword): Likewise.
1660 (cp_parser_error): Use gmsgid as parameter.
1661 (cp_parser_name_lookup_error): Change the type of variable desired to
1662 name_lookup_error and put the diagnostic in the full sentences. Change
1664 (cp_parser_non_integral_constant_expression): Change the type of the
1665 variable thing to non_integral_constant and put the diagnostics in
1666 full sentences. Change caller.
1668 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
1671 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
1673 2010-05-24 Joseph Myers <joseph@codesourcery.com>
1675 * error.c (cp_diagnostic_starter): Update call to
1676 diagnostic_build_prefix.
1677 (cp_print_error_function,
1678 print_instantiation_partial_context_line): Check show_column flag
1681 2010-05-24 Jason Merrill <jason@redhat.com>
1684 * decl.c (check_initializer): Don't wrap an init-list in a
1686 * init.c (build_aggr_init): Don't assume copy-initialization if
1687 init has CONSTRUCTOR_IS_DIRECT_INIT.
1688 * call.c (build_new_method_call): Sanity check.
1690 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
1692 * rtti.c (tinfo_base_init): Use build_constructor instead of
1693 build_constructor_from_list. Don't cons a tree node for
1695 (generic_initializer): Use build_constructor_single instead of
1696 build_constructor_from_list.
1697 (ptr_initializer): Use build_constructor instead of
1698 build_constructor_from_list
1699 (ptm_initializer): Likewise.
1700 (class_initializer): Likewise. Take varargs instead of TRAIL.
1701 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
1702 build_constructor instead of build_constructor_from_list.
1704 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
1706 * semantics.c: Include bitmap.h.
1707 * Make-lang.in: Update dependencies.
1709 2010-05-22 Jan Hubicka <jh@suse.cz>
1711 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
1713 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
1715 2010-05-21 Joseph Myers <joseph@codesourcery.com>
1717 * cxx-pretty-print.c: Correct merge error.
1719 2010-05-21 Joseph Myers <joseph@codesourcery.com>
1721 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
1722 (cp_print_error_function): Use diagnostic_abstract_origin macro.
1723 (cp_printer): Handle %K here using percent_K_format.
1724 * cxx-pretty-print.c: Include tree-pretty-print.h.
1725 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
1728 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
1730 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
1731 Clean up redundant includes.
1733 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1736 * decl.c (xref_basetypes): Return false in case of ill-formed
1739 2010-05-19 Jason Merrill <jason@redhat.com>
1741 * call.c (reference_binding): Use cp_build_qualified_type_real
1742 and cp_type_quals consistently.
1743 (add_function_candidate): Likewise.
1744 (build_conditional_expr): Likewise.
1745 (convert_like_real): Likewise.
1746 (type_passed_as): Likewise.
1747 * class.c (add_method): Likewise.
1748 (same_signature_p): Likewise.
1749 (layout_class_type): Likewise.
1750 * decl.c (cxx_init_decl_processing): Likewise.
1751 (cp_fname_init): Likewise.
1752 (grokdeclarator): Likewise.
1753 * decl2.c (cp_reconstruct_complex_type): Likewise.
1754 * init.c (build_new_1): Likewise.
1755 * method.c (do_build_copy_constructor): Likewise.
1756 (implicitly_declare_fn): Likewise.
1757 * pt.c (tsubst_aggr_type): Likewise.
1759 * rtti.c (init_rtti_processing): Likewise.
1760 (build_headof): Likewise.
1761 (build_dynamic_cast_1): Likewise.
1762 (tinfo_base_init): Likewise.
1763 (emit_support_tinfos): Likewise.
1764 * semantics.c (capture_decltype): Likewise.
1765 * tree.c (cv_unqualified): Likewise.
1766 * typeck.c (composite_pointer_type): Likewise.
1767 (string_conv_p): Likewise.
1769 * mangle.c (write_CV_qualifiers_for_type): Tweak.
1771 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
1772 * decl.c (start_decl): Likewise.
1773 * semantics.c (finish_compound_literal): Likewise.
1774 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
1775 (cp_type_readonly): Remove.
1776 * cp-tree.h: Remove declaration.
1778 * typeck.c (merge_types): Preserve memfn quals.
1780 * decl.c (grokdeclarator): Don't check quals on fn type.
1781 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
1782 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
1785 * typeck.c (type_memfn_quals): New fn.
1786 (apply_memfn_quals): New fn.
1787 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
1788 (cp_type_readonly): Use cp_type_quals.
1789 * cp-tree.h: Add declarations.
1790 * tree.c (cp_build_qualified_type_real): Don't set, but do
1791 preserve, quals on FUNCTION_TYPE.
1792 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
1793 * decl.c (build_ptrmem_type): Likewise.
1794 (grokdeclarator): Likewise.
1795 (static_fn_type): Likewise.
1796 * decl2.c (change_return_type): Likewise.
1797 (cp_reconstruct_complex_type): Likewise.
1798 * pt.c (tsubst_function_type): Likewise.
1800 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
1802 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
1804 * tree.c (build_min_non_dep_call_vec): Update comment.
1806 2010-05-17 Jason Merrill <jason@redhat.com>
1808 * call.c (struct z_candidate): Add explicit_targs field.
1809 (add_template_candidate_real): Set it.
1810 (build_over_call): Use it to control init-list warning.
1813 * call.c (build_over_call): Limit init-list deduction warning to
1814 cases where the argument is actually an init-list.
1817 * call.c (build_over_call): Don't do bitwise copy for move ctor.
1819 2010-05-17 Dodji Seketeli <dodji@redhat.com>
1820 Jason Merrill <jason@redhat.com>
1823 * decl.c (compute_array_index_type): Call mark_rvalue_use.
1825 2010-05-15 Jason Merrill <jason@redhat.com>
1827 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
1828 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
1830 (finish_eh_spec_block): Adjust.
1832 2010-05-15 Jakub Jelinek <jakub@redhat.com>
1835 * pt.c (tsubst): Unshare template argument.
1837 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
1839 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
1840 * Make-lang.in: Fix dependencies accordingly.
1842 2010-05-14 Jason Merrill <jason@redhat.com>
1845 * except.c (build_throw): Simplify, adjust for DR 475.
1848 * except.c (dtor_nothrow): Return nonzero for type with
1852 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
1853 gimple_build_eh_must_not_throw.
1855 2010-05-14 Martin Jambor <mjambor@suse.cz>
1857 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
1860 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
1862 * call.c (build_new_method_call): Change warning text.
1863 * typeck2.c (build_functional_cast): Change error text.
1865 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
1868 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
1869 shadowing the outer parameter or variables by the declaration of
1870 nested function in nested structure or class. Warn the shadowing by
1871 the declaration of nested lambda expression.
1873 2010-05-13 Jason Merrill <jason@redhat.com>
1875 * typeck.c (cp_build_array_ref): Factor out from...
1876 (build_array_ref): ...here. Drop complain parm.
1877 (build_new_op): Adjust.
1878 * class.c (build_vtbl_ref_1): Adjust.
1879 * decl2.c (grok_array_decl): Adjust.
1880 * cp-tree.h: Adjust prototypes.
1882 2010-05-13 Jan Hubicka <jh@suse.cz>
1884 * decl.c (cp_finish_decl): Do not worry about used attribute.
1886 2010-05-12 Jason Merrill <jason@redhat.com>
1888 * typeck.c (build_array_ref): Take complain parm.
1889 * cp-tree.h: Add it to prototype.
1890 * call.c (build_new_op): Pass it.
1891 * class.c (build_vtbl_ref): Pass it.
1892 * decl2.c (grok_array_decl): Pass it.
1896 * cp-tree.def (NULLPTR_TYPE): Remove.
1897 * cp-tree.h (NULLPTR_TYPE_P): New.
1898 (SCALAR_TYPE_P): Use it.
1899 (nullptr_type_node): New.
1900 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
1901 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
1903 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
1904 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
1905 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
1906 * mangle.c (write_type): Likewise.
1907 * name-lookup.c (arg_assoc_type): Likewise.
1908 * typeck.c (build_reinterpret_cast_1): Likewise.
1909 * rtti.c (typeinfo_in_lib_p): Likewise.
1910 (emit_support_tinfos): Remove local nullptr_type_node.
1912 * cp-tree.h (UNKNOWN_TYPE): Remove.
1913 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
1914 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
1915 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
1916 * class.c (instantiate_type): Check unknown_type_node rather than
1918 * name-lookup.c (maybe_push_decl): Likewise.
1919 * rtti.c (get_tinfo_decl_dynamic): Likewise.
1920 (get_typeid): Likewise.
1921 * semantics.c (finish_offsetof): Likewise.
1924 * call.c (add_template_candidate_real): If deduction fails, still
1925 add the template as a non-viable candidate.
1926 (equal_functions): Handle template candidates.
1927 (print_z_candidate): Likewise.
1928 (print_z_candidates): Likewise.
1929 (build_new_function_call): Likewise.
1931 * cp-tree.h (LOOKUP_LIST_ONLY): New.
1932 * call.c (add_candidates): Enforce it.
1933 (build_new_method_call): Try non-list ctor if no viable list ctor.
1934 (build_user_type_conversion_1): Likewise.
1936 * call.c (add_candidates): Distinguish between type(x) and
1938 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
1939 (build_new_method_call): Give better error for conversion op.
1941 * call.c (add_candidates): Add first_arg and return_type parms.
1942 Add special constructor/conversion op handling.
1943 (convert_class_to_reference): Use it.
1944 (build_user_type_conversion_1): Likewise.
1945 (build_op_call): Likewise.
1946 (build_new_method_call): Likewise.
1947 (build_new_op): Adjust.
1948 (perform_overload_resolution): Adjust.
1950 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
1955 * pt.c (process_partial_specialization): Return error_mark_node
1956 in case of unused template parameters in partial specialization.
1958 2010-05-11 Jakub Jelinek <jakub@redhat.com>
1961 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
1962 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
1963 look at its second operand.
1965 2010-05-10 Jason Merrill <jason@redhat.com>
1968 * semantics.c (baselink_for_fns): Revert earlier change.
1971 * typeck.c (cp_build_modify_expr): Complain about assignment to
1972 array from init list.
1974 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
1977 * decl.c (check_initializer): strip array type before checking for
1978 uninitialized const or ref members.
1980 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
1983 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
1984 error count. Emit errors only if compain is true.
1985 (build_new_1): Do not return error_mark_node if
1986 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
1987 errors. Delay the check for user-provided constructor.
1988 (perform_member_init): Adjust.
1989 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
1992 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
1993 Jason Merrill <jason@redhat.com>
1995 Add support for C++0x nullptr.
1996 * cp-tree.def: Add NULLPTR_TYPE.
1997 * cp-tree.h: Add nullptr_node.
1998 (cp_tree_index): Add CPTI_NULLPTR.
1999 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
2000 * call.c (null_ptr_cst_p): Handle nullptr.
2001 (standard_conversion): Likewise.
2002 (convert_arg_to_ellipsis): Likewise.
2003 * mangle.c (write_type): Likewise.
2004 * name-lookup.c (arg_assoc_type): Likewise.
2005 * parser.c (cp_parser_primary_expression): Likewise.
2006 * typeck.c (cp_build_binary_op): Likewise.
2007 (build_reinterpret_cast_1): Likewise.
2008 * error.c (dump_type): Likewise.
2009 (dump_type_prefix, dump_type_suffix): Likewise.
2010 * decl.c (cxx_init_decl_processing): Likewise.
2011 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2012 * cvt.c (ocp_convert): Likewise.
2013 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
2014 nullptr_t tinfo in libsupc++.
2016 2010-05-06 Jason Merrill <jason@redhat.com>
2018 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
2020 2010-04-22 Jakub Jelinek <jakub@redhat.com>
2021 Dodji Seketeli <dodji@redhat.com>
2024 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
2026 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
2027 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
2028 (decay_conversion, perform_integral_promotions): Call rvalue_use.
2029 (cp_build_unary_op): Call lvalue_use.
2030 * decl.c (unused_but_set_errorcount): New variable.
2031 (poplevel): Issue -Wunused-but-set-variable diagnostics.
2032 (duplicate_decls): Merge DECL_READ_P flags.
2033 (start_cleanup_fn): Set DECL_READ_P flag.
2034 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
2035 * tree.c (rvalue): Call rvalue_use.
2036 * pt.c (convert_nontype_argument): Likewise.
2037 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
2038 finish_decltype_type): Likewise.
2039 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
2040 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
2041 or rvalue_use depending on the expr.
2042 * init.c (build_new, build_delete): Likewise.
2043 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
2045 2010-05-05 Jason Merrill <jason@redhat.com>
2048 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
2049 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
2051 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2054 * pt.c (unify): Check each elt for error_mark_node.
2056 2010-05-04 Jason Merrill <jason@redhat.com>
2059 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
2061 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2064 * call.c (build_new_method_call): Return error_mark_node if fns is
2067 2010-05-03 Dodji Seketeli <dodji@redhat.com>
2070 * pt.c (most_specialized_class): Pretend we are processing
2071 a template decl during the call to coerce_template_parms.
2073 2010-05-03 Jason Merrill <jason@redhat.com>
2077 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
2078 from the selected underlying type unless -fstrict-enums. Set
2079 ENUM_UNDERLYING_TYPE to have the restricted range.
2080 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
2081 * class.c (check_bitfield_decl): Likewise.
2083 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
2086 * init.c (build_new_1): Revert the accidental checkin in
2089 2010-04-30 Jason Merrill <jason@redhat.com>
2092 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
2093 (pp_cxx_type_specifier_seq): ...here.
2095 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
2097 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
2098 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
2100 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
2103 * typeck.c (warn_args_num): New function.
2104 (convert_arguments): Use warn_args_num to print the diagnostic
2107 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
2110 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
2111 user-provided constructor while recursing.
2113 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
2116 * error.c (print_instantiation_partial_context_line): Handle
2117 recursive instantiation.
2118 (print_instantiation_partial_context): Likewise.
2120 2010-04-27 Jason Merrill <jason@redhat.com>
2122 * init.c (perform_member_init): Check CLASS_TYPE_P.
2124 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2127 * init.c (perform_member_init): check for uninitialized const or
2128 reference members, including array types.
2130 2010-04-24 Jason Merrill <jason@redhat.com>
2132 * tree.c (get_fns): Split out from get_first_fn.
2133 * cp-tree.h: Declare it.
2134 * search.c (shared_member_p): Use it.
2135 * semantics.c (finish_qualified_id_expr): Simplify.
2136 (finish_id_expression): Simplify.
2138 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
2139 whenever object is NULL_TREE. Don't do 'this' capture here.
2140 (finish_qualified_id_expr): Pass NULL_TREE.
2141 (finish_id_expression): Likewise.
2142 (lambda_expr_this_capture): Likewise.
2144 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
2145 rather than checking current_class_ref directly.
2146 (finish_call_expr): Likewise.
2149 * name-lookup.c (qualify_lookup): Disqualify lambda op().
2150 * class.c (current_nonlambda_class_type): New fn.
2151 * semantics.c (nonlambda_method_basetype): New.
2152 * cp-tree.h: Declare them.
2153 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
2155 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
2158 * semantics.c (lambda_return_type): Complain about
2162 * tree.c (cv_unqualified): Handle error_mark_node.
2165 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
2166 if we don't want errors.
2169 * class.c (convert_to_base): Add complain parameter. Pass
2170 ba_quiet to lookup_base if we don't want errors.
2171 (build_vfield_ref): Pass complain to convert_to_base.
2172 * call.c (convert_like_real): Likewise.
2173 (initialize_reference): Likewise.
2174 (perform_direct_initialization_if_possible): Pass complain to
2176 * cp-tree.h: Adjust.
2178 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2179 Jason Merrill <jason@redhat.com>
2182 * decl.c (check_for_uninitialized_const_var): Handle classes that need
2184 (check_initializer): Call it for classes that need constructing, too.
2185 * class.c (in_class_defaulted_default_constructor): New.
2186 * cp-tree.h: Declare it.
2188 2010-04-20 Jason Merrill <jason@redhat.com>
2191 * init.c (constant_value_1): Treat error_mark_node as a constant
2192 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
2193 * cvt.c (ocp_convert): Handle getting error_mark_node from
2194 integral_constant_value.
2195 * decl.c (compute_array_index_type): Likewise.
2197 2010-04-20 Dodji Seketeli <dodji@redhat.com>
2201 * typeck.c (incompatible_dependent_types_p): If one of the
2202 compared types if not a typedef then honour their main variant
2205 2010-04-20 Jakub Jelinek <jakub@redhat.com>
2207 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
2209 2010-04-19 Dodji Seketeli <dodji@redhat.com>
2212 * typeck.c (structural_comptypes): Test dependent typedefs
2213 incompatibility before testing for their main variant based
2216 2010-04-19 Jakub Jelinek <jakub@redhat.com>
2218 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
2219 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
2221 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
2223 * decl.c (cxx_init_decl_processing): Remove second argument in call to
2224 build_common_tree_nodes.
2226 2010-04-14 Jason Merrill <jason@redhat.com>
2229 * parser.c (cp_parser_parenthesized_expression_list): Change
2230 is_attribute_list parm to int to indicate whether or not to
2231 handle initial identifier specially.
2232 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
2234 2010-04-13 Jason Merrill <jason@redhat.com>
2236 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
2238 * parser.c (cp_parser_lambda_expression): Complain about lambda in
2239 unevaluated context.
2240 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
2242 2010-04-12 Jason Merrill <jason@redhat.com>
2245 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
2246 return value directly.
2248 * call.c (type_decays_to): Call cv_unqualified for non-class type.
2250 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
2253 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2254 * init.c (build_new_1): Check for uninitialized const members and
2255 uninitialized reference members, when using new without
2256 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
2257 (diagnose_uninitialized_cst_or_ref_member): Define, call
2258 diagnose_uninitialized_cst_or_ref_member_1.
2259 (diagnose_uninitialized_cst_or_ref_member_1): New function.
2261 2010-04-12 Richard Guenther <rguenther@suse.de>
2264 * semantics.c (expand_or_defer_fn_1): Do not keep extern
2265 template inline functions.
2267 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2270 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
2273 2010-04-07 Jason Merrill <jason@redhat.com>
2276 * decl.c (start_preparsed_function): Do defer nested functions.
2278 PR c++/11094, DR 408
2279 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
2280 * decl2.c (finish_static_data_member_decl): Set it.
2281 * decl.c (duplicate_decls): Propagate it.
2282 * pt.c (tsubst_decl): Don't substitute the domain of an array
2283 VAR_DECL if it's set.
2284 (regenerate_decl_from_template): Substitute it here.
2285 (type_dependent_expression_p): Return true if it's set.
2286 * semantics.c (finish_decltype_type): Instantiate such a variable.
2287 * typeck.c (cxx_sizeof_expr): Likewise.
2288 (strip_array_domain): New.
2291 * name-lookup.c (current_decl_namespace): Non-static.
2292 (pop_nested_namespace): Sanity check.
2293 * cp-tree.h: Declare current_decl_namespace.
2294 * decl.c (grokvardecl): Use it instead of current_namespace.
2295 (grokfndecl): Likewise.
2298 * pt.c (tsubst_friend_function): Instatiate a friend that has already
2301 * pt.c (print_template_statistics): New.
2302 * cp-tree.h: Declare it.
2303 * tree.c (cxx_print_statistics): Call it.
2306 * decl.c (grokvardecl): Tweak warning message.
2307 (grokfndecl): Likewise.
2309 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2312 *pt.c (tsubst_decl): Get the arguments of a specialization from
2313 the specialization template, not from the most general template.
2315 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2318 * typeck2.c (process_init_constructor_record):
2319 value-initialize members that are are not explicitely
2322 2010-04-07 Jie Zhang <jie@codesourcery.com>
2325 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
2326 when all of its elements are non-constant and have been split out.
2328 2010-04-06 Taras Glek <taras@mozilla.com>
2329 Jason Merrill <jason@redhat.com>
2331 * parser.c (cp_parser_class_specifier): Set class location to that
2332 of IDENTIFIER_NODE instead of '{' when possible.
2333 * semantics.c (begin_class_definition): Do not overide locations
2334 with less precise ones.
2336 2010-04-06 Jason Merrill <jason@redhat.com>
2339 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
2342 * pt.c (maybe_update_decl_type): Check the return value from
2345 2010-04-01 Jason Merrill <jason@redhat.com>
2347 * decl.c (next_initializable_field): No longer static.
2348 * cp-tree.h: Declare it.
2349 * call.c (build_aggr_conv): Fail if there are more initializers
2350 than initializable fields.
2352 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
2353 instead of void_zero_node.
2355 2010-03-31 Dodji Seketeli <dodji@redhat.com>
2358 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
2359 * pt.c (end_template_parm_list): Store sibling template parms of
2360 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2361 (push_template_decl_real): Don't store the containing template decl
2362 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
2363 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
2364 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2367 2010-03-30 Jason Merrill <jason@redhat.com>
2370 * pt.c (push_template_decl_real): Deal better with running out of
2371 scopes before running out of template parms.
2375 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
2376 function parameter context. Don't print an error if parsing
2380 * pt.c (more_specialized_fn): Don't control cv-qualifier check
2383 2010-03-26 Jason Merrill <jason@redhat.com>
2386 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
2387 c++0x mode, but not other type-names.
2389 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2392 * pt.c (add_to_template_args): Support NULL ARGS;
2393 (most_specialized_class): call coerce_template_parms on
2394 template arguments passed to get_class_bindings. Use
2395 add_to_template_args.
2396 (unify): Handle VAR_DECLs.
2398 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2400 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
2402 * pt.c (get_template_parms_at_level): Adjust.
2404 2010-03-25 Dodji Seketeli <dodji@redhat.com>
2407 * cp-tree.h (get_template_parms_at_level): Declare ...
2408 * pt.c (get_template_parms_at_level): ... new function.
2409 * typeck.c (get_template_parms_of_dependent_type): If a template
2410 type parm's DECL_CONTEXT isn't yet set, get its siblings from
2411 current_template_parms. Use get_template_parms_at_level. Remove
2413 (incompatible_dependent_types_p): If we get empty parms from just one
2414 of the template type parms we are comparing then the template parms are
2417 2010-03-24 Jason Merrill <jason@redhat.com>
2420 * parser.c (make_declarator): Initialize id_loc.
2421 (cp_parser_lambda_declarator_opt): And set it.
2423 2010-03-23 Jason Merrill <jason@redhat.com>
2425 Make lambda conversion op and op() non-static.
2426 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
2427 Also add the thunk function returned by the conversion op.
2428 Mark the conversion deleted if the op() is variadic.
2429 * decl2.c (mark_used): Give helpful message about deleted conversion.
2430 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
2431 * semantics.c (finish_this_expr): Adjust.
2432 * mangle.c (write_closure_type_name): Adjust.
2433 * decl.c (grok_op_properties): Don't allow it.
2434 * call.c (build_user_type_conversion_1): No static conversion ops.
2435 (build_op_call): Or op().
2437 * decl2.c (change_return_type): Fix 'this' quals.
2439 2010-03-22 Jason Merrill <jason@redhat.com>
2442 * tree.c (pod_type_p): Use old meaning in C++98 mode.
2445 * pt.c (contains_auto_r): New fn.
2446 (do_auto_deduction): Use it.
2447 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
2449 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
2452 * decl2.c (grokfield): Handle invalid initializers for member
2455 2010-03-20 Dodji Seketeli <dodji@redhat.com>
2458 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
2460 * decl2.c (vague_linkage_p): Likewise.
2462 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
2465 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
2466 false, in the cp_parser_expression_statement call.
2468 2010-03-05 Jason Merrill <jason@redhat.com>
2470 * mangle.c (mangle_decl): Give name collision error even without
2473 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
2475 * pt.c (process_partial_specialization): Use error_n instead of
2478 2010-03-03 Jason Merrill <jason@redhat.com>
2481 * mangle.c (mangle_decl): Handle VAR_DECL, too.
2483 2010-03-03 Jason Merrill <jason@redhat.com>
2486 * mangle.c: Include cgraph.h.
2487 (mangle_decl): If the mangled name will change in a later
2488 ABI version, make the later mangled name an alias.
2489 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
2490 * Make-lang.in (mangle.o): Depend on cgraph.h.
2491 * method.c (make_alias_for): Handle VAR_DECL, too.
2492 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
2493 * tree.c (no_linkage_check): Adjust.
2494 * decl.c (maybe_commonize_var): Adjust.
2495 * cp-tree.h: Adjust.
2497 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
2499 * pt.c (redeclare_class_template): Use error_n and inform_n.
2501 2010-02-27 Mark Mitchell <mark@codesourcery.com>
2504 * cp-tree.h (push_tinst_level): Declare.
2505 (pop_tinst_level): Likewise.
2506 * pt.c (push_tinst_level): Give it external linkage.
2507 (pop_tinst_level): Likewise.
2508 * mangle.c (mangle_decl_string): Set the source location to that
2509 of the decl while mangling.
2511 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
2514 * pt.c (redeclare_class_template): Return false if there are erroneous
2515 template parameters.
2517 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
2519 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
2522 2010-02-24 Jason Merrill <jason@redhat.com>
2525 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
2527 * class.c (layout_class_type): Don't give -Wabi warning for a bug
2528 in a previous ABI version.
2530 2010-02-23 Jason Merrill <jason@redhat.com>
2533 * typeck2.c (digest_init_r): Accept value init of array.
2535 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
2538 * typeck.c (convert_arguments): Update error message.
2540 2010-02-22 Mike Stump <mikestump@comcast.net>
2543 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
2545 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
2548 * error.c (print_instantiation_partial_context_line): New.
2549 (print_instantiation_partial_context): Print at most 12 contexts,
2550 skip the rest with a message.
2552 2010-02-21 Dodji Seketeli <dodji@redhat.com>
2555 * pt.c (lookup_template_class): Better support of specialization
2556 of member of class template implicit instantiation.
2558 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
2561 * call.c (conversion_null_warnings): Replace -Wconversion with
2563 * cvt.c (build_expr_type_conversion): Likewise.
2565 2010-02-18 Jason Merrill <jason@redhat.com>
2568 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
2571 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
2573 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
2574 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
2577 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
2581 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
2582 (maybe_update_decl_type): New fn.
2583 * parser.c (cp_parser_init_declarator): Use it.
2586 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
2588 2010-02-17 Jason Merrill <jason@redhat.com>
2591 * call.c (build_over_call): Don't create zero-sized assignments.
2592 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
2593 * cp-objcp-common.c (cp_expr_size): Remove.
2594 * cp-tree.h: Remove prototype.
2597 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
2598 decl we looked up doesn't match.
2601 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
2602 have an INIT_EXPR anymore.
2605 * pt.c (convert_nontype_argument): Change assert to test.
2607 2010-02-16 Jason Merrill <jason@redhat.com>
2609 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
2612 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
2613 VIEW_CONVERT_EXPR for conversions between structural equality types
2614 that the back end can't tell are the same.
2617 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
2618 cv-quals from element here.
2619 (cp_build_qualified_type_real): Not here. Preserve typedef name.
2621 2010-02-14 Jason Merrill <jason@redhat.com>
2624 * semantics.c (finish_compound_literal): Use
2625 cp_apply_type_quals_to_decl when creating a static variable.
2627 2010-02-12 Jason Merrill <jason@redhat.com>
2630 * name-lookup.h (current_binding_level): Check for null
2633 2010-02-12 Jason Merrill <jason@redhat.com>
2636 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
2638 2010-02-12 Jakub Jelinek <jakub@redhat.com>
2641 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
2644 2010-02-10 Jason Merrill <jason@redhat.com>
2647 * semantics.c (outer_lambda_capture_p): Revert.
2648 (add_capture): Only finish_member_declaration if
2649 we're in the lambda class.
2650 (register_capture_members): New.
2651 * cp-tree.h: Declare it.
2652 * parser.c (cp_parser_lambda_expression): Call it.
2654 2010-02-10 Jason Merrill <jason@redhat.com>
2657 * semantics.c (outer_lambda_capture_p): Use current_function_decl
2658 instead of current_class_type.
2660 2010-02-10 Jason Merrill <jason@redhat.com>
2662 PR c++/42983, core issue 906
2663 * method.c (defaultable_fn_check): Check virtualness.
2665 2010-02-10 Jason Merrill <jason@redhat.com>
2668 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
2670 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
2672 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
2673 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
2675 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
2676 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
2677 (cp_parser_parameter_declaration)
2678 (cp_parser_exception_specification_opt)
2679 (cp_parser_exception_declaration): Likewise.
2680 * pt.c (check_default_tmpl_args): Likewise.
2681 * search.c (lookup_field_r): Likewise.
2683 2010-02-09 Jason Merrill <jason@redhat.com>
2686 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
2688 2010-02-09 Jason Merrill <jason@redhat.com>
2691 * decl2.c (change_return_type): New fn.
2692 * semantics.c (apply_lambda_return_type): Use it.
2693 * cp-tree.h: Declare it.
2695 2010-02-05 Richard Guenther <rguenther@suse.de>
2697 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
2698 * cp-lang.c: Include gt-cp-cp-lang.h.
2699 * config-lang.in (gtfiles): Add cp/cp-lang.c.
2701 2010-02-05 Dodji Seketeli <dodji@redhat.com>
2704 * typeck.c (get_template_parms_of_dependent_type): Try getting
2705 the template parameters fromt the type itself first.
2707 2010-02-03 Jason Merrill <jason@redhat.com>
2711 * mangle.c (write_unqualified_id): Split out from write_expression.
2712 (write_unqualified_name): Call it.
2713 (write_member_name): Likewise.
2714 (write_expression): Support TEMPLATE_ID_EXPR.
2715 Disambiguate operator names.
2718 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
2721 2010-02-02 Jason Merrill <jason@redhat.com>
2724 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
2725 * optimize.c (clone_body): Remap their initializers when making base
2727 (maybe_clone_body): Complain if multiple clones aren't safe.
2729 2010-01-29 Dodji Seketeli <dodji@redhat.com>
2736 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
2737 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
2738 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
2739 * pt.c (coerce_template_parms, type_unification_real,
2740 expand_template_argument_pack, coerce_template_parameter_pack):
2741 Set the non default template args count.
2742 (current_template_args): Always set non defaulted
2743 template args count when compiled with --enable-checking
2744 (tsubst_template_args, type_unification_real): Propagate the non
2745 defaulted template args count.
2746 * error.c (get_non_default_template_args_count): Renamed
2747 count_non_default_template_args into this. Don't calculate the
2748 non default template argument count anymore. Use the new
2749 accessor macros above to get it.
2750 (dump_template_argument_list, dump_type, dump_decl,
2751 dump_template_parms): Adjust.
2752 * parser.c (cp_parser_template_argument_list): Always set defaulted
2753 template args count when compiled with --enable-checking.
2755 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
2757 * decl.c (redeclaration_error_message): Wrap the return messages into
2758 G_() for easy translation.
2760 2010-01-28 Jason Merrill <jason@redhat.com>
2763 * semantics.c (begin_class_definition): Don't use type_as_string.
2765 2010-01-28 Dodji Seketeli <dodji@redhat.com>
2769 * typeck.c (get_template_parms_of_dependent_type): Factorized
2770 this out of incompatible_template_type_parms_p
2771 (incompatible_dependent_types_p): Renamed
2772 incompatible_template_type_parms_p into this. Make it detect
2773 two incompatible dependent typedefs too.
2774 (structural_comptypes): Use incompatible_dependent_types_p.
2775 * pt.c (get_template_info):
2776 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
2778 2010-01-20 Janis Johnson <janis187@us.ibm.com>
2779 Jason Merrill <jason@redhat.com>
2781 * mangle.c (write_type): Mangle transparent record as member type.
2782 * semantics.c (begin_class_definition): Recognize decimal classes
2783 and set TYPE_TRANSPARENT_AGGR.
2785 2010-01-20 Jason Merrill <jason@redhat.com>
2788 * mangle.c (write_expression): Handle tree codes that have extra
2789 arguments in the middle-end.
2791 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
2794 * except.c (expand_start_catch_block): Deal correctly with
2795 do_begin_catch returning error_mark_node.
2797 2010-01-20 Jason Merrill <jason@redhat.com>
2800 * class.c (layout_class_type): Set packed_maybe_necessary for packed
2804 * semantics.c (build_lambda_object): Call mark_used on captured
2808 * decl.c (grokdeclarator): Clear type_quals for a member function
2809 declared using a typedef. Don't complain about adding cv-quals
2810 to a function typedef in C++0x mode.
2812 2010-01-20 Jakub Jelinek <jakub@redhat.com>
2814 * decl.c (create_array_type_for_decl): Remove set but not used
2815 variable error_msg. Remove break stmts after return stmts.
2817 2010-01-19 Dodji Seketeli <dodji@redhat.com>
2819 * error.c (dump_template_parms, count_non_default_template_args):
2820 Revert fix of PR c++/42634.
2822 2010-01-18 Dodji Seketeli <dodji@redhat.com>
2825 * error.c (dump_template_parms): Use innermost template
2826 arguments before calling count_non_default_template_args.
2827 (count_non_default_template_args): We are being called with
2828 template innermost arguments now. There is no need to ensure
2831 2010-01-18 Dodji Seketeli <dodji@redhat.com>
2834 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
2836 2010-01-17 Dodji Seketeli <dodji@redhat.com>
2839 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
2841 2010-01-17 Dodji Seketeli <dodji@redhat.com>
2844 *pt.c (tsubst_decl): Get the arguments of a specialization from
2845 the specialization template, not from the most general template.
2847 2010-01-16 Jason Merrill <jason@redhat.com>
2850 * semantics.c (finish_decltype_type): Within a template, treat
2851 unresolved CALL_EXPR as dependent.
2853 2010-01-15 Dodji Seketeli <dodji@redhat.com>
2855 * error.c (dump_template_parms,count_non_default_template_args):
2856 Revert changes of PR c++/42634.
2858 2010-01-14 Jakub Jelinek <jakub@redhat.com>
2861 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
2862 functions with noreturn attribute.
2864 2010-01-14 Jason Merrill <jason@redhat.com>
2867 * call.c (build_new_method_call): Don't free the vec here.
2870 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
2872 2010-01-13 Dodji Seketeli <dodji@redhat.com>
2875 * error.c (dump_template_parms): Use innermost template
2876 arguments before calling count_non_default_template_args.
2877 (count_non_default_template_args): We are being called with
2878 template innermost arguments now. There is no need to ensure
2881 2010-01-07 Dodji Seketeli <dodji@redhat.com>
2884 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
2885 arguments that were previously deduced.
2887 2010-01-05 Jason Merrill <jason@redhat.com>
2889 * pt.c (unify_pack_expansion): Handle deduction from init-list.
2890 * call.c (build_over_call): Don't complain about it.
2892 2010-01-04 Jason Merrill <jason@redhat.com>
2895 * pt.c (tsubst_decl): Don't apply type attributes in place.
2898 * semantics.c (describable_type): Remove decltype comment and
2903 Copyright (C) 2010 Free Software Foundation, Inc.
2905 Copying and distribution of this file, with or without modification,
2906 are permitted in any medium without royalty provided the copyright
2907 notice and this notice are preserved.