1 2010-11-02 Dodji Seketeli <dodji@redhat.com>
5 * pt.c (check_valid_ptrmem_cst_expr): Add a complain parameter to
7 (convert_nontype_argument, convert_nontype_argument): Pass the
8 complain parameter down to check_valid_ptrmem_cst_expr.
10 2010-11-02 Dodji Seketeli <dodji@redhat.com>
13 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): Remove.
14 (struct template_parm_index_s)<num_siblings>: New field.
15 (TEMPLATE_PARM_NUM_SIBLINGS): New accessor.
16 (process_template_parm): Extend the API to accept the number of
17 template parms in argument.
18 (cp_set_underlying_type): Remove this.
19 * class.c (build_self_reference): Require canonical type equality
20 back on the self reference of class.
21 * decl2.c (grokfield): Require canonical type equality back on
23 * name-lookup.c (pushdecl_maybe_friend): Require canonical type
24 equality back on typedefs.
25 * parser.c (cp_parser_template_parameter_list): Do not require
26 canonical type equality on dependent types created during template
28 * pt.c (fixup_template_type_parm_type, fixup_template_parm_index)
29 (fixup_template_parm, fixup_template_parms): New private
31 (current_template_args): Declare this.
32 (process_template_parm): Pass the total number of template parms
33 to canonical_type_parameter.
34 (build_template_parm_index): Add a new argument to carry the total
35 number of template parms.
36 (reduce_template_parm_level, process_template_parm, make_auto):
38 (current_template_args): Fix this for template template
40 (tsubst_template_parm): Split out of ...
41 (tsubst_template_parms): ... this.
42 (reduce_template_parm_level): Don't loose
43 TEMPLATE_PARM_NUM_SIBLINGS when cloning a TEMPLATE_PARM_INDEX.
44 (template_parm_to_arg): Extracted this function from
45 current_template_args. Make it represent invalid template parms
46 with an error_mark_node instead of a LIST_TREE containing an
48 (current_template_args): Use template_parm_to_arg.
49 (dependent_template_arg_p): Consider an invalid template argument
51 (end_template_parm_list): Do not update template sibling parms
52 here anymore. Use fixup_template_parms instead.
53 (process_template_parm): Pass the number of template parms to
54 canonical_type_parameter.
55 (make_auto): Require structural equality on auto
56 TEMPLATE_TYPE_PARM for now.
57 (unify)<BOUND_TEMPLATE_TEMPLATE_PARM>: Coerce template parameters
58 using all the arguments deduced so far.
59 (tsubst)<TEMPLATE_TYPE_PARM>: Pass the number of sibling parms to
60 canonical_type_parameter.
61 * tree.c (cp_set_underlying_type): Remove.
62 * typeck.c (get_template_parms_of_dependent_type)
63 (incompatible_dependent_types_p): Remove.
64 (structural_comptypes): Do not call incompatible_dependent_types_p
66 (comp_template_parms_position): Re-organized. Take the length of
67 template parms list in account.
69 2010-11-01 Jason Merrill <jason@redhat.com>
71 * semantics.c (call_stack, call_stack_tick, cx_error_context): New.
72 (last_cx_error_tick, push_cx_call_context, pop_cx_call_context): New.
73 (cxx_eval_call_expression): Call push/pop_cx_call_context instead
74 of giving follow-on errors.
75 * error.c (maybe_print_constexpr_context): New.
76 (cp_diagnostic_starter): Call it.
77 * cp-tree.h: Declare cx_error_context.
79 * semantics.c (cxx_eval_constant_expression): Explain
80 unacceptable use of variable better.
82 2010-11-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
83 Jason Merrill <jason@redhat.com>
85 * call.c (null_ptr_cst_p): Use maybe_constant_value.
86 (set_up_extended_ref_temp): Support constant initialization.
87 (initialize_reference): Adjust.
88 * class.c (check_bitfield_decl): Use cxx_constant_value.
89 * cvt.c (ocp_convert): Don't use integral_constant_value when
90 converting to class type.
91 * decl.c (finish_case_label): Use maybe_constant_value.
92 (build_init_list_var_init): Support constant initialization.
93 (check_initializer): Likewise. Reorganize.
94 (cp_finish_decl): Likewise.
95 (expand_static_init): Likewise.
96 (compute_array_index_type): Use maybe_constant_value.
98 (create_array_type_for_decl, grokdeclarator): Pass it.
99 (build_enumerator): Use cxx_constant_value.
100 * decl2.c (grokfield): Use maybe_constant_init.
101 * except.c (check_noexcept_r): Handle constexpr.
102 (build_noexcept_spec): Use maybe_constant_value.
103 * init.c (expand_default_init): Support constant initialization.
104 (build_vec_init): Likewise.
105 (constant_value_1): Adjust.
106 (build_new_1): Adjust.
107 * parser.c (cp_parser_constant_expression): Allow non-integral
109 (cp_parser_direct_declarator): Don't fold yet in C++0x mode.
110 (cp_parser_initializer_clause): Toss folded result if non-constant.
111 * pt.c (fold_decl_constant_value): Remove.
112 (convert_nontype_argument): Use maybe_constant_value. Give clearer
113 error about overflow.
114 (tsubst): Move array bounds handling into compute_array_index_type.
115 (value_dependent_expression_p): Handle constant CALL_EXPR.
116 (tsubst_decl): Don't set
117 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P yet.
118 (tsubst_expr) [DECL_EXPR]: Pass it into cp_finish_decl.
119 (instantiate_decl): Here too.
120 * semantics.c (finish_static_assert): Use maybe_constant_value.
121 (ensure_literal_type_for_constexpr_object): Make sure type is complete.
122 (potential_constant_expression): Use maybe_constant_value.
123 * tree.c (cast_valid_in_integral_constant_expression_p): Any cast
124 is potentially valid in C++0x.
125 * typeck2.c (store_init_value): Handle constant init.
126 (check_narrowing): Use maybe_constant_value.
127 (build_functional_cast): Set TREE_CONSTANT on literal T().
128 * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): Remove.
129 (LOOKUP_ALREADY_DIGESTED): New.
130 (compute_array_index_type): Adjust prototype.
132 * semantics.c (constexpr_call): New datatype.
133 (constexpr_call_table): New global table.
134 (constexpr_call_hash): New.
135 (constexpr_call_equal): Likewise.
136 (maybe_initialize_constexpr_call_table): Likewise.
137 (lookup_parameter_binding): Likewise.
138 (cxx_eval_builtin_function_call): Likewise.
139 (cxx_bind_parameters_in_call): Likewise.
140 (cxx_eval_call_expression): Likewise.
141 (cxx_eval_unary_expression): Likewise.
142 (cxx_eval_binary_expression): Likewise.
143 (cxx_eval_conditional_expression): Likewise.
144 (cxx_eval_array_reference): Likewise.
145 (cxx_eval_component_reference): Likewise.
146 (cxx_eval_logical_expression): Likewise.
147 (cxx_eval_object_construction): Likewise.
148 (cxx_eval_constant_expression): Likewise.
149 (cxx_eval_indirect_ref): Likewise.
150 (cxx_constant_value): Likewise.
151 (cxx_eval_bare_aggregate): Likewise.
152 (adjust_temp_type): New.
153 (reduced_constant_expression_p): New.
154 (verify_constant): New.
155 (cxx_eval_vec_init, cxx_eval_vec_init_1): New.
156 (cxx_eval_outermost_constant_expr): New.
157 (maybe_constant_value, maybe_constant_init): New.
158 (cxx_eval_constant_expression): Use them.
159 * pt.c (iterative_hash_template_arg): No longer static.
160 * cp-tree.h: Declare fns.
162 * cp-tree.h (register_constexpr_fundef): Declare.
163 * decl.c (maybe_save_function_definition): New.
164 (finish_function): Use it.
165 * semantics.c (constexpr_fundef): New datatype.
166 (constexpr_fundef_table): New global table.
167 (constexpr_fundef_equal): New.
168 (constexpr_fundef_hash): Likewise.
169 (retrieve_constexpr_fundef): Likewise.
170 (validate_constexpr_fundecl): Store in the table.
171 (build_data_member_initialization): New fn.
172 (build_constexpr_constructor_member_initializers): New.
173 (register_constexpr_fundef): Define.
174 (is_this_parameter): New.
175 (get_function_named_in_call): Likewise.
176 (get_nth_callarg): Likewise.
177 (check_automatic_or_tls): New.
178 (morally_constexpr_builtin_function_p): New.
179 (potential_constant_expression): New.
181 2010-11-01 Jason Merrill <jason@redhat.com>
183 * decl2.c (decl_constant_var_p): New fn.
184 (decl_maybe_constant_var_p): New fn.
185 (mark_used): Rework instantiation of things needed for constant
187 * cp-tree.h: Declare new fns.
188 * pt.c (instantiate_decl): Handle cp_unevaluated_operand.
189 (always_instantiate_p): Use decl_maybe_constant_var_p.
190 (instantiate_decl): Don't defer constexpr functions.
191 * repo.c (repo_emit_p): Use decl_maybe_constant_var_p.
192 * semantics.c (finish_id_expression): Use decl_constant_var_p.
193 Check for valid name in constant expr after mark_used.
195 2010-10-31 Jason Merrill <jason@redhat.com>
197 * class.c (is_really_empty_class): Work when type is not complete.
198 (synthesized_default_constructor_is_constexpr): New.
199 (add_implicitly_declared_members): Use it.
200 (type_has_constexpr_default_constructor): Likewise.
201 * cp-tree.h: Declare it.
202 * method.c (synthesized_method_walk): Use it.
204 * decl.c (pop_switch): Use EXPR_LOC_OR_HERE.
205 * typeck.c (convert_for_assignment): Likewise.
207 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
208 message about constexpr without -std=c++0x.
210 * decl.c (grokdeclarator): Don't ICE on constexpr non-static data
213 2010-10-30 Nathan Froyd <froydnj@codesourcery.com>
215 * class.c (layout_vtable_decl): Call build_array_of_n_type.
216 (build_vtt, build_ctor_vtabl_group): Likewise.
218 2010-10-30 Nicola Pero <nicola.pero@meta-innovation.com>
220 Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
221 * parser.c (cp_parser_objc_at_property_declaration): Removed
222 parsing of RID_COPIES and RID_IVAR. Updated call to
223 objc_add_property_declaration.
224 * typecheck.c (finish_class_member_access_expr): Call
225 objc_maybe_build_component_ref instead of objc_build_setter_call.
226 (cp_build_modify_expr): Call objc_maybe_build_modify_expr instead
227 of objc_build_getter_call.
229 2010-10-27 Jason Merrill <jason@redhat.com>
231 * cp-tree.h (cp_trait_kind): Add CPTK_IS_LITERAL_TYPE.
232 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle it.
233 * semantics.c (trait_expr_value, finish_trait_expr): Likewise.
234 * parser.c (cp_parser_primary_expression): Handle RID_IS_LITERAL_TYPE.
235 (cp_parser_trait_expr): Likewise.
237 2010-10-27 Gabriel Dos Reis <gdr@cse.tamu.edu>
238 Jason Merrill <jason@redhat.com>
240 * decl.c (finish_case_label): Use decl_constant_value.
242 * method.c (synthesized_method_walk): Track constexprness too.
243 (process_subob_fn, walk_field_subobs): Likewise.
244 (implicitly_declare_fn): Set DECL_DECLARED_CONSTEXPR_P.
245 (defaulted_late_check): Handle DECL_DECLARED_CONSTEXPR_P.
246 * class.c (add_implicitly_declared_members): Handle
247 constexpr default ctor.
249 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
250 Make sure a constexpr ctor has an empty body.
251 * class.c (type_has_constexpr_default_constructor): New.
252 * cp-tree.h: Declare it.
253 * init.c (perform_member_init): Complain about uninitialized
254 member in constexpr ctor.
255 (emit_mem_initializers): And uninitialized base.
256 * decl.c (check_tag_decl): Fix typo.
258 * semantics.c (valid_type_in_constexpr_fundecl_p): New fn.
259 (is_valid_constexpr_fn): New fn.
260 (validate_constexpr_fundecl): Use it.
261 * decl.c (validate_constexpr_redeclaration): New.
262 (duplicate_decls): Use it.
263 (cp_finish_decl): Call validate_constexpr_fundecl and
264 ensure_literal_type_for_constexpr_object here.
265 (start_decl): Not here. Don't ICE on constexpr reference.
266 (check_for_uninitialized_const_var): Don't handle constexpr specially.
267 (grokfndecl): Set DECL_DECLARED_CONSTEXPR_P.
268 (check_static_variable_definition): Give friendly message about
270 (grokdeclarator): Complain about typedef and volatile with constexpr.
271 Reorganize. Give sorry about non-static data members in C++0x mode.
272 (start_preparsed_function): Check validate_constexpr_fundecl here.
273 (check_function_type): Not here.
274 * decl2.c (finish_static_data_member_decl): Don't complain about
276 * parser.c (CP_PARSER_FLAGS_ONLY_TYPE_OR_CONSTEXPR): New.
277 (cp_parser_condition): Pass it to cp_parser_decl_specifier_seq.
278 (cp_parser_decl_specifier_seq): Handle it.
279 (cp_parser_explicit_instantiation): Diagnose inline and constexpr.
281 * class.c (check_bases): Propagate non-literality.
282 (check_field_decls): Likewise.
283 (finalize_literal_type_property): New.
284 (check_bases_and_members): Call it.
285 * cp-tree.h (TYPE_HAS_CONSTEXPR_CTOR): New.
286 (lang_type_class): Add has_constexpr_ctor field.
287 (DECL_DECLARED_CONSTEXPR_P): Strip template.
288 * decl.c (grok_special_member_properties): Set
289 TYPE_HAS_CONSTEXPR_CTOR.
291 2010-10-27 Jason Merrill <jason@redhat.com>
293 * call.c (build_integral_nontype_arg_conv): New.
294 * cp-tree.h: Declare it.
295 * pt.c (convert_nontype_argument): Use it.
297 * error.c (dump_simple_decl): Print constexpr.
299 * cvt.c (build_up_reference): Use target_type for the temporary var.
301 * except.c (build_throw): Set EXPR_LOCATION.
303 * tree.c (build_cplus_new): Handle CONSTRUCTOR.
305 * semantics.c (finish_compound_stmt): Avoid creating an
306 unnecessary BIND_EXPR.
308 * call.c (convert_like_real): Don't check narrowing if the element
309 is also an initializer-list.
311 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
313 * parser.c (cp_parser_objc_at_property_declaration): Recognize
314 RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
315 Do not use objc_set_property_attr, but use local variables
316 instead. Detect repeated usage of setter, getter and ivar
317 attributes. Improved error processing when a setter name does not
318 end in ':'. Do not check for CPP_CLOSE_PAREN after we determined
319 that the token is a keyword. Updated call to
320 objc_add_property_declaration.
322 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
324 * parser.c (cp_parser_objc_property_decl): Renamed to
325 cp_parser_objc_struct_declaration. Return the parsed trees
326 instead of calling objc_add_property_variable directly. Detect
327 missing or invalid declspecs. Implemented attributes. Do not eat
328 the ';' at the end. Exit loop whenever a non-comma is parsed, not
330 (cp_parser_objc_at_property): Renamed to
331 cp_parser_objc_at_property_declaration. Updated calls to
332 objc_add_property_variable, now objc_add_property_declaration, and
333 to cp_parser_objc_property_decl, now
334 cp_parser_objc_struct_declaration. Rewritten all code to be more
335 robust in dealing with syntax errors, and almost identical to the
336 one in c_parser_objc_at_property_declaration.
337 (cp_parser_objc_property_attrlist): Removed.
338 (cp_parser_objc_method_prototype_list): Updated call to
339 cp_parser_objc_at_property.
340 (cp_parser_objc_method_definition_list): Same change.
341 (cp_parser_objc_class_ivars): Detect a number of invalid
342 declarations of instance variables and produce errors when they
345 2010-10-26 Jason Merrill <jason@redhat.com>
347 * tree.c (build_vec_init_expr): Split out from...
348 (build_array_copy): ...here.
349 * init.c (perform_member_init): Use it.
350 * cp-tree.h: Declare it.
351 * cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for
352 VEC_INIT_EXPR and AGGR_INIT_EXPR here. Drop pre/post parameters.
353 (cp_gimplify_expr): Handle array default-initialization via
356 * tree.c (stabilize_expr): Handle xvalues properly.
358 * call.c (build_over_call): Use argarray[0] for 'this' argument.
360 * decl.c (finish_function): Don't look at function_depth.
362 2010-10-25 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
364 Implement opaque-enum-specifiers for C++0x.
365 * cp-tree.h (SET_OPAQUE_ENUM_P): New.
366 (OPAQUE_ENUM_P): New.
367 (ENUM_FIXED_UNDERLYING_TYPE_P): New.
368 (start_enum): Update prototype.
369 (finish_enum_value_list): New prototype.
370 * parser.c (cp_parser_elaborated_type_specifier): Issue a pedwarn if
371 "enum class" is used in an elaborated-type-specifier.
372 (cp_parser_enum_specifier): Rewrite to parse opaque-enum-specifiers.
373 * decl.c (copy_type_enum): New.
374 (finish_enum_value_list): New, with code from finish_enum.
375 (finish_enum): A lot of code removed. Added a gcc_assert.
376 (start_enum): Add parameters enumtype and is_new.
377 Rewrite to work with opaque-enum-specifiers.
378 * pt.c (maybe_process_partial_specialization): Allow for template
379 specialization of enumerations, with a pedwarn.
380 (lookup_template_class): Update call to start_enum. Call to
382 (tsubst_enum): Call to begin_scope, finish_scope and
383 finish_enum_value_list.
385 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com>
387 Removed Objective-C++ specific replacement of cxx_printable_name.
388 * cp-objcp-common.h: Added LANG_HOOKS_DECL_PRINTABLE_NAME, set
389 to cxx_printable_name for both C++ and Objective-C++.
390 * cp-lang.h: Removed LANG_HOOKS_DECL_PRINTABLE_NAME.
392 * error.c (dump_decl): For Objective-C++, call
393 objc_maybe_printable_name here ...
394 * tree.c (cxx_printable_name_internal): ... instead of here.
396 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com>
398 * tree.c (cxx_printable_name_internal): In Objective-C++, call
399 objc_maybe_printable_name.
401 2010-10-22 Jason Merrill <jason@redhat.com>
404 * pt.c (instantiate_class_template): Don't instantiate default
408 * init.c (build_vec_init): Handle memberwise move.
410 2010-10-21 Paolo Carlini <paolo.carlini@oracle.com>
413 * call.c (add_function_candidate): Don't use TREE_VALUE on null
416 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
418 * parser.c (cp_parser_objc_method_type): Mark inline. Return a
419 bool instead of calling objc_set_method_type.
420 (cp_parser_objc_method_signature): Updated calls to
421 cp_parser_objc_method_type and to objc_build_method_signature.
422 (cp_parser_objc_method_prototype_list): Updated calls to
423 objc_add_method_declaration. Use token->type to determine if it
424 is a class method or not.
425 (cp_parser_objc_method_definition_list): Same change.
427 2010-10-20 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
430 * parser.c (cp_convert_range_for): Call cp_finish_decl
431 instead of finish_expr_stmt.
433 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
435 * cp-lang.c (finish_file): Removed.
436 * decl2.c (cp_write_global_declarations): Call
437 objc_write_global_declarations when compiling Objective-C++.
439 2010-10-19 Paolo Carlini <paolo.carlini@oracle.com>
442 * pt.c (add_to_template_args): Check extra_args for error_mark_node.
443 (coerce_template_parms): Likewise for args.
445 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
447 Implemented parsing @synthesize and @dynamic for Objective-C++.
448 * parser.c (cp_parser_objc_method_definition_list): Recognize
449 RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
450 (cp_parser_objc_at_dynamic_declaration): New.
451 (cp_parser_objc_at_synthesize_declaration): New.
453 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
455 * parser.c (cp_parser_objc_identifier_list): Check the return
456 value of cp_parser_identifier and react if it is error_mark_node.
458 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
460 Merge from apple/trunk branch on FSF servers.
462 2005-03-01 Fariborz Jahanian <fjahanian@apple.com>
465 * call.c (standard_conversion, implicit_conversion): Ignore
466 'volatile' attribute of artificially volatized type in objc when
467 evaluating various conversion weights.
469 2005-11-08 Fariborz Jahanian <fjahanian@apple.com>
472 * typeck.c (comp_ptr_ttypes_real): Remove the hack. un-volatize the
473 artiificially 'volatized' type before doing pointer comparison.
475 2010-10-18 Jakub Jelinek <jakub@redhat.com>
478 * semantics.c (finish_goto_stmt): Call mark_rvalue_use on computed
481 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
483 Merge from apple/trunk branch on FSF servers.
485 2006-04-19 Fariborz Jahanian <fjahanian@apple.com>
488 * parser.c (cp_parser_simple_type_specifier): Don't lookup for
489 objc object types if type is scope qualified.
491 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
493 Merge from apple/trunk branch on FSF servers.
495 2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
498 * lex.c (unqualified_name_lookup_error): Issue diagnostic
499 for private 'ivar' access.
501 2010-10-17 Iain Sandoe <iains@gcc.gnu.org>
503 * parser.c (cp_parser_objc_visibility_spec): Update to use visibility
504 enum, and handle @package.
506 2010-10-15 Jason Merrill <jason@redhat.com>
509 * tree.c (cp_build_qualified_type_real): Don't reuse a variant
510 with a different typedef variant of the element type.
512 2010-10-14 Iain Sandoe <iains@gcc.gnu.org>
514 merge from FSF apple 'trunk' branch.
515 2006 Fariborz Jahanian <fjahanian@apple.com>
517 Radars 4436866, 4505126, 4506903, 4517826
518 * typeck.c (finish_class_member_access_expr): Handle CLASS.property
520 (cp_build_modify_expr): Likewise.
521 * parser.c (cp_parser_objc_method_prototype_list): Handle @property.
522 (cp_parser_objc_method_definition_list): Likewise.
523 (cp_parser_objc_property_decl): New.
524 (cp_parser_objc_property_attrlist): New.
525 (cp_parser_objc_at_property): New.
527 2010-10-14 Richard Guenther <rguenther@suse.de>
530 * cp-tree.h (NULLPTR_TYPE_P): Adjust.
531 * decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node,
533 * error.c (dump_type): Handle NULLPTR_TYPE.
534 (dump_type_prefix): Likewise.
535 (dump_type_suffix): Likewise.
536 * mangle.c (write_type): Likewise.
537 * name-lookup.c (arg_assoc_type): Likewise.
538 * rtti.c (typeinfo_in_lib_p): Likewise.
539 * pt.c (tsubst): Likewise.
541 2010-10-13 Jason Merrill <jason@redhat.com>
544 * class.c (fixup_attribute_variants): New fn.
545 * cp-tree.h: Declare it.
546 * pt.c (instantiate_class_template): Call it.
547 * semantics.c (begin_class_definition): Call it.
549 2010-10-13 Richard Henderson <rth@redhat.com>
551 * cp-lang.c (cp_eh_personality): Update call to
552 build_personality_function.
553 * except.c (choose_personality_routine): Update function comment.
555 2010-10-13 Richard Guenther <rguenther@suse.de>
557 * tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and
558 clear DECL_CHAIN of NAMESPACE_DECLs.
560 2010-10-11 Martin Jambor <mjambor@suse.cz>
563 * cp-tree.h (current_class_ref): Check that cp_function_chain is
565 * call.c (build_cxx_call): Likewise.
567 2010-10-10 Jason Merrill <jason@redhat.com>
569 * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
570 (tsubst_default_arguments): Only do this once for cloned fns.
571 (tsubst): Use typedef_variant_p. Handle LANG_TYPE. Don't
573 (tsubst_expr): Avoid calling tsubst_expr for non-expressions.
574 (tsubst_copy_and_build): Likewise.
575 (tsubst_initializer_list): Likewise.
576 (tsubst_copy): Change default to gcc_unreachable. Handle
577 OVERLOAD and PTRMEM_CST.
579 2010-10-10 Jason Merrill <jason@redhat.com>
583 * pt.c (tsubst_copy) [INTEGER_CST]: Instantiate the type.
585 2010-10-07 Andi Kleen <ak@linux.intel.com>
587 * Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
588 (cc1plus-dummy): Remove.
589 (cc1plus-checksum): Change to run checksum over object files
592 2010-10-08 Joseph Myers <joseph@codesourcery.com>
594 * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
596 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
598 * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to
600 * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for
602 * error.c (dump_expr): Added case for AT_ENCODE_EXPR.
603 * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR.
604 (value_dependent_expression_p): Added case for AT_ENCODE_EXPR.
605 (type_dependent_expression_p): Added case for AT_ENCODE_EXPR.
606 * parser.c (cp_parser_objc_encode_expression): Updated comment.
608 2010-10-07 Nicola Pero <nicola@nicola.brainstorm.co.uk>
610 Merge from apple/trunk branch on FSF servers.
612 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
615 * parser.c (cp_parser_objc_interstitial_code): Recognize
616 and parse RID_NAMESPACE keyword.
618 2010-10-07 Iain Sandoe <iains@gcc.gnu.org>
620 * parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
621 finding ellipsis, before checking for attributes.
623 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
625 Merge from apple/trunk branch on FSF servers.
626 * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
627 longer existing gcc/c-common.def.
629 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
632 * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
633 * parser.c (cp_parser_objc_encode_expression): Build a templatized
634 parse tree for @encode(T).
636 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
639 * c-common.def: Add new expression code AT_ENCODE_EXPR.
641 2010-10-06 Eric Botcazou <ebotcazou@adacore.com>
644 * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
645 code folding offsetof-like computations.
647 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
650 * parser.c (cp_parser_objc_class_interface): If no identifier
651 follows an @interface token, stop parsing the interface after
653 (cp_parser_objc_class_implementation): If no identifier follows an
654 @implementation token, stop parsing the implementation after
657 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
660 * parser.c (cp_parser_objc_method_keyword_params): If the required
661 colon is not found while parsing parameters, stop parsing them.
663 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
666 * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
667 @end after detecting it. Print an error if @end is found without
669 (cp_parser_objc_method_prototype_list): Do not eat the EOF after
670 detecting it. Fixed reading the next token when continuing
671 because of an error in a method signature. Print an error if EOF
672 is found without an '@end'.
673 (cp_parser_objc_method_definition_list): Same change.
675 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
677 Merge from apple/trunk branch on FSF servers:
679 2005-10-17 Fariborz Jahanian <fjahanian@apple.com>
682 * parser.c (cp_parser_objc_method_keyword_params): Check for valid
683 method parameters and issue error.
684 (cp_parser_objc_method_definition_list): Check for invalid tokens
685 which cannot start a function definition.
687 2005-10-14 Fariborz Jahanian <fjahanian@apple.com>
690 * parser.c (cp_parser_objc_message_args): Check for missing message
691 arguments and syntax error.
693 2005-10-13 Fariborz Jahanian <fjahanian@apple.com>
696 * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
699 2005-08-15 Ziemowit Laski <zlaski@apple.com>
702 * parser.c (cp_parser_objc_interstitial_code): Catch stray
703 '{' and '}' tokens and issue appropriate errors.
705 2005-08-02 Ziemowit Laski <zlaski@apple.com>
708 (cp_parser_statement_seq_opt): In addition to '}' and
709 end-of-file, a statement sequence may also be terminated
712 2010-10-05 Joseph Myers <joseph@codesourcery.com>
714 * cp-tree.h (cxx_print_error_function,
715 cxx_initialize_diagnostics): Declare using diagnostic_context
718 2010-10-04 Andi Kleen <ak@linux.intel.com>
720 * Make-lang.in (g++, cc1plus): Add + to build rule.
722 2010-10-04 Jason Merrill <jason@redhat.com>
724 * tree.c (decl_storage_duration): New.
725 * cp-tree.h: Declare it.
726 (duration_kind): Return values.
728 2010-10-03 Jason Merrill <jason@redhat.com>
730 * typeck.c (require_complete_type_sfinae): Add complain parm to...
731 (require_complete_type): ...this function.
732 (cp_build_array_ref, convert_arguments): Use it.
733 (convert_for_initialization, cp_build_modify_expr): Likewise.
734 * cp-tree.h: Declare it.
735 * call.c (build_over_call): Use it.
737 2010-09-30 Iain Sandoe <iains@gcc.gnu.org>
739 merge from FSF 'apple/trunk' branch.
740 2006-01-30 Fariborz Jahanian <fjahanian@apple.com>
743 * cp/parser.c (cp_parser_objc_interstitial_code): For
744 @optional/@required set the optional/required flag.
746 2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>
748 * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
749 and indentation when finding an Objective-C++ CPP_AT_NAME token.
751 2010-09-29 Richard Guenther <rguenther@suse.de>
753 * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
754 (CP_TYPE_CONTEXT): Similar.
755 (FROB_CONTEXT): Frob global_namespace to the global
756 TRANSLATION_UNIT_DECL.
757 * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
758 set DECL_CONTEXT of global_namespace to it.
759 (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
760 instead of zeroing context.
761 (cp_finish_decl): Use DECL_FILE_SCOPE_P.
762 (grokfndecl): Likewise.
763 (start_preparsed_function): Likewise.
764 * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
765 (namespace_binding): Use SCOPE_FILE_SCOPE_P.
766 * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
767 (is_specialization_of_friend): Use CP_DECL_CONTEXT.
768 (push_template_decl_real): Likewise.
769 (tsubst_friend_class): Likewise. Adjust context comparisons.
770 (instantiate_class_template): Use CP_TYPE_CONTEXT.
771 (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
772 * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
775 2010-09-29 Yao Qi <yao@codesourcery.com>
777 * decl.c (get_atexit_node): Fix typo.
779 2010-09-28 Jason Merrill <jason@redhat.com>
781 * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
782 (real_lvalue_p): Take const_tree.
784 * typeck.c (lvalue_or_else): Make temporary arg a permerror.
785 (cp_build_addr_expr_1): Likewise.
787 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
789 Partially merged from apple/trunk branch on FSF servers:
790 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
791 Radar 3803157 (method attributes)
793 * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
794 (cp_parser_objc_method_tail_params_opt): Likewise.
795 (cp_parser_objc_method_signature): Likewise.
796 (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
797 (cp_parser_objc_method_prototype_list): Handle attributes.
798 (cp_parser_objc_method_definition_list): Likewise.
800 2010-09-28 Richard Henderson <rth@redhat.com>
802 * cp-lang.c: Include "target.h".
803 (cp_eh_personality): Use targetm.except_unwind_info.
804 * Make-lang.in (cp-lang.o): Update deps.
806 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
808 * parser.c (cp_parser_objc_valid_prefix_attributes): New.
809 (cp_parser_declaration): Parse prefix attributes for ObjC++.
810 (cp_parser_objc_protocol_declaration): Handle attributes.
811 (cp_parser_objc_class_interface): Likewise.
812 (cp_parser_objc_declaration): Likewise.
814 2010-09-27 Jason Merrill <jason@redhat.com>
816 Require lvalues as specified by the standard.
817 * typeck.c (lvalue_or_else): Use real_lvalue_p.
818 (cp_build_addr_expr_1): Split out of cp_build_unary_op.
819 (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
820 (decay_conversion, get_member_function_from_ptrfunc): Adjust.
821 (build_x_unary_op, build_reinterpret_cast_1): Adjust.
822 (build_const_cast_1): Adjust.
823 * cp-tree.h: Declare new fns.
824 * call.c (build_this, convert_like_real, build_over_call): Adjust.
825 (initialize_reference): Adjust.
826 * class.c (build_base_path, convert_to_base_statically): Adjust.
827 (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
828 * cvt.c (build_up_reference, convert_to_reference): Adjust.
829 * decl.c (register_dtor_fn): Adjust.
830 * decl2.c (build_offset_ref_call_from_tree): Adjust.
831 * except.c (initialize_handler_parm): Adjust.
832 * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
833 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
834 * tree.c (stabilize_expr): Adjust.
836 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
838 Merge from apple/trunk branch on FSF servers:
840 2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
843 * typeck.c (composite_pointer_type): Call objc_have_common_type
844 when comparing two objective-c pointer types.
846 2005-07-18 Ziemowit Laski <zlaski@apple.com>
849 * call.c (standard_conversion): Do not issue warnings when
850 comparing ObjC pointer types.
852 2005-06-22 Ziemowit Laski <zlaski@apple.com>
855 * call.c (standard_conversion): Allow for a pointer conversion
856 between any two ObjC pointer types.
857 * typeck.c (composite_pointer_type): Determine common type
858 for two ObjC pointer types.
860 2010-09-24 Jan Hubicka <jh@suse.cz>
862 * decl.c (finish_function): Use decl_replaceable_p
863 * method.c (make_alias_for_thunk): Update call of
864 cgraph_same_body_alias.
866 2010-09-24 Jason Merrill <jason@redhat.com>
868 * decl.c (compute_array_index_type): Remember type dependence of
870 * pt.c (dependent_type_p_r): Don't recompute it here.
872 * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
873 reference and pointer to the same type as "*" or "&".
875 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
877 * typeck.c (warn_args_num): Use warning 'too many arguments to
878 method [methodname]' for an Objective-C method instead of the less
879 satisfactory 'too many arguments to function' (with no method
882 2010-09-21 Jason Merrill <jason@redhat.com>
884 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
885 special handling if we know the member.
887 2010-09-18 Jason Merrill <jason@redhat.com>
889 * call.c (compare_ics): Do lvalue/rvalue reference binding
890 comparison for ck_list, too.
892 2010-09-15 Jason Merrill <jason@redhat.com>
894 * semantics.c (finish_id_expression): Diagnose use of function
895 parms in evaluated context outside function body.
897 * decl2.c (grokbitfield): Diagnose non-integral width.
899 * call.c (convert_like_real): Use the underlying type of the
900 reference for the temporary.
902 2010-09-15 Jakub Jelinek <jakub@redhat.com>
905 * class.c (build_vtbl_initializer): Use fn instead of init's operand
906 as first argument to FDESC_EXPR.
908 2010-09-15 Paolo Carlini <paolo.carlini@oracle.com>
911 * decl.c (grokdeclarator): Check build_memfn_type return value
914 2010-09-13 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
916 * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
917 (begin_range_for_stmt): Likewise.
919 2010-09-11 Rodrigo Rivas <rodrigorivascosta@gmail.com>
921 Implement range-based for-statements.
922 * cp-tree.def (RANGE_FOR_STMT): New.
923 * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
924 (cp_convert_range_for): Declare.
925 * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
926 (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
927 * semantics.c (begin_range_for_stmt): New.
928 (finish_range_for_decl): New.
929 (finish_for_stmt): Accept also RANGE_FOR_STMT.
930 (perform_koenig_lookup): Add extra argument include_std.
931 * parser.c (cp_parser_c_for): New with code from
932 cp_parser_iteration_statement().
933 (cp_parser_range_for): New.
934 (cp_convert_range_for): New.
935 (cp_parser_iteration_statement): Add range-for support.
936 (cp_parser_condition): Adjust comment.
937 (cp_parser_postfix_expression): perform_koenig_lookup takes extra
939 * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
940 * cxx-pretty-print.c: Likewise.
941 * lex.c (cxx_init): Likewise.
942 * name-lookup.c (lookup_function_nonclass): Add extra argument
944 (lookup_arg_dependent): Likewise.
945 * name-lookup.h: Likewise.
947 2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
950 * error.c (maybe_warn_cpp0x): Add new warning
951 CPP0X_INLINE_NAMESPACES.
952 * parser.c (cp_parser_namespace_definition): Likewise.
953 * cp-tree.h (cpp0x_warn_str): Likewise.
955 2010-09-10 Richard Guenther <rguenther@suse.de>
957 * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
958 TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
960 2010-09-10 Jan Hubicka <jh@suse.cz>
962 PR tree-optimization/45605
963 * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
966 2010-09-08 Jakub Jelinek <jakub@redhat.com>
969 * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
970 before calling fold_decl_constant_value.
972 2010-09-07 Arnaud Charlet <charlet@adacore.com>
974 * cp-tree.h (build_enumerator): Add new location_t parameter.
975 (build_lang_decl_loc): New function.
976 * decl.c (build_enumerator): New parameter loc. Use it when calling
977 build_decl. Replace build_lang_decl with build_lang_decl_loc.
978 * pt.c (tsubst_enum): Adjust call to build_enumerator.
979 * parser.c (cp_parser_enumerator_definition): Ditto.
980 * lex.c (build_lang_decl_loc): New function.
982 2010-09-06 Dodji Seketeli <dodji@redhat.com>
987 * tree.c (strip_typedefs): Strip typedefs from the context of
990 2010-09-06 Mark Mitchell <mark@codesourcery.com>
992 * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
993 * call.c (build_conditional_expr): Likewise.
994 (convert_arg_to_ellipsis): Likewise.
996 2010-09-06 Arnaud Charlet <charlet@adacore.com>
998 * parser.c (make_pointer_declarator, make_reference_declarator,
999 make_call_declarator, make_array_declarator): Set declarator->id_loc.
1000 (cp_parser_init_declarator): Adjust location of decl if appropriate.
1002 2010-09-06 Jason Merrill <jason@redhat.com>
1004 * call.c (implicit_conversion): Fix value-init of enums.
1005 (convert_like_real): Likewise.
1007 * decl.c (cp_finish_decl): Don't change init for auto deduction.
1009 * pt.c (fold_non_dependent_expr_sfinae): Split out from...
1010 (fold_non_dependent_expr): ...here.
1011 (convert_nontype_argument): Use it. Take complain parm.
1012 Use perform_implicit_conversion instead of ocp_convert.
1013 Allow cv-qual changes.
1014 (convert_template_argument): Pass complain down.
1015 (tsubst_template_arg): Suppress constant expression warnings.
1018 * method.c (synthesized_method_walk): In constructors, also check
1019 subobject destructors.
1021 * semantics.c (finish_compound_literal): Always build a
1024 2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
1027 * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
1029 2010-08-30 Jakub Jelinek <jakub@redhat.com>
1032 * parser.c (cp_parser_omp_atomic): Handle boolean
1033 {PRE,POST}_INCREMENT.
1035 2010-08-29 Jason Merrill <jason@redhat.com>
1038 * parser.c (cp_parser_parameter_declaration): Pop parameter decls
1039 after tentative parsing.
1041 2010-08-22 Joseph Myers <joseph@codesourcery.com>
1043 * Make-lang.in (g++spec.o): Update dependencies.
1044 * g++spec.c: Include opts.h
1045 (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
1046 (lang_specific_driver): Use cl_decoded_option structures.
1048 2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
1050 * call.c: Use FOR_EACH_VEC_ELT.
1051 * class.c: Likewise.
1053 * decl2.c: Likewise.
1054 * error.c: Likewise.
1055 * except.c: Likewise.
1056 * mangle.c: Likewise.
1057 * method.c: Likewise.
1058 * name-lookup.c: Likewise.
1059 * parser.c: Likewise.
1062 * semantics.c: Likewise.
1063 * typeck2.c: Likewise.
1065 2010-08-19 Jason Merrill <jason@redhat.com>
1067 * call.c (reference_related_p): Check for error_mark_node.
1068 (add_function_candidate): Check it instead of
1069 same_type_ignoring_top_level_qualifiers_p.
1072 * init.c (build_new_1): Don't use build_value_init in a template.
1073 (build_value_init): Make sure we don't.
1076 * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
1077 of empty class CONSTRUCTOR.
1079 * except.c (pending_noexcept, pending_noexcept_checks): New.
1080 (perform_deferred_noexcept_checks): New.
1081 (maybe_noexcept_warning): Split from...
1082 (finish_noexcept_expr): ...here. Adjust.
1083 * decl2.c (cp_write_global_declarations): Call
1084 perform_deferred_noexcept_checks.
1085 * cp-tree.h: And declare it.
1087 2010-08-18 Nathan Froyd <froydnj@codesourcery.com>
1090 * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
1093 2010-08-17 Kai Tietz <kai.tietz@onevision.com>
1095 * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
1096 or if -fms-extensions is enabled check, check permissive.
1098 2010-08-09 Jason Merrill <jason@redhat.com>
1101 * pt.c (lookup_template_class): Don't re-coerce outer parms.
1103 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1105 * call.c (add_builtin_candidates): Use VECs for local variable
1106 `types'. Adjust remainder of function accordingly.
1108 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1110 * name-lookup.c (is_associated_namespace): Convert local variables
1111 to be VECs instead of TREE_LISTs.
1113 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1115 * tree.c (varargs_function_p): Use stdarg_p.
1117 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1119 * parser.c (cp_default_arg_entry): Declare. Declare a VEC of it.
1120 (cp_unparsed_functions_entry): Declare. Declare a VEC of it.
1121 (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
1122 Change type to a VEC.
1123 (unparsed_funs_with_default_args): Define.
1124 (unparsed_funs_with_definitions): Define.
1125 (push_unparsed_function_queues): New function.
1126 (cp_parser_new): Call it.
1127 (pop_unparsed_function_queues): New function.
1128 (cp_parser_class_specifier): Adjust processing of unparsed functions.
1129 (cp_parser_template_declaration_after_export): Use VEC_safe_push.
1130 (cp_parser_save_member_function_body): Likewise.
1131 (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
1132 and pop_unparsed_function_queues.
1133 (cp_parser_late_parsing_default_args): Likewise.
1134 (cp_parser_save_default_args): Use VEC_safe_push.
1136 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1138 * name-lookup.h (cp_label_binding): Declare. Declare a VEC type
1140 (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
1142 * decl.c (poplevel): Adjust for type changes.
1143 (declare_local_label): Likewise.
1145 2010-08-06 Jason Merrill <jason@redhat.com>
1147 * typeck.c (complete_type_or_maybe_complain): Split out from...
1148 (complete_type_or_else): Here.
1149 (build_class_member_access_expr): Call it.
1150 (finish_class_member_access_expr): Likewise.
1151 * call.c (build_special_member_call): Likewise.
1152 * cvt.c (build_expr_type_conversion): Likewise.
1153 * init.c (build_new): Likewise.
1154 * typeck2.c (build_functional_cast): Likewise.
1155 * cp-tree.h: Declare it.
1157 * init.c (build_value_init): Add complain parm.
1158 (build_value_init_noctor): Likewise.
1159 (perform_member_init): Pass it.
1160 (expand_aggr_init_1): Likewise.
1161 (build_new_1): Likewise.
1162 (build_vec_init): Likewise.
1163 * pt.c (tsubst_expr): Likewise.
1164 * typeck2.c (build_functional_cast): Likewise.
1165 * cp-tree.h: Adjust.
1166 * tree.c (build_target_expr_with_type): Handle error_mark_node.
1168 * typeck.c (decay_conversion): Any expression with type nullptr_t
1171 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1174 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
1176 2010-07-27 Jason Merrill <jason@redhat.com>
1178 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
1179 from build_value_init.
1180 * init.c (build_value_init_noctor): Give error for unknown array
1183 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1185 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
1187 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1189 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
1190 c_common_initialize_diagnostics.
1191 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
1192 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
1194 2010-07-21 Jason Merrill <jason@redhat.com>
1196 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
1198 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
1201 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
1204 * pt.c (instantiate_class_template): Propagate the template's
1205 location to its instance.
1207 2010-07-20 Jason Merrill <jason@redhat.com>
1210 * pt.c (tsubst_copy_and_build): Rework last change.
1213 * pt.c (tsubst_copy_and_build): Handle partial substitution of
1216 2010-07-19 Jason Merrill <jason@redhat.com>
1219 * semantics.c (finish_decltype_type): Correct decltype
1220 of parenthesized rvalue reference variable.
1223 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
1224 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
1226 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
1229 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
1231 * cp-tree.h: Adjust declaration.
1232 * init.c (perform_member_init): Adjust caller.
1233 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
1234 * typeck2.c (store_init_value): Likewise.
1235 (build_functional_cast): Pass complain argument to
1236 build_x_compound_expr_from_list.
1238 2010-07-16 Jason Merrill <jason@redhat.com>
1241 * pt.c (process_partial_specialization): Diagnose partial
1242 specialization after instantiation.
1243 (most_specialized_class): Add complain parm.
1245 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
1247 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1249 * init.c (build_new_1): Use cp_build_function_call_nary instead of
1250 cp_build_function_call.
1252 2010-07-15 Jason Merrill <jason@redhat.com>
1255 * call.c (add_function_candidate): If we're working on an implicit
1256 declaration, don't consider candidates that won't match.
1257 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
1258 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
1261 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1262 (TYPE_HAS_USER_OPEQ): New.
1263 * decl.c (grok_special_member_properties): Set it.
1264 * class.c (add_implicitly_declared_members): Don't lazily declare
1265 constructors/operator= if a base or member has a user-declared one.
1266 (check_bases_and_members, check_bases): Adjust.
1267 (check_field_decls, check_field_decl): Adjust.
1269 2010-07-15 Anatoly Sokolov <aesok@post.ru>
1271 * decl.c (integer_three_node): Remove.
1272 (cxx_init_decl_processing): Do not initialize the integer_three_node.
1273 * cp-tree.h (integer_three_node): Remove.
1275 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1277 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
1279 * class.c: Likewise.
1280 * cp-gimplify.c: Likewise.
1282 * decl2.c: Likewise.
1284 * mangle.c: Likewise.
1285 * name-lookup.c: Likewise.
1286 * optimize.c: Likewise.
1287 * parser.c: Likewise.
1290 * search.c: Likewise.
1291 * semantics.c: Likewise.
1292 * typeck.c: Likewise.
1293 * typeck2.c: Likewise.
1295 2010-07-14 Jason Merrill <jason@redhat.com>
1297 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
1298 (build_field_list): Cache field type.
1300 Implement C++0x unrestricted unions (N2544)
1301 * class.c (check_field_decl): Loosen union handling in C++0x.
1302 * method.c (walk_field_subobs): Split out from...
1303 (synthesized_method_walk): ...here. Set msg before loops.
1304 (process_subob_fn): Check for triviality in union members.
1305 * init.c (sort_mem_initializers): Splice out uninitialized
1306 anonymous unions and union members.
1307 (push_base_cleanups): Don't automatically destroy anonymous unions
1310 2010-07-13 Jason Merrill <jason@redhat.com>
1313 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1314 (TYPE_HAS_USER_OPEQ): New.
1315 * decl.c (grok_special_member_properties): Set it.
1316 * class.c (add_implicitly_declared_members): Don't lazily declare
1317 constructors/operator= if a base or member has a user-declared one.
1318 (check_bases_and_members, check_bases): Adjust.
1319 (check_field_decls, check_field_decl): Adjust.
1320 * method.c (synthesized_method_walk): Initialize check_vdtor.
1323 * mangle.c (write_type): Canonicalize.
1324 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
1325 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
1327 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
1330 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
1332 * typeck.c (get_delta_difference): Update prototype, add a
1333 tsubst_flags_t parameter; update get_delta_difference_1 calls and
1334 add checks for error_mark_node.
1335 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
1336 parameter; update lookup_base call.
1337 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
1338 parameter; update get_delta_difference call and add check for
1340 (convert_ptrmem): Update prototype, add a tsubst_flags_t
1341 parameter; update get_delta_difference call and add check for
1342 error_mark_node; update build_ptrmemfunc call.
1343 (build_static_cast_1): Adjust convert_ptrmem call.
1344 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
1345 (cp_build_unary_op): Adjust build_ptrmemfunc call.
1346 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
1347 and build_ptrmemfunc calls.
1348 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
1350 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
1353 * call.c (build_temp): Add tsubst_flags_t complain parameter;
1354 adjust build_special_member_call call, pass complain.
1355 (convert_like_real): Adjust build_temp call, pass complain.
1357 2010-07-09 Jason Merrill <jason@redhat.com>
1360 * cp-tree.h (BV_LOST_PRIMARY): New macro.
1361 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
1362 Set BV_LOST_PRIMARY.
1363 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
1365 2010-07-08 Jason Merrill <jason@redhat.com>
1368 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
1369 virtual bases for covariant thunks.
1371 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
1373 * cp-tree.h: Do not include toplev.h.
1375 2010-07-06 Jason Merrill <jason@redhat.com>
1378 * call.c (is_std_init_list): Look through typedefs.
1381 * init.c (build_offset_ref): If scope isn't dependent,
1382 don't exit early. Look at TYPE_MAIN_VARIANT.
1383 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
1385 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
1387 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
1389 * cp-tree.h (impl_conv_void): New type.
1390 (convert_to_void): Adjust prototype.
1391 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
1392 diagnostic for easy translation. Change caller.
1393 * typeck.c: Update call to convert_to_void.
1394 * semantics.c: Likewise.
1397 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
1399 * decl.c (cp_finish_decl): Call add_local_decl.
1400 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
1402 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
1404 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
1407 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
1410 * parser.c (cp_parser_primary_expression): Error if local template is
1413 2010-07-02 Le-Chun Wu <lcwu@google.com>
1416 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
1417 (variable or type) shadows another type.
1419 2010-07-02 Jakub Jelinek <jakub@redhat.com>
1422 * typeck.c (convert_for_assignment): When converting a convertible
1423 vector type or objc++ types, call mark_rvalue_use.
1424 * typeck2.c (build_m_component_ref): Use return values from
1425 mark_rvalue_use or mark_lvalue_use.
1426 * class.c (build_base_path): Likewise.
1427 * call.c (build_conditional_expr): Likewise.
1429 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1432 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
1435 2010-07-01 Richard Guenther <rguenther@suse.de>
1437 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
1438 predicate we are looking for, allow non-gimplified
1441 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
1444 * typeck.c (cp_build_unary_op): Early return error_mark_node when
1445 arg is NULL_TREE too.
1446 * call.c (convert_class_to_reference): Return error_mark_node when
1449 2010-06-30 Michael Matz <matz@suse.de>
1451 * repo.c (finish_repo): Fix typo.
1453 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1455 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
1457 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1459 * repo.c (pending_repo): Change type to a VEC.
1460 (finish_repo): Adjust for new type of pending_repo.
1461 (repo_emit_p): Likewise.
1463 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
1465 * tree.c: Include gimple.h. Do not include tree-flow.h
1466 * decl.c: Do not include tree-flow.h
1467 * Make-lang.in: Adjust dependencies.
1469 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1471 * decl.c (incomplete_var): Declare. Declare VECs containing them.
1472 (incomplete_vars): Adjust comment. Change type to a VEC.
1473 (maybe_register_incomplete_var): Adjust for new type.
1474 (complete_vars): Adjust iteration over incomplete_vars.
1476 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1478 * decl.c (struct named_label_entry): Change type of bad_decls field
1480 (poplevel_named_label_1): Adjust for new type of bad_decls.
1481 (check_goto): Likewise.
1483 2010-06-29 Jason Merrill <jason@redhat.com>
1485 Enable implicitly declared move constructor/operator= (N3053).
1486 * class.c (add_implicitly_declared_members): A class with no
1487 explicitly declared copy or move constructor gets both declared
1488 implicitly, and similarly for operator=.
1489 (check_bases): A type with no copy ctor does not inhibit
1490 a const copy ctor in a derived class. It does mean the derived
1492 (check_field_decl): Likewise.
1493 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
1494 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
1495 (trivially_copyable_p): Likewise.
1496 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
1497 * class.c (finish_struct_bits): Likewise.
1498 * tree.c (build_target_expr_with_type): Likewise.
1499 * typeck2.c (store_init_value): Likewise.
1501 Enable implicitly deleted functions (N2346)
1502 * class.c (check_bases_and_members): Adjust lambda flags.
1503 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
1505 * decl2.c (mark_used): Adjust error for use of deleted function.
1507 Machinery to support implicit delete/move.
1508 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
1509 has_complex_move_ctor, has_complex_move_assign bitfields.
1510 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
1511 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
1512 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
1513 (enum special_function_kind): Add sfk_move_assignment.
1514 (LOOKUP_SPECULATIVE): New.
1515 * call.c (build_over_call): Return early if it's set.
1516 (build_over_call): Use trivial_fn_p.
1517 * class.c (check_bases): If the base has no default constructor,
1518 the derived one is non-trivial. Handle move ctor/op=.
1519 (check_field_decl): Likewise.
1520 (check_bases_and_members): Handle move ctor/op=.
1521 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
1522 (type_has_move_constructor, type_has_move_assign): New.
1523 * decl.c (grok_special_member_properties): Handle move ctor/op=.
1524 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
1525 (trivial_fn_p): New.
1526 (do_build_copy_constructor): Use it.
1527 (do_build_assign_ref): Likewise. Handle move assignment.
1528 (build_stub_type, build_stub_object, locate_fn_flags): New.
1529 (locate_ctor): Use locate_fn_flags.
1530 (locate_copy, locate_dtor): Remove.
1531 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
1532 (process_subob_fn, synthesized_method_walk): New.
1533 (maybe_explain_implicit_delete): New.
1534 (implicitly_declare_fn): Use synthesized_method_walk,
1535 type_has_trivial_fn, and type_set_nontrivial_flag.
1536 (defaulted_late_check): Set DECL_DELETED_FN.
1537 (defaultable_fn_check): Handle sfk_move_assignment.
1538 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
1539 implicitly deleted move ctor/op=.
1540 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
1541 (lookup_fnfields_slot): New.
1542 * semantics.c (omp_clause_info_fndecl): Remove.
1543 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
1544 get_copy_assign, trivial_fn_p.
1545 (trait_expr_value): Adjust call to locate_ctor.
1546 * tree.c (special_function_p): Handle sfk_move_assignment.
1548 * class.c (type_has_virtual_destructor): New.
1549 * cp-tree.h: Declare it.
1550 * semantics.c (trait_expr_value): Use it.
1552 * call.c (build_over_call): Only give warnings with tf_warning.
1554 * name-lookup.c (pop_scope): Handle NULL_TREE.
1556 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
1557 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
1558 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
1559 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
1560 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
1561 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
1562 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
1563 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
1564 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
1565 (sfk_assignment_operator): Rename to sfk_copy_assignment.
1566 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
1567 * search.c, semantics.c, tree.c: Adjust.
1569 * pt.c (dependent_scope_ref_p): Remove.
1570 (value_dependent_expression_p): Don't call it.
1571 (type_dependent_expression_p): Here either.
1572 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
1573 if the scope isn't dependent.
1575 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
1579 * pt.c (has_value_dependent_address): New.
1580 (value_dependent_expression_p): Check it.
1581 (convert_nontype_argument): Likewise. Call decay_conversion before
1582 folding if we want a pointer.
1583 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
1584 scope is the current instantiation.
1586 2010-06-28 Jakub Jelinek <jakub@redhat.com>
1589 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
1592 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
1594 * init.c: Do not include except.h.
1597 * cp-lang.c: Likewise.
1599 * semantics.c: Likewise.
1600 * decl2.c: Likewise.
1601 * except.c: Likewise.
1602 (init_exception_processing): Do not set the removed
1603 lang_protect_cleanup_actions here.
1604 (cp_protect_cleanup_actions): Make non-static and remove prototype.
1605 (doing_eh): New, moved from except.c but removed the do_warning flag.
1606 (expand_start_catch_block): Update doing_eh call.
1607 (expand_end_catch_block): Likewise.
1608 (build_throw): Likewise.
1609 * cp-tree.h: Prototype cp_protect_cleanup_actions.
1610 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
1611 cp_protect_cleanup_actions.
1612 * Make-lang.in: Update dependencies.
1614 2010-06-26 Jason Merrill <jason@redhat.com>
1616 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
1617 constructor called with a single argument that takes a reference
1618 to the constructor's class.
1619 (BAD_CONVERSION_RANK): New.
1620 (compare_ics): Use it to compare bad ICSes.
1622 2010-06-25 Joseph Myers <joseph@codesourcery.com>
1624 * lang-specs.h: Remove +e handling.
1626 2010-06-24 Andi Kleen <ak@linux.intel.com>
1628 * parser.c: (cp_parser_question_colon_clause):
1629 Switch to use cp_lexer_peek_token.
1630 Call warn_for_omitted_condop. Call pedwarn for omitted
1633 2010-06-22 Jakub Jelinek <jakub@redhat.com>
1636 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
1637 datum and mark_rvalue_use on component.
1640 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
1641 the CALL_EXPR has no arguments.
1643 2010-06-21 Jason Merrill <jason@redhat.com>
1645 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
1647 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
1650 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
1652 * name-lookup.c (struct arg_lookup): Convert namespaces and
1653 classes fields to VEC.
1654 (arg_assoc_namespace): Adjust for new type of namespaces.
1655 (arg_assoc_class): Adjust for new type of classes.
1656 (lookup_arg_dependent): Use make_tree_vector and
1657 release_tree_vector.
1658 * typeck2.c (build_x_arrow): Use vec_member.
1660 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
1663 * error.c (dump_decl): Better wording for anonymous namespace.
1665 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
1667 * class.c (build_vtbl_initializer): Adjust computation of new_position
1668 and which entry to add padding for.
1670 2010-06-16 Jason Merrill <jason@redhat.com>
1672 * except.c (check_noexcept_r): Return the problematic function.
1673 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
1674 * pt.c (tsubst_copy_and_build): Pass it.
1675 * parser.c (cp_parser_unary_expression): Likewise.
1676 * cp-tree.h: Adjust prototype.
1678 * method.c (defaulted_late_check): Give the defaulted method
1679 the same exception specification as the implicit declaration.
1681 2010-06-15 Jason Merrill <jason@redhat.com>
1683 * class.c (add_implicitly_declared_members): Implicit assignment
1684 operators can also be virtual overriders.
1685 * method.c (lazily_declare_fn): Likewise.
1687 * call.c (convert_like_real): Give "initializing argument of"
1688 information for ambiguous conversion. Give source position
1691 * call.c (print_z_candidates): Do print viable deleted candidates.
1692 (joust): Don't choose a deleted function just because its worst
1693 conversion is better than another candidate's worst.
1695 * call.c (convert_like_real): Don't complain about
1696 list-value-initialization from an explicit constructor.
1698 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
1699 DECL_SOURCE_LOCATION directly.
1701 * class.c (type_has_user_provided_default_constructor): Use
1704 * call.c (is_subseq): Handle ck_aggr, ck_list.
1705 (compare_ics): Treat an aggregate or ambiguous conversion to the
1706 same type as involving the same function.
1708 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
1710 * typeck.c (convert_for_assignment): Fix comment. Change message
1711 format from %d to %qP.
1712 (convert_for_initialization): Fix comment.
1714 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
1716 * cp-tree.h (expr_list_kind): New type.
1717 (impl_conv_rhs): New type.
1718 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
1720 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
1721 diagnostics for easy translation. Change caller.
1722 (convert_for_initialization): Use impl_conv_rhs and change caller.
1723 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
1724 diagnostics for easy translation. Change caller.
1725 * decl.c (bad_spec_place): New enum.
1726 (bad_specifiers): Use it and emit the diagnostics for easy
1727 translation. Change caller.
1728 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
1730 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1732 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
1734 * decl2.c (cp_write_global_declarations): Adjust for new type of
1735 decl_namespace_list.
1736 * name-lookup.c (current_decl_namespace): Likewise.
1737 (push_decl_namespace): Likewise.
1738 (pop_decl_namespace): Likewise.
1740 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1742 * call.c (build_java_interface_fn_ref): Call build_function_type_list
1743 instead of build_function_type.
1744 * decl.c (cxx_init_decl_processing): Likewise.
1745 (declare_global_var): Likewise.
1746 (get_atexit_node): Likewise.
1747 (expand_static_init): Likewise.
1748 * decl2.c (start_objects): Likewise.
1749 (start_static_storage_duration_function): Likewise.
1750 * except.c (init_exception_processing): Likewise.
1751 (build_exc_ptr): Likewise.
1752 (build_throw): Likewise.
1753 * rtti.c (throw_bad_cast): Likewise.
1754 (throw_bad_typeid): Likewise.
1755 (build_dynamic_cast_1): Likewise.
1757 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1759 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
1760 (build_op_delete_call): Likewise.
1761 (build_over_call): Likewise.
1762 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1763 * pt.c (process_partial_specialization): Likewise.
1764 (tsubst_template_args): Likewise.
1765 * semantics.c (finish_asm_stmt): Likewise.
1767 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
1769 * decl.c (record_key_method_defined): New, broken out of ...
1770 (finish_function): ... here. Call it.
1771 (start_decl): Treat aliases as definitions.
1773 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1775 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
1777 * pt.c (maybe_process_partial_specialization): Likewise.
1778 (register_specialization): Likewise.
1779 (add_pending_template): Likewise.
1780 (lookup_template_class): Likewise.
1781 (push_tinst_level): Likewise.
1783 * parser.c (cp_lexer_new_main): Likewise.
1784 (cp_lexer_new_from_tokens): Likewise.
1785 (cp_token_cache_new): Likewise.
1786 (cp_parser_context_new): Likewise.
1787 (cp_parser_new): Likewise.
1788 (cp_parser_nested_name_specifier_opt): Likewise.
1789 (cp_parser_template_id): Likewise.
1791 * name-lookup.c (binding_entry_make): Likewise.
1792 (binding_table_construct): Likewise.
1793 (binding_table_new): Likewise.
1794 (cxx_binding_make): Likewise.
1795 (pushdecl_maybe_friend): Likewise.
1796 (begin_scope): Likewise.
1797 (push_to_top_level): Likewise.
1799 * lex.c (init_reswords): Likewise.
1800 (retrofit_lang_decl): Likewise.
1801 (cxx_dup_lang_specific_decl): Likewise.
1802 (copy_lang_type): Likewise.
1803 (cxx_make_type): Likewise.
1805 * decl.c (make_label_decl): Likewise.
1806 (check_goto): Likewise.
1807 (start_preparsed_function): Likewise.
1808 (save_function_data): Likewise.
1810 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
1812 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1814 * class.c (finish_struct_1): Likewise.
1816 * cp-tree.h (struct lang_type): Add variable_size GTY option.
1817 (struct lang_decl): Likewise.
1819 * parser.c (cp_parser_new): Update comment to not reference
1822 2010-06-07 Jason Merrill <jason@redhat.com>
1825 * error.c (dump_parameters): Mask out TFF_SCOPE.
1826 (dump_simple_decl): Don't print the scope of a PARM_DECL.
1827 (dump_scope): Remove no-op mask.
1830 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
1832 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
1833 * init.c (build_offset_ref): Use it.
1834 * pt.c (maybe_process_partial_specialization): Use it.
1835 (instantiate_class_template): Use it.
1836 * search.c (lookup_base): Use it.
1838 2010-06-07 Jakub Jelinek <jakub@redhat.com>
1841 * expr.c (mark_exp_read): Handle INDIRECT_REF.
1842 * cvt.c (convert_to_void): Handle INDIRECT_REF like
1843 handled_component_p.
1846 * decl.c (initialize_local_var): If TREE_USED is set on the type,
1847 set also DECL_READ_P on the decl.
1849 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1852 * cp-tree.h (typedef_variant_p): Move this declaration to
1854 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1855 * decl.c (grokdeclarator): Do not rename debug info of an
1856 anonymous tagged type named by a typedef.
1858 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
1861 * class.c (check_field_decls): Move the call to
1862 check_bitfield_decl before trying to set the
1863 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
1865 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
1867 * typeck.c: Update include path for moved files.
1870 * cp-gimplify.c: Likewise.
1871 * cp-lang.c: Likewise.
1873 * semantics.c: Likewise.
1874 * cxx-pretty-print.h: Likewise.
1875 * decl2.c: Likewise.
1876 * parser.c: Likewise.
1877 * cp-objcp-common.c: Likewise.
1878 * cp-tree.h: Likewise.
1879 * name-lookup.c: Likewise.
1881 * name-lookup.h: Likewise.
1882 * config-lang.in: Update paths in gtfiles for files in c-family/.
1883 * Make-lang.in: Likewise.
1885 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
1887 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
1888 * typeck.c (build_ptrmemfunc): Likewise.
1890 2010-06-04 Jason Merrill <jason@redhat.com>
1892 * typeck2.c (merge_exception_specifiers): Adjust merging of
1893 throw() and noexcept(true).
1895 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
1896 using an uninitialized variable.
1898 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
1899 (pp_cxx_expression): Likewise.
1901 Implement noexcept-specification (15.4)
1902 * parser.c (cp_parser_exception_specification_opt): Parse it.
1903 Give -Wdeprecated warning about throw() specs.
1904 * pt.c (tsubst_exception_specification): Handle it.
1905 * error.c (dump_exception_spec): Handle it.
1906 (dump_expr): Handle NOEXCEPT_EXPR.
1907 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
1908 * typeck.c (comp_except_specs): Handle compatibility rules.
1909 Change exact parm to take an enum.
1910 * typeck2.c (merge_exception_specifiers): Handle noexcept.
1911 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
1912 (type_throw_all_p, build_noexcept_spec): New fns.
1913 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
1914 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
1915 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
1916 (noexcept_true_spec, noexcept_false_spec): New macros.
1917 * name-lookup.c (pushdecl_maybe_friend): Adjust.
1918 * search.c (check_final_overrider): Adjust.
1919 * decl.c (check_redeclaration_exception_specification): Adjust.
1920 (use_eh_spec_block): Use type_throw_all_p.
1921 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
1922 Give operator new a noexcept-specification in C++0x mode.
1923 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
1924 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
1926 Implement noexcept operator (5.3.7)
1927 * cp-tree.def (NOEXCEPT_EXPR): New.
1928 * except.c (check_noexcept_r, finish_noexcept_expr): New.
1929 * cp-tree.h: Declare finish_noexcept_expr.
1930 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
1931 * pt.c (tsubst_copy_and_build): And tsubst it.
1932 (type_dependent_expression_p): Handle it.
1933 (value_dependent_expression_p): Handle it.
1935 * call.c (build_conditional_expr): Never fold in unevaluated context.
1936 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
1937 * semantics.c (simplify_aggr_init_expr): Likewise.
1938 * typeck.c (merge_types): Call merge_exception_specifiers.
1939 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
1940 DECL_ANTICIPATED for preferring new type.
1942 2010-06-04 Joseph Myers <joseph@codesourcery.com>
1944 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
1947 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1950 * typeck.c (build_class_member_access_expr): Call mark_exp_read
1951 on object for static data members.
1953 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1954 Jason Merrill <jason@redhat.com>
1957 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
1958 with the same type, call mark_lvalue_use on both.
1960 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
1962 * class.c (struct vtbl_init_data_s): Remove last_init field.
1963 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
1965 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
1967 (build_vtt): Likewise.
1968 (initialize_vtable): Take a VEC instead of a tree.
1969 (build_vtt_inits): Change return type to void. Take a VEC **
1970 instead of a tree *; accumulate results into said VEC.
1971 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
1972 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
1973 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
1975 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
1976 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
1978 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
1979 rather than tree_cons.
1980 (build_vbase_offset_vtbl_entries): Likewise.
1981 (add_vcall_offset): Likewise.
1982 (build_rtti_vtbl_entries): Likewise.
1983 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
1984 * decl.c (initialize_artificial_var): Use build_constructor instead
1985 of build_constructor_from_list.
1987 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
1990 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
1993 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
1995 * parser.c (cp_parser_mem_initializer_list): Change error text.
1997 2010-06-02 Jakub Jelinek <jakub@redhat.com>
1999 * cp-objcp-common.c (shadowed_var_for_decl): Change into
2000 tree_decl_map hashtab from tree_map.
2001 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
2002 (init_shadowed_var_for_decl): Adjust initialization.
2005 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
2006 instead of calling mark_exp_read only when not an assignment.
2009 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
2010 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
2011 Set DECL_VALUE_EXPR on var.
2013 2010-06-02 Jason Merrill <jason@redhat.com>
2015 * error.c (dump_type): Improve typedef handling.
2020 * name-lookup.c (same_entity_p): New.
2021 (ambiguous_decl): Multiple declarations of the same entity
2024 2010-06-01 Jason Merrill <jason@redhat.com>
2027 * call.c (add_list_candidates): Prefer the default constructor.
2028 (build_aggr_conv): Treat missing initializers like { }.
2029 * typeck2.c (process_init_constructor_record): Likewise.
2030 * init.c (expand_default_init): Use digest_init for
2031 direct aggregate initialization, too.
2033 * call.c (add_list_candidates): Split out...
2034 (build_user_type_conversion_1): ...from here.
2035 (build_new_method_call): And here.
2036 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
2039 * call.c (build_list_conv): Set list-initialization flags properly.
2041 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
2043 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
2045 2010-06-01 Arnaud Charlet <charlet@adacore.com>
2046 Matthew Gingell <gingell@adacore.com>
2048 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
2049 * decl2.c: Include langhooks.h and c-ada-spec.h.
2050 (cpp_check, collect_source_refs, collect_ada_namespace,
2051 collect_all_refs): New functions.
2052 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
2053 * lang-specs.h: Ditto.
2055 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2057 * cp-tree.h (cp_build_function_call_nary): Declare.
2058 * typeck.c (cp_build_function_call_nary): Define.
2059 * decl.c (register_dtor_fn): Use it instead of
2060 cp_build_function_call.
2061 (cxx_maybe_build_cleanup): Likewise.
2062 * decl2.c (generate_ctor_or_dtor_function): Likewise.
2063 * except.c (do_get_exception_ptr): Likewise.
2064 (do_begin_catch): Likewise.
2065 (do_allocate_exception): Likewise.
2066 (do_free_exception): Likewise.
2067 (build_throw): Likewise. Use cp_build_function_call_vec instead
2068 of cp_build_function_call.
2069 (do_end_catch): Likewise.
2071 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2073 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
2074 (struct cp_declarator): Move id_loc field up.
2076 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2078 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
2079 this file is included before c-common.h. Define GCC_DIAG_STYLE
2080 before including diagnostic-core.h and toplev.h.
2081 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
2082 * pt.c: Include cp-tree.h before c-common.h.
2084 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2086 * tree.c (c_register_addr_space): Add stub.
2088 2010-05-28 Joseph Myers <joseph@codesourcery.com>
2090 * g++spec.c (lang_specific_driver): Use fatal_error instead of
2093 2010-05-28 Dodji Seketeli <dodji@redhat.com>
2095 Revert fix of PR c++/44188
2096 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
2098 * tree.c (typedef_variant_p): Revert moving this definition to
2100 * decl.c (grokdeclarator): Revert naming typedef handling.
2102 2010-05-27 Joseph Myers <joseph@codesourcery.com>
2104 * call.c: Include diagnostic-core.h instead of diagnostic.h.
2105 * cp-lang.c: Don't include diagnostic.h
2106 * name-lookup.c: Include diagnostic-core.h instead of
2108 (cp_emit_debug_info_for_using): Use seen_error.
2109 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
2110 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
2111 * pt.c (iterative_hash_template_arg): Use seen_error.
2112 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
2113 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
2114 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
2115 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
2118 2010-05-25 Dodji Seketeli <dodji@redhat.com>
2121 * cp-tree.h (typedef_variant_p): Move this declaration to
2123 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
2124 * decl.c (grokdeclarator): Do not rename debug info of an
2125 anonymous tagged type named by a typedef.
2127 2010-05-27 Jason Merrill <jason@redhat.com>
2130 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
2133 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
2136 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
2137 * class.c (layout_class_type): Likewise.
2138 * decl.c (finish_enum): Likewise.
2139 * mangle.c (write_builitin_type): Likewise.
2141 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
2143 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
2145 * decl.c (grokdeclarator): Handle __int128.
2146 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
2147 (cp_parser_simple_type_specifier): Likewise.
2148 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
2149 * typeck.c (cp_common_type): Handle __int128.
2150 * mangle.c (integer_type_codes): Add itk_int128 and
2151 itk_unsigned_int128.
2153 2010-05-26 Jason Merrill <jason@redhat.com>
2156 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
2159 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2161 * cp-lang.c: Do not include expr.h.
2163 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2165 * decl.c: Do not include rtl.h
2166 * semantics.c: Likewise.
2168 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
2170 * cp-tree.h: Do not include splay-tree.h.
2171 (struct prtmem_cst): Remove unused field and false comment.
2172 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
2173 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
2174 * init.c: Do not include rtl.h and expr.h.
2175 * class.c: Do not include rtl.h. Include splay-tree.h.
2176 (build_clone): Use plain NULL instead of NULL_RTX.
2177 * decl.c: Do not include expr.h. Explain why rtl.h has to be
2178 included. Include splay-tree.h.
2179 * method.c: Do not include rtl.h and expr.h.
2180 (use_thunk): Use plain NULL instead of NULL_RTX.
2181 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
2182 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
2183 and target.h. Include splay-tree.h.
2184 * expr.c: Do not include rtl.h and expr.h.
2185 * pt.c: Do not include obstack.h and rtl.h.
2186 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
2187 (tsubst_decl): Likewise.
2188 (instantiate_decl): Likewise.
2189 * semantics.c: Do not include exprt.h and debug.h. Explain why
2190 rtl.h has to be included.
2191 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
2192 * call.c: Do not include rtl.h and expr.h.
2193 * search.c: Do not include obstack.h and rtl.h.
2194 * friend.c: Do not include rtl.h and expr.h.
2195 * Make-lang.in: Update dependencies.
2197 2010-05-25 Jakub Jelinek <jakub@redhat.com>
2200 * parser.c (non_integral_constant): Add NIC_NONE.
2201 (required_token): Add RT_NONE.
2202 (cp_parser_unary_expression): Initialize non_constant_p
2204 (cp_parser_asm_definition): Initialize missing to RT_NONE.
2205 (cp_parser_primary_expression, cp_parser_postfix_expression,
2206 cp_parser_cast_expression, cp_parser_binary_expression,
2207 cp_parser_functional_cast): Fix formatting.
2209 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
2212 * parser.c: Remove inclusion of dyn-string.h.
2213 (non_integral_constant): New enum.
2214 (name_lookup_error): New enum.
2215 (required_token): New enum.
2216 (cp_parser_required_error): New function.
2217 (cp_parser_require): Change the type of variable token_desc to
2218 required_token and use cp_parser_required_error.
2219 (cp_parser_require_keyword): Likewise.
2220 (cp_parser_error): Use gmsgid as parameter.
2221 (cp_parser_name_lookup_error): Change the type of variable desired to
2222 name_lookup_error and put the diagnostic in the full sentences. Change
2224 (cp_parser_non_integral_constant_expression): Change the type of the
2225 variable thing to non_integral_constant and put the diagnostics in
2226 full sentences. Change caller.
2228 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
2231 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
2233 2010-05-24 Joseph Myers <joseph@codesourcery.com>
2235 * error.c (cp_diagnostic_starter): Update call to
2236 diagnostic_build_prefix.
2237 (cp_print_error_function,
2238 print_instantiation_partial_context_line): Check show_column flag
2241 2010-05-24 Jason Merrill <jason@redhat.com>
2244 * decl.c (check_initializer): Don't wrap an init-list in a
2246 * init.c (build_aggr_init): Don't assume copy-initialization if
2247 init has CONSTRUCTOR_IS_DIRECT_INIT.
2248 * call.c (build_new_method_call): Sanity check.
2250 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
2252 * rtti.c (tinfo_base_init): Use build_constructor instead of
2253 build_constructor_from_list. Don't cons a tree node for
2255 (generic_initializer): Use build_constructor_single instead of
2256 build_constructor_from_list.
2257 (ptr_initializer): Use build_constructor instead of
2258 build_constructor_from_list
2259 (ptm_initializer): Likewise.
2260 (class_initializer): Likewise. Take varargs instead of TRAIL.
2261 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
2262 build_constructor instead of build_constructor_from_list.
2264 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
2266 * semantics.c: Include bitmap.h.
2267 * Make-lang.in: Update dependencies.
2269 2010-05-22 Jan Hubicka <jh@suse.cz>
2271 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
2273 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
2275 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2277 * cxx-pretty-print.c: Correct merge error.
2279 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2281 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
2282 (cp_print_error_function): Use diagnostic_abstract_origin macro.
2283 (cp_printer): Handle %K here using percent_K_format.
2284 * cxx-pretty-print.c: Include tree-pretty-print.h.
2285 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
2288 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
2290 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
2291 Clean up redundant includes.
2293 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2296 * decl.c (xref_basetypes): Return false in case of ill-formed
2299 2010-05-19 Jason Merrill <jason@redhat.com>
2301 * call.c (reference_binding): Use cp_build_qualified_type_real
2302 and cp_type_quals consistently.
2303 (add_function_candidate): Likewise.
2304 (build_conditional_expr): Likewise.
2305 (convert_like_real): Likewise.
2306 (type_passed_as): Likewise.
2307 * class.c (add_method): Likewise.
2308 (same_signature_p): Likewise.
2309 (layout_class_type): Likewise.
2310 * decl.c (cxx_init_decl_processing): Likewise.
2311 (cp_fname_init): Likewise.
2312 (grokdeclarator): Likewise.
2313 * decl2.c (cp_reconstruct_complex_type): Likewise.
2314 * init.c (build_new_1): Likewise.
2315 * method.c (do_build_copy_constructor): Likewise.
2316 (implicitly_declare_fn): Likewise.
2317 * pt.c (tsubst_aggr_type): Likewise.
2319 * rtti.c (init_rtti_processing): Likewise.
2320 (build_headof): Likewise.
2321 (build_dynamic_cast_1): Likewise.
2322 (tinfo_base_init): Likewise.
2323 (emit_support_tinfos): Likewise.
2324 * semantics.c (capture_decltype): Likewise.
2325 * tree.c (cv_unqualified): Likewise.
2326 * typeck.c (composite_pointer_type): Likewise.
2327 (string_conv_p): Likewise.
2329 * mangle.c (write_CV_qualifiers_for_type): Tweak.
2331 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
2332 * decl.c (start_decl): Likewise.
2333 * semantics.c (finish_compound_literal): Likewise.
2334 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
2335 (cp_type_readonly): Remove.
2336 * cp-tree.h: Remove declaration.
2338 * typeck.c (merge_types): Preserve memfn quals.
2340 * decl.c (grokdeclarator): Don't check quals on fn type.
2341 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
2342 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
2345 * typeck.c (type_memfn_quals): New fn.
2346 (apply_memfn_quals): New fn.
2347 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
2348 (cp_type_readonly): Use cp_type_quals.
2349 * cp-tree.h: Add declarations.
2350 * tree.c (cp_build_qualified_type_real): Don't set, but do
2351 preserve, quals on FUNCTION_TYPE.
2352 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
2353 * decl.c (build_ptrmem_type): Likewise.
2354 (grokdeclarator): Likewise.
2355 (static_fn_type): Likewise.
2356 * decl2.c (change_return_type): Likewise.
2357 (cp_reconstruct_complex_type): Likewise.
2358 * pt.c (tsubst_function_type): Likewise.
2360 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
2362 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
2364 * tree.c (build_min_non_dep_call_vec): Update comment.
2366 2010-05-17 Jason Merrill <jason@redhat.com>
2368 * call.c (struct z_candidate): Add explicit_targs field.
2369 (add_template_candidate_real): Set it.
2370 (build_over_call): Use it to control init-list warning.
2373 * call.c (build_over_call): Limit init-list deduction warning to
2374 cases where the argument is actually an init-list.
2377 * call.c (build_over_call): Don't do bitwise copy for move ctor.
2379 2010-05-17 Dodji Seketeli <dodji@redhat.com>
2380 Jason Merrill <jason@redhat.com>
2383 * decl.c (compute_array_index_type): Call mark_rvalue_use.
2385 2010-05-15 Jason Merrill <jason@redhat.com>
2387 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
2388 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
2390 (finish_eh_spec_block): Adjust.
2392 2010-05-15 Jakub Jelinek <jakub@redhat.com>
2395 * pt.c (tsubst): Unshare template argument.
2397 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
2399 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
2400 * Make-lang.in: Fix dependencies accordingly.
2402 2010-05-14 Jason Merrill <jason@redhat.com>
2405 * except.c (build_throw): Simplify, adjust for DR 475.
2408 * except.c (dtor_nothrow): Return nonzero for type with
2412 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
2413 gimple_build_eh_must_not_throw.
2415 2010-05-14 Martin Jambor <mjambor@suse.cz>
2417 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
2420 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
2422 * call.c (build_new_method_call): Change warning text.
2423 * typeck2.c (build_functional_cast): Change error text.
2425 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
2428 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
2429 shadowing the outer parameter or variables by the declaration of
2430 nested function in nested structure or class. Warn the shadowing by
2431 the declaration of nested lambda expression.
2433 2010-05-13 Jason Merrill <jason@redhat.com>
2435 * typeck.c (cp_build_array_ref): Factor out from...
2436 (build_array_ref): ...here. Drop complain parm.
2437 (build_new_op): Adjust.
2438 * class.c (build_vtbl_ref_1): Adjust.
2439 * decl2.c (grok_array_decl): Adjust.
2440 * cp-tree.h: Adjust prototypes.
2442 2010-05-13 Jan Hubicka <jh@suse.cz>
2444 * decl.c (cp_finish_decl): Do not worry about used attribute.
2446 2010-05-12 Jason Merrill <jason@redhat.com>
2448 * typeck.c (build_array_ref): Take complain parm.
2449 * cp-tree.h: Add it to prototype.
2450 * call.c (build_new_op): Pass it.
2451 * class.c (build_vtbl_ref): Pass it.
2452 * decl2.c (grok_array_decl): Pass it.
2456 * cp-tree.def (NULLPTR_TYPE): Remove.
2457 * cp-tree.h (NULLPTR_TYPE_P): New.
2458 (SCALAR_TYPE_P): Use it.
2459 (nullptr_type_node): New.
2460 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
2461 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
2463 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
2464 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2465 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
2466 * mangle.c (write_type): Likewise.
2467 * name-lookup.c (arg_assoc_type): Likewise.
2468 * typeck.c (build_reinterpret_cast_1): Likewise.
2469 * rtti.c (typeinfo_in_lib_p): Likewise.
2470 (emit_support_tinfos): Remove local nullptr_type_node.
2472 * cp-tree.h (UNKNOWN_TYPE): Remove.
2473 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
2474 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
2475 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
2476 * class.c (instantiate_type): Check unknown_type_node rather than
2478 * name-lookup.c (maybe_push_decl): Likewise.
2479 * rtti.c (get_tinfo_decl_dynamic): Likewise.
2480 (get_typeid): Likewise.
2481 * semantics.c (finish_offsetof): Likewise.
2484 * call.c (add_template_candidate_real): If deduction fails, still
2485 add the template as a non-viable candidate.
2486 (equal_functions): Handle template candidates.
2487 (print_z_candidate): Likewise.
2488 (print_z_candidates): Likewise.
2489 (build_new_function_call): Likewise.
2491 * cp-tree.h (LOOKUP_LIST_ONLY): New.
2492 * call.c (add_candidates): Enforce it.
2493 (build_new_method_call): Try non-list ctor if no viable list ctor.
2494 (build_user_type_conversion_1): Likewise.
2496 * call.c (add_candidates): Distinguish between type(x) and
2498 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
2499 (build_new_method_call): Give better error for conversion op.
2501 * call.c (add_candidates): Add first_arg and return_type parms.
2502 Add special constructor/conversion op handling.
2503 (convert_class_to_reference): Use it.
2504 (build_user_type_conversion_1): Likewise.
2505 (build_op_call): Likewise.
2506 (build_new_method_call): Likewise.
2507 (build_new_op): Adjust.
2508 (perform_overload_resolution): Adjust.
2510 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
2515 * pt.c (process_partial_specialization): Return error_mark_node
2516 in case of unused template parameters in partial specialization.
2518 2010-05-11 Jakub Jelinek <jakub@redhat.com>
2521 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
2522 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
2523 look at its second operand.
2525 2010-05-10 Jason Merrill <jason@redhat.com>
2528 * semantics.c (baselink_for_fns): Revert earlier change.
2531 * typeck.c (cp_build_modify_expr): Complain about assignment to
2532 array from init list.
2534 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
2537 * decl.c (check_initializer): strip array type before checking for
2538 uninitialized const or ref members.
2540 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
2543 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
2544 error count. Emit errors only if compain is true.
2545 (build_new_1): Do not return error_mark_node if
2546 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
2547 errors. Delay the check for user-provided constructor.
2548 (perform_member_init): Adjust.
2549 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
2552 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
2553 Jason Merrill <jason@redhat.com>
2555 Add support for C++0x nullptr.
2556 * cp-tree.def: Add NULLPTR_TYPE.
2557 * cp-tree.h: Add nullptr_node.
2558 (cp_tree_index): Add CPTI_NULLPTR.
2559 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
2560 * call.c (null_ptr_cst_p): Handle nullptr.
2561 (standard_conversion): Likewise.
2562 (convert_arg_to_ellipsis): Likewise.
2563 * mangle.c (write_type): Likewise.
2564 * name-lookup.c (arg_assoc_type): Likewise.
2565 * parser.c (cp_parser_primary_expression): Likewise.
2566 * typeck.c (cp_build_binary_op): Likewise.
2567 (build_reinterpret_cast_1): Likewise.
2568 * error.c (dump_type): Likewise.
2569 (dump_type_prefix, dump_type_suffix): Likewise.
2570 * decl.c (cxx_init_decl_processing): Likewise.
2571 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2572 * cvt.c (ocp_convert): Likewise.
2573 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
2574 nullptr_t tinfo in libsupc++.
2576 2010-05-06 Jason Merrill <jason@redhat.com>
2578 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
2580 2010-04-22 Jakub Jelinek <jakub@redhat.com>
2581 Dodji Seketeli <dodji@redhat.com>
2584 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
2586 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
2587 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
2588 (decay_conversion, perform_integral_promotions): Call rvalue_use.
2589 (cp_build_unary_op): Call lvalue_use.
2590 * decl.c (unused_but_set_errorcount): New variable.
2591 (poplevel): Issue -Wunused-but-set-variable diagnostics.
2592 (duplicate_decls): Merge DECL_READ_P flags.
2593 (start_cleanup_fn): Set DECL_READ_P flag.
2594 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
2595 * tree.c (rvalue): Call rvalue_use.
2596 * pt.c (convert_nontype_argument): Likewise.
2597 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
2598 finish_decltype_type): Likewise.
2599 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
2600 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
2601 or rvalue_use depending on the expr.
2602 * init.c (build_new, build_delete): Likewise.
2603 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
2605 2010-05-05 Jason Merrill <jason@redhat.com>
2608 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
2609 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
2611 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2614 * pt.c (unify): Check each elt for error_mark_node.
2616 2010-05-04 Jason Merrill <jason@redhat.com>
2619 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
2621 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2624 * call.c (build_new_method_call): Return error_mark_node if fns is
2627 2010-05-03 Dodji Seketeli <dodji@redhat.com>
2630 * pt.c (most_specialized_class): Pretend we are processing
2631 a template decl during the call to coerce_template_parms.
2633 2010-05-03 Jason Merrill <jason@redhat.com>
2637 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
2638 from the selected underlying type unless -fstrict-enums. Set
2639 ENUM_UNDERLYING_TYPE to have the restricted range.
2640 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
2641 * class.c (check_bitfield_decl): Likewise.
2643 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
2646 * init.c (build_new_1): Revert the accidental checkin in
2649 2010-04-30 Jason Merrill <jason@redhat.com>
2652 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
2653 (pp_cxx_type_specifier_seq): ...here.
2655 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
2657 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
2658 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
2660 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
2663 * typeck.c (warn_args_num): New function.
2664 (convert_arguments): Use warn_args_num to print the diagnostic
2667 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
2670 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
2671 user-provided constructor while recursing.
2673 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
2676 * error.c (print_instantiation_partial_context_line): Handle
2677 recursive instantiation.
2678 (print_instantiation_partial_context): Likewise.
2680 2010-04-27 Jason Merrill <jason@redhat.com>
2682 * init.c (perform_member_init): Check CLASS_TYPE_P.
2684 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2687 * init.c (perform_member_init): check for uninitialized const or
2688 reference members, including array types.
2690 2010-04-24 Jason Merrill <jason@redhat.com>
2692 * tree.c (get_fns): Split out from get_first_fn.
2693 * cp-tree.h: Declare it.
2694 * search.c (shared_member_p): Use it.
2695 * semantics.c (finish_qualified_id_expr): Simplify.
2696 (finish_id_expression): Simplify.
2698 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
2699 whenever object is NULL_TREE. Don't do 'this' capture here.
2700 (finish_qualified_id_expr): Pass NULL_TREE.
2701 (finish_id_expression): Likewise.
2702 (lambda_expr_this_capture): Likewise.
2704 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
2705 rather than checking current_class_ref directly.
2706 (finish_call_expr): Likewise.
2709 * name-lookup.c (qualify_lookup): Disqualify lambda op().
2710 * class.c (current_nonlambda_class_type): New fn.
2711 * semantics.c (nonlambda_method_basetype): New.
2712 * cp-tree.h: Declare them.
2713 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
2715 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
2718 * semantics.c (lambda_return_type): Complain about
2722 * tree.c (cv_unqualified): Handle error_mark_node.
2725 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
2726 if we don't want errors.
2729 * class.c (convert_to_base): Add complain parameter. Pass
2730 ba_quiet to lookup_base if we don't want errors.
2731 (build_vfield_ref): Pass complain to convert_to_base.
2732 * call.c (convert_like_real): Likewise.
2733 (initialize_reference): Likewise.
2734 (perform_direct_initialization_if_possible): Pass complain to
2736 * cp-tree.h: Adjust.
2738 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2739 Jason Merrill <jason@redhat.com>
2742 * decl.c (check_for_uninitialized_const_var): Handle classes that need
2744 (check_initializer): Call it for classes that need constructing, too.
2745 * class.c (in_class_defaulted_default_constructor): New.
2746 * cp-tree.h: Declare it.
2748 2010-04-20 Jason Merrill <jason@redhat.com>
2751 * init.c (constant_value_1): Treat error_mark_node as a constant
2752 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
2753 * cvt.c (ocp_convert): Handle getting error_mark_node from
2754 integral_constant_value.
2755 * decl.c (compute_array_index_type): Likewise.
2757 2010-04-20 Dodji Seketeli <dodji@redhat.com>
2761 * typeck.c (incompatible_dependent_types_p): If one of the
2762 compared types if not a typedef then honour their main variant
2765 2010-04-20 Jakub Jelinek <jakub@redhat.com>
2767 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
2769 2010-04-19 Dodji Seketeli <dodji@redhat.com>
2772 * typeck.c (structural_comptypes): Test dependent typedefs
2773 incompatibility before testing for their main variant based
2776 2010-04-19 Jakub Jelinek <jakub@redhat.com>
2778 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
2779 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
2781 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
2783 * decl.c (cxx_init_decl_processing): Remove second argument in call to
2784 build_common_tree_nodes.
2786 2010-04-14 Jason Merrill <jason@redhat.com>
2789 * parser.c (cp_parser_parenthesized_expression_list): Change
2790 is_attribute_list parm to int to indicate whether or not to
2791 handle initial identifier specially.
2792 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
2794 2010-04-13 Jason Merrill <jason@redhat.com>
2796 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
2798 * parser.c (cp_parser_lambda_expression): Complain about lambda in
2799 unevaluated context.
2800 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
2802 2010-04-12 Jason Merrill <jason@redhat.com>
2805 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
2806 return value directly.
2808 * call.c (type_decays_to): Call cv_unqualified for non-class type.
2810 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
2813 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2814 * init.c (build_new_1): Check for uninitialized const members and
2815 uninitialized reference members, when using new without
2816 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
2817 (diagnose_uninitialized_cst_or_ref_member): Define, call
2818 diagnose_uninitialized_cst_or_ref_member_1.
2819 (diagnose_uninitialized_cst_or_ref_member_1): New function.
2821 2010-04-12 Richard Guenther <rguenther@suse.de>
2824 * semantics.c (expand_or_defer_fn_1): Do not keep extern
2825 template inline functions.
2827 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2830 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
2833 2010-04-07 Jason Merrill <jason@redhat.com>
2836 * decl.c (start_preparsed_function): Do defer nested functions.
2838 PR c++/11094, DR 408
2839 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
2840 * decl2.c (finish_static_data_member_decl): Set it.
2841 * decl.c (duplicate_decls): Propagate it.
2842 * pt.c (tsubst_decl): Don't substitute the domain of an array
2843 VAR_DECL if it's set.
2844 (regenerate_decl_from_template): Substitute it here.
2845 (type_dependent_expression_p): Return true if it's set.
2846 * semantics.c (finish_decltype_type): Instantiate such a variable.
2847 * typeck.c (cxx_sizeof_expr): Likewise.
2848 (strip_array_domain): New.
2851 * name-lookup.c (current_decl_namespace): Non-static.
2852 (pop_nested_namespace): Sanity check.
2853 * cp-tree.h: Declare current_decl_namespace.
2854 * decl.c (grokvardecl): Use it instead of current_namespace.
2855 (grokfndecl): Likewise.
2858 * pt.c (tsubst_friend_function): Instatiate a friend that has already
2861 * pt.c (print_template_statistics): New.
2862 * cp-tree.h: Declare it.
2863 * tree.c (cxx_print_statistics): Call it.
2866 * decl.c (grokvardecl): Tweak warning message.
2867 (grokfndecl): Likewise.
2869 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2872 *pt.c (tsubst_decl): Get the arguments of a specialization from
2873 the specialization template, not from the most general template.
2875 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2878 * typeck2.c (process_init_constructor_record):
2879 value-initialize members that are are not explicitely
2882 2010-04-07 Jie Zhang <jie@codesourcery.com>
2885 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
2886 when all of its elements are non-constant and have been split out.
2888 2010-04-06 Taras Glek <taras@mozilla.com>
2889 Jason Merrill <jason@redhat.com>
2891 * parser.c (cp_parser_class_specifier): Set class location to that
2892 of IDENTIFIER_NODE instead of '{' when possible.
2893 * semantics.c (begin_class_definition): Do not overide locations
2894 with less precise ones.
2896 2010-04-06 Jason Merrill <jason@redhat.com>
2899 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
2902 * pt.c (maybe_update_decl_type): Check the return value from
2905 2010-04-01 Jason Merrill <jason@redhat.com>
2907 * decl.c (next_initializable_field): No longer static.
2908 * cp-tree.h: Declare it.
2909 * call.c (build_aggr_conv): Fail if there are more initializers
2910 than initializable fields.
2912 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
2913 instead of void_zero_node.
2915 2010-03-31 Dodji Seketeli <dodji@redhat.com>
2918 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
2919 * pt.c (end_template_parm_list): Store sibling template parms of
2920 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2921 (push_template_decl_real): Don't store the containing template decl
2922 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
2923 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
2924 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2927 2010-03-30 Jason Merrill <jason@redhat.com>
2930 * pt.c (push_template_decl_real): Deal better with running out of
2931 scopes before running out of template parms.
2935 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
2936 function parameter context. Don't print an error if parsing
2940 * pt.c (more_specialized_fn): Don't control cv-qualifier check
2943 2010-03-26 Jason Merrill <jason@redhat.com>
2946 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
2947 c++0x mode, but not other type-names.
2949 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2952 * pt.c (add_to_template_args): Support NULL ARGS;
2953 (most_specialized_class): call coerce_template_parms on
2954 template arguments passed to get_class_bindings. Use
2955 add_to_template_args.
2956 (unify): Handle VAR_DECLs.
2958 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2960 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
2962 * pt.c (get_template_parms_at_level): Adjust.
2964 2010-03-25 Dodji Seketeli <dodji@redhat.com>
2967 * cp-tree.h (get_template_parms_at_level): Declare ...
2968 * pt.c (get_template_parms_at_level): ... new function.
2969 * typeck.c (get_template_parms_of_dependent_type): If a template
2970 type parm's DECL_CONTEXT isn't yet set, get its siblings from
2971 current_template_parms. Use get_template_parms_at_level. Remove
2973 (incompatible_dependent_types_p): If we get empty parms from just one
2974 of the template type parms we are comparing then the template parms are
2977 2010-03-24 Jason Merrill <jason@redhat.com>
2980 * parser.c (make_declarator): Initialize id_loc.
2981 (cp_parser_lambda_declarator_opt): And set it.
2983 2010-03-23 Jason Merrill <jason@redhat.com>
2985 Make lambda conversion op and op() non-static.
2986 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
2987 Also add the thunk function returned by the conversion op.
2988 Mark the conversion deleted if the op() is variadic.
2989 * decl2.c (mark_used): Give helpful message about deleted conversion.
2990 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
2991 * semantics.c (finish_this_expr): Adjust.
2992 * mangle.c (write_closure_type_name): Adjust.
2993 * decl.c (grok_op_properties): Don't allow it.
2994 * call.c (build_user_type_conversion_1): No static conversion ops.
2995 (build_op_call): Or op().
2997 * decl2.c (change_return_type): Fix 'this' quals.
2999 2010-03-22 Jason Merrill <jason@redhat.com>
3002 * tree.c (pod_type_p): Use old meaning in C++98 mode.
3005 * pt.c (contains_auto_r): New fn.
3006 (do_auto_deduction): Use it.
3007 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
3009 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
3012 * decl2.c (grokfield): Handle invalid initializers for member
3015 2010-03-20 Dodji Seketeli <dodji@redhat.com>
3018 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
3020 * decl2.c (vague_linkage_p): Likewise.
3022 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
3025 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
3026 false, in the cp_parser_expression_statement call.
3028 2010-03-05 Jason Merrill <jason@redhat.com>
3030 * mangle.c (mangle_decl): Give name collision error even without
3033 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
3035 * pt.c (process_partial_specialization): Use error_n instead of
3038 2010-03-03 Jason Merrill <jason@redhat.com>
3041 * mangle.c (mangle_decl): Handle VAR_DECL, too.
3043 2010-03-03 Jason Merrill <jason@redhat.com>
3046 * mangle.c: Include cgraph.h.
3047 (mangle_decl): If the mangled name will change in a later
3048 ABI version, make the later mangled name an alias.
3049 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
3050 * Make-lang.in (mangle.o): Depend on cgraph.h.
3051 * method.c (make_alias_for): Handle VAR_DECL, too.
3052 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
3053 * tree.c (no_linkage_check): Adjust.
3054 * decl.c (maybe_commonize_var): Adjust.
3055 * cp-tree.h: Adjust.
3057 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
3059 * pt.c (redeclare_class_template): Use error_n and inform_n.
3061 2010-02-27 Mark Mitchell <mark@codesourcery.com>
3064 * cp-tree.h (push_tinst_level): Declare.
3065 (pop_tinst_level): Likewise.
3066 * pt.c (push_tinst_level): Give it external linkage.
3067 (pop_tinst_level): Likewise.
3068 * mangle.c (mangle_decl_string): Set the source location to that
3069 of the decl while mangling.
3071 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
3074 * pt.c (redeclare_class_template): Return false if there are erroneous
3075 template parameters.
3077 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
3079 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
3082 2010-02-24 Jason Merrill <jason@redhat.com>
3085 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
3087 * class.c (layout_class_type): Don't give -Wabi warning for a bug
3088 in a previous ABI version.
3090 2010-02-23 Jason Merrill <jason@redhat.com>
3093 * typeck2.c (digest_init_r): Accept value init of array.
3095 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
3098 * typeck.c (convert_arguments): Update error message.
3100 2010-02-22 Mike Stump <mikestump@comcast.net>
3103 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
3105 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
3108 * error.c (print_instantiation_partial_context_line): New.
3109 (print_instantiation_partial_context): Print at most 12 contexts,
3110 skip the rest with a message.
3112 2010-02-21 Dodji Seketeli <dodji@redhat.com>
3115 * pt.c (lookup_template_class): Better support of specialization
3116 of member of class template implicit instantiation.
3118 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
3121 * call.c (conversion_null_warnings): Replace -Wconversion with
3123 * cvt.c (build_expr_type_conversion): Likewise.
3125 2010-02-18 Jason Merrill <jason@redhat.com>
3128 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
3131 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
3133 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
3134 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
3137 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
3141 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
3142 (maybe_update_decl_type): New fn.
3143 * parser.c (cp_parser_init_declarator): Use it.
3146 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
3148 2010-02-17 Jason Merrill <jason@redhat.com>
3151 * call.c (build_over_call): Don't create zero-sized assignments.
3152 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
3153 * cp-objcp-common.c (cp_expr_size): Remove.
3154 * cp-tree.h: Remove prototype.
3157 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
3158 decl we looked up doesn't match.
3161 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
3162 have an INIT_EXPR anymore.
3165 * pt.c (convert_nontype_argument): Change assert to test.
3167 2010-02-16 Jason Merrill <jason@redhat.com>
3169 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
3172 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
3173 VIEW_CONVERT_EXPR for conversions between structural equality types
3174 that the back end can't tell are the same.
3177 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
3178 cv-quals from element here.
3179 (cp_build_qualified_type_real): Not here. Preserve typedef name.
3181 2010-02-14 Jason Merrill <jason@redhat.com>
3184 * semantics.c (finish_compound_literal): Use
3185 cp_apply_type_quals_to_decl when creating a static variable.
3187 2010-02-12 Jason Merrill <jason@redhat.com>
3190 * name-lookup.h (current_binding_level): Check for null
3193 2010-02-12 Jason Merrill <jason@redhat.com>
3196 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
3198 2010-02-12 Jakub Jelinek <jakub@redhat.com>
3201 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
3204 2010-02-10 Jason Merrill <jason@redhat.com>
3207 * semantics.c (outer_lambda_capture_p): Revert.
3208 (add_capture): Only finish_member_declaration if
3209 we're in the lambda class.
3210 (register_capture_members): New.
3211 * cp-tree.h: Declare it.
3212 * parser.c (cp_parser_lambda_expression): Call it.
3214 2010-02-10 Jason Merrill <jason@redhat.com>
3217 * semantics.c (outer_lambda_capture_p): Use current_function_decl
3218 instead of current_class_type.
3220 2010-02-10 Jason Merrill <jason@redhat.com>
3222 PR c++/42983, core issue 906
3223 * method.c (defaultable_fn_check): Check virtualness.
3225 2010-02-10 Jason Merrill <jason@redhat.com>
3228 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
3230 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
3232 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
3233 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
3235 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
3236 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
3237 (cp_parser_parameter_declaration)
3238 (cp_parser_exception_specification_opt)
3239 (cp_parser_exception_declaration): Likewise.
3240 * pt.c (check_default_tmpl_args): Likewise.
3241 * search.c (lookup_field_r): Likewise.
3243 2010-02-09 Jason Merrill <jason@redhat.com>
3246 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
3248 2010-02-09 Jason Merrill <jason@redhat.com>
3251 * decl2.c (change_return_type): New fn.
3252 * semantics.c (apply_lambda_return_type): Use it.
3253 * cp-tree.h: Declare it.
3255 2010-02-05 Richard Guenther <rguenther@suse.de>
3257 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
3258 * cp-lang.c: Include gt-cp-cp-lang.h.
3259 * config-lang.in (gtfiles): Add cp/cp-lang.c.
3261 2010-02-05 Dodji Seketeli <dodji@redhat.com>
3264 * typeck.c (get_template_parms_of_dependent_type): Try getting
3265 the template parameters fromt the type itself first.
3267 2010-02-03 Jason Merrill <jason@redhat.com>
3271 * mangle.c (write_unqualified_id): Split out from write_expression.
3272 (write_unqualified_name): Call it.
3273 (write_member_name): Likewise.
3274 (write_expression): Support TEMPLATE_ID_EXPR.
3275 Disambiguate operator names.
3278 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
3281 2010-02-02 Jason Merrill <jason@redhat.com>
3284 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
3285 * optimize.c (clone_body): Remap their initializers when making base
3287 (maybe_clone_body): Complain if multiple clones aren't safe.
3289 2010-01-29 Dodji Seketeli <dodji@redhat.com>
3296 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3297 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3298 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
3299 * pt.c (coerce_template_parms, type_unification_real,
3300 expand_template_argument_pack, coerce_template_parameter_pack):
3301 Set the non default template args count.
3302 (current_template_args): Always set non defaulted
3303 template args count when compiled with --enable-checking
3304 (tsubst_template_args, type_unification_real): Propagate the non
3305 defaulted template args count.
3306 * error.c (get_non_default_template_args_count): Renamed
3307 count_non_default_template_args into this. Don't calculate the
3308 non default template argument count anymore. Use the new
3309 accessor macros above to get it.
3310 (dump_template_argument_list, dump_type, dump_decl,
3311 dump_template_parms): Adjust.
3312 * parser.c (cp_parser_template_argument_list): Always set defaulted
3313 template args count when compiled with --enable-checking.
3315 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
3317 * decl.c (redeclaration_error_message): Wrap the return messages into
3318 G_() for easy translation.
3320 2010-01-28 Jason Merrill <jason@redhat.com>
3323 * semantics.c (begin_class_definition): Don't use type_as_string.
3325 2010-01-28 Dodji Seketeli <dodji@redhat.com>
3329 * typeck.c (get_template_parms_of_dependent_type): Factorized
3330 this out of incompatible_template_type_parms_p
3331 (incompatible_dependent_types_p): Renamed
3332 incompatible_template_type_parms_p into this. Make it detect
3333 two incompatible dependent typedefs too.
3334 (structural_comptypes): Use incompatible_dependent_types_p.
3335 * pt.c (get_template_info):
3336 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
3338 2010-01-20 Janis Johnson <janis187@us.ibm.com>
3339 Jason Merrill <jason@redhat.com>
3341 * mangle.c (write_type): Mangle transparent record as member type.
3342 * semantics.c (begin_class_definition): Recognize decimal classes
3343 and set TYPE_TRANSPARENT_AGGR.
3345 2010-01-20 Jason Merrill <jason@redhat.com>
3348 * mangle.c (write_expression): Handle tree codes that have extra
3349 arguments in the middle-end.
3351 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
3354 * except.c (expand_start_catch_block): Deal correctly with
3355 do_begin_catch returning error_mark_node.
3357 2010-01-20 Jason Merrill <jason@redhat.com>
3360 * class.c (layout_class_type): Set packed_maybe_necessary for packed
3364 * semantics.c (build_lambda_object): Call mark_used on captured
3368 * decl.c (grokdeclarator): Clear type_quals for a member function
3369 declared using a typedef. Don't complain about adding cv-quals
3370 to a function typedef in C++0x mode.
3372 2010-01-20 Jakub Jelinek <jakub@redhat.com>
3374 * decl.c (create_array_type_for_decl): Remove set but not used
3375 variable error_msg. Remove break stmts after return stmts.
3377 2010-01-19 Dodji Seketeli <dodji@redhat.com>
3379 * error.c (dump_template_parms, count_non_default_template_args):
3380 Revert fix of PR c++/42634.
3382 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3385 * error.c (dump_template_parms): Use innermost template
3386 arguments before calling count_non_default_template_args.
3387 (count_non_default_template_args): We are being called with
3388 template innermost arguments now. There is no need to ensure
3391 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3394 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
3396 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3399 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
3401 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3404 *pt.c (tsubst_decl): Get the arguments of a specialization from
3405 the specialization template, not from the most general template.
3407 2010-01-16 Jason Merrill <jason@redhat.com>
3410 * semantics.c (finish_decltype_type): Within a template, treat
3411 unresolved CALL_EXPR as dependent.
3413 2010-01-15 Dodji Seketeli <dodji@redhat.com>
3415 * error.c (dump_template_parms,count_non_default_template_args):
3416 Revert changes of PR c++/42634.
3418 2010-01-14 Jakub Jelinek <jakub@redhat.com>
3421 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
3422 functions with noreturn attribute.
3424 2010-01-14 Jason Merrill <jason@redhat.com>
3427 * call.c (build_new_method_call): Don't free the vec here.
3430 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
3432 2010-01-13 Dodji Seketeli <dodji@redhat.com>
3435 * error.c (dump_template_parms): Use innermost template
3436 arguments before calling count_non_default_template_args.
3437 (count_non_default_template_args): We are being called with
3438 template innermost arguments now. There is no need to ensure
3441 2010-01-07 Dodji Seketeli <dodji@redhat.com>
3444 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
3445 arguments that were previously deduced.
3447 2010-01-05 Jason Merrill <jason@redhat.com>
3449 * pt.c (unify_pack_expansion): Handle deduction from init-list.
3450 * call.c (build_over_call): Don't complain about it.
3452 2010-01-04 Jason Merrill <jason@redhat.com>
3455 * pt.c (tsubst_decl): Don't apply type attributes in place.
3458 * semantics.c (describable_type): Remove decltype comment and
3463 Copyright (C) 2010 Free Software Foundation, Inc.
3465 Copying and distribution of this file, with or without modification,
3466 are permitted in any medium without royalty provided the copyright
3467 notice and this notice are preserved.