1 2010-11-03 Jason Merrill <jason@redhat.com>
4 * init.c (expand_default_init): Avoid ICE if we can't figure out
5 which function is being called.
7 2010-11-02 Nathan Froyd <froydnj@codesourcery.com>
9 * class.c (build_base_path, add_vcall_offset): Use build_zero_cst
10 instead of fold_convert.
11 * init.c (build_zero_init): Likewise.
12 * typeck.c (cp_build_binary_op): Likewise.
14 2010-11-02 Dodji Seketeli <dodji@redhat.com>
18 * pt.c (check_valid_ptrmem_cst_expr): Add a complain parameter to
20 (convert_nontype_argument, convert_nontype_argument): Pass the
21 complain parameter down to check_valid_ptrmem_cst_expr.
23 2010-11-02 Dodji Seketeli <dodji@redhat.com>
26 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): Remove.
27 (struct template_parm_index_s)<num_siblings>: New field.
28 (TEMPLATE_PARM_NUM_SIBLINGS): New accessor.
29 (process_template_parm): Extend the API to accept the number of
30 template parms in argument.
31 (cp_set_underlying_type): Remove this.
32 * class.c (build_self_reference): Require canonical type equality
33 back on the self reference of class.
34 * decl2.c (grokfield): Require canonical type equality back on
36 * name-lookup.c (pushdecl_maybe_friend): Require canonical type
37 equality back on typedefs.
38 * parser.c (cp_parser_template_parameter_list): Do not require
39 canonical type equality on dependent types created during template
41 * pt.c (fixup_template_type_parm_type, fixup_template_parm_index)
42 (fixup_template_parm, fixup_template_parms): New private
44 (current_template_args): Declare this.
45 (process_template_parm): Pass the total number of template parms
46 to canonical_type_parameter.
47 (build_template_parm_index): Add a new argument to carry the total
48 number of template parms.
49 (reduce_template_parm_level, process_template_parm, make_auto):
51 (current_template_args): Fix this for template template
53 (tsubst_template_parm): Split out of ...
54 (tsubst_template_parms): ... this.
55 (reduce_template_parm_level): Don't loose
56 TEMPLATE_PARM_NUM_SIBLINGS when cloning a TEMPLATE_PARM_INDEX.
57 (template_parm_to_arg): Extracted this function from
58 current_template_args. Make it represent invalid template parms
59 with an error_mark_node instead of a LIST_TREE containing an
61 (current_template_args): Use template_parm_to_arg.
62 (dependent_template_arg_p): Consider an invalid template argument
64 (end_template_parm_list): Do not update template sibling parms
65 here anymore. Use fixup_template_parms instead.
66 (process_template_parm): Pass the number of template parms to
67 canonical_type_parameter.
68 (make_auto): Require structural equality on auto
69 TEMPLATE_TYPE_PARM for now.
70 (unify)<BOUND_TEMPLATE_TEMPLATE_PARM>: Coerce template parameters
71 using all the arguments deduced so far.
72 (tsubst)<TEMPLATE_TYPE_PARM>: Pass the number of sibling parms to
73 canonical_type_parameter.
74 * tree.c (cp_set_underlying_type): Remove.
75 * typeck.c (get_template_parms_of_dependent_type)
76 (incompatible_dependent_types_p): Remove.
77 (structural_comptypes): Do not call incompatible_dependent_types_p
79 (comp_template_parms_position): Re-organized. Take the length of
80 template parms list in account.
82 2010-11-01 Jason Merrill <jason@redhat.com>
84 * semantics.c (call_stack, call_stack_tick, cx_error_context): New.
85 (last_cx_error_tick, push_cx_call_context, pop_cx_call_context): New.
86 (cxx_eval_call_expression): Call push/pop_cx_call_context instead
87 of giving follow-on errors.
88 * error.c (maybe_print_constexpr_context): New.
89 (cp_diagnostic_starter): Call it.
90 * cp-tree.h: Declare cx_error_context.
92 * semantics.c (cxx_eval_constant_expression): Explain
93 unacceptable use of variable better.
95 2010-11-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
96 Jason Merrill <jason@redhat.com>
98 * call.c (null_ptr_cst_p): Use maybe_constant_value.
99 (set_up_extended_ref_temp): Support constant initialization.
100 (initialize_reference): Adjust.
101 * class.c (check_bitfield_decl): Use cxx_constant_value.
102 * cvt.c (ocp_convert): Don't use integral_constant_value when
103 converting to class type.
104 * decl.c (finish_case_label): Use maybe_constant_value.
105 (build_init_list_var_init): Support constant initialization.
106 (check_initializer): Likewise. Reorganize.
107 (cp_finish_decl): Likewise.
108 (expand_static_init): Likewise.
109 (compute_array_index_type): Use maybe_constant_value.
111 (create_array_type_for_decl, grokdeclarator): Pass it.
112 (build_enumerator): Use cxx_constant_value.
113 * decl2.c (grokfield): Use maybe_constant_init.
114 * except.c (check_noexcept_r): Handle constexpr.
115 (build_noexcept_spec): Use maybe_constant_value.
116 * init.c (expand_default_init): Support constant initialization.
117 (build_vec_init): Likewise.
118 (constant_value_1): Adjust.
119 (build_new_1): Adjust.
120 * parser.c (cp_parser_constant_expression): Allow non-integral
122 (cp_parser_direct_declarator): Don't fold yet in C++0x mode.
123 (cp_parser_initializer_clause): Toss folded result if non-constant.
124 * pt.c (fold_decl_constant_value): Remove.
125 (convert_nontype_argument): Use maybe_constant_value. Give clearer
126 error about overflow.
127 (tsubst): Move array bounds handling into compute_array_index_type.
128 (value_dependent_expression_p): Handle constant CALL_EXPR.
129 (tsubst_decl): Don't set
130 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P yet.
131 (tsubst_expr) [DECL_EXPR]: Pass it into cp_finish_decl.
132 (instantiate_decl): Here too.
133 * semantics.c (finish_static_assert): Use maybe_constant_value.
134 (ensure_literal_type_for_constexpr_object): Make sure type is complete.
135 (potential_constant_expression): Use maybe_constant_value.
136 * tree.c (cast_valid_in_integral_constant_expression_p): Any cast
137 is potentially valid in C++0x.
138 * typeck2.c (store_init_value): Handle constant init.
139 (check_narrowing): Use maybe_constant_value.
140 (build_functional_cast): Set TREE_CONSTANT on literal T().
141 * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): Remove.
142 (LOOKUP_ALREADY_DIGESTED): New.
143 (compute_array_index_type): Adjust prototype.
145 * semantics.c (constexpr_call): New datatype.
146 (constexpr_call_table): New global table.
147 (constexpr_call_hash): New.
148 (constexpr_call_equal): Likewise.
149 (maybe_initialize_constexpr_call_table): Likewise.
150 (lookup_parameter_binding): Likewise.
151 (cxx_eval_builtin_function_call): Likewise.
152 (cxx_bind_parameters_in_call): Likewise.
153 (cxx_eval_call_expression): Likewise.
154 (cxx_eval_unary_expression): Likewise.
155 (cxx_eval_binary_expression): Likewise.
156 (cxx_eval_conditional_expression): Likewise.
157 (cxx_eval_array_reference): Likewise.
158 (cxx_eval_component_reference): Likewise.
159 (cxx_eval_logical_expression): Likewise.
160 (cxx_eval_object_construction): Likewise.
161 (cxx_eval_constant_expression): Likewise.
162 (cxx_eval_indirect_ref): Likewise.
163 (cxx_constant_value): Likewise.
164 (cxx_eval_bare_aggregate): Likewise.
165 (adjust_temp_type): New.
166 (reduced_constant_expression_p): New.
167 (verify_constant): New.
168 (cxx_eval_vec_init, cxx_eval_vec_init_1): New.
169 (cxx_eval_outermost_constant_expr): New.
170 (maybe_constant_value, maybe_constant_init): New.
171 (cxx_eval_constant_expression): Use them.
172 * pt.c (iterative_hash_template_arg): No longer static.
173 * cp-tree.h: Declare fns.
175 * cp-tree.h (register_constexpr_fundef): Declare.
176 * decl.c (maybe_save_function_definition): New.
177 (finish_function): Use it.
178 * semantics.c (constexpr_fundef): New datatype.
179 (constexpr_fundef_table): New global table.
180 (constexpr_fundef_equal): New.
181 (constexpr_fundef_hash): Likewise.
182 (retrieve_constexpr_fundef): Likewise.
183 (validate_constexpr_fundecl): Store in the table.
184 (build_data_member_initialization): New fn.
185 (build_constexpr_constructor_member_initializers): New.
186 (register_constexpr_fundef): Define.
187 (is_this_parameter): New.
188 (get_function_named_in_call): Likewise.
189 (get_nth_callarg): Likewise.
190 (check_automatic_or_tls): New.
191 (morally_constexpr_builtin_function_p): New.
192 (potential_constant_expression): New.
194 2010-11-01 Jason Merrill <jason@redhat.com>
196 * decl2.c (decl_constant_var_p): New fn.
197 (decl_maybe_constant_var_p): New fn.
198 (mark_used): Rework instantiation of things needed for constant
200 * cp-tree.h: Declare new fns.
201 * pt.c (instantiate_decl): Handle cp_unevaluated_operand.
202 (always_instantiate_p): Use decl_maybe_constant_var_p.
203 (instantiate_decl): Don't defer constexpr functions.
204 * repo.c (repo_emit_p): Use decl_maybe_constant_var_p.
205 * semantics.c (finish_id_expression): Use decl_constant_var_p.
206 Check for valid name in constant expr after mark_used.
208 2010-10-31 Jason Merrill <jason@redhat.com>
210 * class.c (is_really_empty_class): Work when type is not complete.
211 (synthesized_default_constructor_is_constexpr): New.
212 (add_implicitly_declared_members): Use it.
213 (type_has_constexpr_default_constructor): Likewise.
214 * cp-tree.h: Declare it.
215 * method.c (synthesized_method_walk): Use it.
217 * decl.c (pop_switch): Use EXPR_LOC_OR_HERE.
218 * typeck.c (convert_for_assignment): Likewise.
220 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
221 message about constexpr without -std=c++0x.
223 * decl.c (grokdeclarator): Don't ICE on constexpr non-static data
226 2010-10-30 Nathan Froyd <froydnj@codesourcery.com>
228 * class.c (layout_vtable_decl): Call build_array_of_n_type.
229 (build_vtt, build_ctor_vtabl_group): Likewise.
231 2010-10-30 Nicola Pero <nicola.pero@meta-innovation.com>
233 Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
234 * parser.c (cp_parser_objc_at_property_declaration): Removed
235 parsing of RID_COPIES and RID_IVAR. Updated call to
236 objc_add_property_declaration.
237 * typecheck.c (finish_class_member_access_expr): Call
238 objc_maybe_build_component_ref instead of objc_build_setter_call.
239 (cp_build_modify_expr): Call objc_maybe_build_modify_expr instead
240 of objc_build_getter_call.
242 2010-10-27 Jason Merrill <jason@redhat.com>
244 * cp-tree.h (cp_trait_kind): Add CPTK_IS_LITERAL_TYPE.
245 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle it.
246 * semantics.c (trait_expr_value, finish_trait_expr): Likewise.
247 * parser.c (cp_parser_primary_expression): Handle RID_IS_LITERAL_TYPE.
248 (cp_parser_trait_expr): Likewise.
250 2010-10-27 Gabriel Dos Reis <gdr@cse.tamu.edu>
251 Jason Merrill <jason@redhat.com>
253 * decl.c (finish_case_label): Use decl_constant_value.
255 * method.c (synthesized_method_walk): Track constexprness too.
256 (process_subob_fn, walk_field_subobs): Likewise.
257 (implicitly_declare_fn): Set DECL_DECLARED_CONSTEXPR_P.
258 (defaulted_late_check): Handle DECL_DECLARED_CONSTEXPR_P.
259 * class.c (add_implicitly_declared_members): Handle
260 constexpr default ctor.
262 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
263 Make sure a constexpr ctor has an empty body.
264 * class.c (type_has_constexpr_default_constructor): New.
265 * cp-tree.h: Declare it.
266 * init.c (perform_member_init): Complain about uninitialized
267 member in constexpr ctor.
268 (emit_mem_initializers): And uninitialized base.
269 * decl.c (check_tag_decl): Fix typo.
271 * semantics.c (valid_type_in_constexpr_fundecl_p): New fn.
272 (is_valid_constexpr_fn): New fn.
273 (validate_constexpr_fundecl): Use it.
274 * decl.c (validate_constexpr_redeclaration): New.
275 (duplicate_decls): Use it.
276 (cp_finish_decl): Call validate_constexpr_fundecl and
277 ensure_literal_type_for_constexpr_object here.
278 (start_decl): Not here. Don't ICE on constexpr reference.
279 (check_for_uninitialized_const_var): Don't handle constexpr specially.
280 (grokfndecl): Set DECL_DECLARED_CONSTEXPR_P.
281 (check_static_variable_definition): Give friendly message about
283 (grokdeclarator): Complain about typedef and volatile with constexpr.
284 Reorganize. Give sorry about non-static data members in C++0x mode.
285 (start_preparsed_function): Check validate_constexpr_fundecl here.
286 (check_function_type): Not here.
287 * decl2.c (finish_static_data_member_decl): Don't complain about
289 * parser.c (CP_PARSER_FLAGS_ONLY_TYPE_OR_CONSTEXPR): New.
290 (cp_parser_condition): Pass it to cp_parser_decl_specifier_seq.
291 (cp_parser_decl_specifier_seq): Handle it.
292 (cp_parser_explicit_instantiation): Diagnose inline and constexpr.
294 * class.c (check_bases): Propagate non-literality.
295 (check_field_decls): Likewise.
296 (finalize_literal_type_property): New.
297 (check_bases_and_members): Call it.
298 * cp-tree.h (TYPE_HAS_CONSTEXPR_CTOR): New.
299 (lang_type_class): Add has_constexpr_ctor field.
300 (DECL_DECLARED_CONSTEXPR_P): Strip template.
301 * decl.c (grok_special_member_properties): Set
302 TYPE_HAS_CONSTEXPR_CTOR.
304 2010-10-27 Jason Merrill <jason@redhat.com>
306 * call.c (build_integral_nontype_arg_conv): New.
307 * cp-tree.h: Declare it.
308 * pt.c (convert_nontype_argument): Use it.
310 * error.c (dump_simple_decl): Print constexpr.
312 * cvt.c (build_up_reference): Use target_type for the temporary var.
314 * except.c (build_throw): Set EXPR_LOCATION.
316 * tree.c (build_cplus_new): Handle CONSTRUCTOR.
318 * semantics.c (finish_compound_stmt): Avoid creating an
319 unnecessary BIND_EXPR.
321 * call.c (convert_like_real): Don't check narrowing if the element
322 is also an initializer-list.
324 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
326 * parser.c (cp_parser_objc_at_property_declaration): Recognize
327 RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
328 Do not use objc_set_property_attr, but use local variables
329 instead. Detect repeated usage of setter, getter and ivar
330 attributes. Improved error processing when a setter name does not
331 end in ':'. Do not check for CPP_CLOSE_PAREN after we determined
332 that the token is a keyword. Updated call to
333 objc_add_property_declaration.
335 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
337 * parser.c (cp_parser_objc_property_decl): Renamed to
338 cp_parser_objc_struct_declaration. Return the parsed trees
339 instead of calling objc_add_property_variable directly. Detect
340 missing or invalid declspecs. Implemented attributes. Do not eat
341 the ';' at the end. Exit loop whenever a non-comma is parsed, not
343 (cp_parser_objc_at_property): Renamed to
344 cp_parser_objc_at_property_declaration. Updated calls to
345 objc_add_property_variable, now objc_add_property_declaration, and
346 to cp_parser_objc_property_decl, now
347 cp_parser_objc_struct_declaration. Rewritten all code to be more
348 robust in dealing with syntax errors, and almost identical to the
349 one in c_parser_objc_at_property_declaration.
350 (cp_parser_objc_property_attrlist): Removed.
351 (cp_parser_objc_method_prototype_list): Updated call to
352 cp_parser_objc_at_property.
353 (cp_parser_objc_method_definition_list): Same change.
354 (cp_parser_objc_class_ivars): Detect a number of invalid
355 declarations of instance variables and produce errors when they
358 2010-10-26 Jason Merrill <jason@redhat.com>
360 * tree.c (build_vec_init_expr): Split out from...
361 (build_array_copy): ...here.
362 * init.c (perform_member_init): Use it.
363 * cp-tree.h: Declare it.
364 * cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for
365 VEC_INIT_EXPR and AGGR_INIT_EXPR here. Drop pre/post parameters.
366 (cp_gimplify_expr): Handle array default-initialization via
369 * tree.c (stabilize_expr): Handle xvalues properly.
371 * call.c (build_over_call): Use argarray[0] for 'this' argument.
373 * decl.c (finish_function): Don't look at function_depth.
375 2010-10-25 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
377 Implement opaque-enum-specifiers for C++0x.
378 * cp-tree.h (SET_OPAQUE_ENUM_P): New.
379 (OPAQUE_ENUM_P): New.
380 (ENUM_FIXED_UNDERLYING_TYPE_P): New.
381 (start_enum): Update prototype.
382 (finish_enum_value_list): New prototype.
383 * parser.c (cp_parser_elaborated_type_specifier): Issue a pedwarn if
384 "enum class" is used in an elaborated-type-specifier.
385 (cp_parser_enum_specifier): Rewrite to parse opaque-enum-specifiers.
386 * decl.c (copy_type_enum): New.
387 (finish_enum_value_list): New, with code from finish_enum.
388 (finish_enum): A lot of code removed. Added a gcc_assert.
389 (start_enum): Add parameters enumtype and is_new.
390 Rewrite to work with opaque-enum-specifiers.
391 * pt.c (maybe_process_partial_specialization): Allow for template
392 specialization of enumerations, with a pedwarn.
393 (lookup_template_class): Update call to start_enum. Call to
395 (tsubst_enum): Call to begin_scope, finish_scope and
396 finish_enum_value_list.
398 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com>
400 Removed Objective-C++ specific replacement of cxx_printable_name.
401 * cp-objcp-common.h: Added LANG_HOOKS_DECL_PRINTABLE_NAME, set
402 to cxx_printable_name for both C++ and Objective-C++.
403 * cp-lang.h: Removed LANG_HOOKS_DECL_PRINTABLE_NAME.
405 * error.c (dump_decl): For Objective-C++, call
406 objc_maybe_printable_name here ...
407 * tree.c (cxx_printable_name_internal): ... instead of here.
409 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com>
411 * tree.c (cxx_printable_name_internal): In Objective-C++, call
412 objc_maybe_printable_name.
414 2010-10-22 Jason Merrill <jason@redhat.com>
417 * pt.c (instantiate_class_template): Don't instantiate default
421 * init.c (build_vec_init): Handle memberwise move.
423 2010-10-21 Paolo Carlini <paolo.carlini@oracle.com>
426 * call.c (add_function_candidate): Don't use TREE_VALUE on null
429 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
431 * parser.c (cp_parser_objc_method_type): Mark inline. Return a
432 bool instead of calling objc_set_method_type.
433 (cp_parser_objc_method_signature): Updated calls to
434 cp_parser_objc_method_type and to objc_build_method_signature.
435 (cp_parser_objc_method_prototype_list): Updated calls to
436 objc_add_method_declaration. Use token->type to determine if it
437 is a class method or not.
438 (cp_parser_objc_method_definition_list): Same change.
440 2010-10-20 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
443 * parser.c (cp_convert_range_for): Call cp_finish_decl
444 instead of finish_expr_stmt.
446 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
448 * cp-lang.c (finish_file): Removed.
449 * decl2.c (cp_write_global_declarations): Call
450 objc_write_global_declarations when compiling Objective-C++.
452 2010-10-19 Paolo Carlini <paolo.carlini@oracle.com>
455 * pt.c (add_to_template_args): Check extra_args for error_mark_node.
456 (coerce_template_parms): Likewise for args.
458 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
460 Implemented parsing @synthesize and @dynamic for Objective-C++.
461 * parser.c (cp_parser_objc_method_definition_list): Recognize
462 RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
463 (cp_parser_objc_at_dynamic_declaration): New.
464 (cp_parser_objc_at_synthesize_declaration): New.
466 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
468 * parser.c (cp_parser_objc_identifier_list): Check the return
469 value of cp_parser_identifier and react if it is error_mark_node.
471 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
473 Merge from apple/trunk branch on FSF servers.
475 2005-03-01 Fariborz Jahanian <fjahanian@apple.com>
478 * call.c (standard_conversion, implicit_conversion): Ignore
479 'volatile' attribute of artificially volatized type in objc when
480 evaluating various conversion weights.
482 2005-11-08 Fariborz Jahanian <fjahanian@apple.com>
485 * typeck.c (comp_ptr_ttypes_real): Remove the hack. un-volatize the
486 artiificially 'volatized' type before doing pointer comparison.
488 2010-10-18 Jakub Jelinek <jakub@redhat.com>
491 * semantics.c (finish_goto_stmt): Call mark_rvalue_use on computed
494 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
496 Merge from apple/trunk branch on FSF servers.
498 2006-04-19 Fariborz Jahanian <fjahanian@apple.com>
501 * parser.c (cp_parser_simple_type_specifier): Don't lookup for
502 objc object types if type is scope qualified.
504 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
506 Merge from apple/trunk branch on FSF servers.
508 2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
511 * lex.c (unqualified_name_lookup_error): Issue diagnostic
512 for private 'ivar' access.
514 2010-10-17 Iain Sandoe <iains@gcc.gnu.org>
516 * parser.c (cp_parser_objc_visibility_spec): Update to use visibility
517 enum, and handle @package.
519 2010-10-15 Jason Merrill <jason@redhat.com>
522 * tree.c (cp_build_qualified_type_real): Don't reuse a variant
523 with a different typedef variant of the element type.
525 2010-10-14 Iain Sandoe <iains@gcc.gnu.org>
527 merge from FSF apple 'trunk' branch.
528 2006 Fariborz Jahanian <fjahanian@apple.com>
530 Radars 4436866, 4505126, 4506903, 4517826
531 * typeck.c (finish_class_member_access_expr): Handle CLASS.property
533 (cp_build_modify_expr): Likewise.
534 * parser.c (cp_parser_objc_method_prototype_list): Handle @property.
535 (cp_parser_objc_method_definition_list): Likewise.
536 (cp_parser_objc_property_decl): New.
537 (cp_parser_objc_property_attrlist): New.
538 (cp_parser_objc_at_property): New.
540 2010-10-14 Richard Guenther <rguenther@suse.de>
543 * cp-tree.h (NULLPTR_TYPE_P): Adjust.
544 * decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node,
546 * error.c (dump_type): Handle NULLPTR_TYPE.
547 (dump_type_prefix): Likewise.
548 (dump_type_suffix): Likewise.
549 * mangle.c (write_type): Likewise.
550 * name-lookup.c (arg_assoc_type): Likewise.
551 * rtti.c (typeinfo_in_lib_p): Likewise.
552 * pt.c (tsubst): Likewise.
554 2010-10-13 Jason Merrill <jason@redhat.com>
557 * class.c (fixup_attribute_variants): New fn.
558 * cp-tree.h: Declare it.
559 * pt.c (instantiate_class_template): Call it.
560 * semantics.c (begin_class_definition): Call it.
562 2010-10-13 Richard Henderson <rth@redhat.com>
564 * cp-lang.c (cp_eh_personality): Update call to
565 build_personality_function.
566 * except.c (choose_personality_routine): Update function comment.
568 2010-10-13 Richard Guenther <rguenther@suse.de>
570 * tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and
571 clear DECL_CHAIN of NAMESPACE_DECLs.
573 2010-10-11 Martin Jambor <mjambor@suse.cz>
576 * cp-tree.h (current_class_ref): Check that cp_function_chain is
578 * call.c (build_cxx_call): Likewise.
580 2010-10-10 Jason Merrill <jason@redhat.com>
582 * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
583 (tsubst_default_arguments): Only do this once for cloned fns.
584 (tsubst): Use typedef_variant_p. Handle LANG_TYPE. Don't
586 (tsubst_expr): Avoid calling tsubst_expr for non-expressions.
587 (tsubst_copy_and_build): Likewise.
588 (tsubst_initializer_list): Likewise.
589 (tsubst_copy): Change default to gcc_unreachable. Handle
590 OVERLOAD and PTRMEM_CST.
592 2010-10-10 Jason Merrill <jason@redhat.com>
596 * pt.c (tsubst_copy) [INTEGER_CST]: Instantiate the type.
598 2010-10-07 Andi Kleen <ak@linux.intel.com>
600 * Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
601 (cc1plus-dummy): Remove.
602 (cc1plus-checksum): Change to run checksum over object files
605 2010-10-08 Joseph Myers <joseph@codesourcery.com>
607 * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
609 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
611 * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to
613 * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for
615 * error.c (dump_expr): Added case for AT_ENCODE_EXPR.
616 * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR.
617 (value_dependent_expression_p): Added case for AT_ENCODE_EXPR.
618 (type_dependent_expression_p): Added case for AT_ENCODE_EXPR.
619 * parser.c (cp_parser_objc_encode_expression): Updated comment.
621 2010-10-07 Nicola Pero <nicola@nicola.brainstorm.co.uk>
623 Merge from apple/trunk branch on FSF servers.
625 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
628 * parser.c (cp_parser_objc_interstitial_code): Recognize
629 and parse RID_NAMESPACE keyword.
631 2010-10-07 Iain Sandoe <iains@gcc.gnu.org>
633 * parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
634 finding ellipsis, before checking for attributes.
636 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
638 Merge from apple/trunk branch on FSF servers.
639 * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
640 longer existing gcc/c-common.def.
642 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
645 * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
646 * parser.c (cp_parser_objc_encode_expression): Build a templatized
647 parse tree for @encode(T).
649 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
652 * c-common.def: Add new expression code AT_ENCODE_EXPR.
654 2010-10-06 Eric Botcazou <ebotcazou@adacore.com>
657 * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
658 code folding offsetof-like computations.
660 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
663 * parser.c (cp_parser_objc_class_interface): If no identifier
664 follows an @interface token, stop parsing the interface after
666 (cp_parser_objc_class_implementation): If no identifier follows an
667 @implementation token, stop parsing the implementation after
670 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
673 * parser.c (cp_parser_objc_method_keyword_params): If the required
674 colon is not found while parsing parameters, stop parsing them.
676 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
679 * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
680 @end after detecting it. Print an error if @end is found without
682 (cp_parser_objc_method_prototype_list): Do not eat the EOF after
683 detecting it. Fixed reading the next token when continuing
684 because of an error in a method signature. Print an error if EOF
685 is found without an '@end'.
686 (cp_parser_objc_method_definition_list): Same change.
688 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
690 Merge from apple/trunk branch on FSF servers:
692 2005-10-17 Fariborz Jahanian <fjahanian@apple.com>
695 * parser.c (cp_parser_objc_method_keyword_params): Check for valid
696 method parameters and issue error.
697 (cp_parser_objc_method_definition_list): Check for invalid tokens
698 which cannot start a function definition.
700 2005-10-14 Fariborz Jahanian <fjahanian@apple.com>
703 * parser.c (cp_parser_objc_message_args): Check for missing message
704 arguments and syntax error.
706 2005-10-13 Fariborz Jahanian <fjahanian@apple.com>
709 * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
712 2005-08-15 Ziemowit Laski <zlaski@apple.com>
715 * parser.c (cp_parser_objc_interstitial_code): Catch stray
716 '{' and '}' tokens and issue appropriate errors.
718 2005-08-02 Ziemowit Laski <zlaski@apple.com>
721 (cp_parser_statement_seq_opt): In addition to '}' and
722 end-of-file, a statement sequence may also be terminated
725 2010-10-05 Joseph Myers <joseph@codesourcery.com>
727 * cp-tree.h (cxx_print_error_function,
728 cxx_initialize_diagnostics): Declare using diagnostic_context
731 2010-10-04 Andi Kleen <ak@linux.intel.com>
733 * Make-lang.in (g++, cc1plus): Add + to build rule.
735 2010-10-04 Jason Merrill <jason@redhat.com>
737 * tree.c (decl_storage_duration): New.
738 * cp-tree.h: Declare it.
739 (duration_kind): Return values.
741 2010-10-03 Jason Merrill <jason@redhat.com>
743 * typeck.c (require_complete_type_sfinae): Add complain parm to...
744 (require_complete_type): ...this function.
745 (cp_build_array_ref, convert_arguments): Use it.
746 (convert_for_initialization, cp_build_modify_expr): Likewise.
747 * cp-tree.h: Declare it.
748 * call.c (build_over_call): Use it.
750 2010-09-30 Iain Sandoe <iains@gcc.gnu.org>
752 merge from FSF 'apple/trunk' branch.
753 2006-01-30 Fariborz Jahanian <fjahanian@apple.com>
756 * cp/parser.c (cp_parser_objc_interstitial_code): For
757 @optional/@required set the optional/required flag.
759 2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>
761 * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
762 and indentation when finding an Objective-C++ CPP_AT_NAME token.
764 2010-09-29 Richard Guenther <rguenther@suse.de>
766 * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
767 (CP_TYPE_CONTEXT): Similar.
768 (FROB_CONTEXT): Frob global_namespace to the global
769 TRANSLATION_UNIT_DECL.
770 * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
771 set DECL_CONTEXT of global_namespace to it.
772 (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
773 instead of zeroing context.
774 (cp_finish_decl): Use DECL_FILE_SCOPE_P.
775 (grokfndecl): Likewise.
776 (start_preparsed_function): Likewise.
777 * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
778 (namespace_binding): Use SCOPE_FILE_SCOPE_P.
779 * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
780 (is_specialization_of_friend): Use CP_DECL_CONTEXT.
781 (push_template_decl_real): Likewise.
782 (tsubst_friend_class): Likewise. Adjust context comparisons.
783 (instantiate_class_template): Use CP_TYPE_CONTEXT.
784 (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
785 * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
788 2010-09-29 Yao Qi <yao@codesourcery.com>
790 * decl.c (get_atexit_node): Fix typo.
792 2010-09-28 Jason Merrill <jason@redhat.com>
794 * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
795 (real_lvalue_p): Take const_tree.
797 * typeck.c (lvalue_or_else): Make temporary arg a permerror.
798 (cp_build_addr_expr_1): Likewise.
800 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
802 Partially merged from apple/trunk branch on FSF servers:
803 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
804 Radar 3803157 (method attributes)
806 * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
807 (cp_parser_objc_method_tail_params_opt): Likewise.
808 (cp_parser_objc_method_signature): Likewise.
809 (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
810 (cp_parser_objc_method_prototype_list): Handle attributes.
811 (cp_parser_objc_method_definition_list): Likewise.
813 2010-09-28 Richard Henderson <rth@redhat.com>
815 * cp-lang.c: Include "target.h".
816 (cp_eh_personality): Use targetm.except_unwind_info.
817 * Make-lang.in (cp-lang.o): Update deps.
819 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
821 * parser.c (cp_parser_objc_valid_prefix_attributes): New.
822 (cp_parser_declaration): Parse prefix attributes for ObjC++.
823 (cp_parser_objc_protocol_declaration): Handle attributes.
824 (cp_parser_objc_class_interface): Likewise.
825 (cp_parser_objc_declaration): Likewise.
827 2010-09-27 Jason Merrill <jason@redhat.com>
829 Require lvalues as specified by the standard.
830 * typeck.c (lvalue_or_else): Use real_lvalue_p.
831 (cp_build_addr_expr_1): Split out of cp_build_unary_op.
832 (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
833 (decay_conversion, get_member_function_from_ptrfunc): Adjust.
834 (build_x_unary_op, build_reinterpret_cast_1): Adjust.
835 (build_const_cast_1): Adjust.
836 * cp-tree.h: Declare new fns.
837 * call.c (build_this, convert_like_real, build_over_call): Adjust.
838 (initialize_reference): Adjust.
839 * class.c (build_base_path, convert_to_base_statically): Adjust.
840 (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
841 * cvt.c (build_up_reference, convert_to_reference): Adjust.
842 * decl.c (register_dtor_fn): Adjust.
843 * decl2.c (build_offset_ref_call_from_tree): Adjust.
844 * except.c (initialize_handler_parm): Adjust.
845 * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
846 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
847 * tree.c (stabilize_expr): Adjust.
849 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
851 Merge from apple/trunk branch on FSF servers:
853 2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
856 * typeck.c (composite_pointer_type): Call objc_have_common_type
857 when comparing two objective-c pointer types.
859 2005-07-18 Ziemowit Laski <zlaski@apple.com>
862 * call.c (standard_conversion): Do not issue warnings when
863 comparing ObjC pointer types.
865 2005-06-22 Ziemowit Laski <zlaski@apple.com>
868 * call.c (standard_conversion): Allow for a pointer conversion
869 between any two ObjC pointer types.
870 * typeck.c (composite_pointer_type): Determine common type
871 for two ObjC pointer types.
873 2010-09-24 Jan Hubicka <jh@suse.cz>
875 * decl.c (finish_function): Use decl_replaceable_p
876 * method.c (make_alias_for_thunk): Update call of
877 cgraph_same_body_alias.
879 2010-09-24 Jason Merrill <jason@redhat.com>
881 * decl.c (compute_array_index_type): Remember type dependence of
883 * pt.c (dependent_type_p_r): Don't recompute it here.
885 * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
886 reference and pointer to the same type as "*" or "&".
888 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
890 * typeck.c (warn_args_num): Use warning 'too many arguments to
891 method [methodname]' for an Objective-C method instead of the less
892 satisfactory 'too many arguments to function' (with no method
895 2010-09-21 Jason Merrill <jason@redhat.com>
897 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
898 special handling if we know the member.
900 2010-09-18 Jason Merrill <jason@redhat.com>
902 * call.c (compare_ics): Do lvalue/rvalue reference binding
903 comparison for ck_list, too.
905 2010-09-15 Jason Merrill <jason@redhat.com>
907 * semantics.c (finish_id_expression): Diagnose use of function
908 parms in evaluated context outside function body.
910 * decl2.c (grokbitfield): Diagnose non-integral width.
912 * call.c (convert_like_real): Use the underlying type of the
913 reference for the temporary.
915 2010-09-15 Jakub Jelinek <jakub@redhat.com>
918 * class.c (build_vtbl_initializer): Use fn instead of init's operand
919 as first argument to FDESC_EXPR.
921 2010-09-15 Paolo Carlini <paolo.carlini@oracle.com>
924 * decl.c (grokdeclarator): Check build_memfn_type return value
927 2010-09-13 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
929 * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
930 (begin_range_for_stmt): Likewise.
932 2010-09-11 Rodrigo Rivas <rodrigorivascosta@gmail.com>
934 Implement range-based for-statements.
935 * cp-tree.def (RANGE_FOR_STMT): New.
936 * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
937 (cp_convert_range_for): Declare.
938 * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
939 (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
940 * semantics.c (begin_range_for_stmt): New.
941 (finish_range_for_decl): New.
942 (finish_for_stmt): Accept also RANGE_FOR_STMT.
943 (perform_koenig_lookup): Add extra argument include_std.
944 * parser.c (cp_parser_c_for): New with code from
945 cp_parser_iteration_statement().
946 (cp_parser_range_for): New.
947 (cp_convert_range_for): New.
948 (cp_parser_iteration_statement): Add range-for support.
949 (cp_parser_condition): Adjust comment.
950 (cp_parser_postfix_expression): perform_koenig_lookup takes extra
952 * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
953 * cxx-pretty-print.c: Likewise.
954 * lex.c (cxx_init): Likewise.
955 * name-lookup.c (lookup_function_nonclass): Add extra argument
957 (lookup_arg_dependent): Likewise.
958 * name-lookup.h: Likewise.
960 2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
963 * error.c (maybe_warn_cpp0x): Add new warning
964 CPP0X_INLINE_NAMESPACES.
965 * parser.c (cp_parser_namespace_definition): Likewise.
966 * cp-tree.h (cpp0x_warn_str): Likewise.
968 2010-09-10 Richard Guenther <rguenther@suse.de>
970 * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
971 TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
973 2010-09-10 Jan Hubicka <jh@suse.cz>
975 PR tree-optimization/45605
976 * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
979 2010-09-08 Jakub Jelinek <jakub@redhat.com>
982 * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
983 before calling fold_decl_constant_value.
985 2010-09-07 Arnaud Charlet <charlet@adacore.com>
987 * cp-tree.h (build_enumerator): Add new location_t parameter.
988 (build_lang_decl_loc): New function.
989 * decl.c (build_enumerator): New parameter loc. Use it when calling
990 build_decl. Replace build_lang_decl with build_lang_decl_loc.
991 * pt.c (tsubst_enum): Adjust call to build_enumerator.
992 * parser.c (cp_parser_enumerator_definition): Ditto.
993 * lex.c (build_lang_decl_loc): New function.
995 2010-09-06 Dodji Seketeli <dodji@redhat.com>
1000 * tree.c (strip_typedefs): Strip typedefs from the context of
1003 2010-09-06 Mark Mitchell <mark@codesourcery.com>
1005 * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
1006 * call.c (build_conditional_expr): Likewise.
1007 (convert_arg_to_ellipsis): Likewise.
1009 2010-09-06 Arnaud Charlet <charlet@adacore.com>
1011 * parser.c (make_pointer_declarator, make_reference_declarator,
1012 make_call_declarator, make_array_declarator): Set declarator->id_loc.
1013 (cp_parser_init_declarator): Adjust location of decl if appropriate.
1015 2010-09-06 Jason Merrill <jason@redhat.com>
1017 * call.c (implicit_conversion): Fix value-init of enums.
1018 (convert_like_real): Likewise.
1020 * decl.c (cp_finish_decl): Don't change init for auto deduction.
1022 * pt.c (fold_non_dependent_expr_sfinae): Split out from...
1023 (fold_non_dependent_expr): ...here.
1024 (convert_nontype_argument): Use it. Take complain parm.
1025 Use perform_implicit_conversion instead of ocp_convert.
1026 Allow cv-qual changes.
1027 (convert_template_argument): Pass complain down.
1028 (tsubst_template_arg): Suppress constant expression warnings.
1031 * method.c (synthesized_method_walk): In constructors, also check
1032 subobject destructors.
1034 * semantics.c (finish_compound_literal): Always build a
1037 2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
1040 * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
1042 2010-08-30 Jakub Jelinek <jakub@redhat.com>
1045 * parser.c (cp_parser_omp_atomic): Handle boolean
1046 {PRE,POST}_INCREMENT.
1048 2010-08-29 Jason Merrill <jason@redhat.com>
1051 * parser.c (cp_parser_parameter_declaration): Pop parameter decls
1052 after tentative parsing.
1054 2010-08-22 Joseph Myers <joseph@codesourcery.com>
1056 * Make-lang.in (g++spec.o): Update dependencies.
1057 * g++spec.c: Include opts.h
1058 (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
1059 (lang_specific_driver): Use cl_decoded_option structures.
1061 2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
1063 * call.c: Use FOR_EACH_VEC_ELT.
1064 * class.c: Likewise.
1066 * decl2.c: Likewise.
1067 * error.c: Likewise.
1068 * except.c: Likewise.
1069 * mangle.c: Likewise.
1070 * method.c: Likewise.
1071 * name-lookup.c: Likewise.
1072 * parser.c: Likewise.
1075 * semantics.c: Likewise.
1076 * typeck2.c: Likewise.
1078 2010-08-19 Jason Merrill <jason@redhat.com>
1080 * call.c (reference_related_p): Check for error_mark_node.
1081 (add_function_candidate): Check it instead of
1082 same_type_ignoring_top_level_qualifiers_p.
1085 * init.c (build_new_1): Don't use build_value_init in a template.
1086 (build_value_init): Make sure we don't.
1089 * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
1090 of empty class CONSTRUCTOR.
1092 * except.c (pending_noexcept, pending_noexcept_checks): New.
1093 (perform_deferred_noexcept_checks): New.
1094 (maybe_noexcept_warning): Split from...
1095 (finish_noexcept_expr): ...here. Adjust.
1096 * decl2.c (cp_write_global_declarations): Call
1097 perform_deferred_noexcept_checks.
1098 * cp-tree.h: And declare it.
1100 2010-08-18 Nathan Froyd <froydnj@codesourcery.com>
1103 * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
1106 2010-08-17 Kai Tietz <kai.tietz@onevision.com>
1108 * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
1109 or if -fms-extensions is enabled check, check permissive.
1111 2010-08-09 Jason Merrill <jason@redhat.com>
1114 * pt.c (lookup_template_class): Don't re-coerce outer parms.
1116 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1118 * call.c (add_builtin_candidates): Use VECs for local variable
1119 `types'. Adjust remainder of function accordingly.
1121 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1123 * name-lookup.c (is_associated_namespace): Convert local variables
1124 to be VECs instead of TREE_LISTs.
1126 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1128 * tree.c (varargs_function_p): Use stdarg_p.
1130 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1132 * parser.c (cp_default_arg_entry): Declare. Declare a VEC of it.
1133 (cp_unparsed_functions_entry): Declare. Declare a VEC of it.
1134 (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
1135 Change type to a VEC.
1136 (unparsed_funs_with_default_args): Define.
1137 (unparsed_funs_with_definitions): Define.
1138 (push_unparsed_function_queues): New function.
1139 (cp_parser_new): Call it.
1140 (pop_unparsed_function_queues): New function.
1141 (cp_parser_class_specifier): Adjust processing of unparsed functions.
1142 (cp_parser_template_declaration_after_export): Use VEC_safe_push.
1143 (cp_parser_save_member_function_body): Likewise.
1144 (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
1145 and pop_unparsed_function_queues.
1146 (cp_parser_late_parsing_default_args): Likewise.
1147 (cp_parser_save_default_args): Use VEC_safe_push.
1149 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1151 * name-lookup.h (cp_label_binding): Declare. Declare a VEC type
1153 (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
1155 * decl.c (poplevel): Adjust for type changes.
1156 (declare_local_label): Likewise.
1158 2010-08-06 Jason Merrill <jason@redhat.com>
1160 * typeck.c (complete_type_or_maybe_complain): Split out from...
1161 (complete_type_or_else): Here.
1162 (build_class_member_access_expr): Call it.
1163 (finish_class_member_access_expr): Likewise.
1164 * call.c (build_special_member_call): Likewise.
1165 * cvt.c (build_expr_type_conversion): Likewise.
1166 * init.c (build_new): Likewise.
1167 * typeck2.c (build_functional_cast): Likewise.
1168 * cp-tree.h: Declare it.
1170 * init.c (build_value_init): Add complain parm.
1171 (build_value_init_noctor): Likewise.
1172 (perform_member_init): Pass it.
1173 (expand_aggr_init_1): Likewise.
1174 (build_new_1): Likewise.
1175 (build_vec_init): Likewise.
1176 * pt.c (tsubst_expr): Likewise.
1177 * typeck2.c (build_functional_cast): Likewise.
1178 * cp-tree.h: Adjust.
1179 * tree.c (build_target_expr_with_type): Handle error_mark_node.
1181 * typeck.c (decay_conversion): Any expression with type nullptr_t
1184 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1187 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
1189 2010-07-27 Jason Merrill <jason@redhat.com>
1191 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
1192 from build_value_init.
1193 * init.c (build_value_init_noctor): Give error for unknown array
1196 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1198 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
1200 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1202 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
1203 c_common_initialize_diagnostics.
1204 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
1205 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
1207 2010-07-21 Jason Merrill <jason@redhat.com>
1209 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
1211 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
1214 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
1217 * pt.c (instantiate_class_template): Propagate the template's
1218 location to its instance.
1220 2010-07-20 Jason Merrill <jason@redhat.com>
1223 * pt.c (tsubst_copy_and_build): Rework last change.
1226 * pt.c (tsubst_copy_and_build): Handle partial substitution of
1229 2010-07-19 Jason Merrill <jason@redhat.com>
1232 * semantics.c (finish_decltype_type): Correct decltype
1233 of parenthesized rvalue reference variable.
1236 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
1237 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
1239 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
1242 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
1244 * cp-tree.h: Adjust declaration.
1245 * init.c (perform_member_init): Adjust caller.
1246 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
1247 * typeck2.c (store_init_value): Likewise.
1248 (build_functional_cast): Pass complain argument to
1249 build_x_compound_expr_from_list.
1251 2010-07-16 Jason Merrill <jason@redhat.com>
1254 * pt.c (process_partial_specialization): Diagnose partial
1255 specialization after instantiation.
1256 (most_specialized_class): Add complain parm.
1258 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
1260 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1262 * init.c (build_new_1): Use cp_build_function_call_nary instead of
1263 cp_build_function_call.
1265 2010-07-15 Jason Merrill <jason@redhat.com>
1268 * call.c (add_function_candidate): If we're working on an implicit
1269 declaration, don't consider candidates that won't match.
1270 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
1271 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
1274 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1275 (TYPE_HAS_USER_OPEQ): New.
1276 * decl.c (grok_special_member_properties): Set it.
1277 * class.c (add_implicitly_declared_members): Don't lazily declare
1278 constructors/operator= if a base or member has a user-declared one.
1279 (check_bases_and_members, check_bases): Adjust.
1280 (check_field_decls, check_field_decl): Adjust.
1282 2010-07-15 Anatoly Sokolov <aesok@post.ru>
1284 * decl.c (integer_three_node): Remove.
1285 (cxx_init_decl_processing): Do not initialize the integer_three_node.
1286 * cp-tree.h (integer_three_node): Remove.
1288 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1290 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
1292 * class.c: Likewise.
1293 * cp-gimplify.c: Likewise.
1295 * decl2.c: Likewise.
1297 * mangle.c: Likewise.
1298 * name-lookup.c: Likewise.
1299 * optimize.c: Likewise.
1300 * parser.c: Likewise.
1303 * search.c: Likewise.
1304 * semantics.c: Likewise.
1305 * typeck.c: Likewise.
1306 * typeck2.c: Likewise.
1308 2010-07-14 Jason Merrill <jason@redhat.com>
1310 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
1311 (build_field_list): Cache field type.
1313 Implement C++0x unrestricted unions (N2544)
1314 * class.c (check_field_decl): Loosen union handling in C++0x.
1315 * method.c (walk_field_subobs): Split out from...
1316 (synthesized_method_walk): ...here. Set msg before loops.
1317 (process_subob_fn): Check for triviality in union members.
1318 * init.c (sort_mem_initializers): Splice out uninitialized
1319 anonymous unions and union members.
1320 (push_base_cleanups): Don't automatically destroy anonymous unions
1323 2010-07-13 Jason Merrill <jason@redhat.com>
1326 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1327 (TYPE_HAS_USER_OPEQ): New.
1328 * decl.c (grok_special_member_properties): Set it.
1329 * class.c (add_implicitly_declared_members): Don't lazily declare
1330 constructors/operator= if a base or member has a user-declared one.
1331 (check_bases_and_members, check_bases): Adjust.
1332 (check_field_decls, check_field_decl): Adjust.
1333 * method.c (synthesized_method_walk): Initialize check_vdtor.
1336 * mangle.c (write_type): Canonicalize.
1337 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
1338 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
1340 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
1343 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
1345 * typeck.c (get_delta_difference): Update prototype, add a
1346 tsubst_flags_t parameter; update get_delta_difference_1 calls and
1347 add checks for error_mark_node.
1348 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
1349 parameter; update lookup_base call.
1350 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
1351 parameter; update get_delta_difference call and add check for
1353 (convert_ptrmem): Update prototype, add a tsubst_flags_t
1354 parameter; update get_delta_difference call and add check for
1355 error_mark_node; update build_ptrmemfunc call.
1356 (build_static_cast_1): Adjust convert_ptrmem call.
1357 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
1358 (cp_build_unary_op): Adjust build_ptrmemfunc call.
1359 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
1360 and build_ptrmemfunc calls.
1361 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
1363 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
1366 * call.c (build_temp): Add tsubst_flags_t complain parameter;
1367 adjust build_special_member_call call, pass complain.
1368 (convert_like_real): Adjust build_temp call, pass complain.
1370 2010-07-09 Jason Merrill <jason@redhat.com>
1373 * cp-tree.h (BV_LOST_PRIMARY): New macro.
1374 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
1375 Set BV_LOST_PRIMARY.
1376 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
1378 2010-07-08 Jason Merrill <jason@redhat.com>
1381 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
1382 virtual bases for covariant thunks.
1384 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
1386 * cp-tree.h: Do not include toplev.h.
1388 2010-07-06 Jason Merrill <jason@redhat.com>
1391 * call.c (is_std_init_list): Look through typedefs.
1394 * init.c (build_offset_ref): If scope isn't dependent,
1395 don't exit early. Look at TYPE_MAIN_VARIANT.
1396 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
1398 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
1400 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
1402 * cp-tree.h (impl_conv_void): New type.
1403 (convert_to_void): Adjust prototype.
1404 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
1405 diagnostic for easy translation. Change caller.
1406 * typeck.c: Update call to convert_to_void.
1407 * semantics.c: Likewise.
1410 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
1412 * decl.c (cp_finish_decl): Call add_local_decl.
1413 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
1415 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
1417 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
1420 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
1423 * parser.c (cp_parser_primary_expression): Error if local template is
1426 2010-07-02 Le-Chun Wu <lcwu@google.com>
1429 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
1430 (variable or type) shadows another type.
1432 2010-07-02 Jakub Jelinek <jakub@redhat.com>
1435 * typeck.c (convert_for_assignment): When converting a convertible
1436 vector type or objc++ types, call mark_rvalue_use.
1437 * typeck2.c (build_m_component_ref): Use return values from
1438 mark_rvalue_use or mark_lvalue_use.
1439 * class.c (build_base_path): Likewise.
1440 * call.c (build_conditional_expr): Likewise.
1442 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1445 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
1448 2010-07-01 Richard Guenther <rguenther@suse.de>
1450 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
1451 predicate we are looking for, allow non-gimplified
1454 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
1457 * typeck.c (cp_build_unary_op): Early return error_mark_node when
1458 arg is NULL_TREE too.
1459 * call.c (convert_class_to_reference): Return error_mark_node when
1462 2010-06-30 Michael Matz <matz@suse.de>
1464 * repo.c (finish_repo): Fix typo.
1466 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1468 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
1470 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1472 * repo.c (pending_repo): Change type to a VEC.
1473 (finish_repo): Adjust for new type of pending_repo.
1474 (repo_emit_p): Likewise.
1476 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
1478 * tree.c: Include gimple.h. Do not include tree-flow.h
1479 * decl.c: Do not include tree-flow.h
1480 * Make-lang.in: Adjust dependencies.
1482 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1484 * decl.c (incomplete_var): Declare. Declare VECs containing them.
1485 (incomplete_vars): Adjust comment. Change type to a VEC.
1486 (maybe_register_incomplete_var): Adjust for new type.
1487 (complete_vars): Adjust iteration over incomplete_vars.
1489 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1491 * decl.c (struct named_label_entry): Change type of bad_decls field
1493 (poplevel_named_label_1): Adjust for new type of bad_decls.
1494 (check_goto): Likewise.
1496 2010-06-29 Jason Merrill <jason@redhat.com>
1498 Enable implicitly declared move constructor/operator= (N3053).
1499 * class.c (add_implicitly_declared_members): A class with no
1500 explicitly declared copy or move constructor gets both declared
1501 implicitly, and similarly for operator=.
1502 (check_bases): A type with no copy ctor does not inhibit
1503 a const copy ctor in a derived class. It does mean the derived
1505 (check_field_decl): Likewise.
1506 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
1507 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
1508 (trivially_copyable_p): Likewise.
1509 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
1510 * class.c (finish_struct_bits): Likewise.
1511 * tree.c (build_target_expr_with_type): Likewise.
1512 * typeck2.c (store_init_value): Likewise.
1514 Enable implicitly deleted functions (N2346)
1515 * class.c (check_bases_and_members): Adjust lambda flags.
1516 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
1518 * decl2.c (mark_used): Adjust error for use of deleted function.
1520 Machinery to support implicit delete/move.
1521 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
1522 has_complex_move_ctor, has_complex_move_assign bitfields.
1523 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
1524 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
1525 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
1526 (enum special_function_kind): Add sfk_move_assignment.
1527 (LOOKUP_SPECULATIVE): New.
1528 * call.c (build_over_call): Return early if it's set.
1529 (build_over_call): Use trivial_fn_p.
1530 * class.c (check_bases): If the base has no default constructor,
1531 the derived one is non-trivial. Handle move ctor/op=.
1532 (check_field_decl): Likewise.
1533 (check_bases_and_members): Handle move ctor/op=.
1534 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
1535 (type_has_move_constructor, type_has_move_assign): New.
1536 * decl.c (grok_special_member_properties): Handle move ctor/op=.
1537 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
1538 (trivial_fn_p): New.
1539 (do_build_copy_constructor): Use it.
1540 (do_build_assign_ref): Likewise. Handle move assignment.
1541 (build_stub_type, build_stub_object, locate_fn_flags): New.
1542 (locate_ctor): Use locate_fn_flags.
1543 (locate_copy, locate_dtor): Remove.
1544 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
1545 (process_subob_fn, synthesized_method_walk): New.
1546 (maybe_explain_implicit_delete): New.
1547 (implicitly_declare_fn): Use synthesized_method_walk,
1548 type_has_trivial_fn, and type_set_nontrivial_flag.
1549 (defaulted_late_check): Set DECL_DELETED_FN.
1550 (defaultable_fn_check): Handle sfk_move_assignment.
1551 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
1552 implicitly deleted move ctor/op=.
1553 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
1554 (lookup_fnfields_slot): New.
1555 * semantics.c (omp_clause_info_fndecl): Remove.
1556 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
1557 get_copy_assign, trivial_fn_p.
1558 (trait_expr_value): Adjust call to locate_ctor.
1559 * tree.c (special_function_p): Handle sfk_move_assignment.
1561 * class.c (type_has_virtual_destructor): New.
1562 * cp-tree.h: Declare it.
1563 * semantics.c (trait_expr_value): Use it.
1565 * call.c (build_over_call): Only give warnings with tf_warning.
1567 * name-lookup.c (pop_scope): Handle NULL_TREE.
1569 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
1570 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
1571 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
1572 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
1573 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
1574 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
1575 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
1576 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
1577 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
1578 (sfk_assignment_operator): Rename to sfk_copy_assignment.
1579 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
1580 * search.c, semantics.c, tree.c: Adjust.
1582 * pt.c (dependent_scope_ref_p): Remove.
1583 (value_dependent_expression_p): Don't call it.
1584 (type_dependent_expression_p): Here either.
1585 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
1586 if the scope isn't dependent.
1588 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
1592 * pt.c (has_value_dependent_address): New.
1593 (value_dependent_expression_p): Check it.
1594 (convert_nontype_argument): Likewise. Call decay_conversion before
1595 folding if we want a pointer.
1596 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
1597 scope is the current instantiation.
1599 2010-06-28 Jakub Jelinek <jakub@redhat.com>
1602 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
1605 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
1607 * init.c: Do not include except.h.
1610 * cp-lang.c: Likewise.
1612 * semantics.c: Likewise.
1613 * decl2.c: Likewise.
1614 * except.c: Likewise.
1615 (init_exception_processing): Do not set the removed
1616 lang_protect_cleanup_actions here.
1617 (cp_protect_cleanup_actions): Make non-static and remove prototype.
1618 (doing_eh): New, moved from except.c but removed the do_warning flag.
1619 (expand_start_catch_block): Update doing_eh call.
1620 (expand_end_catch_block): Likewise.
1621 (build_throw): Likewise.
1622 * cp-tree.h: Prototype cp_protect_cleanup_actions.
1623 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
1624 cp_protect_cleanup_actions.
1625 * Make-lang.in: Update dependencies.
1627 2010-06-26 Jason Merrill <jason@redhat.com>
1629 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
1630 constructor called with a single argument that takes a reference
1631 to the constructor's class.
1632 (BAD_CONVERSION_RANK): New.
1633 (compare_ics): Use it to compare bad ICSes.
1635 2010-06-25 Joseph Myers <joseph@codesourcery.com>
1637 * lang-specs.h: Remove +e handling.
1639 2010-06-24 Andi Kleen <ak@linux.intel.com>
1641 * parser.c: (cp_parser_question_colon_clause):
1642 Switch to use cp_lexer_peek_token.
1643 Call warn_for_omitted_condop. Call pedwarn for omitted
1646 2010-06-22 Jakub Jelinek <jakub@redhat.com>
1649 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
1650 datum and mark_rvalue_use on component.
1653 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
1654 the CALL_EXPR has no arguments.
1656 2010-06-21 Jason Merrill <jason@redhat.com>
1658 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
1660 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
1663 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
1665 * name-lookup.c (struct arg_lookup): Convert namespaces and
1666 classes fields to VEC.
1667 (arg_assoc_namespace): Adjust for new type of namespaces.
1668 (arg_assoc_class): Adjust for new type of classes.
1669 (lookup_arg_dependent): Use make_tree_vector and
1670 release_tree_vector.
1671 * typeck2.c (build_x_arrow): Use vec_member.
1673 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
1676 * error.c (dump_decl): Better wording for anonymous namespace.
1678 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
1680 * class.c (build_vtbl_initializer): Adjust computation of new_position
1681 and which entry to add padding for.
1683 2010-06-16 Jason Merrill <jason@redhat.com>
1685 * except.c (check_noexcept_r): Return the problematic function.
1686 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
1687 * pt.c (tsubst_copy_and_build): Pass it.
1688 * parser.c (cp_parser_unary_expression): Likewise.
1689 * cp-tree.h: Adjust prototype.
1691 * method.c (defaulted_late_check): Give the defaulted method
1692 the same exception specification as the implicit declaration.
1694 2010-06-15 Jason Merrill <jason@redhat.com>
1696 * class.c (add_implicitly_declared_members): Implicit assignment
1697 operators can also be virtual overriders.
1698 * method.c (lazily_declare_fn): Likewise.
1700 * call.c (convert_like_real): Give "initializing argument of"
1701 information for ambiguous conversion. Give source position
1704 * call.c (print_z_candidates): Do print viable deleted candidates.
1705 (joust): Don't choose a deleted function just because its worst
1706 conversion is better than another candidate's worst.
1708 * call.c (convert_like_real): Don't complain about
1709 list-value-initialization from an explicit constructor.
1711 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
1712 DECL_SOURCE_LOCATION directly.
1714 * class.c (type_has_user_provided_default_constructor): Use
1717 * call.c (is_subseq): Handle ck_aggr, ck_list.
1718 (compare_ics): Treat an aggregate or ambiguous conversion to the
1719 same type as involving the same function.
1721 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
1723 * typeck.c (convert_for_assignment): Fix comment. Change message
1724 format from %d to %qP.
1725 (convert_for_initialization): Fix comment.
1727 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
1729 * cp-tree.h (expr_list_kind): New type.
1730 (impl_conv_rhs): New type.
1731 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
1733 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
1734 diagnostics for easy translation. Change caller.
1735 (convert_for_initialization): Use impl_conv_rhs and change caller.
1736 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
1737 diagnostics for easy translation. Change caller.
1738 * decl.c (bad_spec_place): New enum.
1739 (bad_specifiers): Use it and emit the diagnostics for easy
1740 translation. Change caller.
1741 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
1743 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1745 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
1747 * decl2.c (cp_write_global_declarations): Adjust for new type of
1748 decl_namespace_list.
1749 * name-lookup.c (current_decl_namespace): Likewise.
1750 (push_decl_namespace): Likewise.
1751 (pop_decl_namespace): Likewise.
1753 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1755 * call.c (build_java_interface_fn_ref): Call build_function_type_list
1756 instead of build_function_type.
1757 * decl.c (cxx_init_decl_processing): Likewise.
1758 (declare_global_var): Likewise.
1759 (get_atexit_node): Likewise.
1760 (expand_static_init): Likewise.
1761 * decl2.c (start_objects): Likewise.
1762 (start_static_storage_duration_function): Likewise.
1763 * except.c (init_exception_processing): Likewise.
1764 (build_exc_ptr): Likewise.
1765 (build_throw): Likewise.
1766 * rtti.c (throw_bad_cast): Likewise.
1767 (throw_bad_typeid): Likewise.
1768 (build_dynamic_cast_1): Likewise.
1770 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1772 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
1773 (build_op_delete_call): Likewise.
1774 (build_over_call): Likewise.
1775 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1776 * pt.c (process_partial_specialization): Likewise.
1777 (tsubst_template_args): Likewise.
1778 * semantics.c (finish_asm_stmt): Likewise.
1780 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
1782 * decl.c (record_key_method_defined): New, broken out of ...
1783 (finish_function): ... here. Call it.
1784 (start_decl): Treat aliases as definitions.
1786 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1788 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
1790 * pt.c (maybe_process_partial_specialization): Likewise.
1791 (register_specialization): Likewise.
1792 (add_pending_template): Likewise.
1793 (lookup_template_class): Likewise.
1794 (push_tinst_level): Likewise.
1796 * parser.c (cp_lexer_new_main): Likewise.
1797 (cp_lexer_new_from_tokens): Likewise.
1798 (cp_token_cache_new): Likewise.
1799 (cp_parser_context_new): Likewise.
1800 (cp_parser_new): Likewise.
1801 (cp_parser_nested_name_specifier_opt): Likewise.
1802 (cp_parser_template_id): Likewise.
1804 * name-lookup.c (binding_entry_make): Likewise.
1805 (binding_table_construct): Likewise.
1806 (binding_table_new): Likewise.
1807 (cxx_binding_make): Likewise.
1808 (pushdecl_maybe_friend): Likewise.
1809 (begin_scope): Likewise.
1810 (push_to_top_level): Likewise.
1812 * lex.c (init_reswords): Likewise.
1813 (retrofit_lang_decl): Likewise.
1814 (cxx_dup_lang_specific_decl): Likewise.
1815 (copy_lang_type): Likewise.
1816 (cxx_make_type): Likewise.
1818 * decl.c (make_label_decl): Likewise.
1819 (check_goto): Likewise.
1820 (start_preparsed_function): Likewise.
1821 (save_function_data): Likewise.
1823 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
1825 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1827 * class.c (finish_struct_1): Likewise.
1829 * cp-tree.h (struct lang_type): Add variable_size GTY option.
1830 (struct lang_decl): Likewise.
1832 * parser.c (cp_parser_new): Update comment to not reference
1835 2010-06-07 Jason Merrill <jason@redhat.com>
1838 * error.c (dump_parameters): Mask out TFF_SCOPE.
1839 (dump_simple_decl): Don't print the scope of a PARM_DECL.
1840 (dump_scope): Remove no-op mask.
1843 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
1845 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
1846 * init.c (build_offset_ref): Use it.
1847 * pt.c (maybe_process_partial_specialization): Use it.
1848 (instantiate_class_template): Use it.
1849 * search.c (lookup_base): Use it.
1851 2010-06-07 Jakub Jelinek <jakub@redhat.com>
1854 * expr.c (mark_exp_read): Handle INDIRECT_REF.
1855 * cvt.c (convert_to_void): Handle INDIRECT_REF like
1856 handled_component_p.
1859 * decl.c (initialize_local_var): If TREE_USED is set on the type,
1860 set also DECL_READ_P on the decl.
1862 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1865 * cp-tree.h (typedef_variant_p): Move this declaration to
1867 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1868 * decl.c (grokdeclarator): Do not rename debug info of an
1869 anonymous tagged type named by a typedef.
1871 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
1874 * class.c (check_field_decls): Move the call to
1875 check_bitfield_decl before trying to set the
1876 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
1878 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
1880 * typeck.c: Update include path for moved files.
1883 * cp-gimplify.c: Likewise.
1884 * cp-lang.c: Likewise.
1886 * semantics.c: Likewise.
1887 * cxx-pretty-print.h: Likewise.
1888 * decl2.c: Likewise.
1889 * parser.c: Likewise.
1890 * cp-objcp-common.c: Likewise.
1891 * cp-tree.h: Likewise.
1892 * name-lookup.c: Likewise.
1894 * name-lookup.h: Likewise.
1895 * config-lang.in: Update paths in gtfiles for files in c-family/.
1896 * Make-lang.in: Likewise.
1898 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
1900 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
1901 * typeck.c (build_ptrmemfunc): Likewise.
1903 2010-06-04 Jason Merrill <jason@redhat.com>
1905 * typeck2.c (merge_exception_specifiers): Adjust merging of
1906 throw() and noexcept(true).
1908 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
1909 using an uninitialized variable.
1911 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
1912 (pp_cxx_expression): Likewise.
1914 Implement noexcept-specification (15.4)
1915 * parser.c (cp_parser_exception_specification_opt): Parse it.
1916 Give -Wdeprecated warning about throw() specs.
1917 * pt.c (tsubst_exception_specification): Handle it.
1918 * error.c (dump_exception_spec): Handle it.
1919 (dump_expr): Handle NOEXCEPT_EXPR.
1920 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
1921 * typeck.c (comp_except_specs): Handle compatibility rules.
1922 Change exact parm to take an enum.
1923 * typeck2.c (merge_exception_specifiers): Handle noexcept.
1924 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
1925 (type_throw_all_p, build_noexcept_spec): New fns.
1926 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
1927 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
1928 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
1929 (noexcept_true_spec, noexcept_false_spec): New macros.
1930 * name-lookup.c (pushdecl_maybe_friend): Adjust.
1931 * search.c (check_final_overrider): Adjust.
1932 * decl.c (check_redeclaration_exception_specification): Adjust.
1933 (use_eh_spec_block): Use type_throw_all_p.
1934 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
1935 Give operator new a noexcept-specification in C++0x mode.
1936 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
1937 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
1939 Implement noexcept operator (5.3.7)
1940 * cp-tree.def (NOEXCEPT_EXPR): New.
1941 * except.c (check_noexcept_r, finish_noexcept_expr): New.
1942 * cp-tree.h: Declare finish_noexcept_expr.
1943 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
1944 * pt.c (tsubst_copy_and_build): And tsubst it.
1945 (type_dependent_expression_p): Handle it.
1946 (value_dependent_expression_p): Handle it.
1948 * call.c (build_conditional_expr): Never fold in unevaluated context.
1949 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
1950 * semantics.c (simplify_aggr_init_expr): Likewise.
1951 * typeck.c (merge_types): Call merge_exception_specifiers.
1952 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
1953 DECL_ANTICIPATED for preferring new type.
1955 2010-06-04 Joseph Myers <joseph@codesourcery.com>
1957 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
1960 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1963 * typeck.c (build_class_member_access_expr): Call mark_exp_read
1964 on object for static data members.
1966 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1967 Jason Merrill <jason@redhat.com>
1970 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
1971 with the same type, call mark_lvalue_use on both.
1973 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
1975 * class.c (struct vtbl_init_data_s): Remove last_init field.
1976 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
1978 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
1980 (build_vtt): Likewise.
1981 (initialize_vtable): Take a VEC instead of a tree.
1982 (build_vtt_inits): Change return type to void. Take a VEC **
1983 instead of a tree *; accumulate results into said VEC.
1984 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
1985 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
1986 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
1988 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
1989 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
1991 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
1992 rather than tree_cons.
1993 (build_vbase_offset_vtbl_entries): Likewise.
1994 (add_vcall_offset): Likewise.
1995 (build_rtti_vtbl_entries): Likewise.
1996 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
1997 * decl.c (initialize_artificial_var): Use build_constructor instead
1998 of build_constructor_from_list.
2000 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
2003 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
2006 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
2008 * parser.c (cp_parser_mem_initializer_list): Change error text.
2010 2010-06-02 Jakub Jelinek <jakub@redhat.com>
2012 * cp-objcp-common.c (shadowed_var_for_decl): Change into
2013 tree_decl_map hashtab from tree_map.
2014 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
2015 (init_shadowed_var_for_decl): Adjust initialization.
2018 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
2019 instead of calling mark_exp_read only when not an assignment.
2022 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
2023 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
2024 Set DECL_VALUE_EXPR on var.
2026 2010-06-02 Jason Merrill <jason@redhat.com>
2028 * error.c (dump_type): Improve typedef handling.
2033 * name-lookup.c (same_entity_p): New.
2034 (ambiguous_decl): Multiple declarations of the same entity
2037 2010-06-01 Jason Merrill <jason@redhat.com>
2040 * call.c (add_list_candidates): Prefer the default constructor.
2041 (build_aggr_conv): Treat missing initializers like { }.
2042 * typeck2.c (process_init_constructor_record): Likewise.
2043 * init.c (expand_default_init): Use digest_init for
2044 direct aggregate initialization, too.
2046 * call.c (add_list_candidates): Split out...
2047 (build_user_type_conversion_1): ...from here.
2048 (build_new_method_call): And here.
2049 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
2052 * call.c (build_list_conv): Set list-initialization flags properly.
2054 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
2056 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
2058 2010-06-01 Arnaud Charlet <charlet@adacore.com>
2059 Matthew Gingell <gingell@adacore.com>
2061 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
2062 * decl2.c: Include langhooks.h and c-ada-spec.h.
2063 (cpp_check, collect_source_refs, collect_ada_namespace,
2064 collect_all_refs): New functions.
2065 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
2066 * lang-specs.h: Ditto.
2068 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2070 * cp-tree.h (cp_build_function_call_nary): Declare.
2071 * typeck.c (cp_build_function_call_nary): Define.
2072 * decl.c (register_dtor_fn): Use it instead of
2073 cp_build_function_call.
2074 (cxx_maybe_build_cleanup): Likewise.
2075 * decl2.c (generate_ctor_or_dtor_function): Likewise.
2076 * except.c (do_get_exception_ptr): Likewise.
2077 (do_begin_catch): Likewise.
2078 (do_allocate_exception): Likewise.
2079 (do_free_exception): Likewise.
2080 (build_throw): Likewise. Use cp_build_function_call_vec instead
2081 of cp_build_function_call.
2082 (do_end_catch): Likewise.
2084 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2086 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
2087 (struct cp_declarator): Move id_loc field up.
2089 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2091 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
2092 this file is included before c-common.h. Define GCC_DIAG_STYLE
2093 before including diagnostic-core.h and toplev.h.
2094 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
2095 * pt.c: Include cp-tree.h before c-common.h.
2097 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2099 * tree.c (c_register_addr_space): Add stub.
2101 2010-05-28 Joseph Myers <joseph@codesourcery.com>
2103 * g++spec.c (lang_specific_driver): Use fatal_error instead of
2106 2010-05-28 Dodji Seketeli <dodji@redhat.com>
2108 Revert fix of PR c++/44188
2109 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
2111 * tree.c (typedef_variant_p): Revert moving this definition to
2113 * decl.c (grokdeclarator): Revert naming typedef handling.
2115 2010-05-27 Joseph Myers <joseph@codesourcery.com>
2117 * call.c: Include diagnostic-core.h instead of diagnostic.h.
2118 * cp-lang.c: Don't include diagnostic.h
2119 * name-lookup.c: Include diagnostic-core.h instead of
2121 (cp_emit_debug_info_for_using): Use seen_error.
2122 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
2123 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
2124 * pt.c (iterative_hash_template_arg): Use seen_error.
2125 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
2126 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
2127 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
2128 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
2131 2010-05-25 Dodji Seketeli <dodji@redhat.com>
2134 * cp-tree.h (typedef_variant_p): Move this declaration to
2136 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
2137 * decl.c (grokdeclarator): Do not rename debug info of an
2138 anonymous tagged type named by a typedef.
2140 2010-05-27 Jason Merrill <jason@redhat.com>
2143 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
2146 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
2149 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
2150 * class.c (layout_class_type): Likewise.
2151 * decl.c (finish_enum): Likewise.
2152 * mangle.c (write_builitin_type): Likewise.
2154 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
2156 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
2158 * decl.c (grokdeclarator): Handle __int128.
2159 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
2160 (cp_parser_simple_type_specifier): Likewise.
2161 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
2162 * typeck.c (cp_common_type): Handle __int128.
2163 * mangle.c (integer_type_codes): Add itk_int128 and
2164 itk_unsigned_int128.
2166 2010-05-26 Jason Merrill <jason@redhat.com>
2169 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
2172 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2174 * cp-lang.c: Do not include expr.h.
2176 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2178 * decl.c: Do not include rtl.h
2179 * semantics.c: Likewise.
2181 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
2183 * cp-tree.h: Do not include splay-tree.h.
2184 (struct prtmem_cst): Remove unused field and false comment.
2185 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
2186 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
2187 * init.c: Do not include rtl.h and expr.h.
2188 * class.c: Do not include rtl.h. Include splay-tree.h.
2189 (build_clone): Use plain NULL instead of NULL_RTX.
2190 * decl.c: Do not include expr.h. Explain why rtl.h has to be
2191 included. Include splay-tree.h.
2192 * method.c: Do not include rtl.h and expr.h.
2193 (use_thunk): Use plain NULL instead of NULL_RTX.
2194 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
2195 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
2196 and target.h. Include splay-tree.h.
2197 * expr.c: Do not include rtl.h and expr.h.
2198 * pt.c: Do not include obstack.h and rtl.h.
2199 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
2200 (tsubst_decl): Likewise.
2201 (instantiate_decl): Likewise.
2202 * semantics.c: Do not include exprt.h and debug.h. Explain why
2203 rtl.h has to be included.
2204 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
2205 * call.c: Do not include rtl.h and expr.h.
2206 * search.c: Do not include obstack.h and rtl.h.
2207 * friend.c: Do not include rtl.h and expr.h.
2208 * Make-lang.in: Update dependencies.
2210 2010-05-25 Jakub Jelinek <jakub@redhat.com>
2213 * parser.c (non_integral_constant): Add NIC_NONE.
2214 (required_token): Add RT_NONE.
2215 (cp_parser_unary_expression): Initialize non_constant_p
2217 (cp_parser_asm_definition): Initialize missing to RT_NONE.
2218 (cp_parser_primary_expression, cp_parser_postfix_expression,
2219 cp_parser_cast_expression, cp_parser_binary_expression,
2220 cp_parser_functional_cast): Fix formatting.
2222 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
2225 * parser.c: Remove inclusion of dyn-string.h.
2226 (non_integral_constant): New enum.
2227 (name_lookup_error): New enum.
2228 (required_token): New enum.
2229 (cp_parser_required_error): New function.
2230 (cp_parser_require): Change the type of variable token_desc to
2231 required_token and use cp_parser_required_error.
2232 (cp_parser_require_keyword): Likewise.
2233 (cp_parser_error): Use gmsgid as parameter.
2234 (cp_parser_name_lookup_error): Change the type of variable desired to
2235 name_lookup_error and put the diagnostic in the full sentences. Change
2237 (cp_parser_non_integral_constant_expression): Change the type of the
2238 variable thing to non_integral_constant and put the diagnostics in
2239 full sentences. Change caller.
2241 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
2244 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
2246 2010-05-24 Joseph Myers <joseph@codesourcery.com>
2248 * error.c (cp_diagnostic_starter): Update call to
2249 diagnostic_build_prefix.
2250 (cp_print_error_function,
2251 print_instantiation_partial_context_line): Check show_column flag
2254 2010-05-24 Jason Merrill <jason@redhat.com>
2257 * decl.c (check_initializer): Don't wrap an init-list in a
2259 * init.c (build_aggr_init): Don't assume copy-initialization if
2260 init has CONSTRUCTOR_IS_DIRECT_INIT.
2261 * call.c (build_new_method_call): Sanity check.
2263 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
2265 * rtti.c (tinfo_base_init): Use build_constructor instead of
2266 build_constructor_from_list. Don't cons a tree node for
2268 (generic_initializer): Use build_constructor_single instead of
2269 build_constructor_from_list.
2270 (ptr_initializer): Use build_constructor instead of
2271 build_constructor_from_list
2272 (ptm_initializer): Likewise.
2273 (class_initializer): Likewise. Take varargs instead of TRAIL.
2274 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
2275 build_constructor instead of build_constructor_from_list.
2277 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
2279 * semantics.c: Include bitmap.h.
2280 * Make-lang.in: Update dependencies.
2282 2010-05-22 Jan Hubicka <jh@suse.cz>
2284 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
2286 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
2288 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2290 * cxx-pretty-print.c: Correct merge error.
2292 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2294 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
2295 (cp_print_error_function): Use diagnostic_abstract_origin macro.
2296 (cp_printer): Handle %K here using percent_K_format.
2297 * cxx-pretty-print.c: Include tree-pretty-print.h.
2298 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
2301 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
2303 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
2304 Clean up redundant includes.
2306 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2309 * decl.c (xref_basetypes): Return false in case of ill-formed
2312 2010-05-19 Jason Merrill <jason@redhat.com>
2314 * call.c (reference_binding): Use cp_build_qualified_type_real
2315 and cp_type_quals consistently.
2316 (add_function_candidate): Likewise.
2317 (build_conditional_expr): Likewise.
2318 (convert_like_real): Likewise.
2319 (type_passed_as): Likewise.
2320 * class.c (add_method): Likewise.
2321 (same_signature_p): Likewise.
2322 (layout_class_type): Likewise.
2323 * decl.c (cxx_init_decl_processing): Likewise.
2324 (cp_fname_init): Likewise.
2325 (grokdeclarator): Likewise.
2326 * decl2.c (cp_reconstruct_complex_type): Likewise.
2327 * init.c (build_new_1): Likewise.
2328 * method.c (do_build_copy_constructor): Likewise.
2329 (implicitly_declare_fn): Likewise.
2330 * pt.c (tsubst_aggr_type): Likewise.
2332 * rtti.c (init_rtti_processing): Likewise.
2333 (build_headof): Likewise.
2334 (build_dynamic_cast_1): Likewise.
2335 (tinfo_base_init): Likewise.
2336 (emit_support_tinfos): Likewise.
2337 * semantics.c (capture_decltype): Likewise.
2338 * tree.c (cv_unqualified): Likewise.
2339 * typeck.c (composite_pointer_type): Likewise.
2340 (string_conv_p): Likewise.
2342 * mangle.c (write_CV_qualifiers_for_type): Tweak.
2344 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
2345 * decl.c (start_decl): Likewise.
2346 * semantics.c (finish_compound_literal): Likewise.
2347 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
2348 (cp_type_readonly): Remove.
2349 * cp-tree.h: Remove declaration.
2351 * typeck.c (merge_types): Preserve memfn quals.
2353 * decl.c (grokdeclarator): Don't check quals on fn type.
2354 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
2355 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
2358 * typeck.c (type_memfn_quals): New fn.
2359 (apply_memfn_quals): New fn.
2360 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
2361 (cp_type_readonly): Use cp_type_quals.
2362 * cp-tree.h: Add declarations.
2363 * tree.c (cp_build_qualified_type_real): Don't set, but do
2364 preserve, quals on FUNCTION_TYPE.
2365 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
2366 * decl.c (build_ptrmem_type): Likewise.
2367 (grokdeclarator): Likewise.
2368 (static_fn_type): Likewise.
2369 * decl2.c (change_return_type): Likewise.
2370 (cp_reconstruct_complex_type): Likewise.
2371 * pt.c (tsubst_function_type): Likewise.
2373 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
2375 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
2377 * tree.c (build_min_non_dep_call_vec): Update comment.
2379 2010-05-17 Jason Merrill <jason@redhat.com>
2381 * call.c (struct z_candidate): Add explicit_targs field.
2382 (add_template_candidate_real): Set it.
2383 (build_over_call): Use it to control init-list warning.
2386 * call.c (build_over_call): Limit init-list deduction warning to
2387 cases where the argument is actually an init-list.
2390 * call.c (build_over_call): Don't do bitwise copy for move ctor.
2392 2010-05-17 Dodji Seketeli <dodji@redhat.com>
2393 Jason Merrill <jason@redhat.com>
2396 * decl.c (compute_array_index_type): Call mark_rvalue_use.
2398 2010-05-15 Jason Merrill <jason@redhat.com>
2400 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
2401 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
2403 (finish_eh_spec_block): Adjust.
2405 2010-05-15 Jakub Jelinek <jakub@redhat.com>
2408 * pt.c (tsubst): Unshare template argument.
2410 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
2412 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
2413 * Make-lang.in: Fix dependencies accordingly.
2415 2010-05-14 Jason Merrill <jason@redhat.com>
2418 * except.c (build_throw): Simplify, adjust for DR 475.
2421 * except.c (dtor_nothrow): Return nonzero for type with
2425 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
2426 gimple_build_eh_must_not_throw.
2428 2010-05-14 Martin Jambor <mjambor@suse.cz>
2430 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
2433 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
2435 * call.c (build_new_method_call): Change warning text.
2436 * typeck2.c (build_functional_cast): Change error text.
2438 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
2441 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
2442 shadowing the outer parameter or variables by the declaration of
2443 nested function in nested structure or class. Warn the shadowing by
2444 the declaration of nested lambda expression.
2446 2010-05-13 Jason Merrill <jason@redhat.com>
2448 * typeck.c (cp_build_array_ref): Factor out from...
2449 (build_array_ref): ...here. Drop complain parm.
2450 (build_new_op): Adjust.
2451 * class.c (build_vtbl_ref_1): Adjust.
2452 * decl2.c (grok_array_decl): Adjust.
2453 * cp-tree.h: Adjust prototypes.
2455 2010-05-13 Jan Hubicka <jh@suse.cz>
2457 * decl.c (cp_finish_decl): Do not worry about used attribute.
2459 2010-05-12 Jason Merrill <jason@redhat.com>
2461 * typeck.c (build_array_ref): Take complain parm.
2462 * cp-tree.h: Add it to prototype.
2463 * call.c (build_new_op): Pass it.
2464 * class.c (build_vtbl_ref): Pass it.
2465 * decl2.c (grok_array_decl): Pass it.
2469 * cp-tree.def (NULLPTR_TYPE): Remove.
2470 * cp-tree.h (NULLPTR_TYPE_P): New.
2471 (SCALAR_TYPE_P): Use it.
2472 (nullptr_type_node): New.
2473 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
2474 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
2476 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
2477 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2478 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
2479 * mangle.c (write_type): Likewise.
2480 * name-lookup.c (arg_assoc_type): Likewise.
2481 * typeck.c (build_reinterpret_cast_1): Likewise.
2482 * rtti.c (typeinfo_in_lib_p): Likewise.
2483 (emit_support_tinfos): Remove local nullptr_type_node.
2485 * cp-tree.h (UNKNOWN_TYPE): Remove.
2486 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
2487 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
2488 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
2489 * class.c (instantiate_type): Check unknown_type_node rather than
2491 * name-lookup.c (maybe_push_decl): Likewise.
2492 * rtti.c (get_tinfo_decl_dynamic): Likewise.
2493 (get_typeid): Likewise.
2494 * semantics.c (finish_offsetof): Likewise.
2497 * call.c (add_template_candidate_real): If deduction fails, still
2498 add the template as a non-viable candidate.
2499 (equal_functions): Handle template candidates.
2500 (print_z_candidate): Likewise.
2501 (print_z_candidates): Likewise.
2502 (build_new_function_call): Likewise.
2504 * cp-tree.h (LOOKUP_LIST_ONLY): New.
2505 * call.c (add_candidates): Enforce it.
2506 (build_new_method_call): Try non-list ctor if no viable list ctor.
2507 (build_user_type_conversion_1): Likewise.
2509 * call.c (add_candidates): Distinguish between type(x) and
2511 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
2512 (build_new_method_call): Give better error for conversion op.
2514 * call.c (add_candidates): Add first_arg and return_type parms.
2515 Add special constructor/conversion op handling.
2516 (convert_class_to_reference): Use it.
2517 (build_user_type_conversion_1): Likewise.
2518 (build_op_call): Likewise.
2519 (build_new_method_call): Likewise.
2520 (build_new_op): Adjust.
2521 (perform_overload_resolution): Adjust.
2523 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
2528 * pt.c (process_partial_specialization): Return error_mark_node
2529 in case of unused template parameters in partial specialization.
2531 2010-05-11 Jakub Jelinek <jakub@redhat.com>
2534 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
2535 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
2536 look at its second operand.
2538 2010-05-10 Jason Merrill <jason@redhat.com>
2541 * semantics.c (baselink_for_fns): Revert earlier change.
2544 * typeck.c (cp_build_modify_expr): Complain about assignment to
2545 array from init list.
2547 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
2550 * decl.c (check_initializer): strip array type before checking for
2551 uninitialized const or ref members.
2553 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
2556 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
2557 error count. Emit errors only if compain is true.
2558 (build_new_1): Do not return error_mark_node if
2559 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
2560 errors. Delay the check for user-provided constructor.
2561 (perform_member_init): Adjust.
2562 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
2565 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
2566 Jason Merrill <jason@redhat.com>
2568 Add support for C++0x nullptr.
2569 * cp-tree.def: Add NULLPTR_TYPE.
2570 * cp-tree.h: Add nullptr_node.
2571 (cp_tree_index): Add CPTI_NULLPTR.
2572 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
2573 * call.c (null_ptr_cst_p): Handle nullptr.
2574 (standard_conversion): Likewise.
2575 (convert_arg_to_ellipsis): Likewise.
2576 * mangle.c (write_type): Likewise.
2577 * name-lookup.c (arg_assoc_type): Likewise.
2578 * parser.c (cp_parser_primary_expression): Likewise.
2579 * typeck.c (cp_build_binary_op): Likewise.
2580 (build_reinterpret_cast_1): Likewise.
2581 * error.c (dump_type): Likewise.
2582 (dump_type_prefix, dump_type_suffix): Likewise.
2583 * decl.c (cxx_init_decl_processing): Likewise.
2584 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2585 * cvt.c (ocp_convert): Likewise.
2586 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
2587 nullptr_t tinfo in libsupc++.
2589 2010-05-06 Jason Merrill <jason@redhat.com>
2591 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
2593 2010-04-22 Jakub Jelinek <jakub@redhat.com>
2594 Dodji Seketeli <dodji@redhat.com>
2597 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
2599 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
2600 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
2601 (decay_conversion, perform_integral_promotions): Call rvalue_use.
2602 (cp_build_unary_op): Call lvalue_use.
2603 * decl.c (unused_but_set_errorcount): New variable.
2604 (poplevel): Issue -Wunused-but-set-variable diagnostics.
2605 (duplicate_decls): Merge DECL_READ_P flags.
2606 (start_cleanup_fn): Set DECL_READ_P flag.
2607 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
2608 * tree.c (rvalue): Call rvalue_use.
2609 * pt.c (convert_nontype_argument): Likewise.
2610 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
2611 finish_decltype_type): Likewise.
2612 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
2613 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
2614 or rvalue_use depending on the expr.
2615 * init.c (build_new, build_delete): Likewise.
2616 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
2618 2010-05-05 Jason Merrill <jason@redhat.com>
2621 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
2622 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
2624 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2627 * pt.c (unify): Check each elt for error_mark_node.
2629 2010-05-04 Jason Merrill <jason@redhat.com>
2632 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
2634 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2637 * call.c (build_new_method_call): Return error_mark_node if fns is
2640 2010-05-03 Dodji Seketeli <dodji@redhat.com>
2643 * pt.c (most_specialized_class): Pretend we are processing
2644 a template decl during the call to coerce_template_parms.
2646 2010-05-03 Jason Merrill <jason@redhat.com>
2650 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
2651 from the selected underlying type unless -fstrict-enums. Set
2652 ENUM_UNDERLYING_TYPE to have the restricted range.
2653 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
2654 * class.c (check_bitfield_decl): Likewise.
2656 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
2659 * init.c (build_new_1): Revert the accidental checkin in
2662 2010-04-30 Jason Merrill <jason@redhat.com>
2665 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
2666 (pp_cxx_type_specifier_seq): ...here.
2668 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
2670 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
2671 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
2673 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
2676 * typeck.c (warn_args_num): New function.
2677 (convert_arguments): Use warn_args_num to print the diagnostic
2680 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
2683 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
2684 user-provided constructor while recursing.
2686 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
2689 * error.c (print_instantiation_partial_context_line): Handle
2690 recursive instantiation.
2691 (print_instantiation_partial_context): Likewise.
2693 2010-04-27 Jason Merrill <jason@redhat.com>
2695 * init.c (perform_member_init): Check CLASS_TYPE_P.
2697 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2700 * init.c (perform_member_init): check for uninitialized const or
2701 reference members, including array types.
2703 2010-04-24 Jason Merrill <jason@redhat.com>
2705 * tree.c (get_fns): Split out from get_first_fn.
2706 * cp-tree.h: Declare it.
2707 * search.c (shared_member_p): Use it.
2708 * semantics.c (finish_qualified_id_expr): Simplify.
2709 (finish_id_expression): Simplify.
2711 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
2712 whenever object is NULL_TREE. Don't do 'this' capture here.
2713 (finish_qualified_id_expr): Pass NULL_TREE.
2714 (finish_id_expression): Likewise.
2715 (lambda_expr_this_capture): Likewise.
2717 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
2718 rather than checking current_class_ref directly.
2719 (finish_call_expr): Likewise.
2722 * name-lookup.c (qualify_lookup): Disqualify lambda op().
2723 * class.c (current_nonlambda_class_type): New fn.
2724 * semantics.c (nonlambda_method_basetype): New.
2725 * cp-tree.h: Declare them.
2726 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
2728 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
2731 * semantics.c (lambda_return_type): Complain about
2735 * tree.c (cv_unqualified): Handle error_mark_node.
2738 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
2739 if we don't want errors.
2742 * class.c (convert_to_base): Add complain parameter. Pass
2743 ba_quiet to lookup_base if we don't want errors.
2744 (build_vfield_ref): Pass complain to convert_to_base.
2745 * call.c (convert_like_real): Likewise.
2746 (initialize_reference): Likewise.
2747 (perform_direct_initialization_if_possible): Pass complain to
2749 * cp-tree.h: Adjust.
2751 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2752 Jason Merrill <jason@redhat.com>
2755 * decl.c (check_for_uninitialized_const_var): Handle classes that need
2757 (check_initializer): Call it for classes that need constructing, too.
2758 * class.c (in_class_defaulted_default_constructor): New.
2759 * cp-tree.h: Declare it.
2761 2010-04-20 Jason Merrill <jason@redhat.com>
2764 * init.c (constant_value_1): Treat error_mark_node as a constant
2765 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
2766 * cvt.c (ocp_convert): Handle getting error_mark_node from
2767 integral_constant_value.
2768 * decl.c (compute_array_index_type): Likewise.
2770 2010-04-20 Dodji Seketeli <dodji@redhat.com>
2774 * typeck.c (incompatible_dependent_types_p): If one of the
2775 compared types if not a typedef then honour their main variant
2778 2010-04-20 Jakub Jelinek <jakub@redhat.com>
2780 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
2782 2010-04-19 Dodji Seketeli <dodji@redhat.com>
2785 * typeck.c (structural_comptypes): Test dependent typedefs
2786 incompatibility before testing for their main variant based
2789 2010-04-19 Jakub Jelinek <jakub@redhat.com>
2791 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
2792 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
2794 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
2796 * decl.c (cxx_init_decl_processing): Remove second argument in call to
2797 build_common_tree_nodes.
2799 2010-04-14 Jason Merrill <jason@redhat.com>
2802 * parser.c (cp_parser_parenthesized_expression_list): Change
2803 is_attribute_list parm to int to indicate whether or not to
2804 handle initial identifier specially.
2805 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
2807 2010-04-13 Jason Merrill <jason@redhat.com>
2809 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
2811 * parser.c (cp_parser_lambda_expression): Complain about lambda in
2812 unevaluated context.
2813 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
2815 2010-04-12 Jason Merrill <jason@redhat.com>
2818 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
2819 return value directly.
2821 * call.c (type_decays_to): Call cv_unqualified for non-class type.
2823 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
2826 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2827 * init.c (build_new_1): Check for uninitialized const members and
2828 uninitialized reference members, when using new without
2829 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
2830 (diagnose_uninitialized_cst_or_ref_member): Define, call
2831 diagnose_uninitialized_cst_or_ref_member_1.
2832 (diagnose_uninitialized_cst_or_ref_member_1): New function.
2834 2010-04-12 Richard Guenther <rguenther@suse.de>
2837 * semantics.c (expand_or_defer_fn_1): Do not keep extern
2838 template inline functions.
2840 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2843 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
2846 2010-04-07 Jason Merrill <jason@redhat.com>
2849 * decl.c (start_preparsed_function): Do defer nested functions.
2851 PR c++/11094, DR 408
2852 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
2853 * decl2.c (finish_static_data_member_decl): Set it.
2854 * decl.c (duplicate_decls): Propagate it.
2855 * pt.c (tsubst_decl): Don't substitute the domain of an array
2856 VAR_DECL if it's set.
2857 (regenerate_decl_from_template): Substitute it here.
2858 (type_dependent_expression_p): Return true if it's set.
2859 * semantics.c (finish_decltype_type): Instantiate such a variable.
2860 * typeck.c (cxx_sizeof_expr): Likewise.
2861 (strip_array_domain): New.
2864 * name-lookup.c (current_decl_namespace): Non-static.
2865 (pop_nested_namespace): Sanity check.
2866 * cp-tree.h: Declare current_decl_namespace.
2867 * decl.c (grokvardecl): Use it instead of current_namespace.
2868 (grokfndecl): Likewise.
2871 * pt.c (tsubst_friend_function): Instatiate a friend that has already
2874 * pt.c (print_template_statistics): New.
2875 * cp-tree.h: Declare it.
2876 * tree.c (cxx_print_statistics): Call it.
2879 * decl.c (grokvardecl): Tweak warning message.
2880 (grokfndecl): Likewise.
2882 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2885 *pt.c (tsubst_decl): Get the arguments of a specialization from
2886 the specialization template, not from the most general template.
2888 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2891 * typeck2.c (process_init_constructor_record):
2892 value-initialize members that are are not explicitely
2895 2010-04-07 Jie Zhang <jie@codesourcery.com>
2898 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
2899 when all of its elements are non-constant and have been split out.
2901 2010-04-06 Taras Glek <taras@mozilla.com>
2902 Jason Merrill <jason@redhat.com>
2904 * parser.c (cp_parser_class_specifier): Set class location to that
2905 of IDENTIFIER_NODE instead of '{' when possible.
2906 * semantics.c (begin_class_definition): Do not overide locations
2907 with less precise ones.
2909 2010-04-06 Jason Merrill <jason@redhat.com>
2912 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
2915 * pt.c (maybe_update_decl_type): Check the return value from
2918 2010-04-01 Jason Merrill <jason@redhat.com>
2920 * decl.c (next_initializable_field): No longer static.
2921 * cp-tree.h: Declare it.
2922 * call.c (build_aggr_conv): Fail if there are more initializers
2923 than initializable fields.
2925 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
2926 instead of void_zero_node.
2928 2010-03-31 Dodji Seketeli <dodji@redhat.com>
2931 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
2932 * pt.c (end_template_parm_list): Store sibling template parms of
2933 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2934 (push_template_decl_real): Don't store the containing template decl
2935 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
2936 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
2937 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2940 2010-03-30 Jason Merrill <jason@redhat.com>
2943 * pt.c (push_template_decl_real): Deal better with running out of
2944 scopes before running out of template parms.
2948 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
2949 function parameter context. Don't print an error if parsing
2953 * pt.c (more_specialized_fn): Don't control cv-qualifier check
2956 2010-03-26 Jason Merrill <jason@redhat.com>
2959 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
2960 c++0x mode, but not other type-names.
2962 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2965 * pt.c (add_to_template_args): Support NULL ARGS;
2966 (most_specialized_class): call coerce_template_parms on
2967 template arguments passed to get_class_bindings. Use
2968 add_to_template_args.
2969 (unify): Handle VAR_DECLs.
2971 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2973 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
2975 * pt.c (get_template_parms_at_level): Adjust.
2977 2010-03-25 Dodji Seketeli <dodji@redhat.com>
2980 * cp-tree.h (get_template_parms_at_level): Declare ...
2981 * pt.c (get_template_parms_at_level): ... new function.
2982 * typeck.c (get_template_parms_of_dependent_type): If a template
2983 type parm's DECL_CONTEXT isn't yet set, get its siblings from
2984 current_template_parms. Use get_template_parms_at_level. Remove
2986 (incompatible_dependent_types_p): If we get empty parms from just one
2987 of the template type parms we are comparing then the template parms are
2990 2010-03-24 Jason Merrill <jason@redhat.com>
2993 * parser.c (make_declarator): Initialize id_loc.
2994 (cp_parser_lambda_declarator_opt): And set it.
2996 2010-03-23 Jason Merrill <jason@redhat.com>
2998 Make lambda conversion op and op() non-static.
2999 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
3000 Also add the thunk function returned by the conversion op.
3001 Mark the conversion deleted if the op() is variadic.
3002 * decl2.c (mark_used): Give helpful message about deleted conversion.
3003 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
3004 * semantics.c (finish_this_expr): Adjust.
3005 * mangle.c (write_closure_type_name): Adjust.
3006 * decl.c (grok_op_properties): Don't allow it.
3007 * call.c (build_user_type_conversion_1): No static conversion ops.
3008 (build_op_call): Or op().
3010 * decl2.c (change_return_type): Fix 'this' quals.
3012 2010-03-22 Jason Merrill <jason@redhat.com>
3015 * tree.c (pod_type_p): Use old meaning in C++98 mode.
3018 * pt.c (contains_auto_r): New fn.
3019 (do_auto_deduction): Use it.
3020 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
3022 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
3025 * decl2.c (grokfield): Handle invalid initializers for member
3028 2010-03-20 Dodji Seketeli <dodji@redhat.com>
3031 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
3033 * decl2.c (vague_linkage_p): Likewise.
3035 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
3038 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
3039 false, in the cp_parser_expression_statement call.
3041 2010-03-05 Jason Merrill <jason@redhat.com>
3043 * mangle.c (mangle_decl): Give name collision error even without
3046 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
3048 * pt.c (process_partial_specialization): Use error_n instead of
3051 2010-03-03 Jason Merrill <jason@redhat.com>
3054 * mangle.c (mangle_decl): Handle VAR_DECL, too.
3056 2010-03-03 Jason Merrill <jason@redhat.com>
3059 * mangle.c: Include cgraph.h.
3060 (mangle_decl): If the mangled name will change in a later
3061 ABI version, make the later mangled name an alias.
3062 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
3063 * Make-lang.in (mangle.o): Depend on cgraph.h.
3064 * method.c (make_alias_for): Handle VAR_DECL, too.
3065 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
3066 * tree.c (no_linkage_check): Adjust.
3067 * decl.c (maybe_commonize_var): Adjust.
3068 * cp-tree.h: Adjust.
3070 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
3072 * pt.c (redeclare_class_template): Use error_n and inform_n.
3074 2010-02-27 Mark Mitchell <mark@codesourcery.com>
3077 * cp-tree.h (push_tinst_level): Declare.
3078 (pop_tinst_level): Likewise.
3079 * pt.c (push_tinst_level): Give it external linkage.
3080 (pop_tinst_level): Likewise.
3081 * mangle.c (mangle_decl_string): Set the source location to that
3082 of the decl while mangling.
3084 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
3087 * pt.c (redeclare_class_template): Return false if there are erroneous
3088 template parameters.
3090 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
3092 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
3095 2010-02-24 Jason Merrill <jason@redhat.com>
3098 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
3100 * class.c (layout_class_type): Don't give -Wabi warning for a bug
3101 in a previous ABI version.
3103 2010-02-23 Jason Merrill <jason@redhat.com>
3106 * typeck2.c (digest_init_r): Accept value init of array.
3108 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
3111 * typeck.c (convert_arguments): Update error message.
3113 2010-02-22 Mike Stump <mikestump@comcast.net>
3116 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
3118 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
3121 * error.c (print_instantiation_partial_context_line): New.
3122 (print_instantiation_partial_context): Print at most 12 contexts,
3123 skip the rest with a message.
3125 2010-02-21 Dodji Seketeli <dodji@redhat.com>
3128 * pt.c (lookup_template_class): Better support of specialization
3129 of member of class template implicit instantiation.
3131 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
3134 * call.c (conversion_null_warnings): Replace -Wconversion with
3136 * cvt.c (build_expr_type_conversion): Likewise.
3138 2010-02-18 Jason Merrill <jason@redhat.com>
3141 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
3144 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
3146 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
3147 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
3150 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
3154 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
3155 (maybe_update_decl_type): New fn.
3156 * parser.c (cp_parser_init_declarator): Use it.
3159 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
3161 2010-02-17 Jason Merrill <jason@redhat.com>
3164 * call.c (build_over_call): Don't create zero-sized assignments.
3165 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
3166 * cp-objcp-common.c (cp_expr_size): Remove.
3167 * cp-tree.h: Remove prototype.
3170 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
3171 decl we looked up doesn't match.
3174 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
3175 have an INIT_EXPR anymore.
3178 * pt.c (convert_nontype_argument): Change assert to test.
3180 2010-02-16 Jason Merrill <jason@redhat.com>
3182 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
3185 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
3186 VIEW_CONVERT_EXPR for conversions between structural equality types
3187 that the back end can't tell are the same.
3190 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
3191 cv-quals from element here.
3192 (cp_build_qualified_type_real): Not here. Preserve typedef name.
3194 2010-02-14 Jason Merrill <jason@redhat.com>
3197 * semantics.c (finish_compound_literal): Use
3198 cp_apply_type_quals_to_decl when creating a static variable.
3200 2010-02-12 Jason Merrill <jason@redhat.com>
3203 * name-lookup.h (current_binding_level): Check for null
3206 2010-02-12 Jason Merrill <jason@redhat.com>
3209 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
3211 2010-02-12 Jakub Jelinek <jakub@redhat.com>
3214 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
3217 2010-02-10 Jason Merrill <jason@redhat.com>
3220 * semantics.c (outer_lambda_capture_p): Revert.
3221 (add_capture): Only finish_member_declaration if
3222 we're in the lambda class.
3223 (register_capture_members): New.
3224 * cp-tree.h: Declare it.
3225 * parser.c (cp_parser_lambda_expression): Call it.
3227 2010-02-10 Jason Merrill <jason@redhat.com>
3230 * semantics.c (outer_lambda_capture_p): Use current_function_decl
3231 instead of current_class_type.
3233 2010-02-10 Jason Merrill <jason@redhat.com>
3235 PR c++/42983, core issue 906
3236 * method.c (defaultable_fn_check): Check virtualness.
3238 2010-02-10 Jason Merrill <jason@redhat.com>
3241 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
3243 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
3245 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
3246 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
3248 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
3249 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
3250 (cp_parser_parameter_declaration)
3251 (cp_parser_exception_specification_opt)
3252 (cp_parser_exception_declaration): Likewise.
3253 * pt.c (check_default_tmpl_args): Likewise.
3254 * search.c (lookup_field_r): Likewise.
3256 2010-02-09 Jason Merrill <jason@redhat.com>
3259 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
3261 2010-02-09 Jason Merrill <jason@redhat.com>
3264 * decl2.c (change_return_type): New fn.
3265 * semantics.c (apply_lambda_return_type): Use it.
3266 * cp-tree.h: Declare it.
3268 2010-02-05 Richard Guenther <rguenther@suse.de>
3270 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
3271 * cp-lang.c: Include gt-cp-cp-lang.h.
3272 * config-lang.in (gtfiles): Add cp/cp-lang.c.
3274 2010-02-05 Dodji Seketeli <dodji@redhat.com>
3277 * typeck.c (get_template_parms_of_dependent_type): Try getting
3278 the template parameters fromt the type itself first.
3280 2010-02-03 Jason Merrill <jason@redhat.com>
3284 * mangle.c (write_unqualified_id): Split out from write_expression.
3285 (write_unqualified_name): Call it.
3286 (write_member_name): Likewise.
3287 (write_expression): Support TEMPLATE_ID_EXPR.
3288 Disambiguate operator names.
3291 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
3294 2010-02-02 Jason Merrill <jason@redhat.com>
3297 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
3298 * optimize.c (clone_body): Remap their initializers when making base
3300 (maybe_clone_body): Complain if multiple clones aren't safe.
3302 2010-01-29 Dodji Seketeli <dodji@redhat.com>
3309 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3310 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3311 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
3312 * pt.c (coerce_template_parms, type_unification_real,
3313 expand_template_argument_pack, coerce_template_parameter_pack):
3314 Set the non default template args count.
3315 (current_template_args): Always set non defaulted
3316 template args count when compiled with --enable-checking
3317 (tsubst_template_args, type_unification_real): Propagate the non
3318 defaulted template args count.
3319 * error.c (get_non_default_template_args_count): Renamed
3320 count_non_default_template_args into this. Don't calculate the
3321 non default template argument count anymore. Use the new
3322 accessor macros above to get it.
3323 (dump_template_argument_list, dump_type, dump_decl,
3324 dump_template_parms): Adjust.
3325 * parser.c (cp_parser_template_argument_list): Always set defaulted
3326 template args count when compiled with --enable-checking.
3328 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
3330 * decl.c (redeclaration_error_message): Wrap the return messages into
3331 G_() for easy translation.
3333 2010-01-28 Jason Merrill <jason@redhat.com>
3336 * semantics.c (begin_class_definition): Don't use type_as_string.
3338 2010-01-28 Dodji Seketeli <dodji@redhat.com>
3342 * typeck.c (get_template_parms_of_dependent_type): Factorized
3343 this out of incompatible_template_type_parms_p
3344 (incompatible_dependent_types_p): Renamed
3345 incompatible_template_type_parms_p into this. Make it detect
3346 two incompatible dependent typedefs too.
3347 (structural_comptypes): Use incompatible_dependent_types_p.
3348 * pt.c (get_template_info):
3349 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
3351 2010-01-20 Janis Johnson <janis187@us.ibm.com>
3352 Jason Merrill <jason@redhat.com>
3354 * mangle.c (write_type): Mangle transparent record as member type.
3355 * semantics.c (begin_class_definition): Recognize decimal classes
3356 and set TYPE_TRANSPARENT_AGGR.
3358 2010-01-20 Jason Merrill <jason@redhat.com>
3361 * mangle.c (write_expression): Handle tree codes that have extra
3362 arguments in the middle-end.
3364 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
3367 * except.c (expand_start_catch_block): Deal correctly with
3368 do_begin_catch returning error_mark_node.
3370 2010-01-20 Jason Merrill <jason@redhat.com>
3373 * class.c (layout_class_type): Set packed_maybe_necessary for packed
3377 * semantics.c (build_lambda_object): Call mark_used on captured
3381 * decl.c (grokdeclarator): Clear type_quals for a member function
3382 declared using a typedef. Don't complain about adding cv-quals
3383 to a function typedef in C++0x mode.
3385 2010-01-20 Jakub Jelinek <jakub@redhat.com>
3387 * decl.c (create_array_type_for_decl): Remove set but not used
3388 variable error_msg. Remove break stmts after return stmts.
3390 2010-01-19 Dodji Seketeli <dodji@redhat.com>
3392 * error.c (dump_template_parms, count_non_default_template_args):
3393 Revert fix of PR c++/42634.
3395 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3398 * error.c (dump_template_parms): Use innermost template
3399 arguments before calling count_non_default_template_args.
3400 (count_non_default_template_args): We are being called with
3401 template innermost arguments now. There is no need to ensure
3404 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3407 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
3409 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3412 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
3414 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3417 *pt.c (tsubst_decl): Get the arguments of a specialization from
3418 the specialization template, not from the most general template.
3420 2010-01-16 Jason Merrill <jason@redhat.com>
3423 * semantics.c (finish_decltype_type): Within a template, treat
3424 unresolved CALL_EXPR as dependent.
3426 2010-01-15 Dodji Seketeli <dodji@redhat.com>
3428 * error.c (dump_template_parms,count_non_default_template_args):
3429 Revert changes of PR c++/42634.
3431 2010-01-14 Jakub Jelinek <jakub@redhat.com>
3434 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
3435 functions with noreturn attribute.
3437 2010-01-14 Jason Merrill <jason@redhat.com>
3440 * call.c (build_new_method_call): Don't free the vec here.
3443 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
3445 2010-01-13 Dodji Seketeli <dodji@redhat.com>
3448 * error.c (dump_template_parms): Use innermost template
3449 arguments before calling count_non_default_template_args.
3450 (count_non_default_template_args): We are being called with
3451 template innermost arguments now. There is no need to ensure
3454 2010-01-07 Dodji Seketeli <dodji@redhat.com>
3457 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
3458 arguments that were previously deduced.
3460 2010-01-05 Jason Merrill <jason@redhat.com>
3462 * pt.c (unify_pack_expansion): Handle deduction from init-list.
3463 * call.c (build_over_call): Don't complain about it.
3465 2010-01-04 Jason Merrill <jason@redhat.com>
3468 * pt.c (tsubst_decl): Don't apply type attributes in place.
3471 * semantics.c (describable_type): Remove decltype comment and
3476 Copyright (C) 2010 Free Software Foundation, Inc.
3478 Copying and distribution of this file, with or without modification,
3479 are permitted in any medium without royalty provided the copyright
3480 notice and this notice are preserved.