1 2010-10-07 Iain Sandoe <iains@gcc.gnu.org>
3 parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
4 finding ellipsis, before checking for attributes.
6 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
8 Merge from apple/trunk branch on FSF servers.
9 * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
10 longer existing gcc/c-common.def.
12 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
15 * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
16 * parser.c (cp_parser_objc_encode_expression): Build a templatized
17 parse tree for @encode(T).
19 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
22 * c-common.def: Add new expression code AT_ENCODE_EXPR.
24 2010-10-06 Eric Botcazou <ebotcazou@adacore.com>
27 * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
28 code folding offsetof-like computations.
30 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
33 * parser.c (cp_parser_objc_class_interface): If no identifier
34 follows an @interface token, stop parsing the interface after
36 (cp_parser_objc_class_implementation): If no identifier follows an
37 @implementation token, stop parsing the implementation after
40 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
43 * parser.c (cp_parser_objc_method_keyword_params): If the required
44 colon is not found while parsing parameters, stop parsing them.
46 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
49 * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
50 @end after detecting it. Print an error if @end is found without
52 (cp_parser_objc_method_prototype_list): Do not eat the EOF after
53 detecting it. Fixed reading the next token when continuing
54 because of an error in a method signature. Print an error if EOF
55 is found without an '@end'.
56 (cp_parser_objc_method_definition_list): Same change.
58 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
60 Merge from apple/trunk branch on FSF servers:
62 2005-10-17 Fariborz Jahanian <fjahanian@apple.com>
65 * parser.c (cp_parser_objc_method_keyword_params): Check for valid
66 method parameters and issue error.
67 (cp_parser_objc_method_definition_list): Check for invalid tokens
68 which cannot start a function definition.
70 2005-10-14 Fariborz Jahanian <fjahanian@apple.com>
73 * parser.c (cp_parser_objc_message_args): Check for missing message
74 arguments and syntax error.
76 2005-10-13 Fariborz Jahanian <fjahanian@apple.com>
79 * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
82 2005-08-15 Ziemowit Laski <zlaski@apple.com>
85 * parser.c (cp_parser_objc_interstitial_code): Catch stray
86 '{' and '}' tokens and issue appropriate errors.
88 2005-08-02 Ziemowit Laski <zlaski@apple.com>
91 (cp_parser_statement_seq_opt): In addition to '}' and
92 end-of-file, a statement sequence may also be terminated
95 2010-10-05 Joseph Myers <joseph@codesourcery.com>
97 * cp-tree.h (cxx_print_error_function,
98 cxx_initialize_diagnostics): Declare using diagnostic_context
101 2010-10-04 Andi Kleen <ak@linux.intel.com>
103 * Make-lang.in (g++, cc1plus): Add + to build rule.
105 2010-10-04 Jason Merrill <jason@redhat.com>
107 * tree.c (decl_storage_duration): New.
108 * cp-tree.h: Declare it.
109 (duration_kind): Return values.
111 2010-10-03 Jason Merrill <jason@redhat.com>
113 * typeck.c (require_complete_type_sfinae): Add complain parm to...
114 (require_complete_type): ...this function.
115 (cp_build_array_ref, convert_arguments): Use it.
116 (convert_for_initialization, cp_build_modify_expr): Likewise.
117 * cp-tree.h: Declare it.
118 * call.c (build_over_call): Use it.
120 2010-09-30 Iain Sandoe <iains@gcc.gnu.org>
122 merge from FSF 'apple/trunk' branch.
123 2006-01-30 Fariborz Jahanian <fjahanian@apple.com>
126 * cp/parser.c (cp_parser_objc_interstitial_code): For
127 @optional/@required set the optional/required flag.
129 2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>
131 * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
132 and indentation when finding an Objective-C++ CPP_AT_NAME token.
134 2010-09-29 Richard Guenther <rguenther@suse.de>
136 * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
137 (CP_TYPE_CONTEXT): Similar.
138 (FROB_CONTEXT): Frob global_namespace to the global
139 TRANSLATION_UNIT_DECL.
140 * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
141 set DECL_CONTEXT of global_namespace to it.
142 (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
143 instead of zeroing context.
144 (cp_finish_decl): Use DECL_FILE_SCOPE_P.
145 (grokfndecl): Likewise.
146 (start_preparsed_function): Likewise.
147 * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
148 (namespace_binding): Use SCOPE_FILE_SCOPE_P.
149 * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
150 (is_specialization_of_friend): Use CP_DECL_CONTEXT.
151 (push_template_decl_real): Likewise.
152 (tsubst_friend_class): Likewise. Adjust context comparisons.
153 (instantiate_class_template): Use CP_TYPE_CONTEXT.
154 (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
155 * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
158 2010-09-29 Yao Qi <yao@codesourcery.com>
160 * decl.c (get_atexit_node): Fix typo.
162 2010-09-28 Jason Merrill <jason@redhat.com>
164 * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
165 (real_lvalue_p): Take const_tree.
167 * typeck.c (lvalue_or_else): Make temporary arg a permerror.
168 (cp_build_addr_expr_1): Likewise.
170 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
172 Partially merged from apple/trunk branch on FSF servers:
173 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
174 Radar 3803157 (method attributes)
176 * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
177 (cp_parser_objc_method_tail_params_opt): Likewise.
178 (cp_parser_objc_method_signature): Likewise.
179 (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
180 (cp_parser_objc_method_prototype_list): Handle attributes.
181 (cp_parser_objc_method_definition_list): Likewise.
183 2010-09-28 Richard Henderson <rth@redhat.com>
185 * cp-lang.c: Include "target.h".
186 (cp_eh_personality): Use targetm.except_unwind_info.
187 * Make-lang.in (cp-lang.o): Update deps.
189 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
191 * parser.c (cp_parser_objc_valid_prefix_attributes): New.
192 (cp_parser_declaration): Parse prefix attributes for ObjC++.
193 (cp_parser_objc_protocol_declaration): Handle attributes.
194 (cp_parser_objc_class_interface): Likewise.
195 (cp_parser_objc_declaration): Likewise.
197 2010-09-27 Jason Merrill <jason@redhat.com>
199 Require lvalues as specified by the standard.
200 * typeck.c (lvalue_or_else): Use real_lvalue_p.
201 (cp_build_addr_expr_1): Split out of cp_build_unary_op.
202 (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
203 (decay_conversion, get_member_function_from_ptrfunc): Adjust.
204 (build_x_unary_op, build_reinterpret_cast_1): Adjust.
205 (build_const_cast_1): Adjust.
206 * cp-tree.h: Declare new fns.
207 * call.c (build_this, convert_like_real, build_over_call): Adjust.
208 (initialize_reference): Adjust.
209 * class.c (build_base_path, convert_to_base_statically): Adjust.
210 (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
211 * cvt.c (build_up_reference, convert_to_reference): Adjust.
212 * decl.c (register_dtor_fn): Adjust.
213 * decl2.c (build_offset_ref_call_from_tree): Adjust.
214 * except.c (initialize_handler_parm): Adjust.
215 * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
216 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
217 * tree.c (stabilize_expr): Adjust.
219 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
221 Merge from apple/trunk branch on FSF servers:
223 2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
226 * typeck.c (composite_pointer_type): Call objc_have_common_type
227 when comparing two objective-c pointer types.
229 2005-07-18 Ziemowit Laski <zlaski@apple.com>
232 * call.c (standard_conversion): Do not issue warnings when
233 comparing ObjC pointer types.
235 2005-06-22 Ziemowit Laski <zlaski@apple.com>
238 * call.c (standard_conversion): Allow for a pointer conversion
239 between any two ObjC pointer types.
240 * typeck.c (composite_pointer_type): Determine common type
241 for two ObjC pointer types.
243 2010-09-24 Jan Hubicka <jh@suse.cz>
245 * decl.c (finish_function): Use decl_replaceable_p
246 * method.c (make_alias_for_thunk): Update call of cgraph_same_body_alias.
248 2010-09-24 Jason Merrill <jason@redhat.com>
250 * decl.c (compute_array_index_type): Remember type dependence of
252 * pt.c (dependent_type_p_r): Don't recompute it here.
254 * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
255 reference and pointer to the same type as "*" or "&".
257 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
259 * typeck.c (warn_args_num): Use warning 'too many arguments to
260 method [methodname]' for an Objective-C method instead of the less
261 satisfactory 'too many arguments to function' (with no method
264 2010-09-21 Jason Merrill <jason@redhat.com>
266 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
267 special handling if we know the member.
269 2010-09-18 Jason Merrill <jason@redhat.com>
271 * call.c (compare_ics): Do lvalue/rvalue reference binding
272 comparison for ck_list, too.
274 2010-09-15 Jason Merrill <jason@redhat.com>
276 * semantics.c (finish_id_expression): Diagnose use of function
277 parms in evaluated context outside function body.
279 * decl2.c (grokbitfield): Diagnose non-integral width.
281 * call.c (convert_like_real): Use the underlying type of the
282 reference for the temporary.
284 2010-09-15 Jakub Jelinek <jakub@redhat.com>
287 * class.c (build_vtbl_initializer): Use fn instead of init's operand
288 as first argument to FDESC_EXPR.
290 2010-09-15 Paolo Carlini <paolo.carlini@oracle.com>
293 * decl.c (grokdeclarator): Check build_memfn_type return value
296 2010-09-13 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
298 * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
299 (begin_range_for_stmt): Likewise.
301 2010-09-11 Rodrigo Rivas <rodrigorivascosta@gmail.com>
303 Implement range-based for-statements.
304 * cp-tree.def (RANGE_FOR_STMT): New.
305 * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
306 (cp_convert_range_for): Declare.
307 * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
308 (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
309 * semantics.c (begin_range_for_stmt): New.
310 (finish_range_for_decl): New.
311 (finish_for_stmt): Accept also RANGE_FOR_STMT.
312 (perform_koenig_lookup): Add extra argument include_std.
313 * parser.c (cp_parser_c_for): New with code from
314 cp_parser_iteration_statement().
315 (cp_parser_range_for): New.
316 (cp_convert_range_for): New.
317 (cp_parser_iteration_statement): Add range-for support.
318 (cp_parser_condition): Adjust comment.
319 (cp_parser_postfix_expression): perform_koenig_lookup takes extra
321 * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
322 * cxx-pretty-print.c: Likewise.
323 * lex.c (cxx_init): Likewise.
324 * name-lookup.c (lookup_function_nonclass): Add extra argument
326 (lookup_arg_dependent): Likewise.
327 * name-lookup.h: Likewise.
329 2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
332 * error.c (maybe_warn_cpp0x): Add new warning
333 CPP0X_INLINE_NAMESPACES.
334 * parser.c (cp_parser_namespace_definition): Likewise.
335 * cp-tree.h (cpp0x_warn_str): Likewise.
337 2010-09-10 Richard Guenther <rguenther@suse.de>
339 * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
340 TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
342 2010-09-10 Jan Hubicka <jh@suse.cz>
344 PR tree-optimization/45605
345 * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
348 2010-09-08 Jakub Jelinek <jakub@redhat.com>
351 * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
352 before calling fold_decl_constant_value.
354 2010-09-07 Arnaud Charlet <charlet@adacore.com>
356 * cp-tree.h (build_enumerator): Add new location_t parameter.
357 (build_lang_decl_loc): New function.
358 * decl.c (build_enumerator): New parameter loc. Use it when calling
359 build_decl. Replace build_lang_decl with build_lang_decl_loc.
360 * pt.c (tsubst_enum): Adjust call to build_enumerator.
361 * parser.c (cp_parser_enumerator_definition): Ditto.
362 * lex.c (build_lang_decl_loc): New function.
364 2010-09-06 Dodji Seketeli <dodji@redhat.com>
369 * tree.c (strip_typedefs): Strip typedefs from the context of
372 2010-09-06 Mark Mitchell <mark@codesourcery.com>
374 * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
375 * call.c (build_conditional_expr): Likewise.
376 (convert_arg_to_ellipsis): Likewise.
378 2010-09-06 Arnaud Charlet <charlet@adacore.com>
380 * parser.c (make_pointer_declarator, make_reference_declarator,
381 make_call_declarator, make_array_declarator): Set declarator->id_loc.
382 (cp_parser_init_declarator): Adjust location of decl if appropriate.
384 2010-09-06 Jason Merrill <jason@redhat.com>
386 * call.c (implicit_conversion): Fix value-init of enums.
387 (convert_like_real): Likewise.
389 * decl.c (cp_finish_decl): Don't change init for auto deduction.
391 * pt.c (fold_non_dependent_expr_sfinae): Split out from...
392 (fold_non_dependent_expr): ...here.
393 (convert_nontype_argument): Use it. Take complain parm.
394 Use perform_implicit_conversion instead of ocp_convert.
395 Allow cv-qual changes.
396 (convert_template_argument): Pass complain down.
397 (tsubst_template_arg): Suppress constant expression warnings.
400 * method.c (synthesized_method_walk): In constructors, also check
401 subobject destructors.
403 * semantics.c (finish_compound_literal): Always build a
406 2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
409 * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
411 2010-08-30 Jakub Jelinek <jakub@redhat.com>
414 * parser.c (cp_parser_omp_atomic): Handle boolean
415 {PRE,POST}_INCREMENT.
417 2010-08-29 Jason Merrill <jason@redhat.com>
420 * parser.c (cp_parser_parameter_declaration): Pop parameter decls
421 after tentative parsing.
423 2010-08-22 Joseph Myers <joseph@codesourcery.com>
425 * Make-lang.in (g++spec.o): Update dependencies.
426 * g++spec.c: Include opts.h
427 (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
428 (lang_specific_driver): Use cl_decoded_option structures.
430 2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
432 * call.c: Use FOR_EACH_VEC_ELT.
437 * except.c: Likewise.
438 * mangle.c: Likewise.
439 * method.c: Likewise.
440 * name-lookup.c: Likewise.
441 * parser.c: Likewise.
444 * semantics.c: Likewise.
445 * typeck2.c: Likewise.
447 2010-08-19 Jason Merrill <jason@redhat.com>
449 * call.c (reference_related_p): Check for error_mark_node.
450 (add_function_candidate): Check it instead of
451 same_type_ignoring_top_level_qualifiers_p.
454 * init.c (build_new_1): Don't use build_value_init in a template.
455 (build_value_init): Make sure we don't.
458 * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
459 of empty class CONSTRUCTOR.
461 * except.c (pending_noexcept, pending_noexcept_checks): New.
462 (perform_deferred_noexcept_checks): New.
463 (maybe_noexcept_warning): Split from...
464 (finish_noexcept_expr): ...here. Adjust.
465 * decl2.c (cp_write_global_declarations): Call
466 perform_deferred_noexcept_checks.
467 * cp-tree.h: And declare it.
469 2010-08-18 Nathan Froyd <froydnj@codesourcery.com>
472 * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
475 2010-08-17 Kai Tietz <kai.tietz@onevision.com>
477 * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
478 or if -fms-extensions is enabled check, check permissive.
480 2010-08-09 Jason Merrill <jason@redhat.com>
483 * pt.c (lookup_template_class): Don't re-coerce outer parms.
485 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
487 * call.c (add_builtin_candidates): Use VECs for local variable
488 `types'. Adjust remainder of function accordingly.
490 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
492 * name-lookup.c (is_associated_namespace): Convert local variables
493 to be VECs instead of TREE_LISTs.
495 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
497 * tree.c (varargs_function_p): Use stdarg_p.
499 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
501 * parser.c (cp_default_arg_entry): Declare. Declare a VEC of it.
502 (cp_unparsed_functions_entry): Declare. Declare a VEC of it.
503 (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
504 Change type to a VEC.
505 (unparsed_funs_with_default_args): Define.
506 (unparsed_funs_with_definitions): Define.
507 (push_unparsed_function_queues): New function.
508 (cp_parser_new): Call it.
509 (pop_unparsed_function_queues): New function.
510 (cp_parser_class_specifier): Adjust processing of unparsed functions.
511 (cp_parser_template_declaration_after_export): Use VEC_safe_push.
512 (cp_parser_save_member_function_body): Likewise.
513 (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
514 and pop_unparsed_function_queues.
515 (cp_parser_late_parsing_default_args): Likewise.
516 (cp_parser_save_default_args): Use VEC_safe_push.
518 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
520 * name-lookup.h (cp_label_binding): Declare. Declare a VEC type
522 (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
524 * decl.c (poplevel): Adjust for type changes.
525 (declare_local_label): Likewise.
527 2010-08-06 Jason Merrill <jason@redhat.com>
529 * typeck.c (complete_type_or_maybe_complain): Split out from...
530 (complete_type_or_else): Here.
531 (build_class_member_access_expr): Call it.
532 (finish_class_member_access_expr): Likewise.
533 * call.c (build_special_member_call): Likewise.
534 * cvt.c (build_expr_type_conversion): Likewise.
535 * init.c (build_new): Likewise.
536 * typeck2.c (build_functional_cast): Likewise.
537 * cp-tree.h: Declare it.
539 * init.c (build_value_init): Add complain parm.
540 (build_value_init_noctor): Likewise.
541 (perform_member_init): Pass it.
542 (expand_aggr_init_1): Likewise.
543 (build_new_1): Likewise.
544 (build_vec_init): Likewise.
545 * pt.c (tsubst_expr): Likewise.
546 * typeck2.c (build_functional_cast): Likewise.
548 * tree.c (build_target_expr_with_type): Handle error_mark_node.
550 * typeck.c (decay_conversion): Any expression with type nullptr_t
553 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
556 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
558 2010-07-27 Jason Merrill <jason@redhat.com>
560 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
561 from build_value_init.
562 * init.c (build_value_init_noctor): Give error for unknown array
565 2010-07-27 Joseph Myers <joseph@codesourcery.com>
567 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
569 2010-07-27 Joseph Myers <joseph@codesourcery.com>
571 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
572 c_common_initialize_diagnostics.
573 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
574 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
576 2010-07-21 Jason Merrill <jason@redhat.com>
578 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
580 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
583 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
586 * pt.c (instantiate_class_template): Propagate the template's
587 location to its instance.
589 2010-07-20 Jason Merrill <jason@redhat.com>
592 * pt.c (tsubst_copy_and_build): Rework last change.
595 * pt.c (tsubst_copy_and_build): Handle partial substitution of
598 2010-07-19 Jason Merrill <jason@redhat.com>
601 * semantics.c (finish_decltype_type): Correct decltype
602 of parenthesized rvalue reference variable.
605 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
606 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
608 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
611 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
613 * cp-tree.h: Adjust declaration.
614 * init.c (perform_member_init): Adjust caller.
615 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
616 * typeck2.c (store_init_value): Likewise.
617 (build_functional_cast): Pass complain argument to
618 build_x_compound_expr_from_list.
620 2010-07-16 Jason Merrill <jason@redhat.com>
623 * pt.c (process_partial_specialization): Diagnose partial
624 specialization after instantiation.
625 (most_specialized_class): Add complain parm.
627 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
629 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
631 * init.c (build_new_1): Use cp_build_function_call_nary instead of
632 cp_build_function_call.
634 2010-07-15 Jason Merrill <jason@redhat.com>
637 * call.c (add_function_candidate): If we're working on an implicit
638 declaration, don't consider candidates that won't match.
639 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
640 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
643 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
644 (TYPE_HAS_USER_OPEQ): New.
645 * decl.c (grok_special_member_properties): Set it.
646 * class.c (add_implicitly_declared_members): Don't lazily declare
647 constructors/operator= if a base or member has a user-declared one.
648 (check_bases_and_members, check_bases): Adjust.
649 (check_field_decls, check_field_decl): Adjust.
651 2010-07-15 Anatoly Sokolov <aesok@post.ru>
653 * decl.c (integer_three_node): Remove.
654 (cxx_init_decl_processing): Do not initialize the integer_three_node.
655 * cp-tree.h (integer_three_node): Remove.
657 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
659 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
662 * cp-gimplify.c: Likewise.
666 * mangle.c: Likewise.
667 * name-lookup.c: Likewise.
668 * optimize.c: Likewise.
669 * parser.c: Likewise.
672 * search.c: Likewise.
673 * semantics.c: Likewise.
674 * typeck.c: Likewise.
675 * typeck2.c: Likewise.
677 2010-07-14 Jason Merrill <jason@redhat.com>
679 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
680 (build_field_list): Cache field type.
682 Implement C++0x unrestricted unions (N2544)
683 * class.c (check_field_decl): Loosen union handling in C++0x.
684 * method.c (walk_field_subobs): Split out from...
685 (synthesized_method_walk): ...here. Set msg before loops.
686 (process_subob_fn): Check for triviality in union members.
687 * init.c (sort_mem_initializers): Splice out uninitialized
688 anonymous unions and union members.
689 (push_base_cleanups): Don't automatically destroy anonymous unions
692 2010-07-13 Jason Merrill <jason@redhat.com>
695 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
696 (TYPE_HAS_USER_OPEQ): New.
697 * decl.c (grok_special_member_properties): Set it.
698 * class.c (add_implicitly_declared_members): Don't lazily declare
699 constructors/operator= if a base or member has a user-declared one.
700 (check_bases_and_members, check_bases): Adjust.
701 (check_field_decls, check_field_decl): Adjust.
702 * method.c (synthesized_method_walk): Initialize check_vdtor.
705 * mangle.c (write_type): Canonicalize.
706 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
707 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
709 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
712 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
714 * typeck.c (get_delta_difference): Update prototype, add a
715 tsubst_flags_t parameter; update get_delta_difference_1 calls and
716 add checks for error_mark_node.
717 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
718 parameter; update lookup_base call.
719 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
720 parameter; update get_delta_difference call and add check for
722 (convert_ptrmem): Update prototype, add a tsubst_flags_t
723 parameter; update get_delta_difference call and add check for
724 error_mark_node; update build_ptrmemfunc call.
725 (build_static_cast_1): Adjust convert_ptrmem call.
726 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
727 (cp_build_unary_op): Adjust build_ptrmemfunc call.
728 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
729 and build_ptrmemfunc calls.
730 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
732 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
735 * call.c (build_temp): Add tsubst_flags_t complain parameter;
736 adjust build_special_member_call call, pass complain.
737 (convert_like_real): Adjust build_temp call, pass complain.
739 2010-07-09 Jason Merrill <jason@redhat.com>
742 * cp-tree.h (BV_LOST_PRIMARY): New macro.
743 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
745 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
747 2010-07-08 Jason Merrill <jason@redhat.com>
750 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
751 virtual bases for covariant thunks.
753 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
755 * cp-tree.h: Do not include toplev.h.
757 2010-07-06 Jason Merrill <jason@redhat.com>
760 * call.c (is_std_init_list): Look through typedefs.
763 * init.c (build_offset_ref): If scope isn't dependent,
764 don't exit early. Look at TYPE_MAIN_VARIANT.
765 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
767 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
769 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
771 * cp-tree.h (impl_conv_void): New type.
772 (convert_to_void): Adjust prototype.
773 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
774 diagnostic for easy translation. Change caller.
775 * typeck.c: Update call to convert_to_void.
776 * semantics.c: Likewise.
779 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
781 * decl.c (cp_finish_decl): Call add_local_decl.
782 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
784 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
786 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
789 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
792 * parser.c (cp_parser_primary_expression): Error if local template is
795 2010-07-02 Le-Chun Wu <lcwu@google.com>
798 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
799 (variable or type) shadows another type.
801 2010-07-02 Jakub Jelinek <jakub@redhat.com>
804 * typeck.c (convert_for_assignment): When converting a convertible
805 vector type or objc++ types, call mark_rvalue_use.
806 * typeck2.c (build_m_component_ref): Use return values from
807 mark_rvalue_use or mark_lvalue_use.
808 * class.c (build_base_path): Likewise.
809 * call.c (build_conditional_expr): Likewise.
811 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
814 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
817 2010-07-01 Richard Guenther <rguenther@suse.de>
819 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
820 predicate we are looking for, allow non-gimplified
823 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
826 * typeck.c (cp_build_unary_op): Early return error_mark_node when
827 arg is NULL_TREE too.
828 * call.c (convert_class_to_reference): Return error_mark_node when
831 2010-06-30 Michael Matz <matz@suse.de>
833 * repo.c (finish_repo): Fix typo.
835 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
837 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
839 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
841 * repo.c (pending_repo): Change type to a VEC.
842 (finish_repo): Adjust for new type of pending_repo.
843 (repo_emit_p): Likewise.
845 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
847 * tree.c: Include gimple.h. Do not include tree-flow.h
848 * decl.c: Do not include tree-flow.h
849 * Make-lang.in: Adjust dependencies.
851 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
853 * decl.c (incomplete_var): Declare. Declare VECs containing them.
854 (incomplete_vars): Adjust comment. Change type to a VEC.
855 (maybe_register_incomplete_var): Adjust for new type.
856 (complete_vars): Adjust iteration over incomplete_vars.
858 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
860 * decl.c (struct named_label_entry): Change type of bad_decls field
862 (poplevel_named_label_1): Adjust for new type of bad_decls.
863 (check_goto): Likewise.
865 2010-06-29 Jason Merrill <jason@redhat.com>
867 Enable implicitly declared move constructor/operator= (N3053).
868 * class.c (add_implicitly_declared_members): A class with no
869 explicitly declared copy or move constructor gets both declared
870 implicitly, and similarly for operator=.
871 (check_bases): A type with no copy ctor does not inhibit
872 a const copy ctor in a derived class. It does mean the derived
874 (check_field_decl): Likewise.
875 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
876 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
877 (trivially_copyable_p): Likewise.
878 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
879 * class.c (finish_struct_bits): Likewise.
880 * tree.c (build_target_expr_with_type): Likewise.
881 * typeck2.c (store_init_value): Likewise.
883 Enable implicitly deleted functions (N2346)
884 * class.c (check_bases_and_members): Adjust lambda flags.
885 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
887 * decl2.c (mark_used): Adjust error for use of deleted function.
889 Machinery to support implicit delete/move.
890 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
891 has_complex_move_ctor, has_complex_move_assign bitfields.
892 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
893 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
894 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
895 (enum special_function_kind): Add sfk_move_assignment.
896 (LOOKUP_SPECULATIVE): New.
897 * call.c (build_over_call): Return early if it's set.
898 (build_over_call): Use trivial_fn_p.
899 * class.c (check_bases): If the base has no default constructor,
900 the derived one is non-trivial. Handle move ctor/op=.
901 (check_field_decl): Likewise.
902 (check_bases_and_members): Handle move ctor/op=.
903 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
904 (type_has_move_constructor, type_has_move_assign): New.
905 * decl.c (grok_special_member_properties): Handle move ctor/op=.
906 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
908 (do_build_copy_constructor): Use it.
909 (do_build_assign_ref): Likewise. Handle move assignment.
910 (build_stub_type, build_stub_object, locate_fn_flags): New.
911 (locate_ctor): Use locate_fn_flags.
912 (locate_copy, locate_dtor): Remove.
913 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
914 (process_subob_fn, synthesized_method_walk): New.
915 (maybe_explain_implicit_delete): New.
916 (implicitly_declare_fn): Use synthesized_method_walk,
917 type_has_trivial_fn, and type_set_nontrivial_flag.
918 (defaulted_late_check): Set DECL_DELETED_FN.
919 (defaultable_fn_check): Handle sfk_move_assignment.
920 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
921 implicitly deleted move ctor/op=.
922 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
923 (lookup_fnfields_slot): New.
924 * semantics.c (omp_clause_info_fndecl): Remove.
925 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
926 get_copy_assign, trivial_fn_p.
927 (trait_expr_value): Adjust call to locate_ctor.
928 * tree.c (special_function_p): Handle sfk_move_assignment.
930 * class.c (type_has_virtual_destructor): New.
931 * cp-tree.h: Declare it.
932 * semantics.c (trait_expr_value): Use it.
934 * call.c (build_over_call): Only give warnings with tf_warning.
936 * name-lookup.c (pop_scope): Handle NULL_TREE.
938 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
939 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
940 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
941 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
942 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
943 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
944 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
945 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
946 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
947 (sfk_assignment_operator): Rename to sfk_copy_assignment.
948 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
949 * search.c, semantics.c, tree.c: Adjust.
951 * pt.c (dependent_scope_ref_p): Remove.
952 (value_dependent_expression_p): Don't call it.
953 (type_dependent_expression_p): Here either.
954 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
955 if the scope isn't dependent.
957 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
961 * pt.c (has_value_dependent_address): New.
962 (value_dependent_expression_p): Check it.
963 (convert_nontype_argument): Likewise. Call decay_conversion before
964 folding if we want a pointer.
965 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
966 scope is the current instantiation.
968 2010-06-28 Jakub Jelinek <jakub@redhat.com>
971 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
974 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
976 * init.c: Do not include except.h.
979 * cp-lang.c: Likewise.
981 * semantics.c: Likewise.
983 * except.c: Likewise.
984 (init_exception_processing): Do not set the removed
985 lang_protect_cleanup_actions here.
986 (cp_protect_cleanup_actions): Make non-static and remove prototype.
987 (doing_eh): New, moved from except.c but removed the do_warning flag.
988 (expand_start_catch_block): Update doing_eh call.
989 (expand_end_catch_block): Likewise.
990 (build_throw): Likewise.
991 * cp-tree.h: Prototype cp_protect_cleanup_actions.
992 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
993 cp_protect_cleanup_actions.
994 * Make-lang.in: Update dependencies.
996 2010-06-26 Jason Merrill <jason@redhat.com>
998 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
999 constructor called with a single argument that takes a reference
1000 to the constructor's class.
1001 (BAD_CONVERSION_RANK): New.
1002 (compare_ics): Use it to compare bad ICSes.
1004 2010-06-25 Joseph Myers <joseph@codesourcery.com>
1006 * lang-specs.h: Remove +e handling.
1008 2010-06-24 Andi Kleen <ak@linux.intel.com>
1010 * parser.c: (cp_parser_question_colon_clause):
1011 Switch to use cp_lexer_peek_token.
1012 Call warn_for_omitted_condop. Call pedwarn for omitted
1015 2010-06-22 Jakub Jelinek <jakub@redhat.com>
1018 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
1019 datum and mark_rvalue_use on component.
1022 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
1023 the CALL_EXPR has no arguments.
1025 2010-06-21 Jason Merrill <jason@redhat.com>
1027 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
1029 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
1032 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
1034 * name-lookup.c (struct arg_lookup): Convert namespaces and
1035 classes fields to VEC.
1036 (arg_assoc_namespace): Adjust for new type of namespaces.
1037 (arg_assoc_class): Adjust for new type of classes.
1038 (lookup_arg_dependent): Use make_tree_vector and
1039 release_tree_vector.
1040 * typeck2.c (build_x_arrow): Use vec_member.
1042 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
1045 * error.c (dump_decl): Better wording for anonymous namespace.
1047 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
1049 * class.c (build_vtbl_initializer): Adjust computation of new_position
1050 and which entry to add padding for.
1052 2010-06-16 Jason Merrill <jason@redhat.com>
1054 * except.c (check_noexcept_r): Return the problematic function.
1055 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
1056 * pt.c (tsubst_copy_and_build): Pass it.
1057 * parser.c (cp_parser_unary_expression): Likewise.
1058 * cp-tree.h: Adjust prototype.
1060 * method.c (defaulted_late_check): Give the defaulted method
1061 the same exception specification as the implicit declaration.
1063 2010-06-15 Jason Merrill <jason@redhat.com>
1065 * class.c (add_implicitly_declared_members): Implicit assignment
1066 operators can also be virtual overriders.
1067 * method.c (lazily_declare_fn): Likewise.
1069 * call.c (convert_like_real): Give "initializing argument of"
1070 information for ambiguous conversion. Give source position
1073 * call.c (print_z_candidates): Do print viable deleted candidates.
1074 (joust): Don't choose a deleted function just because its worst
1075 conversion is better than another candidate's worst.
1077 * call.c (convert_like_real): Don't complain about
1078 list-value-initialization from an explicit constructor.
1080 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
1081 DECL_SOURCE_LOCATION directly.
1083 * class.c (type_has_user_provided_default_constructor): Use
1086 * call.c (is_subseq): Handle ck_aggr, ck_list.
1087 (compare_ics): Treat an aggregate or ambiguous conversion to the
1088 same type as involving the same function.
1090 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
1092 * typeck.c (convert_for_assignment): Fix comment. Change message
1093 format from %d to %qP.
1094 (convert_for_initialization): Fix comment.
1096 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
1098 * cp-tree.h (expr_list_kind): New type.
1099 (impl_conv_rhs): New type.
1100 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
1102 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
1103 diagnostics for easy translation. Change caller.
1104 (convert_for_initialization): Use impl_conv_rhs and change caller.
1105 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
1106 diagnostics for easy translation. Change caller.
1107 * decl.c (bad_spec_place): New enum.
1108 (bad_specifiers): Use it and emit the diagnostics for easy
1109 translation. Change caller.
1110 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
1112 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1114 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
1116 * decl2.c (cp_write_global_declarations): Adjust for new type of
1117 decl_namespace_list.
1118 * name-lookup.c (current_decl_namespace): Likewise.
1119 (push_decl_namespace): Likewise.
1120 (pop_decl_namespace): Likewise.
1122 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1124 * call.c (build_java_interface_fn_ref): Call build_function_type_list
1125 instead of build_function_type.
1126 * decl.c (cxx_init_decl_processing): Likewise.
1127 (declare_global_var): Likewise.
1128 (get_atexit_node): Likewise.
1129 (expand_static_init): Likewise.
1130 * decl2.c (start_objects): Likewise.
1131 (start_static_storage_duration_function): Likewise.
1132 * except.c (init_exception_processing): Likewise.
1133 (build_exc_ptr): Likewise.
1134 (build_throw): Likewise.
1135 * rtti.c (throw_bad_cast): Likewise.
1136 (throw_bad_typeid): Likewise.
1137 (build_dynamic_cast_1): Likewise.
1139 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1141 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
1142 (build_op_delete_call): Likewise.
1143 (build_over_call): Likewise.
1144 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1145 * pt.c (process_partial_specialization): Likewise.
1146 (tsubst_template_args): Likewise.
1147 * semantics.c (finish_asm_stmt): Likewise.
1149 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
1151 * decl.c (record_key_method_defined): New, broken out of ...
1152 (finish_function): ... here. Call it.
1153 (start_decl): Treat aliases as definitions.
1155 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1157 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
1159 * pt.c (maybe_process_partial_specialization): Likewise.
1160 (register_specialization): Likewise.
1161 (add_pending_template): Likewise.
1162 (lookup_template_class): Likewise.
1163 (push_tinst_level): Likewise.
1165 * parser.c (cp_lexer_new_main): Likewise.
1166 (cp_lexer_new_from_tokens): Likewise.
1167 (cp_token_cache_new): Likewise.
1168 (cp_parser_context_new): Likewise.
1169 (cp_parser_new): Likewise.
1170 (cp_parser_nested_name_specifier_opt): Likewise.
1171 (cp_parser_template_id): Likewise.
1173 * name-lookup.c (binding_entry_make): Likewise.
1174 (binding_table_construct): Likewise.
1175 (binding_table_new): Likewise.
1176 (cxx_binding_make): Likewise.
1177 (pushdecl_maybe_friend): Likewise.
1178 (begin_scope): Likewise.
1179 (push_to_top_level): Likewise.
1181 * lex.c (init_reswords): Likewise.
1182 (retrofit_lang_decl): Likewise.
1183 (cxx_dup_lang_specific_decl): Likewise.
1184 (copy_lang_type): Likewise.
1185 (cxx_make_type): Likewise.
1187 * decl.c (make_label_decl): Likewise.
1188 (check_goto): Likewise.
1189 (start_preparsed_function): Likewise.
1190 (save_function_data): Likewise.
1192 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
1194 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1196 * class.c (finish_struct_1): Likewise.
1198 * cp-tree.h (struct lang_type): Add variable_size GTY option.
1199 (struct lang_decl): Likewise.
1201 * parser.c (cp_parser_new): Update comment to not reference
1204 2010-06-07 Jason Merrill <jason@redhat.com>
1207 * error.c (dump_parameters): Mask out TFF_SCOPE.
1208 (dump_simple_decl): Don't print the scope of a PARM_DECL.
1209 (dump_scope): Remove no-op mask.
1212 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
1214 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
1215 * init.c (build_offset_ref): Use it.
1216 * pt.c (maybe_process_partial_specialization): Use it.
1217 (instantiate_class_template): Use it.
1218 * search.c (lookup_base): Use it.
1220 2010-06-07 Jakub Jelinek <jakub@redhat.com>
1223 * expr.c (mark_exp_read): Handle INDIRECT_REF.
1224 * cvt.c (convert_to_void): Handle INDIRECT_REF like
1225 handled_component_p.
1228 * decl.c (initialize_local_var): If TREE_USED is set on the type,
1229 set also DECL_READ_P on the decl.
1231 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1234 * cp-tree.h (typedef_variant_p): Move this declaration to
1236 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1237 * decl.c (grokdeclarator): Do not rename debug info of an
1238 anonymous tagged type named by a typedef.
1240 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
1243 * class.c (check_field_decls): Move the call to
1244 check_bitfield_decl before trying to set the
1245 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
1247 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
1249 * typeck.c: Update include path for moved files.
1252 * cp-gimplify.c: Likewise.
1253 * cp-lang.c: Likewise.
1255 * semantics.c: Likewise.
1256 * cxx-pretty-print.h: Likewise.
1257 * decl2.c: Likewise.
1258 * parser.c: Likewise.
1259 * cp-objcp-common.c: Likewise.
1260 * cp-tree.h: Likewise.
1261 * name-lookup.c: Likewise.
1263 * name-lookup.h: Likewise.
1264 * config-lang.in: Update paths in gtfiles for files in c-family/.
1265 * Make-lang.in: Likewise.
1267 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
1269 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
1270 * typeck.c (build_ptrmemfunc): Likewise.
1272 2010-06-04 Jason Merrill <jason@redhat.com>
1274 * typeck2.c (merge_exception_specifiers): Adjust merging of
1275 throw() and noexcept(true).
1277 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
1278 using an uninitialized variable.
1280 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
1281 (pp_cxx_expression): Likewise.
1283 Implement noexcept-specification (15.4)
1284 * parser.c (cp_parser_exception_specification_opt): Parse it.
1285 Give -Wdeprecated warning about throw() specs.
1286 * pt.c (tsubst_exception_specification): Handle it.
1287 * error.c (dump_exception_spec): Handle it.
1288 (dump_expr): Handle NOEXCEPT_EXPR.
1289 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
1290 * typeck.c (comp_except_specs): Handle compatibility rules.
1291 Change exact parm to take an enum.
1292 * typeck2.c (merge_exception_specifiers): Handle noexcept.
1293 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
1294 (type_throw_all_p, build_noexcept_spec): New fns.
1295 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
1296 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
1297 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
1298 (noexcept_true_spec, noexcept_false_spec): New macros.
1299 * name-lookup.c (pushdecl_maybe_friend): Adjust.
1300 * search.c (check_final_overrider): Adjust.
1301 * decl.c (check_redeclaration_exception_specification): Adjust.
1302 (use_eh_spec_block): Use type_throw_all_p.
1303 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
1304 Give operator new a noexcept-specification in C++0x mode.
1305 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
1306 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
1308 Implement noexcept operator (5.3.7)
1309 * cp-tree.def (NOEXCEPT_EXPR): New.
1310 * except.c (check_noexcept_r, finish_noexcept_expr): New.
1311 * cp-tree.h: Declare finish_noexcept_expr.
1312 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
1313 * pt.c (tsubst_copy_and_build): And tsubst it.
1314 (type_dependent_expression_p): Handle it.
1315 (value_dependent_expression_p): Handle it.
1317 * call.c (build_conditional_expr): Never fold in unevaluated context.
1318 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
1319 * semantics.c (simplify_aggr_init_expr): Likewise.
1320 * typeck.c (merge_types): Call merge_exception_specifiers.
1321 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
1322 DECL_ANTICIPATED for preferring new type.
1324 2010-06-04 Joseph Myers <joseph@codesourcery.com>
1326 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
1329 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1332 * typeck.c (build_class_member_access_expr): Call mark_exp_read
1333 on object for static data members.
1335 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1336 Jason Merrill <jason@redhat.com>
1339 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
1340 with the same type, call mark_lvalue_use on both.
1342 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
1344 * class.c (struct vtbl_init_data_s): Remove last_init field.
1345 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
1347 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
1349 (build_vtt): Likewise.
1350 (initialize_vtable): Take a VEC instead of a tree.
1351 (build_vtt_inits): Change return type to void. Take a VEC **
1352 instead of a tree *; accumulate results into said VEC.
1353 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
1354 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
1355 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
1357 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
1358 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
1360 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
1361 rather than tree_cons.
1362 (build_vbase_offset_vtbl_entries): Likewise.
1363 (add_vcall_offset): Likewise.
1364 (build_rtti_vtbl_entries): Likewise.
1365 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
1366 * decl.c (initialize_artificial_var): Use build_constructor instead
1367 of build_constructor_from_list.
1369 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
1372 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
1375 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
1377 * parser.c (cp_parser_mem_initializer_list): Change error text.
1379 2010-06-02 Jakub Jelinek <jakub@redhat.com>
1381 * cp-objcp-common.c (shadowed_var_for_decl): Change into
1382 tree_decl_map hashtab from tree_map.
1383 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
1384 (init_shadowed_var_for_decl): Adjust initialization.
1387 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
1388 instead of calling mark_exp_read only when not an assignment.
1391 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
1392 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
1393 Set DECL_VALUE_EXPR on var.
1395 2010-06-02 Jason Merrill <jason@redhat.com>
1397 * error.c (dump_type): Improve typedef handling.
1402 * name-lookup.c (same_entity_p): New.
1403 (ambiguous_decl): Multiple declarations of the same entity
1406 2010-06-01 Jason Merrill <jason@redhat.com>
1409 * call.c (add_list_candidates): Prefer the default constructor.
1410 (build_aggr_conv): Treat missing initializers like { }.
1411 * typeck2.c (process_init_constructor_record): Likewise.
1412 * init.c (expand_default_init): Use digest_init for
1413 direct aggregate initialization, too.
1415 * call.c (add_list_candidates): Split out...
1416 (build_user_type_conversion_1): ...from here.
1417 (build_new_method_call): And here.
1418 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
1421 * call.c (build_list_conv): Set list-initialization flags properly.
1423 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
1425 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
1427 2010-06-01 Arnaud Charlet <charlet@adacore.com>
1428 Matthew Gingell <gingell@adacore.com>
1430 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
1431 * decl2.c: Include langhooks.h and c-ada-spec.h.
1432 (cpp_check, collect_source_refs, collect_ada_namespace,
1433 collect_all_refs): New functions.
1434 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
1435 * lang-specs.h: Ditto.
1437 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
1439 * cp-tree.h (cp_build_function_call_nary): Declare.
1440 * typeck.c (cp_build_function_call_nary): Define.
1441 * decl.c (register_dtor_fn): Use it instead of
1442 cp_build_function_call.
1443 (cxx_maybe_build_cleanup): Likewise.
1444 * decl2.c (generate_ctor_or_dtor_function): Likewise.
1445 * except.c (do_get_exception_ptr): Likewise.
1446 (do_begin_catch): Likewise.
1447 (do_allocate_exception): Likewise.
1448 (do_free_exception): Likewise.
1449 (build_throw): Likewise. Use cp_build_function_call_vec instead
1450 of cp_build_function_call.
1451 (do_end_catch): Likewise.
1453 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
1455 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
1456 (struct cp_declarator): Move id_loc field up.
1458 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
1460 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
1461 this file is included before c-common.h. Define GCC_DIAG_STYLE
1462 before including diagnostic-core.h and toplev.h.
1463 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
1464 * pt.c: Include cp-tree.h before c-common.h.
1466 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
1468 * tree.c (c_register_addr_space): Add stub.
1470 2010-05-28 Joseph Myers <joseph@codesourcery.com>
1472 * g++spec.c (lang_specific_driver): Use fatal_error instead of
1475 2010-05-28 Dodji Seketeli <dodji@redhat.com>
1477 Revert fix of PR c++/44188
1478 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
1480 * tree.c (typedef_variant_p): Revert moving this definition to
1482 * decl.c (grokdeclarator): Revert naming typedef handling.
1484 2010-05-27 Joseph Myers <joseph@codesourcery.com>
1486 * call.c: Include diagnostic-core.h instead of diagnostic.h.
1487 * cp-lang.c: Don't include diagnostic.h
1488 * name-lookup.c: Include diagnostic-core.h instead of
1490 (cp_emit_debug_info_for_using): Use seen_error.
1491 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
1492 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
1493 * pt.c (iterative_hash_template_arg): Use seen_error.
1494 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
1495 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
1496 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
1497 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
1500 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1503 * cp-tree.h (typedef_variant_p): Move this declaration to
1505 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1506 * decl.c (grokdeclarator): Do not rename debug info of an
1507 anonymous tagged type named by a typedef.
1509 2010-05-27 Jason Merrill <jason@redhat.com>
1512 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
1515 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
1518 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
1519 * class.c (layout_class_type): Likewise.
1520 * decl.c (finish_enum): Likewise.
1521 * mangle.c (write_builitin_type): Likewise.
1523 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
1525 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
1527 * decl.c (grokdeclarator): Handle __int128.
1528 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
1529 (cp_parser_simple_type_specifier): Likewise.
1530 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
1531 * typeck.c (cp_common_type): Handle __int128.
1532 * mangle.c (integer_type_codes): Add itk_int128 and
1533 itk_unsigned_int128.
1535 2010-05-26 Jason Merrill <jason@redhat.com>
1538 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
1541 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
1543 * cp-lang.c: Do not include expr.h.
1545 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
1547 * decl.c: Do not include rtl.h
1548 * semantics.c: Likewise.
1550 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
1552 * cp-tree.h: Do not include splay-tree.h.
1553 (struct prtmem_cst): Remove unused field and false comment.
1554 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
1555 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
1556 * init.c: Do not include rtl.h and expr.h.
1557 * class.c: Do not include rtl.h. Include splay-tree.h.
1558 (build_clone): Use plain NULL instead of NULL_RTX.
1559 * decl.c: Do not include expr.h. Explain why rtl.h has to be
1560 included. Include splay-tree.h.
1561 * method.c: Do not include rtl.h and expr.h.
1562 (use_thunk): Use plain NULL instead of NULL_RTX.
1563 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
1564 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
1565 and target.h. Include splay-tree.h.
1566 * expr.c: Do not include rtl.h and expr.h.
1567 * pt.c: Do not include obstack.h and rtl.h.
1568 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
1569 (tsubst_decl): Likewise.
1570 (instantiate_decl): Likewise.
1571 * semantics.c: Do not include exprt.h and debug.h. Explain why
1572 rtl.h has to be included.
1573 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
1574 * call.c: Do not include rtl.h and expr.h.
1575 * search.c: Do not include obstack.h and rtl.h.
1576 * friend.c: Do not include rtl.h and expr.h.
1577 * Make-lang.in: Update dependencies.
1579 2010-05-25 Jakub Jelinek <jakub@redhat.com>
1582 * parser.c (non_integral_constant): Add NIC_NONE.
1583 (required_token): Add RT_NONE.
1584 (cp_parser_unary_expression): Initialize non_constant_p
1586 (cp_parser_asm_definition): Initialize missing to RT_NONE.
1587 (cp_parser_primary_expression, cp_parser_postfix_expression,
1588 cp_parser_cast_expression, cp_parser_binary_expression,
1589 cp_parser_functional_cast): Fix formatting.
1591 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
1594 * parser.c: Remove inclusion of dyn-string.h.
1595 (non_integral_constant): New enum.
1596 (name_lookup_error): New enum.
1597 (required_token): New enum.
1598 (cp_parser_required_error): New function.
1599 (cp_parser_require): Change the type of variable token_desc to
1600 required_token and use cp_parser_required_error.
1601 (cp_parser_require_keyword): Likewise.
1602 (cp_parser_error): Use gmsgid as parameter.
1603 (cp_parser_name_lookup_error): Change the type of variable desired to
1604 name_lookup_error and put the diagnostic in the full sentences. Change
1606 (cp_parser_non_integral_constant_expression): Change the type of the
1607 variable thing to non_integral_constant and put the diagnostics in
1608 full sentences. Change caller.
1610 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
1613 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
1615 2010-05-24 Joseph Myers <joseph@codesourcery.com>
1617 * error.c (cp_diagnostic_starter): Update call to
1618 diagnostic_build_prefix.
1619 (cp_print_error_function,
1620 print_instantiation_partial_context_line): Check show_column flag
1623 2010-05-24 Jason Merrill <jason@redhat.com>
1626 * decl.c (check_initializer): Don't wrap an init-list in a
1628 * init.c (build_aggr_init): Don't assume copy-initialization if
1629 init has CONSTRUCTOR_IS_DIRECT_INIT.
1630 * call.c (build_new_method_call): Sanity check.
1632 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
1634 * rtti.c (tinfo_base_init): Use build_constructor instead of
1635 build_constructor_from_list. Don't cons a tree node for
1637 (generic_initializer): Use build_constructor_single instead of
1638 build_constructor_from_list.
1639 (ptr_initializer): Use build_constructor instead of
1640 build_constructor_from_list
1641 (ptm_initializer): Likewise.
1642 (class_initializer): Likewise. Take varargs instead of TRAIL.
1643 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
1644 build_constructor instead of build_constructor_from_list.
1646 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
1648 * semantics.c: Include bitmap.h.
1649 * Make-lang.in: Update dependencies.
1651 2010-05-22 Jan Hubicka <jh@suse.cz>
1653 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
1655 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
1657 2010-05-21 Joseph Myers <joseph@codesourcery.com>
1659 * cxx-pretty-print.c: Correct merge error.
1661 2010-05-21 Joseph Myers <joseph@codesourcery.com>
1663 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
1664 (cp_print_error_function): Use diagnostic_abstract_origin macro.
1665 (cp_printer): Handle %K here using percent_K_format.
1666 * cxx-pretty-print.c: Include tree-pretty-print.h.
1667 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
1670 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
1672 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
1673 Clean up redundant includes.
1675 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1678 * decl.c (xref_basetypes): Return false in case of ill-formed
1681 2010-05-19 Jason Merrill <jason@redhat.com>
1683 * call.c (reference_binding): Use cp_build_qualified_type_real
1684 and cp_type_quals consistently.
1685 (add_function_candidate): Likewise.
1686 (build_conditional_expr): Likewise.
1687 (convert_like_real): Likewise.
1688 (type_passed_as): Likewise.
1689 * class.c (add_method): Likewise.
1690 (same_signature_p): Likewise.
1691 (layout_class_type): Likewise.
1692 * decl.c (cxx_init_decl_processing): Likewise.
1693 (cp_fname_init): Likewise.
1694 (grokdeclarator): Likewise.
1695 * decl2.c (cp_reconstruct_complex_type): Likewise.
1696 * init.c (build_new_1): Likewise.
1697 * method.c (do_build_copy_constructor): Likewise.
1698 (implicitly_declare_fn): Likewise.
1699 * pt.c (tsubst_aggr_type): Likewise.
1701 * rtti.c (init_rtti_processing): Likewise.
1702 (build_headof): Likewise.
1703 (build_dynamic_cast_1): Likewise.
1704 (tinfo_base_init): Likewise.
1705 (emit_support_tinfos): Likewise.
1706 * semantics.c (capture_decltype): Likewise.
1707 * tree.c (cv_unqualified): Likewise.
1708 * typeck.c (composite_pointer_type): Likewise.
1709 (string_conv_p): Likewise.
1711 * mangle.c (write_CV_qualifiers_for_type): Tweak.
1713 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
1714 * decl.c (start_decl): Likewise.
1715 * semantics.c (finish_compound_literal): Likewise.
1716 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
1717 (cp_type_readonly): Remove.
1718 * cp-tree.h: Remove declaration.
1720 * typeck.c (merge_types): Preserve memfn quals.
1722 * decl.c (grokdeclarator): Don't check quals on fn type.
1723 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
1724 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
1727 * typeck.c (type_memfn_quals): New fn.
1728 (apply_memfn_quals): New fn.
1729 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
1730 (cp_type_readonly): Use cp_type_quals.
1731 * cp-tree.h: Add declarations.
1732 * tree.c (cp_build_qualified_type_real): Don't set, but do
1733 preserve, quals on FUNCTION_TYPE.
1734 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
1735 * decl.c (build_ptrmem_type): Likewise.
1736 (grokdeclarator): Likewise.
1737 (static_fn_type): Likewise.
1738 * decl2.c (change_return_type): Likewise.
1739 (cp_reconstruct_complex_type): Likewise.
1740 * pt.c (tsubst_function_type): Likewise.
1742 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
1744 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
1746 * tree.c (build_min_non_dep_call_vec): Update comment.
1748 2010-05-17 Jason Merrill <jason@redhat.com>
1750 * call.c (struct z_candidate): Add explicit_targs field.
1751 (add_template_candidate_real): Set it.
1752 (build_over_call): Use it to control init-list warning.
1755 * call.c (build_over_call): Limit init-list deduction warning to
1756 cases where the argument is actually an init-list.
1759 * call.c (build_over_call): Don't do bitwise copy for move ctor.
1761 2010-05-17 Dodji Seketeli <dodji@redhat.com>
1762 Jason Merrill <jason@redhat.com>
1765 * decl.c (compute_array_index_type): Call mark_rvalue_use.
1767 2010-05-15 Jason Merrill <jason@redhat.com>
1769 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
1770 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
1772 (finish_eh_spec_block): Adjust.
1774 2010-05-15 Jakub Jelinek <jakub@redhat.com>
1777 * pt.c (tsubst): Unshare template argument.
1779 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
1781 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
1782 * Make-lang.in: Fix dependencies accordingly.
1784 2010-05-14 Jason Merrill <jason@redhat.com>
1787 * except.c (build_throw): Simplify, adjust for DR 475.
1790 * except.c (dtor_nothrow): Return nonzero for type with
1794 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
1795 gimple_build_eh_must_not_throw.
1797 2010-05-14 Martin Jambor <mjambor@suse.cz>
1799 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
1802 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
1804 * call.c (build_new_method_call): Change warning text.
1805 * typeck2.c (build_functional_cast): Change error text.
1807 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
1810 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
1811 shadowing the outer parameter or variables by the declaration of
1812 nested function in nested structure or class. Warn the shadowing by
1813 the declaration of nested lambda expression.
1815 2010-05-13 Jason Merrill <jason@redhat.com>
1817 * typeck.c (cp_build_array_ref): Factor out from...
1818 (build_array_ref): ...here. Drop complain parm.
1819 (build_new_op): Adjust.
1820 * class.c (build_vtbl_ref_1): Adjust.
1821 * decl2.c (grok_array_decl): Adjust.
1822 * cp-tree.h: Adjust prototypes.
1824 2010-05-13 Jan Hubicka <jh@suse.cz>
1826 * decl.c (cp_finish_decl): Do not worry about used attribute.
1828 2010-05-12 Jason Merrill <jason@redhat.com>
1830 * typeck.c (build_array_ref): Take complain parm.
1831 * cp-tree.h: Add it to prototype.
1832 * call.c (build_new_op): Pass it.
1833 * class.c (build_vtbl_ref): Pass it.
1834 * decl2.c (grok_array_decl): Pass it.
1838 * cp-tree.def (NULLPTR_TYPE): Remove.
1839 * cp-tree.h (NULLPTR_TYPE_P): New.
1840 (SCALAR_TYPE_P): Use it.
1841 (nullptr_type_node): New.
1842 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
1843 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
1845 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
1846 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
1847 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
1848 * mangle.c (write_type): Likewise.
1849 * name-lookup.c (arg_assoc_type): Likewise.
1850 * typeck.c (build_reinterpret_cast_1): Likewise.
1851 * rtti.c (typeinfo_in_lib_p): Likewise.
1852 (emit_support_tinfos): Remove local nullptr_type_node.
1854 * cp-tree.h (UNKNOWN_TYPE): Remove.
1855 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
1856 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
1857 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
1858 * class.c (instantiate_type): Check unknown_type_node rather than
1860 * name-lookup.c (maybe_push_decl): Likewise.
1861 * rtti.c (get_tinfo_decl_dynamic): Likewise.
1862 (get_typeid): Likewise.
1863 * semantics.c (finish_offsetof): Likewise.
1866 * call.c (add_template_candidate_real): If deduction fails, still
1867 add the template as a non-viable candidate.
1868 (equal_functions): Handle template candidates.
1869 (print_z_candidate): Likewise.
1870 (print_z_candidates): Likewise.
1871 (build_new_function_call): Likewise.
1873 * cp-tree.h (LOOKUP_LIST_ONLY): New.
1874 * call.c (add_candidates): Enforce it.
1875 (build_new_method_call): Try non-list ctor if no viable list ctor.
1876 (build_user_type_conversion_1): Likewise.
1878 * call.c (add_candidates): Distinguish between type(x) and
1880 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
1881 (build_new_method_call): Give better error for conversion op.
1883 * call.c (add_candidates): Add first_arg and return_type parms.
1884 Add special constructor/conversion op handling.
1885 (convert_class_to_reference): Use it.
1886 (build_user_type_conversion_1): Likewise.
1887 (build_op_call): Likewise.
1888 (build_new_method_call): Likewise.
1889 (build_new_op): Adjust.
1890 (perform_overload_resolution): Adjust.
1892 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
1897 * pt.c (process_partial_specialization): Return error_mark_node
1898 in case of unused template parameters in partial specialization.
1900 2010-05-11 Jakub Jelinek <jakub@redhat.com>
1903 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
1904 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
1905 look at its second operand.
1907 2010-05-10 Jason Merrill <jason@redhat.com>
1910 * semantics.c (baselink_for_fns): Revert earlier change.
1913 * typeck.c (cp_build_modify_expr): Complain about assignment to
1914 array from init list.
1916 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
1919 * decl.c (check_initializer): strip array type before checking for
1920 uninitialized const or ref members.
1922 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
1925 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
1926 error count. Emit errors only if compain is true.
1927 (build_new_1): Do not return error_mark_node if
1928 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
1929 errors. Delay the check for user-provided constructor.
1930 (perform_member_init): Adjust.
1931 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
1934 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
1935 Jason Merrill <jason@redhat.com>
1937 Add support for C++0x nullptr.
1938 * cp-tree.def: Add NULLPTR_TYPE.
1939 * cp-tree.h: Add nullptr_node.
1940 (cp_tree_index): Add CPTI_NULLPTR.
1941 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
1942 * call.c (null_ptr_cst_p): Handle nullptr.
1943 (standard_conversion): Likewise.
1944 (convert_arg_to_ellipsis): Likewise.
1945 * mangle.c (write_type): Likewise.
1946 * name-lookup.c (arg_assoc_type): Likewise.
1947 * parser.c (cp_parser_primary_expression): Likewise.
1948 * typeck.c (cp_build_binary_op): Likewise.
1949 (build_reinterpret_cast_1): Likewise.
1950 * error.c (dump_type): Likewise.
1951 (dump_type_prefix, dump_type_suffix): Likewise.
1952 * decl.c (cxx_init_decl_processing): Likewise.
1953 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
1954 * cvt.c (ocp_convert): Likewise.
1955 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
1956 nullptr_t tinfo in libsupc++.
1958 2010-05-06 Jason Merrill <jason@redhat.com>
1960 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
1962 2010-04-22 Jakub Jelinek <jakub@redhat.com>
1963 Dodji Seketeli <dodji@redhat.com>
1966 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
1968 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
1969 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
1970 (decay_conversion, perform_integral_promotions): Call rvalue_use.
1971 (cp_build_unary_op): Call lvalue_use.
1972 * decl.c (unused_but_set_errorcount): New variable.
1973 (poplevel): Issue -Wunused-but-set-variable diagnostics.
1974 (duplicate_decls): Merge DECL_READ_P flags.
1975 (start_cleanup_fn): Set DECL_READ_P flag.
1976 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
1977 * tree.c (rvalue): Call rvalue_use.
1978 * pt.c (convert_nontype_argument): Likewise.
1979 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
1980 finish_decltype_type): Likewise.
1981 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
1982 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
1983 or rvalue_use depending on the expr.
1984 * init.c (build_new, build_delete): Likewise.
1985 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
1987 2010-05-05 Jason Merrill <jason@redhat.com>
1990 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
1991 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
1993 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1996 * pt.c (unify): Check each elt for error_mark_node.
1998 2010-05-04 Jason Merrill <jason@redhat.com>
2001 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
2003 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2006 * call.c (build_new_method_call): Return error_mark_node if fns is
2009 2010-05-03 Dodji Seketeli <dodji@redhat.com>
2012 * pt.c (most_specialized_class): Pretend we are processing
2013 a template decl during the call to coerce_template_parms.
2015 2010-05-03 Jason Merrill <jason@redhat.com>
2019 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
2020 from the selected underlying type unless -fstrict-enums. Set
2021 ENUM_UNDERLYING_TYPE to have the restricted range.
2022 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
2023 * class.c (check_bitfield_decl): Likewise.
2025 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
2028 * init.c (build_new_1): Revert the accidental checkin in
2031 2010-04-30 Jason Merrill <jason@redhat.com>
2034 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
2035 (pp_cxx_type_specifier_seq): ...here.
2037 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
2039 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
2040 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
2042 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
2045 * typeck.c (warn_args_num): New function.
2046 (convert_arguments): Use warn_args_num to print the diagnostic
2049 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
2052 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
2053 user-provided constructor while recursing.
2055 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
2058 * error.c (print_instantiation_partial_context_line): Handle
2059 recursive instantiation.
2060 (print_instantiation_partial_context): Likewise.
2062 2010-04-27 Jason Merrill <jason@redhat.com>
2064 * init.c (perform_member_init): Check CLASS_TYPE_P.
2066 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2069 * init.c (perform_member_init): check for uninitialized const or
2070 reference members, including array types.
2072 2010-04-24 Jason Merrill <jason@redhat.com>
2074 * tree.c (get_fns): Split out from get_first_fn.
2075 * cp-tree.h: Declare it.
2076 * search.c (shared_member_p): Use it.
2077 * semantics.c (finish_qualified_id_expr): Simplify.
2078 (finish_id_expression): Simplify.
2080 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
2081 whenever object is NULL_TREE. Don't do 'this' capture here.
2082 (finish_qualified_id_expr): Pass NULL_TREE.
2083 (finish_id_expression): Likewise.
2084 (lambda_expr_this_capture): Likewise.
2086 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
2087 rather than checking current_class_ref directly.
2088 (finish_call_expr): Likewise.
2091 * name-lookup.c (qualify_lookup): Disqualify lambda op().
2092 * class.c (current_nonlambda_class_type): New fn.
2093 * semantics.c (nonlambda_method_basetype): New.
2094 * cp-tree.h: Declare them.
2095 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
2097 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
2100 * semantics.c (lambda_return_type): Complain about
2104 * tree.c (cv_unqualified): Handle error_mark_node.
2107 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
2108 if we don't want errors.
2111 * class.c (convert_to_base): Add complain parameter. Pass
2112 ba_quiet to lookup_base if we don't want errors.
2113 (build_vfield_ref): Pass complain to convert_to_base.
2114 * call.c (convert_like_real): Likewise.
2115 (initialize_reference): Likewise.
2116 (perform_direct_initialization_if_possible): Pass complain to
2118 * cp-tree.h: Adjust.
2120 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2121 Jason Merrill <jason@redhat.com>
2124 * decl.c (check_for_uninitialized_const_var): Handle classes that need
2126 (check_initializer): Call it for classes that need constructing, too.
2127 * class.c (in_class_defaulted_default_constructor): New.
2128 * cp-tree.h: Declare it.
2130 2010-04-20 Jason Merrill <jason@redhat.com>
2133 * init.c (constant_value_1): Treat error_mark_node as a constant
2134 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
2135 * cvt.c (ocp_convert): Handle getting error_mark_node from
2136 integral_constant_value.
2137 * decl.c (compute_array_index_type): Likewise.
2139 2010-04-20 Dodji Seketeli <dodji@redhat.com>
2143 * typeck.c (incompatible_dependent_types_p): If one of the
2144 compared types if not a typedef then honour their main variant
2147 2010-04-20 Jakub Jelinek <jakub@redhat.com>
2149 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
2151 2010-04-19 Dodji Seketeli <dodji@redhat.com>
2154 * typeck.c (structural_comptypes): Test dependent typedefs
2155 incompatibility before testing for their main variant based
2158 2010-04-19 Jakub Jelinek <jakub@redhat.com>
2160 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
2161 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
2163 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
2165 * decl.c (cxx_init_decl_processing): Remove second argument in call to
2166 build_common_tree_nodes.
2168 2010-04-14 Jason Merrill <jason@redhat.com>
2171 * parser.c (cp_parser_parenthesized_expression_list): Change
2172 is_attribute_list parm to int to indicate whether or not to
2173 handle initial identifier specially.
2174 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
2176 2010-04-13 Jason Merrill <jason@redhat.com>
2178 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
2180 * parser.c (cp_parser_lambda_expression): Complain about lambda in
2181 unevaluated context.
2182 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
2184 2010-04-12 Jason Merrill <jason@redhat.com>
2187 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
2188 return value directly.
2190 * call.c (type_decays_to): Call cv_unqualified for non-class type.
2192 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
2195 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2196 * init.c (build_new_1): Check for uninitialized const members and
2197 uninitialized reference members, when using new without
2198 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
2199 (diagnose_uninitialized_cst_or_ref_member): Define, call
2200 diagnose_uninitialized_cst_or_ref_member_1.
2201 (diagnose_uninitialized_cst_or_ref_member_1): New function.
2203 2010-04-12 Richard Guenther <rguenther@suse.de>
2206 * semantics.c (expand_or_defer_fn_1): Do not keep extern
2207 template inline functions.
2209 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2212 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
2215 2010-04-07 Jason Merrill <jason@redhat.com>
2218 * decl.c (start_preparsed_function): Do defer nested functions.
2220 PR c++/11094, DR 408
2221 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
2222 * decl2.c (finish_static_data_member_decl): Set it.
2223 * decl.c (duplicate_decls): Propagate it.
2224 * pt.c (tsubst_decl): Don't substitute the domain of an array
2225 VAR_DECL if it's set.
2226 (regenerate_decl_from_template): Substitute it here.
2227 (type_dependent_expression_p): Return true if it's set.
2228 * semantics.c (finish_decltype_type): Instantiate such a variable.
2229 * typeck.c (cxx_sizeof_expr): Likewise.
2230 (strip_array_domain): New.
2233 * name-lookup.c (current_decl_namespace): Non-static.
2234 (pop_nested_namespace): Sanity check.
2235 * cp-tree.h: Declare current_decl_namespace.
2236 * decl.c (grokvardecl): Use it instead of current_namespace.
2237 (grokfndecl): Likewise.
2240 * pt.c (tsubst_friend_function): Instatiate a friend that has already
2243 * pt.c (print_template_statistics): New.
2244 * cp-tree.h: Declare it.
2245 * tree.c (cxx_print_statistics): Call it.
2248 * decl.c (grokvardecl): Tweak warning message.
2249 (grokfndecl): Likewise.
2251 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2254 *pt.c (tsubst_decl): Get the arguments of a specialization from
2255 the specialization template, not from the most general template.
2257 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2260 * typeck2.c (process_init_constructor_record):
2261 value-initialize members that are are not explicitely
2264 2010-04-07 Jie Zhang <jie@codesourcery.com>
2267 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
2268 when all of its elements are non-constant and have been split out.
2270 2010-04-06 Taras Glek <taras@mozilla.com>
2271 Jason Merrill <jason@redhat.com>
2273 * parser.c (cp_parser_class_specifier): Set class location to that
2274 of IDENTIFIER_NODE instead of '{' when possible.
2275 * semantics.c (begin_class_definition): Do not overide locations
2276 with less precise ones.
2278 2010-04-06 Jason Merrill <jason@redhat.com>
2281 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
2284 * pt.c (maybe_update_decl_type): Check the return value from
2287 2010-04-01 Jason Merrill <jason@redhat.com>
2289 * decl.c (next_initializable_field): No longer static.
2290 * cp-tree.h: Declare it.
2291 * call.c (build_aggr_conv): Fail if there are more initializers
2292 than initializable fields.
2294 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
2295 instead of void_zero_node.
2297 2010-03-31 Dodji Seketeli <dodji@redhat.com>
2300 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
2301 * pt.c (end_template_parm_list): Store sibling template parms of
2302 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2303 (push_template_decl_real): Don't store the containing template decl
2304 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
2305 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
2306 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2309 2010-03-30 Jason Merrill <jason@redhat.com>
2312 * pt.c (push_template_decl_real): Deal better with running out of
2313 scopes before running out of template parms.
2317 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
2318 function parameter context. Don't print an error if parsing
2322 * pt.c (more_specialized_fn): Don't control cv-qualifier check
2325 2010-03-26 Jason Merrill <jason@redhat.com>
2328 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
2329 c++0x mode, but not other type-names.
2331 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2334 * pt.c (add_to_template_args): Support NULL ARGS;
2335 (most_specialized_class): call coerce_template_parms on
2336 template arguments passed to get_class_bindings. Use
2337 add_to_template_args.
2338 (unify): Handle VAR_DECLs.
2340 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2342 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
2344 * pt.c (get_template_parms_at_level): Adjust.
2346 2010-03-25 Dodji Seketeli <dodji@redhat.com>
2349 * cp-tree.h (get_template_parms_at_level): Declare ...
2350 * pt.c (get_template_parms_at_level): ... new function.
2351 * typeck.c (get_template_parms_of_dependent_type): If a template
2352 type parm's DECL_CONTEXT isn't yet set, get its siblings from
2353 current_template_parms. Use get_template_parms_at_level. Remove
2355 (incompatible_dependent_types_p): If we get empty parms from just one
2356 of the template type parms we are comparing then the template parms are
2359 2010-03-24 Jason Merrill <jason@redhat.com>
2362 * parser.c (make_declarator): Initialize id_loc.
2363 (cp_parser_lambda_declarator_opt): And set it.
2365 2010-03-23 Jason Merrill <jason@redhat.com>
2367 Make lambda conversion op and op() non-static.
2368 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
2369 Also add the thunk function returned by the conversion op.
2370 Mark the conversion deleted if the op() is variadic.
2371 * decl2.c (mark_used): Give helpful message about deleted conversion.
2372 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
2373 * semantics.c (finish_this_expr): Adjust.
2374 * mangle.c (write_closure_type_name): Adjust.
2375 * decl.c (grok_op_properties): Don't allow it.
2376 * call.c (build_user_type_conversion_1): No static conversion ops.
2377 (build_op_call): Or op().
2379 * decl2.c (change_return_type): Fix 'this' quals.
2381 2010-03-22 Jason Merrill <jason@redhat.com>
2384 * tree.c (pod_type_p): Use old meaning in C++98 mode.
2387 * pt.c (contains_auto_r): New fn.
2388 (do_auto_deduction): Use it.
2389 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
2391 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
2394 * decl2.c (grokfield): Handle invalid initializers for member
2397 2010-03-20 Dodji Seketeli <dodji@redhat.com>
2400 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
2402 * decl2.c (vague_linkage_p): Likewise.
2404 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
2407 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
2408 false, in the cp_parser_expression_statement call.
2410 2010-03-05 Jason Merrill <jason@redhat.com>
2412 * mangle.c (mangle_decl): Give name collision error even without
2415 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
2417 * pt.c (process_partial_specialization): Use error_n instead of
2420 2010-03-03 Jason Merrill <jason@redhat.com>
2423 * mangle.c (mangle_decl): Handle VAR_DECL, too.
2425 2010-03-03 Jason Merrill <jason@redhat.com>
2428 * mangle.c: Include cgraph.h.
2429 (mangle_decl): If the mangled name will change in a later
2430 ABI version, make the later mangled name an alias.
2431 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
2432 * Make-lang.in (mangle.o): Depend on cgraph.h.
2433 * method.c (make_alias_for): Handle VAR_DECL, too.
2434 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
2435 * tree.c (no_linkage_check): Adjust.
2436 * decl.c (maybe_commonize_var): Adjust.
2437 * cp-tree.h: Adjust.
2439 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
2441 * pt.c (redeclare_class_template): Use error_n and inform_n.
2443 2010-02-27 Mark Mitchell <mark@codesourcery.com>
2446 * cp-tree.h (push_tinst_level): Declare.
2447 (pop_tinst_level): Likewise.
2448 * pt.c (push_tinst_level): Give it external linkage.
2449 (pop_tinst_level): Likewise.
2450 * mangle.c (mangle_decl_string): Set the source location to that
2451 of the decl while mangling.
2453 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
2456 * pt.c (redeclare_class_template): Return false if there are erroneous
2457 template parameters.
2459 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
2461 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
2464 2010-02-24 Jason Merrill <jason@redhat.com>
2467 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
2469 * class.c (layout_class_type): Don't give -Wabi warning for a bug
2470 in a previous ABI version.
2472 2010-02-23 Jason Merrill <jason@redhat.com>
2475 * typeck2.c (digest_init_r): Accept value init of array.
2477 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
2480 * typeck.c (convert_arguments): Update error message.
2482 2010-02-22 Mike Stump <mikestump@comcast.net>
2485 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
2487 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
2490 * error.c (print_instantiation_partial_context_line): New.
2491 (print_instantiation_partial_context): Print at most 12 contexts,
2492 skip the rest with a message.
2494 2010-02-21 Dodji Seketeli <dodji@redhat.com>
2497 * pt.c (lookup_template_class): Better support of specialization
2498 of member of class template implicit instantiation.
2500 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
2503 * call.c (conversion_null_warnings): Replace -Wconversion with
2505 * cvt.c (build_expr_type_conversion): Likewise.
2507 2010-02-18 Jason Merrill <jason@redhat.com>
2510 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
2513 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
2515 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
2516 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
2519 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
2523 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
2524 (maybe_update_decl_type): New fn.
2525 * parser.c (cp_parser_init_declarator): Use it.
2528 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
2530 2010-02-17 Jason Merrill <jason@redhat.com>
2533 * call.c (build_over_call): Don't create zero-sized assignments.
2534 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
2535 * cp-objcp-common.c (cp_expr_size): Remove.
2536 * cp-tree.h: Remove prototype.
2539 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
2540 decl we looked up doesn't match.
2543 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
2544 have an INIT_EXPR anymore.
2547 * pt.c (convert_nontype_argument): Change assert to test.
2549 2010-02-16 Jason Merrill <jason@redhat.com>
2551 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
2554 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
2555 VIEW_CONVERT_EXPR for conversions between structural equality types
2556 that the back end can't tell are the same.
2559 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
2560 cv-quals from element here.
2561 (cp_build_qualified_type_real): Not here. Preserve typedef name.
2563 2010-02-14 Jason Merrill <jason@redhat.com>
2566 * semantics.c (finish_compound_literal): Use
2567 cp_apply_type_quals_to_decl when creating a static variable.
2569 2010-02-12 Jason Merrill <jason@redhat.com>
2572 * name-lookup.h (current_binding_level): Check for null
2575 2010-02-12 Jason Merrill <jason@redhat.com>
2578 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
2580 2010-02-12 Jakub Jelinek <jakub@redhat.com>
2583 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
2586 2010-02-10 Jason Merrill <jason@redhat.com>
2589 * semantics.c (outer_lambda_capture_p): Revert.
2590 (add_capture): Only finish_member_declaration if
2591 we're in the lambda class.
2592 (register_capture_members): New.
2593 * cp-tree.h: Declare it.
2594 * parser.c (cp_parser_lambda_expression): Call it.
2596 2010-02-10 Jason Merrill <jason@redhat.com>
2599 * semantics.c (outer_lambda_capture_p): Use current_function_decl
2600 instead of current_class_type.
2602 2010-02-10 Jason Merrill <jason@redhat.com>
2604 PR c++/42983, core issue 906
2605 * method.c (defaultable_fn_check): Check virtualness.
2607 2010-02-10 Jason Merrill <jason@redhat.com>
2610 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
2612 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
2614 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
2615 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
2617 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
2618 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
2619 (cp_parser_parameter_declaration)
2620 (cp_parser_exception_specification_opt)
2621 (cp_parser_exception_declaration): Likewise.
2622 * pt.c (check_default_tmpl_args): Likewise.
2623 * search.c (lookup_field_r): Likewise.
2625 2010-02-09 Jason Merrill <jason@redhat.com>
2628 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
2630 2010-02-09 Jason Merrill <jason@redhat.com>
2633 * decl2.c (change_return_type): New fn.
2634 * semantics.c (apply_lambda_return_type): Use it.
2635 * cp-tree.h: Declare it.
2637 2010-02-05 Richard Guenther <rguenther@suse.de>
2639 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
2640 * cp-lang.c: Include gt-cp-cp-lang.h.
2641 * config-lang.in (gtfiles): Add cp/cp-lang.c.
2643 2010-02-05 Dodji Seketeli <dodji@redhat.com>
2646 * typeck.c (get_template_parms_of_dependent_type): Try getting
2647 the template parameters fromt the type itself first.
2649 2010-02-03 Jason Merrill <jason@redhat.com>
2653 * mangle.c (write_unqualified_id): Split out from write_expression.
2654 (write_unqualified_name): Call it.
2655 (write_member_name): Likewise.
2656 (write_expression): Support TEMPLATE_ID_EXPR.
2657 Disambiguate operator names.
2660 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
2663 2010-02-02 Jason Merrill <jason@redhat.com>
2666 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
2667 * optimize.c (clone_body): Remap their initializers when making base
2669 (maybe_clone_body): Complain if multiple clones aren't safe.
2671 2010-01-29 Dodji Seketeli <dodji@redhat.com>
2678 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
2679 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
2680 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
2681 * pt.c (coerce_template_parms, type_unification_real,
2682 expand_template_argument_pack, coerce_template_parameter_pack):
2683 Set the non default template args count.
2684 (current_template_args): Always set non defaulted
2685 template args count when compiled with --enable-checking
2686 (tsubst_template_args, type_unification_real): Propagate the non
2687 defaulted template args count.
2688 * error.c (get_non_default_template_args_count): Renamed
2689 count_non_default_template_args into this. Don't calculate the
2690 non default template argument count anymore. Use the new
2691 accessor macros above to get it.
2692 (dump_template_argument_list, dump_type, dump_decl,
2693 dump_template_parms): Adjust.
2694 * parser.c (cp_parser_template_argument_list): Always set defaulted
2695 template args count when compiled with --enable-checking.
2697 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
2699 * decl.c (redeclaration_error_message): Wrap the return messages into
2700 G_() for easy translation.
2702 2010-01-28 Jason Merrill <jason@redhat.com>
2705 * semantics.c (begin_class_definition): Don't use type_as_string.
2707 2010-01-28 Dodji Seketeli <dodji@redhat.com>
2711 * typeck.c (get_template_parms_of_dependent_type): Factorized
2712 this out of incompatible_template_type_parms_p
2713 (incompatible_dependent_types_p): Renamed
2714 incompatible_template_type_parms_p into this. Make it detect
2715 two incompatible dependent typedefs too.
2716 (structural_comptypes): Use incompatible_dependent_types_p.
2717 * pt.c (get_template_info):
2718 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
2720 2010-01-20 Janis Johnson <janis187@us.ibm.com>
2721 Jason Merrill <jason@redhat.com>
2723 * mangle.c (write_type): Mangle transparent record as member type.
2724 * semantics.c (begin_class_definition): Recognize decimal classes
2725 and set TYPE_TRANSPARENT_AGGR.
2727 2010-01-20 Jason Merrill <jason@redhat.com>
2730 * mangle.c (write_expression): Handle tree codes that have extra
2731 arguments in the middle-end.
2733 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
2736 * except.c (expand_start_catch_block): Deal correctly with
2737 do_begin_catch returning error_mark_node.
2739 2010-01-20 Jason Merrill <jason@redhat.com>
2742 * class.c (layout_class_type): Set packed_maybe_necessary for packed
2746 * semantics.c (build_lambda_object): Call mark_used on captured
2750 * decl.c (grokdeclarator): Clear type_quals for a member function
2751 declared using a typedef. Don't complain about adding cv-quals
2752 to a function typedef in C++0x mode.
2754 2010-01-20 Jakub Jelinek <jakub@redhat.com>
2756 * decl.c (create_array_type_for_decl): Remove set but not used
2757 variable error_msg. Remove break stmts after return stmts.
2759 2010-01-19 Dodji Seketeli <dodji@redhat.com>
2761 * error.c (dump_template_parms, count_non_default_template_args):
2762 Revert fix of PR c++/42634.
2764 2010-01-18 Dodji Seketeli <dodji@redhat.com>
2767 * error.c (dump_template_parms): Use innermost template
2768 arguments before calling count_non_default_template_args.
2769 (count_non_default_template_args): We are being called with
2770 template innermost arguments now. There is no need to ensure
2773 2010-01-18 Dodji Seketeli <dodji@redhat.com>
2776 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
2778 2010-01-17 Dodji Seketeli <dodji@redhat.com>
2781 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
2783 2010-01-17 Dodji Seketeli <dodji@redhat.com>
2786 *pt.c (tsubst_decl): Get the arguments of a specialization from
2787 the specialization template, not from the most general template.
2789 2010-01-16 Jason Merrill <jason@redhat.com>
2792 * semantics.c (finish_decltype_type): Within a template, treat
2793 unresolved CALL_EXPR as dependent.
2795 2010-01-15 Dodji Seketeli <dodji@redhat.com>
2797 * error.c (dump_template_parms,count_non_default_template_args):
2798 Revert changes of PR c++/42634.
2800 2010-01-14 Jakub Jelinek <jakub@redhat.com>
2803 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
2804 functions with noreturn attribute.
2806 2010-01-14 Jason Merrill <jason@redhat.com>
2809 * call.c (build_new_method_call): Don't free the vec here.
2812 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
2814 2010-01-13 Dodji Seketeli <dodji@redhat.com>
2817 * error.c (dump_template_parms): Use innermost template
2818 arguments before calling count_non_default_template_args.
2819 (count_non_default_template_args): We are being called with
2820 template innermost arguments now. There is no need to ensure
2823 2010-01-07 Dodji Seketeli <dodji@redhat.com>
2826 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
2827 arguments that were previously deduced.
2829 2010-01-05 Jason Merrill <jason@redhat.com>
2831 * pt.c (unify_pack_expansion): Handle deduction from init-list.
2832 * call.c (build_over_call): Don't complain about it.
2834 2010-01-04 Jason Merrill <jason@redhat.com>
2837 * pt.c (tsubst_decl): Don't apply type attributes in place.
2840 * semantics.c (describable_type): Remove decltype comment and
2845 Copyright (C) 2010 Free Software Foundation, Inc.
2847 Copying and distribution of this file, with or without modification,
2848 are permitted in any medium without royalty provided the copyright
2849 notice and this notice are preserved.