1 2010-11-06 Jason Merrill <jason@redhat.com>
4 * init.c (perform_member_init): Use build_vec_init_expr for
5 value-init of arrays, too.
6 * cp-gimplify.c (cp_gimplify_expr): Use VEC_INIT_EXPR_VALUE_INIT.
7 * cp-tree.h (VEC_INIT_EXPR_IS_CONSTEXPR): New macro.
8 (VEC_INIT_EXPR_VALUE_INIT): New macro.
9 * semantics.c (potential_constant_expression): No longer static.
10 Check VEC_INIT_EXPR_IS_CONSTEXPR.
11 * tree.c (build_vec_init_expr): Handle value-init. Set
12 VEC_INIT_EXPR_IS_CONSTEXPR and VEC_INIT_EXPR_VALUE_INIT.
14 2010-11-06 Nathan Froyd <froydnj@codesourcery.com>
17 * parser.c (cp_lexer_previous_token): New function.
18 (cp_parser_member_declaration): Use previous token for error
19 messages. Assume semicolon presence rather than grovelling for
22 2010-11-06 Joern Rennecke <amylaar@spamcop.net>
25 * method.c (make_alias_for_thunk):
26 Use targetm.asm_out.generate_internal_label.
28 2010-11-05 Jason Merrill <jason@redhat.com>
31 * search.c (look_for_overrides): A constructor is never virtual.
33 2010-11-05 Jakub Jelinek <jakub@redhat.com>
36 * cp-gimplify.c (cp_gimplify_expr): Drop volatile MEM_REFs
37 on the RHS to avoid infinite recursion with gimplify_expr.
39 2010-11-05 Jason Merrill <jason@redhat.com>
42 * pt.c (tsubst_copy): Handle COMPLEX_CST.
44 2010-11-04 Nicola Pero <nicola.pero@meta-innovation.com>
46 Fixed using the Objective-C 2.0 dot-syntax with class names.
47 * parser.c (cp_parser_primary_expression): Recognize Objective-C
48 2.0 dot-syntax with class names and process it.
49 (cp_parser_nonclass_name): Recognize Objective-C 2.0 dot-syntax
51 (cp_parser_class_name): Same change.
52 (cp_parser_simple_type_specifier): Tidied comments.
54 2010-11-04 Jason Merrill <jason@redhat.com>
57 * semantics.c (build_constexpr_constructor_member_initializers):
58 Handle an enclosing STATEMENT_LIST.
60 * semantics.c (speculative_access_check): New.
61 * cp-tree.h: Declare it.
62 * call.c (build_over_call): Use it.
63 * class.c (type_has_constexpr_default_constructor): Use locate_ctor.
64 * method.c (locate_ctor): Use push/pop_deferring_access_checks.
66 2010-11-03 Jason Merrill <jason@redhat.com>
69 * semantics.c (build_data_member_initialization): Handle
70 value-init of aggregate empty base.
73 * call.c (can_convert_array): New fn.
74 (build_aggr_conv): Use it.
77 * semantics.c (build_constexpr_constructor_member_initializers):
80 2010-11-02 Dodji Seketeli <dodji@redhat.com>
82 * cp-tree.h (enum tsubst_flags)<tf_no_class_instantiations>:
84 * pt.c (tsubst): Remove the use of tf_no_class_instantiations.
86 2010-11-03 Jason Merrill <jason@redhat.com>
89 * init.c (expand_default_init): Avoid ICE if we can't figure out
90 which function is being called.
92 2010-11-02 Nathan Froyd <froydnj@codesourcery.com>
94 * class.c (build_base_path, add_vcall_offset): Use build_zero_cst
95 instead of fold_convert.
96 * init.c (build_zero_init): Likewise.
97 * typeck.c (cp_build_binary_op): Likewise.
99 2010-11-02 Dodji Seketeli <dodji@redhat.com>
103 * pt.c (check_valid_ptrmem_cst_expr): Add a complain parameter to
105 (convert_nontype_argument, convert_nontype_argument): Pass the
106 complain parameter down to check_valid_ptrmem_cst_expr.
108 2010-11-02 Dodji Seketeli <dodji@redhat.com>
111 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): Remove.
112 (struct template_parm_index_s)<num_siblings>: New field.
113 (TEMPLATE_PARM_NUM_SIBLINGS): New accessor.
114 (process_template_parm): Extend the API to accept the number of
115 template parms in argument.
116 (cp_set_underlying_type): Remove this.
117 * class.c (build_self_reference): Require canonical type equality
118 back on the self reference of class.
119 * decl2.c (grokfield): Require canonical type equality back on
120 typedef class fields.
121 * name-lookup.c (pushdecl_maybe_friend): Require canonical type
122 equality back on typedefs.
123 * parser.c (cp_parser_template_parameter_list): Do not require
124 canonical type equality on dependent types created during template
126 * pt.c (fixup_template_type_parm_type, fixup_template_parm_index)
127 (fixup_template_parm, fixup_template_parms): New private
129 (current_template_args): Declare this.
130 (process_template_parm): Pass the total number of template parms
131 to canonical_type_parameter.
132 (build_template_parm_index): Add a new argument to carry the total
133 number of template parms.
134 (reduce_template_parm_level, process_template_parm, make_auto):
136 (current_template_args): Fix this for template template
138 (tsubst_template_parm): Split out of ...
139 (tsubst_template_parms): ... this.
140 (reduce_template_parm_level): Don't loose
141 TEMPLATE_PARM_NUM_SIBLINGS when cloning a TEMPLATE_PARM_INDEX.
142 (template_parm_to_arg): Extracted this function from
143 current_template_args. Make it represent invalid template parms
144 with an error_mark_node instead of a LIST_TREE containing an
146 (current_template_args): Use template_parm_to_arg.
147 (dependent_template_arg_p): Consider an invalid template argument
149 (end_template_parm_list): Do not update template sibling parms
150 here anymore. Use fixup_template_parms instead.
151 (process_template_parm): Pass the number of template parms to
152 canonical_type_parameter.
153 (make_auto): Require structural equality on auto
154 TEMPLATE_TYPE_PARM for now.
155 (unify)<BOUND_TEMPLATE_TEMPLATE_PARM>: Coerce template parameters
156 using all the arguments deduced so far.
157 (tsubst)<TEMPLATE_TYPE_PARM>: Pass the number of sibling parms to
158 canonical_type_parameter.
159 * tree.c (cp_set_underlying_type): Remove.
160 * typeck.c (get_template_parms_of_dependent_type)
161 (incompatible_dependent_types_p): Remove.
162 (structural_comptypes): Do not call incompatible_dependent_types_p
164 (comp_template_parms_position): Re-organized. Take the length of
165 template parms list in account.
167 2010-11-01 Jason Merrill <jason@redhat.com>
169 * semantics.c (call_stack, call_stack_tick, cx_error_context): New.
170 (last_cx_error_tick, push_cx_call_context, pop_cx_call_context): New.
171 (cxx_eval_call_expression): Call push/pop_cx_call_context instead
172 of giving follow-on errors.
173 * error.c (maybe_print_constexpr_context): New.
174 (cp_diagnostic_starter): Call it.
175 * cp-tree.h: Declare cx_error_context.
177 * semantics.c (cxx_eval_constant_expression): Explain
178 unacceptable use of variable better.
180 2010-11-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
181 Jason Merrill <jason@redhat.com>
183 * call.c (null_ptr_cst_p): Use maybe_constant_value.
184 (set_up_extended_ref_temp): Support constant initialization.
185 (initialize_reference): Adjust.
186 * class.c (check_bitfield_decl): Use cxx_constant_value.
187 * cvt.c (ocp_convert): Don't use integral_constant_value when
188 converting to class type.
189 * decl.c (finish_case_label): Use maybe_constant_value.
190 (build_init_list_var_init): Support constant initialization.
191 (check_initializer): Likewise. Reorganize.
192 (cp_finish_decl): Likewise.
193 (expand_static_init): Likewise.
194 (compute_array_index_type): Use maybe_constant_value.
196 (create_array_type_for_decl, grokdeclarator): Pass it.
197 (build_enumerator): Use cxx_constant_value.
198 * decl2.c (grokfield): Use maybe_constant_init.
199 * except.c (check_noexcept_r): Handle constexpr.
200 (build_noexcept_spec): Use maybe_constant_value.
201 * init.c (expand_default_init): Support constant initialization.
202 (build_vec_init): Likewise.
203 (constant_value_1): Adjust.
204 (build_new_1): Adjust.
205 * parser.c (cp_parser_constant_expression): Allow non-integral
207 (cp_parser_direct_declarator): Don't fold yet in C++0x mode.
208 (cp_parser_initializer_clause): Toss folded result if non-constant.
209 * pt.c (fold_decl_constant_value): Remove.
210 (convert_nontype_argument): Use maybe_constant_value. Give clearer
211 error about overflow.
212 (tsubst): Move array bounds handling into compute_array_index_type.
213 (value_dependent_expression_p): Handle constant CALL_EXPR.
214 (tsubst_decl): Don't set
215 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P yet.
216 (tsubst_expr) [DECL_EXPR]: Pass it into cp_finish_decl.
217 (instantiate_decl): Here too.
218 * semantics.c (finish_static_assert): Use maybe_constant_value.
219 (ensure_literal_type_for_constexpr_object): Make sure type is complete.
220 (potential_constant_expression): Use maybe_constant_value.
221 * tree.c (cast_valid_in_integral_constant_expression_p): Any cast
222 is potentially valid in C++0x.
223 * typeck2.c (store_init_value): Handle constant init.
224 (check_narrowing): Use maybe_constant_value.
225 (build_functional_cast): Set TREE_CONSTANT on literal T().
226 * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): Remove.
227 (LOOKUP_ALREADY_DIGESTED): New.
228 (compute_array_index_type): Adjust prototype.
230 * semantics.c (constexpr_call): New datatype.
231 (constexpr_call_table): New global table.
232 (constexpr_call_hash): New.
233 (constexpr_call_equal): Likewise.
234 (maybe_initialize_constexpr_call_table): Likewise.
235 (lookup_parameter_binding): Likewise.
236 (cxx_eval_builtin_function_call): Likewise.
237 (cxx_bind_parameters_in_call): Likewise.
238 (cxx_eval_call_expression): Likewise.
239 (cxx_eval_unary_expression): Likewise.
240 (cxx_eval_binary_expression): Likewise.
241 (cxx_eval_conditional_expression): Likewise.
242 (cxx_eval_array_reference): Likewise.
243 (cxx_eval_component_reference): Likewise.
244 (cxx_eval_logical_expression): Likewise.
245 (cxx_eval_object_construction): Likewise.
246 (cxx_eval_constant_expression): Likewise.
247 (cxx_eval_indirect_ref): Likewise.
248 (cxx_constant_value): Likewise.
249 (cxx_eval_bare_aggregate): Likewise.
250 (adjust_temp_type): New.
251 (reduced_constant_expression_p): New.
252 (verify_constant): New.
253 (cxx_eval_vec_init, cxx_eval_vec_init_1): New.
254 (cxx_eval_outermost_constant_expr): New.
255 (maybe_constant_value, maybe_constant_init): New.
256 (cxx_eval_constant_expression): Use them.
257 * pt.c (iterative_hash_template_arg): No longer static.
258 * cp-tree.h: Declare fns.
260 * cp-tree.h (register_constexpr_fundef): Declare.
261 * decl.c (maybe_save_function_definition): New.
262 (finish_function): Use it.
263 * semantics.c (constexpr_fundef): New datatype.
264 (constexpr_fundef_table): New global table.
265 (constexpr_fundef_equal): New.
266 (constexpr_fundef_hash): Likewise.
267 (retrieve_constexpr_fundef): Likewise.
268 (validate_constexpr_fundecl): Store in the table.
269 (build_data_member_initialization): New fn.
270 (build_constexpr_constructor_member_initializers): New.
271 (register_constexpr_fundef): Define.
272 (is_this_parameter): New.
273 (get_function_named_in_call): Likewise.
274 (get_nth_callarg): Likewise.
275 (check_automatic_or_tls): New.
276 (morally_constexpr_builtin_function_p): New.
277 (potential_constant_expression): New.
279 2010-11-01 Jason Merrill <jason@redhat.com>
281 * decl2.c (decl_constant_var_p): New fn.
282 (decl_maybe_constant_var_p): New fn.
283 (mark_used): Rework instantiation of things needed for constant
285 * cp-tree.h: Declare new fns.
286 * pt.c (instantiate_decl): Handle cp_unevaluated_operand.
287 (always_instantiate_p): Use decl_maybe_constant_var_p.
288 (instantiate_decl): Don't defer constexpr functions.
289 * repo.c (repo_emit_p): Use decl_maybe_constant_var_p.
290 * semantics.c (finish_id_expression): Use decl_constant_var_p.
291 Check for valid name in constant expr after mark_used.
293 2010-10-31 Jason Merrill <jason@redhat.com>
295 * class.c (is_really_empty_class): Work when type is not complete.
296 (synthesized_default_constructor_is_constexpr): New.
297 (add_implicitly_declared_members): Use it.
298 (type_has_constexpr_default_constructor): Likewise.
299 * cp-tree.h: Declare it.
300 * method.c (synthesized_method_walk): Use it.
302 * decl.c (pop_switch): Use EXPR_LOC_OR_HERE.
303 * typeck.c (convert_for_assignment): Likewise.
305 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
306 message about constexpr without -std=c++0x.
308 * decl.c (grokdeclarator): Don't ICE on constexpr non-static data
311 2010-10-30 Nathan Froyd <froydnj@codesourcery.com>
313 * class.c (layout_vtable_decl): Call build_array_of_n_type.
314 (build_vtt, build_ctor_vtabl_group): Likewise.
316 2010-10-30 Nicola Pero <nicola.pero@meta-innovation.com>
318 Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
319 * parser.c (cp_parser_objc_at_property_declaration): Removed
320 parsing of RID_COPIES and RID_IVAR. Updated call to
321 objc_add_property_declaration.
322 * typecheck.c (finish_class_member_access_expr): Call
323 objc_maybe_build_component_ref instead of objc_build_setter_call.
324 (cp_build_modify_expr): Call objc_maybe_build_modify_expr instead
325 of objc_build_getter_call.
327 2010-10-27 Jason Merrill <jason@redhat.com>
329 * cp-tree.h (cp_trait_kind): Add CPTK_IS_LITERAL_TYPE.
330 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle it.
331 * semantics.c (trait_expr_value, finish_trait_expr): Likewise.
332 * parser.c (cp_parser_primary_expression): Handle RID_IS_LITERAL_TYPE.
333 (cp_parser_trait_expr): Likewise.
335 2010-10-27 Gabriel Dos Reis <gdr@cse.tamu.edu>
336 Jason Merrill <jason@redhat.com>
338 * decl.c (finish_case_label): Use decl_constant_value.
340 * method.c (synthesized_method_walk): Track constexprness too.
341 (process_subob_fn, walk_field_subobs): Likewise.
342 (implicitly_declare_fn): Set DECL_DECLARED_CONSTEXPR_P.
343 (defaulted_late_check): Handle DECL_DECLARED_CONSTEXPR_P.
344 * class.c (add_implicitly_declared_members): Handle
345 constexpr default ctor.
347 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
348 Make sure a constexpr ctor has an empty body.
349 * class.c (type_has_constexpr_default_constructor): New.
350 * cp-tree.h: Declare it.
351 * init.c (perform_member_init): Complain about uninitialized
352 member in constexpr ctor.
353 (emit_mem_initializers): And uninitialized base.
354 * decl.c (check_tag_decl): Fix typo.
356 * semantics.c (valid_type_in_constexpr_fundecl_p): New fn.
357 (is_valid_constexpr_fn): New fn.
358 (validate_constexpr_fundecl): Use it.
359 * decl.c (validate_constexpr_redeclaration): New.
360 (duplicate_decls): Use it.
361 (cp_finish_decl): Call validate_constexpr_fundecl and
362 ensure_literal_type_for_constexpr_object here.
363 (start_decl): Not here. Don't ICE on constexpr reference.
364 (check_for_uninitialized_const_var): Don't handle constexpr specially.
365 (grokfndecl): Set DECL_DECLARED_CONSTEXPR_P.
366 (check_static_variable_definition): Give friendly message about
368 (grokdeclarator): Complain about typedef and volatile with constexpr.
369 Reorganize. Give sorry about non-static data members in C++0x mode.
370 (start_preparsed_function): Check validate_constexpr_fundecl here.
371 (check_function_type): Not here.
372 * decl2.c (finish_static_data_member_decl): Don't complain about
374 * parser.c (CP_PARSER_FLAGS_ONLY_TYPE_OR_CONSTEXPR): New.
375 (cp_parser_condition): Pass it to cp_parser_decl_specifier_seq.
376 (cp_parser_decl_specifier_seq): Handle it.
377 (cp_parser_explicit_instantiation): Diagnose inline and constexpr.
379 * class.c (check_bases): Propagate non-literality.
380 (check_field_decls): Likewise.
381 (finalize_literal_type_property): New.
382 (check_bases_and_members): Call it.
383 * cp-tree.h (TYPE_HAS_CONSTEXPR_CTOR): New.
384 (lang_type_class): Add has_constexpr_ctor field.
385 (DECL_DECLARED_CONSTEXPR_P): Strip template.
386 * decl.c (grok_special_member_properties): Set
387 TYPE_HAS_CONSTEXPR_CTOR.
389 2010-10-27 Jason Merrill <jason@redhat.com>
391 * call.c (build_integral_nontype_arg_conv): New.
392 * cp-tree.h: Declare it.
393 * pt.c (convert_nontype_argument): Use it.
395 * error.c (dump_simple_decl): Print constexpr.
397 * cvt.c (build_up_reference): Use target_type for the temporary var.
399 * except.c (build_throw): Set EXPR_LOCATION.
401 * tree.c (build_cplus_new): Handle CONSTRUCTOR.
403 * semantics.c (finish_compound_stmt): Avoid creating an
404 unnecessary BIND_EXPR.
406 * call.c (convert_like_real): Don't check narrowing if the element
407 is also an initializer-list.
409 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
411 * parser.c (cp_parser_objc_at_property_declaration): Recognize
412 RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
413 Do not use objc_set_property_attr, but use local variables
414 instead. Detect repeated usage of setter, getter and ivar
415 attributes. Improved error processing when a setter name does not
416 end in ':'. Do not check for CPP_CLOSE_PAREN after we determined
417 that the token is a keyword. Updated call to
418 objc_add_property_declaration.
420 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
422 * parser.c (cp_parser_objc_property_decl): Renamed to
423 cp_parser_objc_struct_declaration. Return the parsed trees
424 instead of calling objc_add_property_variable directly. Detect
425 missing or invalid declspecs. Implemented attributes. Do not eat
426 the ';' at the end. Exit loop whenever a non-comma is parsed, not
428 (cp_parser_objc_at_property): Renamed to
429 cp_parser_objc_at_property_declaration. Updated calls to
430 objc_add_property_variable, now objc_add_property_declaration, and
431 to cp_parser_objc_property_decl, now
432 cp_parser_objc_struct_declaration. Rewritten all code to be more
433 robust in dealing with syntax errors, and almost identical to the
434 one in c_parser_objc_at_property_declaration.
435 (cp_parser_objc_property_attrlist): Removed.
436 (cp_parser_objc_method_prototype_list): Updated call to
437 cp_parser_objc_at_property.
438 (cp_parser_objc_method_definition_list): Same change.
439 (cp_parser_objc_class_ivars): Detect a number of invalid
440 declarations of instance variables and produce errors when they
443 2010-10-26 Jason Merrill <jason@redhat.com>
445 * tree.c (build_vec_init_expr): Split out from...
446 (build_array_copy): ...here.
447 * init.c (perform_member_init): Use it.
448 * cp-tree.h: Declare it.
449 * cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for
450 VEC_INIT_EXPR and AGGR_INIT_EXPR here. Drop pre/post parameters.
451 (cp_gimplify_expr): Handle array default-initialization via
454 * tree.c (stabilize_expr): Handle xvalues properly.
456 * call.c (build_over_call): Use argarray[0] for 'this' argument.
458 * decl.c (finish_function): Don't look at function_depth.
460 2010-10-25 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
462 Implement opaque-enum-specifiers for C++0x.
463 * cp-tree.h (SET_OPAQUE_ENUM_P): New.
464 (OPAQUE_ENUM_P): New.
465 (ENUM_FIXED_UNDERLYING_TYPE_P): New.
466 (start_enum): Update prototype.
467 (finish_enum_value_list): New prototype.
468 * parser.c (cp_parser_elaborated_type_specifier): Issue a pedwarn if
469 "enum class" is used in an elaborated-type-specifier.
470 (cp_parser_enum_specifier): Rewrite to parse opaque-enum-specifiers.
471 * decl.c (copy_type_enum): New.
472 (finish_enum_value_list): New, with code from finish_enum.
473 (finish_enum): A lot of code removed. Added a gcc_assert.
474 (start_enum): Add parameters enumtype and is_new.
475 Rewrite to work with opaque-enum-specifiers.
476 * pt.c (maybe_process_partial_specialization): Allow for template
477 specialization of enumerations, with a pedwarn.
478 (lookup_template_class): Update call to start_enum. Call to
480 (tsubst_enum): Call to begin_scope, finish_scope and
481 finish_enum_value_list.
483 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com>
485 Removed Objective-C++ specific replacement of cxx_printable_name.
486 * cp-objcp-common.h: Added LANG_HOOKS_DECL_PRINTABLE_NAME, set
487 to cxx_printable_name for both C++ and Objective-C++.
488 * cp-lang.h: Removed LANG_HOOKS_DECL_PRINTABLE_NAME.
490 * error.c (dump_decl): For Objective-C++, call
491 objc_maybe_printable_name here ...
492 * tree.c (cxx_printable_name_internal): ... instead of here.
494 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com>
496 * tree.c (cxx_printable_name_internal): In Objective-C++, call
497 objc_maybe_printable_name.
499 2010-10-22 Jason Merrill <jason@redhat.com>
502 * pt.c (instantiate_class_template): Don't instantiate default
506 * init.c (build_vec_init): Handle memberwise move.
508 2010-10-21 Paolo Carlini <paolo.carlini@oracle.com>
511 * call.c (add_function_candidate): Don't use TREE_VALUE on null
514 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
516 * parser.c (cp_parser_objc_method_type): Mark inline. Return a
517 bool instead of calling objc_set_method_type.
518 (cp_parser_objc_method_signature): Updated calls to
519 cp_parser_objc_method_type and to objc_build_method_signature.
520 (cp_parser_objc_method_prototype_list): Updated calls to
521 objc_add_method_declaration. Use token->type to determine if it
522 is a class method or not.
523 (cp_parser_objc_method_definition_list): Same change.
525 2010-10-20 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
528 * parser.c (cp_convert_range_for): Call cp_finish_decl
529 instead of finish_expr_stmt.
531 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
533 * cp-lang.c (finish_file): Removed.
534 * decl2.c (cp_write_global_declarations): Call
535 objc_write_global_declarations when compiling Objective-C++.
537 2010-10-19 Paolo Carlini <paolo.carlini@oracle.com>
540 * pt.c (add_to_template_args): Check extra_args for error_mark_node.
541 (coerce_template_parms): Likewise for args.
543 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
545 Implemented parsing @synthesize and @dynamic for Objective-C++.
546 * parser.c (cp_parser_objc_method_definition_list): Recognize
547 RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
548 (cp_parser_objc_at_dynamic_declaration): New.
549 (cp_parser_objc_at_synthesize_declaration): New.
551 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
553 * parser.c (cp_parser_objc_identifier_list): Check the return
554 value of cp_parser_identifier and react if it is error_mark_node.
556 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
558 Merge from apple/trunk branch on FSF servers.
560 2005-03-01 Fariborz Jahanian <fjahanian@apple.com>
563 * call.c (standard_conversion, implicit_conversion): Ignore
564 'volatile' attribute of artificially volatized type in objc when
565 evaluating various conversion weights.
567 2005-11-08 Fariborz Jahanian <fjahanian@apple.com>
570 * typeck.c (comp_ptr_ttypes_real): Remove the hack. un-volatize the
571 artiificially 'volatized' type before doing pointer comparison.
573 2010-10-18 Jakub Jelinek <jakub@redhat.com>
576 * semantics.c (finish_goto_stmt): Call mark_rvalue_use on computed
579 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
581 Merge from apple/trunk branch on FSF servers.
583 2006-04-19 Fariborz Jahanian <fjahanian@apple.com>
586 * parser.c (cp_parser_simple_type_specifier): Don't lookup for
587 objc object types if type is scope qualified.
589 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
591 Merge from apple/trunk branch on FSF servers.
593 2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
596 * lex.c (unqualified_name_lookup_error): Issue diagnostic
597 for private 'ivar' access.
599 2010-10-17 Iain Sandoe <iains@gcc.gnu.org>
601 * parser.c (cp_parser_objc_visibility_spec): Update to use visibility
602 enum, and handle @package.
604 2010-10-15 Jason Merrill <jason@redhat.com>
607 * tree.c (cp_build_qualified_type_real): Don't reuse a variant
608 with a different typedef variant of the element type.
610 2010-10-14 Iain Sandoe <iains@gcc.gnu.org>
612 merge from FSF apple 'trunk' branch.
613 2006 Fariborz Jahanian <fjahanian@apple.com>
615 Radars 4436866, 4505126, 4506903, 4517826
616 * typeck.c (finish_class_member_access_expr): Handle CLASS.property
618 (cp_build_modify_expr): Likewise.
619 * parser.c (cp_parser_objc_method_prototype_list): Handle @property.
620 (cp_parser_objc_method_definition_list): Likewise.
621 (cp_parser_objc_property_decl): New.
622 (cp_parser_objc_property_attrlist): New.
623 (cp_parser_objc_at_property): New.
625 2010-10-14 Richard Guenther <rguenther@suse.de>
628 * cp-tree.h (NULLPTR_TYPE_P): Adjust.
629 * decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node,
631 * error.c (dump_type): Handle NULLPTR_TYPE.
632 (dump_type_prefix): Likewise.
633 (dump_type_suffix): Likewise.
634 * mangle.c (write_type): Likewise.
635 * name-lookup.c (arg_assoc_type): Likewise.
636 * rtti.c (typeinfo_in_lib_p): Likewise.
637 * pt.c (tsubst): Likewise.
639 2010-10-13 Jason Merrill <jason@redhat.com>
642 * class.c (fixup_attribute_variants): New fn.
643 * cp-tree.h: Declare it.
644 * pt.c (instantiate_class_template): Call it.
645 * semantics.c (begin_class_definition): Call it.
647 2010-10-13 Richard Henderson <rth@redhat.com>
649 * cp-lang.c (cp_eh_personality): Update call to
650 build_personality_function.
651 * except.c (choose_personality_routine): Update function comment.
653 2010-10-13 Richard Guenther <rguenther@suse.de>
655 * tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and
656 clear DECL_CHAIN of NAMESPACE_DECLs.
658 2010-10-11 Martin Jambor <mjambor@suse.cz>
661 * cp-tree.h (current_class_ref): Check that cp_function_chain is
663 * call.c (build_cxx_call): Likewise.
665 2010-10-10 Jason Merrill <jason@redhat.com>
667 * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
668 (tsubst_default_arguments): Only do this once for cloned fns.
669 (tsubst): Use typedef_variant_p. Handle LANG_TYPE. Don't
671 (tsubst_expr): Avoid calling tsubst_expr for non-expressions.
672 (tsubst_copy_and_build): Likewise.
673 (tsubst_initializer_list): Likewise.
674 (tsubst_copy): Change default to gcc_unreachable. Handle
675 OVERLOAD and PTRMEM_CST.
677 2010-10-10 Jason Merrill <jason@redhat.com>
681 * pt.c (tsubst_copy) [INTEGER_CST]: Instantiate the type.
683 2010-10-07 Andi Kleen <ak@linux.intel.com>
685 * Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
686 (cc1plus-dummy): Remove.
687 (cc1plus-checksum): Change to run checksum over object files
690 2010-10-08 Joseph Myers <joseph@codesourcery.com>
692 * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
694 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
696 * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to
698 * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for
700 * error.c (dump_expr): Added case for AT_ENCODE_EXPR.
701 * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR.
702 (value_dependent_expression_p): Added case for AT_ENCODE_EXPR.
703 (type_dependent_expression_p): Added case for AT_ENCODE_EXPR.
704 * parser.c (cp_parser_objc_encode_expression): Updated comment.
706 2010-10-07 Nicola Pero <nicola@nicola.brainstorm.co.uk>
708 Merge from apple/trunk branch on FSF servers.
710 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
713 * parser.c (cp_parser_objc_interstitial_code): Recognize
714 and parse RID_NAMESPACE keyword.
716 2010-10-07 Iain Sandoe <iains@gcc.gnu.org>
718 * parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
719 finding ellipsis, before checking for attributes.
721 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
723 Merge from apple/trunk branch on FSF servers.
724 * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
725 longer existing gcc/c-common.def.
727 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
730 * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
731 * parser.c (cp_parser_objc_encode_expression): Build a templatized
732 parse tree for @encode(T).
734 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
737 * c-common.def: Add new expression code AT_ENCODE_EXPR.
739 2010-10-06 Eric Botcazou <ebotcazou@adacore.com>
742 * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
743 code folding offsetof-like computations.
745 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
748 * parser.c (cp_parser_objc_class_interface): If no identifier
749 follows an @interface token, stop parsing the interface after
751 (cp_parser_objc_class_implementation): If no identifier follows an
752 @implementation token, stop parsing the implementation after
755 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
758 * parser.c (cp_parser_objc_method_keyword_params): If the required
759 colon is not found while parsing parameters, stop parsing them.
761 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
764 * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
765 @end after detecting it. Print an error if @end is found without
767 (cp_parser_objc_method_prototype_list): Do not eat the EOF after
768 detecting it. Fixed reading the next token when continuing
769 because of an error in a method signature. Print an error if EOF
770 is found without an '@end'.
771 (cp_parser_objc_method_definition_list): Same change.
773 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
775 Merge from apple/trunk branch on FSF servers:
777 2005-10-17 Fariborz Jahanian <fjahanian@apple.com>
780 * parser.c (cp_parser_objc_method_keyword_params): Check for valid
781 method parameters and issue error.
782 (cp_parser_objc_method_definition_list): Check for invalid tokens
783 which cannot start a function definition.
785 2005-10-14 Fariborz Jahanian <fjahanian@apple.com>
788 * parser.c (cp_parser_objc_message_args): Check for missing message
789 arguments and syntax error.
791 2005-10-13 Fariborz Jahanian <fjahanian@apple.com>
794 * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
797 2005-08-15 Ziemowit Laski <zlaski@apple.com>
800 * parser.c (cp_parser_objc_interstitial_code): Catch stray
801 '{' and '}' tokens and issue appropriate errors.
803 2005-08-02 Ziemowit Laski <zlaski@apple.com>
806 (cp_parser_statement_seq_opt): In addition to '}' and
807 end-of-file, a statement sequence may also be terminated
810 2010-10-05 Joseph Myers <joseph@codesourcery.com>
812 * cp-tree.h (cxx_print_error_function,
813 cxx_initialize_diagnostics): Declare using diagnostic_context
816 2010-10-04 Andi Kleen <ak@linux.intel.com>
818 * Make-lang.in (g++, cc1plus): Add + to build rule.
820 2010-10-04 Jason Merrill <jason@redhat.com>
822 * tree.c (decl_storage_duration): New.
823 * cp-tree.h: Declare it.
824 (duration_kind): Return values.
826 2010-10-03 Jason Merrill <jason@redhat.com>
828 * typeck.c (require_complete_type_sfinae): Add complain parm to...
829 (require_complete_type): ...this function.
830 (cp_build_array_ref, convert_arguments): Use it.
831 (convert_for_initialization, cp_build_modify_expr): Likewise.
832 * cp-tree.h: Declare it.
833 * call.c (build_over_call): Use it.
835 2010-09-30 Iain Sandoe <iains@gcc.gnu.org>
837 merge from FSF 'apple/trunk' branch.
838 2006-01-30 Fariborz Jahanian <fjahanian@apple.com>
841 * cp/parser.c (cp_parser_objc_interstitial_code): For
842 @optional/@required set the optional/required flag.
844 2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>
846 * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
847 and indentation when finding an Objective-C++ CPP_AT_NAME token.
849 2010-09-29 Richard Guenther <rguenther@suse.de>
851 * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
852 (CP_TYPE_CONTEXT): Similar.
853 (FROB_CONTEXT): Frob global_namespace to the global
854 TRANSLATION_UNIT_DECL.
855 * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
856 set DECL_CONTEXT of global_namespace to it.
857 (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
858 instead of zeroing context.
859 (cp_finish_decl): Use DECL_FILE_SCOPE_P.
860 (grokfndecl): Likewise.
861 (start_preparsed_function): Likewise.
862 * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
863 (namespace_binding): Use SCOPE_FILE_SCOPE_P.
864 * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
865 (is_specialization_of_friend): Use CP_DECL_CONTEXT.
866 (push_template_decl_real): Likewise.
867 (tsubst_friend_class): Likewise. Adjust context comparisons.
868 (instantiate_class_template): Use CP_TYPE_CONTEXT.
869 (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
870 * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
873 2010-09-29 Yao Qi <yao@codesourcery.com>
875 * decl.c (get_atexit_node): Fix typo.
877 2010-09-28 Jason Merrill <jason@redhat.com>
879 * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
880 (real_lvalue_p): Take const_tree.
882 * typeck.c (lvalue_or_else): Make temporary arg a permerror.
883 (cp_build_addr_expr_1): Likewise.
885 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
887 Partially merged from apple/trunk branch on FSF servers:
888 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
889 Radar 3803157 (method attributes)
891 * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
892 (cp_parser_objc_method_tail_params_opt): Likewise.
893 (cp_parser_objc_method_signature): Likewise.
894 (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
895 (cp_parser_objc_method_prototype_list): Handle attributes.
896 (cp_parser_objc_method_definition_list): Likewise.
898 2010-09-28 Richard Henderson <rth@redhat.com>
900 * cp-lang.c: Include "target.h".
901 (cp_eh_personality): Use targetm.except_unwind_info.
902 * Make-lang.in (cp-lang.o): Update deps.
904 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
906 * parser.c (cp_parser_objc_valid_prefix_attributes): New.
907 (cp_parser_declaration): Parse prefix attributes for ObjC++.
908 (cp_parser_objc_protocol_declaration): Handle attributes.
909 (cp_parser_objc_class_interface): Likewise.
910 (cp_parser_objc_declaration): Likewise.
912 2010-09-27 Jason Merrill <jason@redhat.com>
914 Require lvalues as specified by the standard.
915 * typeck.c (lvalue_or_else): Use real_lvalue_p.
916 (cp_build_addr_expr_1): Split out of cp_build_unary_op.
917 (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
918 (decay_conversion, get_member_function_from_ptrfunc): Adjust.
919 (build_x_unary_op, build_reinterpret_cast_1): Adjust.
920 (build_const_cast_1): Adjust.
921 * cp-tree.h: Declare new fns.
922 * call.c (build_this, convert_like_real, build_over_call): Adjust.
923 (initialize_reference): Adjust.
924 * class.c (build_base_path, convert_to_base_statically): Adjust.
925 (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
926 * cvt.c (build_up_reference, convert_to_reference): Adjust.
927 * decl.c (register_dtor_fn): Adjust.
928 * decl2.c (build_offset_ref_call_from_tree): Adjust.
929 * except.c (initialize_handler_parm): Adjust.
930 * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
931 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
932 * tree.c (stabilize_expr): Adjust.
934 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
936 Merge from apple/trunk branch on FSF servers:
938 2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
941 * typeck.c (composite_pointer_type): Call objc_have_common_type
942 when comparing two objective-c pointer types.
944 2005-07-18 Ziemowit Laski <zlaski@apple.com>
947 * call.c (standard_conversion): Do not issue warnings when
948 comparing ObjC pointer types.
950 2005-06-22 Ziemowit Laski <zlaski@apple.com>
953 * call.c (standard_conversion): Allow for a pointer conversion
954 between any two ObjC pointer types.
955 * typeck.c (composite_pointer_type): Determine common type
956 for two ObjC pointer types.
958 2010-09-24 Jan Hubicka <jh@suse.cz>
960 * decl.c (finish_function): Use decl_replaceable_p
961 * method.c (make_alias_for_thunk): Update call of
962 cgraph_same_body_alias.
964 2010-09-24 Jason Merrill <jason@redhat.com>
966 * decl.c (compute_array_index_type): Remember type dependence of
968 * pt.c (dependent_type_p_r): Don't recompute it here.
970 * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
971 reference and pointer to the same type as "*" or "&".
973 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
975 * typeck.c (warn_args_num): Use warning 'too many arguments to
976 method [methodname]' for an Objective-C method instead of the less
977 satisfactory 'too many arguments to function' (with no method
980 2010-09-21 Jason Merrill <jason@redhat.com>
982 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
983 special handling if we know the member.
985 2010-09-18 Jason Merrill <jason@redhat.com>
987 * call.c (compare_ics): Do lvalue/rvalue reference binding
988 comparison for ck_list, too.
990 2010-09-15 Jason Merrill <jason@redhat.com>
992 * semantics.c (finish_id_expression): Diagnose use of function
993 parms in evaluated context outside function body.
995 * decl2.c (grokbitfield): Diagnose non-integral width.
997 * call.c (convert_like_real): Use the underlying type of the
998 reference for the temporary.
1000 2010-09-15 Jakub Jelinek <jakub@redhat.com>
1003 * class.c (build_vtbl_initializer): Use fn instead of init's operand
1004 as first argument to FDESC_EXPR.
1006 2010-09-15 Paolo Carlini <paolo.carlini@oracle.com>
1009 * decl.c (grokdeclarator): Check build_memfn_type return value
1010 for error_mark_node.
1012 2010-09-13 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
1014 * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
1015 (begin_range_for_stmt): Likewise.
1017 2010-09-11 Rodrigo Rivas <rodrigorivascosta@gmail.com>
1019 Implement range-based for-statements.
1020 * cp-tree.def (RANGE_FOR_STMT): New.
1021 * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
1022 (cp_convert_range_for): Declare.
1023 * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
1024 (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
1025 * semantics.c (begin_range_for_stmt): New.
1026 (finish_range_for_decl): New.
1027 (finish_for_stmt): Accept also RANGE_FOR_STMT.
1028 (perform_koenig_lookup): Add extra argument include_std.
1029 * parser.c (cp_parser_c_for): New with code from
1030 cp_parser_iteration_statement().
1031 (cp_parser_range_for): New.
1032 (cp_convert_range_for): New.
1033 (cp_parser_iteration_statement): Add range-for support.
1034 (cp_parser_condition): Adjust comment.
1035 (cp_parser_postfix_expression): perform_koenig_lookup takes extra
1037 * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
1038 * cxx-pretty-print.c: Likewise.
1039 * lex.c (cxx_init): Likewise.
1040 * name-lookup.c (lookup_function_nonclass): Add extra argument
1042 (lookup_arg_dependent): Likewise.
1043 * name-lookup.h: Likewise.
1045 2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
1048 * error.c (maybe_warn_cpp0x): Add new warning
1049 CPP0X_INLINE_NAMESPACES.
1050 * parser.c (cp_parser_namespace_definition): Likewise.
1051 * cp-tree.h (cpp0x_warn_str): Likewise.
1053 2010-09-10 Richard Guenther <rguenther@suse.de>
1055 * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
1056 TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
1058 2010-09-10 Jan Hubicka <jh@suse.cz>
1060 PR tree-optimization/45605
1061 * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
1064 2010-09-08 Jakub Jelinek <jakub@redhat.com>
1067 * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
1068 before calling fold_decl_constant_value.
1070 2010-09-07 Arnaud Charlet <charlet@adacore.com>
1072 * cp-tree.h (build_enumerator): Add new location_t parameter.
1073 (build_lang_decl_loc): New function.
1074 * decl.c (build_enumerator): New parameter loc. Use it when calling
1075 build_decl. Replace build_lang_decl with build_lang_decl_loc.
1076 * pt.c (tsubst_enum): Adjust call to build_enumerator.
1077 * parser.c (cp_parser_enumerator_definition): Ditto.
1078 * lex.c (build_lang_decl_loc): New function.
1080 2010-09-06 Dodji Seketeli <dodji@redhat.com>
1085 * tree.c (strip_typedefs): Strip typedefs from the context of
1088 2010-09-06 Mark Mitchell <mark@codesourcery.com>
1090 * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
1091 * call.c (build_conditional_expr): Likewise.
1092 (convert_arg_to_ellipsis): Likewise.
1094 2010-09-06 Arnaud Charlet <charlet@adacore.com>
1096 * parser.c (make_pointer_declarator, make_reference_declarator,
1097 make_call_declarator, make_array_declarator): Set declarator->id_loc.
1098 (cp_parser_init_declarator): Adjust location of decl if appropriate.
1100 2010-09-06 Jason Merrill <jason@redhat.com>
1102 * call.c (implicit_conversion): Fix value-init of enums.
1103 (convert_like_real): Likewise.
1105 * decl.c (cp_finish_decl): Don't change init for auto deduction.
1107 * pt.c (fold_non_dependent_expr_sfinae): Split out from...
1108 (fold_non_dependent_expr): ...here.
1109 (convert_nontype_argument): Use it. Take complain parm.
1110 Use perform_implicit_conversion instead of ocp_convert.
1111 Allow cv-qual changes.
1112 (convert_template_argument): Pass complain down.
1113 (tsubst_template_arg): Suppress constant expression warnings.
1116 * method.c (synthesized_method_walk): In constructors, also check
1117 subobject destructors.
1119 * semantics.c (finish_compound_literal): Always build a
1122 2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
1125 * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
1127 2010-08-30 Jakub Jelinek <jakub@redhat.com>
1130 * parser.c (cp_parser_omp_atomic): Handle boolean
1131 {PRE,POST}_INCREMENT.
1133 2010-08-29 Jason Merrill <jason@redhat.com>
1136 * parser.c (cp_parser_parameter_declaration): Pop parameter decls
1137 after tentative parsing.
1139 2010-08-22 Joseph Myers <joseph@codesourcery.com>
1141 * Make-lang.in (g++spec.o): Update dependencies.
1142 * g++spec.c: Include opts.h
1143 (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
1144 (lang_specific_driver): Use cl_decoded_option structures.
1146 2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
1148 * call.c: Use FOR_EACH_VEC_ELT.
1149 * class.c: Likewise.
1151 * decl2.c: Likewise.
1152 * error.c: Likewise.
1153 * except.c: Likewise.
1154 * mangle.c: Likewise.
1155 * method.c: Likewise.
1156 * name-lookup.c: Likewise.
1157 * parser.c: Likewise.
1160 * semantics.c: Likewise.
1161 * typeck2.c: Likewise.
1163 2010-08-19 Jason Merrill <jason@redhat.com>
1165 * call.c (reference_related_p): Check for error_mark_node.
1166 (add_function_candidate): Check it instead of
1167 same_type_ignoring_top_level_qualifiers_p.
1170 * init.c (build_new_1): Don't use build_value_init in a template.
1171 (build_value_init): Make sure we don't.
1174 * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
1175 of empty class CONSTRUCTOR.
1177 * except.c (pending_noexcept, pending_noexcept_checks): New.
1178 (perform_deferred_noexcept_checks): New.
1179 (maybe_noexcept_warning): Split from...
1180 (finish_noexcept_expr): ...here. Adjust.
1181 * decl2.c (cp_write_global_declarations): Call
1182 perform_deferred_noexcept_checks.
1183 * cp-tree.h: And declare it.
1185 2010-08-18 Nathan Froyd <froydnj@codesourcery.com>
1188 * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
1191 2010-08-17 Kai Tietz <kai.tietz@onevision.com>
1193 * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
1194 or if -fms-extensions is enabled check, check permissive.
1196 2010-08-09 Jason Merrill <jason@redhat.com>
1199 * pt.c (lookup_template_class): Don't re-coerce outer parms.
1201 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1203 * call.c (add_builtin_candidates): Use VECs for local variable
1204 `types'. Adjust remainder of function accordingly.
1206 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1208 * name-lookup.c (is_associated_namespace): Convert local variables
1209 to be VECs instead of TREE_LISTs.
1211 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1213 * tree.c (varargs_function_p): Use stdarg_p.
1215 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1217 * parser.c (cp_default_arg_entry): Declare. Declare a VEC of it.
1218 (cp_unparsed_functions_entry): Declare. Declare a VEC of it.
1219 (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
1220 Change type to a VEC.
1221 (unparsed_funs_with_default_args): Define.
1222 (unparsed_funs_with_definitions): Define.
1223 (push_unparsed_function_queues): New function.
1224 (cp_parser_new): Call it.
1225 (pop_unparsed_function_queues): New function.
1226 (cp_parser_class_specifier): Adjust processing of unparsed functions.
1227 (cp_parser_template_declaration_after_export): Use VEC_safe_push.
1228 (cp_parser_save_member_function_body): Likewise.
1229 (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
1230 and pop_unparsed_function_queues.
1231 (cp_parser_late_parsing_default_args): Likewise.
1232 (cp_parser_save_default_args): Use VEC_safe_push.
1234 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1236 * name-lookup.h (cp_label_binding): Declare. Declare a VEC type
1238 (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
1240 * decl.c (poplevel): Adjust for type changes.
1241 (declare_local_label): Likewise.
1243 2010-08-06 Jason Merrill <jason@redhat.com>
1245 * typeck.c (complete_type_or_maybe_complain): Split out from...
1246 (complete_type_or_else): Here.
1247 (build_class_member_access_expr): Call it.
1248 (finish_class_member_access_expr): Likewise.
1249 * call.c (build_special_member_call): Likewise.
1250 * cvt.c (build_expr_type_conversion): Likewise.
1251 * init.c (build_new): Likewise.
1252 * typeck2.c (build_functional_cast): Likewise.
1253 * cp-tree.h: Declare it.
1255 * init.c (build_value_init): Add complain parm.
1256 (build_value_init_noctor): Likewise.
1257 (perform_member_init): Pass it.
1258 (expand_aggr_init_1): Likewise.
1259 (build_new_1): Likewise.
1260 (build_vec_init): Likewise.
1261 * pt.c (tsubst_expr): Likewise.
1262 * typeck2.c (build_functional_cast): Likewise.
1263 * cp-tree.h: Adjust.
1264 * tree.c (build_target_expr_with_type): Handle error_mark_node.
1266 * typeck.c (decay_conversion): Any expression with type nullptr_t
1269 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1272 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
1274 2010-07-27 Jason Merrill <jason@redhat.com>
1276 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
1277 from build_value_init.
1278 * init.c (build_value_init_noctor): Give error for unknown array
1281 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1283 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
1285 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1287 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
1288 c_common_initialize_diagnostics.
1289 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
1290 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
1292 2010-07-21 Jason Merrill <jason@redhat.com>
1294 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
1296 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
1299 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
1302 * pt.c (instantiate_class_template): Propagate the template's
1303 location to its instance.
1305 2010-07-20 Jason Merrill <jason@redhat.com>
1308 * pt.c (tsubst_copy_and_build): Rework last change.
1311 * pt.c (tsubst_copy_and_build): Handle partial substitution of
1314 2010-07-19 Jason Merrill <jason@redhat.com>
1317 * semantics.c (finish_decltype_type): Correct decltype
1318 of parenthesized rvalue reference variable.
1321 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
1322 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
1324 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
1327 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
1329 * cp-tree.h: Adjust declaration.
1330 * init.c (perform_member_init): Adjust caller.
1331 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
1332 * typeck2.c (store_init_value): Likewise.
1333 (build_functional_cast): Pass complain argument to
1334 build_x_compound_expr_from_list.
1336 2010-07-16 Jason Merrill <jason@redhat.com>
1339 * pt.c (process_partial_specialization): Diagnose partial
1340 specialization after instantiation.
1341 (most_specialized_class): Add complain parm.
1343 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
1345 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1347 * init.c (build_new_1): Use cp_build_function_call_nary instead of
1348 cp_build_function_call.
1350 2010-07-15 Jason Merrill <jason@redhat.com>
1353 * call.c (add_function_candidate): If we're working on an implicit
1354 declaration, don't consider candidates that won't match.
1355 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
1356 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
1359 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1360 (TYPE_HAS_USER_OPEQ): New.
1361 * decl.c (grok_special_member_properties): Set it.
1362 * class.c (add_implicitly_declared_members): Don't lazily declare
1363 constructors/operator= if a base or member has a user-declared one.
1364 (check_bases_and_members, check_bases): Adjust.
1365 (check_field_decls, check_field_decl): Adjust.
1367 2010-07-15 Anatoly Sokolov <aesok@post.ru>
1369 * decl.c (integer_three_node): Remove.
1370 (cxx_init_decl_processing): Do not initialize the integer_three_node.
1371 * cp-tree.h (integer_three_node): Remove.
1373 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1375 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
1377 * class.c: Likewise.
1378 * cp-gimplify.c: Likewise.
1380 * decl2.c: Likewise.
1382 * mangle.c: Likewise.
1383 * name-lookup.c: Likewise.
1384 * optimize.c: Likewise.
1385 * parser.c: Likewise.
1388 * search.c: Likewise.
1389 * semantics.c: Likewise.
1390 * typeck.c: Likewise.
1391 * typeck2.c: Likewise.
1393 2010-07-14 Jason Merrill <jason@redhat.com>
1395 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
1396 (build_field_list): Cache field type.
1398 Implement C++0x unrestricted unions (N2544)
1399 * class.c (check_field_decl): Loosen union handling in C++0x.
1400 * method.c (walk_field_subobs): Split out from...
1401 (synthesized_method_walk): ...here. Set msg before loops.
1402 (process_subob_fn): Check for triviality in union members.
1403 * init.c (sort_mem_initializers): Splice out uninitialized
1404 anonymous unions and union members.
1405 (push_base_cleanups): Don't automatically destroy anonymous unions
1408 2010-07-13 Jason Merrill <jason@redhat.com>
1411 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1412 (TYPE_HAS_USER_OPEQ): New.
1413 * decl.c (grok_special_member_properties): Set it.
1414 * class.c (add_implicitly_declared_members): Don't lazily declare
1415 constructors/operator= if a base or member has a user-declared one.
1416 (check_bases_and_members, check_bases): Adjust.
1417 (check_field_decls, check_field_decl): Adjust.
1418 * method.c (synthesized_method_walk): Initialize check_vdtor.
1421 * mangle.c (write_type): Canonicalize.
1422 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
1423 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
1425 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
1428 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
1430 * typeck.c (get_delta_difference): Update prototype, add a
1431 tsubst_flags_t parameter; update get_delta_difference_1 calls and
1432 add checks for error_mark_node.
1433 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
1434 parameter; update lookup_base call.
1435 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
1436 parameter; update get_delta_difference call and add check for
1438 (convert_ptrmem): Update prototype, add a tsubst_flags_t
1439 parameter; update get_delta_difference call and add check for
1440 error_mark_node; update build_ptrmemfunc call.
1441 (build_static_cast_1): Adjust convert_ptrmem call.
1442 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
1443 (cp_build_unary_op): Adjust build_ptrmemfunc call.
1444 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
1445 and build_ptrmemfunc calls.
1446 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
1448 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
1451 * call.c (build_temp): Add tsubst_flags_t complain parameter;
1452 adjust build_special_member_call call, pass complain.
1453 (convert_like_real): Adjust build_temp call, pass complain.
1455 2010-07-09 Jason Merrill <jason@redhat.com>
1458 * cp-tree.h (BV_LOST_PRIMARY): New macro.
1459 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
1460 Set BV_LOST_PRIMARY.
1461 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
1463 2010-07-08 Jason Merrill <jason@redhat.com>
1466 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
1467 virtual bases for covariant thunks.
1469 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
1471 * cp-tree.h: Do not include toplev.h.
1473 2010-07-06 Jason Merrill <jason@redhat.com>
1476 * call.c (is_std_init_list): Look through typedefs.
1479 * init.c (build_offset_ref): If scope isn't dependent,
1480 don't exit early. Look at TYPE_MAIN_VARIANT.
1481 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
1483 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
1485 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
1487 * cp-tree.h (impl_conv_void): New type.
1488 (convert_to_void): Adjust prototype.
1489 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
1490 diagnostic for easy translation. Change caller.
1491 * typeck.c: Update call to convert_to_void.
1492 * semantics.c: Likewise.
1495 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
1497 * decl.c (cp_finish_decl): Call add_local_decl.
1498 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
1500 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
1502 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
1505 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
1508 * parser.c (cp_parser_primary_expression): Error if local template is
1511 2010-07-02 Le-Chun Wu <lcwu@google.com>
1514 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
1515 (variable or type) shadows another type.
1517 2010-07-02 Jakub Jelinek <jakub@redhat.com>
1520 * typeck.c (convert_for_assignment): When converting a convertible
1521 vector type or objc++ types, call mark_rvalue_use.
1522 * typeck2.c (build_m_component_ref): Use return values from
1523 mark_rvalue_use or mark_lvalue_use.
1524 * class.c (build_base_path): Likewise.
1525 * call.c (build_conditional_expr): Likewise.
1527 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1530 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
1533 2010-07-01 Richard Guenther <rguenther@suse.de>
1535 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
1536 predicate we are looking for, allow non-gimplified
1539 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
1542 * typeck.c (cp_build_unary_op): Early return error_mark_node when
1543 arg is NULL_TREE too.
1544 * call.c (convert_class_to_reference): Return error_mark_node when
1547 2010-06-30 Michael Matz <matz@suse.de>
1549 * repo.c (finish_repo): Fix typo.
1551 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1553 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
1555 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1557 * repo.c (pending_repo): Change type to a VEC.
1558 (finish_repo): Adjust for new type of pending_repo.
1559 (repo_emit_p): Likewise.
1561 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
1563 * tree.c: Include gimple.h. Do not include tree-flow.h
1564 * decl.c: Do not include tree-flow.h
1565 * Make-lang.in: Adjust dependencies.
1567 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1569 * decl.c (incomplete_var): Declare. Declare VECs containing them.
1570 (incomplete_vars): Adjust comment. Change type to a VEC.
1571 (maybe_register_incomplete_var): Adjust for new type.
1572 (complete_vars): Adjust iteration over incomplete_vars.
1574 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1576 * decl.c (struct named_label_entry): Change type of bad_decls field
1578 (poplevel_named_label_1): Adjust for new type of bad_decls.
1579 (check_goto): Likewise.
1581 2010-06-29 Jason Merrill <jason@redhat.com>
1583 Enable implicitly declared move constructor/operator= (N3053).
1584 * class.c (add_implicitly_declared_members): A class with no
1585 explicitly declared copy or move constructor gets both declared
1586 implicitly, and similarly for operator=.
1587 (check_bases): A type with no copy ctor does not inhibit
1588 a const copy ctor in a derived class. It does mean the derived
1590 (check_field_decl): Likewise.
1591 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
1592 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
1593 (trivially_copyable_p): Likewise.
1594 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
1595 * class.c (finish_struct_bits): Likewise.
1596 * tree.c (build_target_expr_with_type): Likewise.
1597 * typeck2.c (store_init_value): Likewise.
1599 Enable implicitly deleted functions (N2346)
1600 * class.c (check_bases_and_members): Adjust lambda flags.
1601 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
1603 * decl2.c (mark_used): Adjust error for use of deleted function.
1605 Machinery to support implicit delete/move.
1606 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
1607 has_complex_move_ctor, has_complex_move_assign bitfields.
1608 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
1609 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
1610 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
1611 (enum special_function_kind): Add sfk_move_assignment.
1612 (LOOKUP_SPECULATIVE): New.
1613 * call.c (build_over_call): Return early if it's set.
1614 (build_over_call): Use trivial_fn_p.
1615 * class.c (check_bases): If the base has no default constructor,
1616 the derived one is non-trivial. Handle move ctor/op=.
1617 (check_field_decl): Likewise.
1618 (check_bases_and_members): Handle move ctor/op=.
1619 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
1620 (type_has_move_constructor, type_has_move_assign): New.
1621 * decl.c (grok_special_member_properties): Handle move ctor/op=.
1622 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
1623 (trivial_fn_p): New.
1624 (do_build_copy_constructor): Use it.
1625 (do_build_assign_ref): Likewise. Handle move assignment.
1626 (build_stub_type, build_stub_object, locate_fn_flags): New.
1627 (locate_ctor): Use locate_fn_flags.
1628 (locate_copy, locate_dtor): Remove.
1629 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
1630 (process_subob_fn, synthesized_method_walk): New.
1631 (maybe_explain_implicit_delete): New.
1632 (implicitly_declare_fn): Use synthesized_method_walk,
1633 type_has_trivial_fn, and type_set_nontrivial_flag.
1634 (defaulted_late_check): Set DECL_DELETED_FN.
1635 (defaultable_fn_check): Handle sfk_move_assignment.
1636 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
1637 implicitly deleted move ctor/op=.
1638 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
1639 (lookup_fnfields_slot): New.
1640 * semantics.c (omp_clause_info_fndecl): Remove.
1641 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
1642 get_copy_assign, trivial_fn_p.
1643 (trait_expr_value): Adjust call to locate_ctor.
1644 * tree.c (special_function_p): Handle sfk_move_assignment.
1646 * class.c (type_has_virtual_destructor): New.
1647 * cp-tree.h: Declare it.
1648 * semantics.c (trait_expr_value): Use it.
1650 * call.c (build_over_call): Only give warnings with tf_warning.
1652 * name-lookup.c (pop_scope): Handle NULL_TREE.
1654 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
1655 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
1656 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
1657 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
1658 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
1659 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
1660 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
1661 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
1662 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
1663 (sfk_assignment_operator): Rename to sfk_copy_assignment.
1664 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
1665 * search.c, semantics.c, tree.c: Adjust.
1667 * pt.c (dependent_scope_ref_p): Remove.
1668 (value_dependent_expression_p): Don't call it.
1669 (type_dependent_expression_p): Here either.
1670 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
1671 if the scope isn't dependent.
1673 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
1677 * pt.c (has_value_dependent_address): New.
1678 (value_dependent_expression_p): Check it.
1679 (convert_nontype_argument): Likewise. Call decay_conversion before
1680 folding if we want a pointer.
1681 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
1682 scope is the current instantiation.
1684 2010-06-28 Jakub Jelinek <jakub@redhat.com>
1687 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
1690 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
1692 * init.c: Do not include except.h.
1695 * cp-lang.c: Likewise.
1697 * semantics.c: Likewise.
1698 * decl2.c: Likewise.
1699 * except.c: Likewise.
1700 (init_exception_processing): Do not set the removed
1701 lang_protect_cleanup_actions here.
1702 (cp_protect_cleanup_actions): Make non-static and remove prototype.
1703 (doing_eh): New, moved from except.c but removed the do_warning flag.
1704 (expand_start_catch_block): Update doing_eh call.
1705 (expand_end_catch_block): Likewise.
1706 (build_throw): Likewise.
1707 * cp-tree.h: Prototype cp_protect_cleanup_actions.
1708 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
1709 cp_protect_cleanup_actions.
1710 * Make-lang.in: Update dependencies.
1712 2010-06-26 Jason Merrill <jason@redhat.com>
1714 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
1715 constructor called with a single argument that takes a reference
1716 to the constructor's class.
1717 (BAD_CONVERSION_RANK): New.
1718 (compare_ics): Use it to compare bad ICSes.
1720 2010-06-25 Joseph Myers <joseph@codesourcery.com>
1722 * lang-specs.h: Remove +e handling.
1724 2010-06-24 Andi Kleen <ak@linux.intel.com>
1726 * parser.c: (cp_parser_question_colon_clause):
1727 Switch to use cp_lexer_peek_token.
1728 Call warn_for_omitted_condop. Call pedwarn for omitted
1731 2010-06-22 Jakub Jelinek <jakub@redhat.com>
1734 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
1735 datum and mark_rvalue_use on component.
1738 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
1739 the CALL_EXPR has no arguments.
1741 2010-06-21 Jason Merrill <jason@redhat.com>
1743 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
1745 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
1748 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
1750 * name-lookup.c (struct arg_lookup): Convert namespaces and
1751 classes fields to VEC.
1752 (arg_assoc_namespace): Adjust for new type of namespaces.
1753 (arg_assoc_class): Adjust for new type of classes.
1754 (lookup_arg_dependent): Use make_tree_vector and
1755 release_tree_vector.
1756 * typeck2.c (build_x_arrow): Use vec_member.
1758 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
1761 * error.c (dump_decl): Better wording for anonymous namespace.
1763 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
1765 * class.c (build_vtbl_initializer): Adjust computation of new_position
1766 and which entry to add padding for.
1768 2010-06-16 Jason Merrill <jason@redhat.com>
1770 * except.c (check_noexcept_r): Return the problematic function.
1771 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
1772 * pt.c (tsubst_copy_and_build): Pass it.
1773 * parser.c (cp_parser_unary_expression): Likewise.
1774 * cp-tree.h: Adjust prototype.
1776 * method.c (defaulted_late_check): Give the defaulted method
1777 the same exception specification as the implicit declaration.
1779 2010-06-15 Jason Merrill <jason@redhat.com>
1781 * class.c (add_implicitly_declared_members): Implicit assignment
1782 operators can also be virtual overriders.
1783 * method.c (lazily_declare_fn): Likewise.
1785 * call.c (convert_like_real): Give "initializing argument of"
1786 information for ambiguous conversion. Give source position
1789 * call.c (print_z_candidates): Do print viable deleted candidates.
1790 (joust): Don't choose a deleted function just because its worst
1791 conversion is better than another candidate's worst.
1793 * call.c (convert_like_real): Don't complain about
1794 list-value-initialization from an explicit constructor.
1796 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
1797 DECL_SOURCE_LOCATION directly.
1799 * class.c (type_has_user_provided_default_constructor): Use
1802 * call.c (is_subseq): Handle ck_aggr, ck_list.
1803 (compare_ics): Treat an aggregate or ambiguous conversion to the
1804 same type as involving the same function.
1806 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
1808 * typeck.c (convert_for_assignment): Fix comment. Change message
1809 format from %d to %qP.
1810 (convert_for_initialization): Fix comment.
1812 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
1814 * cp-tree.h (expr_list_kind): New type.
1815 (impl_conv_rhs): New type.
1816 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
1818 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
1819 diagnostics for easy translation. Change caller.
1820 (convert_for_initialization): Use impl_conv_rhs and change caller.
1821 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
1822 diagnostics for easy translation. Change caller.
1823 * decl.c (bad_spec_place): New enum.
1824 (bad_specifiers): Use it and emit the diagnostics for easy
1825 translation. Change caller.
1826 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
1828 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1830 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
1832 * decl2.c (cp_write_global_declarations): Adjust for new type of
1833 decl_namespace_list.
1834 * name-lookup.c (current_decl_namespace): Likewise.
1835 (push_decl_namespace): Likewise.
1836 (pop_decl_namespace): Likewise.
1838 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1840 * call.c (build_java_interface_fn_ref): Call build_function_type_list
1841 instead of build_function_type.
1842 * decl.c (cxx_init_decl_processing): Likewise.
1843 (declare_global_var): Likewise.
1844 (get_atexit_node): Likewise.
1845 (expand_static_init): Likewise.
1846 * decl2.c (start_objects): Likewise.
1847 (start_static_storage_duration_function): Likewise.
1848 * except.c (init_exception_processing): Likewise.
1849 (build_exc_ptr): Likewise.
1850 (build_throw): Likewise.
1851 * rtti.c (throw_bad_cast): Likewise.
1852 (throw_bad_typeid): Likewise.
1853 (build_dynamic_cast_1): Likewise.
1855 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1857 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
1858 (build_op_delete_call): Likewise.
1859 (build_over_call): Likewise.
1860 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1861 * pt.c (process_partial_specialization): Likewise.
1862 (tsubst_template_args): Likewise.
1863 * semantics.c (finish_asm_stmt): Likewise.
1865 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
1867 * decl.c (record_key_method_defined): New, broken out of ...
1868 (finish_function): ... here. Call it.
1869 (start_decl): Treat aliases as definitions.
1871 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1873 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
1875 * pt.c (maybe_process_partial_specialization): Likewise.
1876 (register_specialization): Likewise.
1877 (add_pending_template): Likewise.
1878 (lookup_template_class): Likewise.
1879 (push_tinst_level): Likewise.
1881 * parser.c (cp_lexer_new_main): Likewise.
1882 (cp_lexer_new_from_tokens): Likewise.
1883 (cp_token_cache_new): Likewise.
1884 (cp_parser_context_new): Likewise.
1885 (cp_parser_new): Likewise.
1886 (cp_parser_nested_name_specifier_opt): Likewise.
1887 (cp_parser_template_id): Likewise.
1889 * name-lookup.c (binding_entry_make): Likewise.
1890 (binding_table_construct): Likewise.
1891 (binding_table_new): Likewise.
1892 (cxx_binding_make): Likewise.
1893 (pushdecl_maybe_friend): Likewise.
1894 (begin_scope): Likewise.
1895 (push_to_top_level): Likewise.
1897 * lex.c (init_reswords): Likewise.
1898 (retrofit_lang_decl): Likewise.
1899 (cxx_dup_lang_specific_decl): Likewise.
1900 (copy_lang_type): Likewise.
1901 (cxx_make_type): Likewise.
1903 * decl.c (make_label_decl): Likewise.
1904 (check_goto): Likewise.
1905 (start_preparsed_function): Likewise.
1906 (save_function_data): Likewise.
1908 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
1910 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1912 * class.c (finish_struct_1): Likewise.
1914 * cp-tree.h (struct lang_type): Add variable_size GTY option.
1915 (struct lang_decl): Likewise.
1917 * parser.c (cp_parser_new): Update comment to not reference
1920 2010-06-07 Jason Merrill <jason@redhat.com>
1923 * error.c (dump_parameters): Mask out TFF_SCOPE.
1924 (dump_simple_decl): Don't print the scope of a PARM_DECL.
1925 (dump_scope): Remove no-op mask.
1928 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
1930 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
1931 * init.c (build_offset_ref): Use it.
1932 * pt.c (maybe_process_partial_specialization): Use it.
1933 (instantiate_class_template): Use it.
1934 * search.c (lookup_base): Use it.
1936 2010-06-07 Jakub Jelinek <jakub@redhat.com>
1939 * expr.c (mark_exp_read): Handle INDIRECT_REF.
1940 * cvt.c (convert_to_void): Handle INDIRECT_REF like
1941 handled_component_p.
1944 * decl.c (initialize_local_var): If TREE_USED is set on the type,
1945 set also DECL_READ_P on the decl.
1947 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1950 * cp-tree.h (typedef_variant_p): Move this declaration to
1952 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1953 * decl.c (grokdeclarator): Do not rename debug info of an
1954 anonymous tagged type named by a typedef.
1956 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
1959 * class.c (check_field_decls): Move the call to
1960 check_bitfield_decl before trying to set the
1961 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
1963 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
1965 * typeck.c: Update include path for moved files.
1968 * cp-gimplify.c: Likewise.
1969 * cp-lang.c: Likewise.
1971 * semantics.c: Likewise.
1972 * cxx-pretty-print.h: Likewise.
1973 * decl2.c: Likewise.
1974 * parser.c: Likewise.
1975 * cp-objcp-common.c: Likewise.
1976 * cp-tree.h: Likewise.
1977 * name-lookup.c: Likewise.
1979 * name-lookup.h: Likewise.
1980 * config-lang.in: Update paths in gtfiles for files in c-family/.
1981 * Make-lang.in: Likewise.
1983 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
1985 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
1986 * typeck.c (build_ptrmemfunc): Likewise.
1988 2010-06-04 Jason Merrill <jason@redhat.com>
1990 * typeck2.c (merge_exception_specifiers): Adjust merging of
1991 throw() and noexcept(true).
1993 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
1994 using an uninitialized variable.
1996 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
1997 (pp_cxx_expression): Likewise.
1999 Implement noexcept-specification (15.4)
2000 * parser.c (cp_parser_exception_specification_opt): Parse it.
2001 Give -Wdeprecated warning about throw() specs.
2002 * pt.c (tsubst_exception_specification): Handle it.
2003 * error.c (dump_exception_spec): Handle it.
2004 (dump_expr): Handle NOEXCEPT_EXPR.
2005 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
2006 * typeck.c (comp_except_specs): Handle compatibility rules.
2007 Change exact parm to take an enum.
2008 * typeck2.c (merge_exception_specifiers): Handle noexcept.
2009 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
2010 (type_throw_all_p, build_noexcept_spec): New fns.
2011 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
2012 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
2013 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
2014 (noexcept_true_spec, noexcept_false_spec): New macros.
2015 * name-lookup.c (pushdecl_maybe_friend): Adjust.
2016 * search.c (check_final_overrider): Adjust.
2017 * decl.c (check_redeclaration_exception_specification): Adjust.
2018 (use_eh_spec_block): Use type_throw_all_p.
2019 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
2020 Give operator new a noexcept-specification in C++0x mode.
2021 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
2022 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
2024 Implement noexcept operator (5.3.7)
2025 * cp-tree.def (NOEXCEPT_EXPR): New.
2026 * except.c (check_noexcept_r, finish_noexcept_expr): New.
2027 * cp-tree.h: Declare finish_noexcept_expr.
2028 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
2029 * pt.c (tsubst_copy_and_build): And tsubst it.
2030 (type_dependent_expression_p): Handle it.
2031 (value_dependent_expression_p): Handle it.
2033 * call.c (build_conditional_expr): Never fold in unevaluated context.
2034 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
2035 * semantics.c (simplify_aggr_init_expr): Likewise.
2036 * typeck.c (merge_types): Call merge_exception_specifiers.
2037 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
2038 DECL_ANTICIPATED for preferring new type.
2040 2010-06-04 Joseph Myers <joseph@codesourcery.com>
2042 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
2045 2010-06-04 Jakub Jelinek <jakub@redhat.com>
2048 * typeck.c (build_class_member_access_expr): Call mark_exp_read
2049 on object for static data members.
2051 2010-06-04 Jakub Jelinek <jakub@redhat.com>
2052 Jason Merrill <jason@redhat.com>
2055 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
2056 with the same type, call mark_lvalue_use on both.
2058 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
2060 * class.c (struct vtbl_init_data_s): Remove last_init field.
2061 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
2063 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
2065 (build_vtt): Likewise.
2066 (initialize_vtable): Take a VEC instead of a tree.
2067 (build_vtt_inits): Change return type to void. Take a VEC **
2068 instead of a tree *; accumulate results into said VEC.
2069 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
2070 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
2071 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
2073 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
2074 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
2076 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
2077 rather than tree_cons.
2078 (build_vbase_offset_vtbl_entries): Likewise.
2079 (add_vcall_offset): Likewise.
2080 (build_rtti_vtbl_entries): Likewise.
2081 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
2082 * decl.c (initialize_artificial_var): Use build_constructor instead
2083 of build_constructor_from_list.
2085 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
2088 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
2091 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
2093 * parser.c (cp_parser_mem_initializer_list): Change error text.
2095 2010-06-02 Jakub Jelinek <jakub@redhat.com>
2097 * cp-objcp-common.c (shadowed_var_for_decl): Change into
2098 tree_decl_map hashtab from tree_map.
2099 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
2100 (init_shadowed_var_for_decl): Adjust initialization.
2103 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
2104 instead of calling mark_exp_read only when not an assignment.
2107 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
2108 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
2109 Set DECL_VALUE_EXPR on var.
2111 2010-06-02 Jason Merrill <jason@redhat.com>
2113 * error.c (dump_type): Improve typedef handling.
2118 * name-lookup.c (same_entity_p): New.
2119 (ambiguous_decl): Multiple declarations of the same entity
2122 2010-06-01 Jason Merrill <jason@redhat.com>
2125 * call.c (add_list_candidates): Prefer the default constructor.
2126 (build_aggr_conv): Treat missing initializers like { }.
2127 * typeck2.c (process_init_constructor_record): Likewise.
2128 * init.c (expand_default_init): Use digest_init for
2129 direct aggregate initialization, too.
2131 * call.c (add_list_candidates): Split out...
2132 (build_user_type_conversion_1): ...from here.
2133 (build_new_method_call): And here.
2134 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
2137 * call.c (build_list_conv): Set list-initialization flags properly.
2139 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
2141 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
2143 2010-06-01 Arnaud Charlet <charlet@adacore.com>
2144 Matthew Gingell <gingell@adacore.com>
2146 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
2147 * decl2.c: Include langhooks.h and c-ada-spec.h.
2148 (cpp_check, collect_source_refs, collect_ada_namespace,
2149 collect_all_refs): New functions.
2150 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
2151 * lang-specs.h: Ditto.
2153 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2155 * cp-tree.h (cp_build_function_call_nary): Declare.
2156 * typeck.c (cp_build_function_call_nary): Define.
2157 * decl.c (register_dtor_fn): Use it instead of
2158 cp_build_function_call.
2159 (cxx_maybe_build_cleanup): Likewise.
2160 * decl2.c (generate_ctor_or_dtor_function): Likewise.
2161 * except.c (do_get_exception_ptr): Likewise.
2162 (do_begin_catch): Likewise.
2163 (do_allocate_exception): Likewise.
2164 (do_free_exception): Likewise.
2165 (build_throw): Likewise. Use cp_build_function_call_vec instead
2166 of cp_build_function_call.
2167 (do_end_catch): Likewise.
2169 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2171 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
2172 (struct cp_declarator): Move id_loc field up.
2174 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2176 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
2177 this file is included before c-common.h. Define GCC_DIAG_STYLE
2178 before including diagnostic-core.h and toplev.h.
2179 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
2180 * pt.c: Include cp-tree.h before c-common.h.
2182 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2184 * tree.c (c_register_addr_space): Add stub.
2186 2010-05-28 Joseph Myers <joseph@codesourcery.com>
2188 * g++spec.c (lang_specific_driver): Use fatal_error instead of
2191 2010-05-28 Dodji Seketeli <dodji@redhat.com>
2193 Revert fix of PR c++/44188
2194 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
2196 * tree.c (typedef_variant_p): Revert moving this definition to
2198 * decl.c (grokdeclarator): Revert naming typedef handling.
2200 2010-05-27 Joseph Myers <joseph@codesourcery.com>
2202 * call.c: Include diagnostic-core.h instead of diagnostic.h.
2203 * cp-lang.c: Don't include diagnostic.h
2204 * name-lookup.c: Include diagnostic-core.h instead of
2206 (cp_emit_debug_info_for_using): Use seen_error.
2207 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
2208 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
2209 * pt.c (iterative_hash_template_arg): Use seen_error.
2210 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
2211 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
2212 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
2213 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
2216 2010-05-25 Dodji Seketeli <dodji@redhat.com>
2219 * cp-tree.h (typedef_variant_p): Move this declaration to
2221 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
2222 * decl.c (grokdeclarator): Do not rename debug info of an
2223 anonymous tagged type named by a typedef.
2225 2010-05-27 Jason Merrill <jason@redhat.com>
2228 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
2231 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
2234 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
2235 * class.c (layout_class_type): Likewise.
2236 * decl.c (finish_enum): Likewise.
2237 * mangle.c (write_builitin_type): Likewise.
2239 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
2241 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
2243 * decl.c (grokdeclarator): Handle __int128.
2244 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
2245 (cp_parser_simple_type_specifier): Likewise.
2246 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
2247 * typeck.c (cp_common_type): Handle __int128.
2248 * mangle.c (integer_type_codes): Add itk_int128 and
2249 itk_unsigned_int128.
2251 2010-05-26 Jason Merrill <jason@redhat.com>
2254 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
2257 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2259 * cp-lang.c: Do not include expr.h.
2261 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2263 * decl.c: Do not include rtl.h
2264 * semantics.c: Likewise.
2266 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
2268 * cp-tree.h: Do not include splay-tree.h.
2269 (struct prtmem_cst): Remove unused field and false comment.
2270 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
2271 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
2272 * init.c: Do not include rtl.h and expr.h.
2273 * class.c: Do not include rtl.h. Include splay-tree.h.
2274 (build_clone): Use plain NULL instead of NULL_RTX.
2275 * decl.c: Do not include expr.h. Explain why rtl.h has to be
2276 included. Include splay-tree.h.
2277 * method.c: Do not include rtl.h and expr.h.
2278 (use_thunk): Use plain NULL instead of NULL_RTX.
2279 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
2280 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
2281 and target.h. Include splay-tree.h.
2282 * expr.c: Do not include rtl.h and expr.h.
2283 * pt.c: Do not include obstack.h and rtl.h.
2284 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
2285 (tsubst_decl): Likewise.
2286 (instantiate_decl): Likewise.
2287 * semantics.c: Do not include exprt.h and debug.h. Explain why
2288 rtl.h has to be included.
2289 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
2290 * call.c: Do not include rtl.h and expr.h.
2291 * search.c: Do not include obstack.h and rtl.h.
2292 * friend.c: Do not include rtl.h and expr.h.
2293 * Make-lang.in: Update dependencies.
2295 2010-05-25 Jakub Jelinek <jakub@redhat.com>
2298 * parser.c (non_integral_constant): Add NIC_NONE.
2299 (required_token): Add RT_NONE.
2300 (cp_parser_unary_expression): Initialize non_constant_p
2302 (cp_parser_asm_definition): Initialize missing to RT_NONE.
2303 (cp_parser_primary_expression, cp_parser_postfix_expression,
2304 cp_parser_cast_expression, cp_parser_binary_expression,
2305 cp_parser_functional_cast): Fix formatting.
2307 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
2310 * parser.c: Remove inclusion of dyn-string.h.
2311 (non_integral_constant): New enum.
2312 (name_lookup_error): New enum.
2313 (required_token): New enum.
2314 (cp_parser_required_error): New function.
2315 (cp_parser_require): Change the type of variable token_desc to
2316 required_token and use cp_parser_required_error.
2317 (cp_parser_require_keyword): Likewise.
2318 (cp_parser_error): Use gmsgid as parameter.
2319 (cp_parser_name_lookup_error): Change the type of variable desired to
2320 name_lookup_error and put the diagnostic in the full sentences. Change
2322 (cp_parser_non_integral_constant_expression): Change the type of the
2323 variable thing to non_integral_constant and put the diagnostics in
2324 full sentences. Change caller.
2326 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
2329 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
2331 2010-05-24 Joseph Myers <joseph@codesourcery.com>
2333 * error.c (cp_diagnostic_starter): Update call to
2334 diagnostic_build_prefix.
2335 (cp_print_error_function,
2336 print_instantiation_partial_context_line): Check show_column flag
2339 2010-05-24 Jason Merrill <jason@redhat.com>
2342 * decl.c (check_initializer): Don't wrap an init-list in a
2344 * init.c (build_aggr_init): Don't assume copy-initialization if
2345 init has CONSTRUCTOR_IS_DIRECT_INIT.
2346 * call.c (build_new_method_call): Sanity check.
2348 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
2350 * rtti.c (tinfo_base_init): Use build_constructor instead of
2351 build_constructor_from_list. Don't cons a tree node for
2353 (generic_initializer): Use build_constructor_single instead of
2354 build_constructor_from_list.
2355 (ptr_initializer): Use build_constructor instead of
2356 build_constructor_from_list
2357 (ptm_initializer): Likewise.
2358 (class_initializer): Likewise. Take varargs instead of TRAIL.
2359 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
2360 build_constructor instead of build_constructor_from_list.
2362 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
2364 * semantics.c: Include bitmap.h.
2365 * Make-lang.in: Update dependencies.
2367 2010-05-22 Jan Hubicka <jh@suse.cz>
2369 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
2371 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
2373 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2375 * cxx-pretty-print.c: Correct merge error.
2377 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2379 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
2380 (cp_print_error_function): Use diagnostic_abstract_origin macro.
2381 (cp_printer): Handle %K here using percent_K_format.
2382 * cxx-pretty-print.c: Include tree-pretty-print.h.
2383 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
2386 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
2388 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
2389 Clean up redundant includes.
2391 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2394 * decl.c (xref_basetypes): Return false in case of ill-formed
2397 2010-05-19 Jason Merrill <jason@redhat.com>
2399 * call.c (reference_binding): Use cp_build_qualified_type_real
2400 and cp_type_quals consistently.
2401 (add_function_candidate): Likewise.
2402 (build_conditional_expr): Likewise.
2403 (convert_like_real): Likewise.
2404 (type_passed_as): Likewise.
2405 * class.c (add_method): Likewise.
2406 (same_signature_p): Likewise.
2407 (layout_class_type): Likewise.
2408 * decl.c (cxx_init_decl_processing): Likewise.
2409 (cp_fname_init): Likewise.
2410 (grokdeclarator): Likewise.
2411 * decl2.c (cp_reconstruct_complex_type): Likewise.
2412 * init.c (build_new_1): Likewise.
2413 * method.c (do_build_copy_constructor): Likewise.
2414 (implicitly_declare_fn): Likewise.
2415 * pt.c (tsubst_aggr_type): Likewise.
2417 * rtti.c (init_rtti_processing): Likewise.
2418 (build_headof): Likewise.
2419 (build_dynamic_cast_1): Likewise.
2420 (tinfo_base_init): Likewise.
2421 (emit_support_tinfos): Likewise.
2422 * semantics.c (capture_decltype): Likewise.
2423 * tree.c (cv_unqualified): Likewise.
2424 * typeck.c (composite_pointer_type): Likewise.
2425 (string_conv_p): Likewise.
2427 * mangle.c (write_CV_qualifiers_for_type): Tweak.
2429 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
2430 * decl.c (start_decl): Likewise.
2431 * semantics.c (finish_compound_literal): Likewise.
2432 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
2433 (cp_type_readonly): Remove.
2434 * cp-tree.h: Remove declaration.
2436 * typeck.c (merge_types): Preserve memfn quals.
2438 * decl.c (grokdeclarator): Don't check quals on fn type.
2439 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
2440 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
2443 * typeck.c (type_memfn_quals): New fn.
2444 (apply_memfn_quals): New fn.
2445 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
2446 (cp_type_readonly): Use cp_type_quals.
2447 * cp-tree.h: Add declarations.
2448 * tree.c (cp_build_qualified_type_real): Don't set, but do
2449 preserve, quals on FUNCTION_TYPE.
2450 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
2451 * decl.c (build_ptrmem_type): Likewise.
2452 (grokdeclarator): Likewise.
2453 (static_fn_type): Likewise.
2454 * decl2.c (change_return_type): Likewise.
2455 (cp_reconstruct_complex_type): Likewise.
2456 * pt.c (tsubst_function_type): Likewise.
2458 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
2460 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
2462 * tree.c (build_min_non_dep_call_vec): Update comment.
2464 2010-05-17 Jason Merrill <jason@redhat.com>
2466 * call.c (struct z_candidate): Add explicit_targs field.
2467 (add_template_candidate_real): Set it.
2468 (build_over_call): Use it to control init-list warning.
2471 * call.c (build_over_call): Limit init-list deduction warning to
2472 cases where the argument is actually an init-list.
2475 * call.c (build_over_call): Don't do bitwise copy for move ctor.
2477 2010-05-17 Dodji Seketeli <dodji@redhat.com>
2478 Jason Merrill <jason@redhat.com>
2481 * decl.c (compute_array_index_type): Call mark_rvalue_use.
2483 2010-05-15 Jason Merrill <jason@redhat.com>
2485 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
2486 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
2488 (finish_eh_spec_block): Adjust.
2490 2010-05-15 Jakub Jelinek <jakub@redhat.com>
2493 * pt.c (tsubst): Unshare template argument.
2495 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
2497 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
2498 * Make-lang.in: Fix dependencies accordingly.
2500 2010-05-14 Jason Merrill <jason@redhat.com>
2503 * except.c (build_throw): Simplify, adjust for DR 475.
2506 * except.c (dtor_nothrow): Return nonzero for type with
2510 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
2511 gimple_build_eh_must_not_throw.
2513 2010-05-14 Martin Jambor <mjambor@suse.cz>
2515 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
2518 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
2520 * call.c (build_new_method_call): Change warning text.
2521 * typeck2.c (build_functional_cast): Change error text.
2523 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
2526 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
2527 shadowing the outer parameter or variables by the declaration of
2528 nested function in nested structure or class. Warn the shadowing by
2529 the declaration of nested lambda expression.
2531 2010-05-13 Jason Merrill <jason@redhat.com>
2533 * typeck.c (cp_build_array_ref): Factor out from...
2534 (build_array_ref): ...here. Drop complain parm.
2535 (build_new_op): Adjust.
2536 * class.c (build_vtbl_ref_1): Adjust.
2537 * decl2.c (grok_array_decl): Adjust.
2538 * cp-tree.h: Adjust prototypes.
2540 2010-05-13 Jan Hubicka <jh@suse.cz>
2542 * decl.c (cp_finish_decl): Do not worry about used attribute.
2544 2010-05-12 Jason Merrill <jason@redhat.com>
2546 * typeck.c (build_array_ref): Take complain parm.
2547 * cp-tree.h: Add it to prototype.
2548 * call.c (build_new_op): Pass it.
2549 * class.c (build_vtbl_ref): Pass it.
2550 * decl2.c (grok_array_decl): Pass it.
2554 * cp-tree.def (NULLPTR_TYPE): Remove.
2555 * cp-tree.h (NULLPTR_TYPE_P): New.
2556 (SCALAR_TYPE_P): Use it.
2557 (nullptr_type_node): New.
2558 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
2559 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
2561 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
2562 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2563 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
2564 * mangle.c (write_type): Likewise.
2565 * name-lookup.c (arg_assoc_type): Likewise.
2566 * typeck.c (build_reinterpret_cast_1): Likewise.
2567 * rtti.c (typeinfo_in_lib_p): Likewise.
2568 (emit_support_tinfos): Remove local nullptr_type_node.
2570 * cp-tree.h (UNKNOWN_TYPE): Remove.
2571 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
2572 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
2573 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
2574 * class.c (instantiate_type): Check unknown_type_node rather than
2576 * name-lookup.c (maybe_push_decl): Likewise.
2577 * rtti.c (get_tinfo_decl_dynamic): Likewise.
2578 (get_typeid): Likewise.
2579 * semantics.c (finish_offsetof): Likewise.
2582 * call.c (add_template_candidate_real): If deduction fails, still
2583 add the template as a non-viable candidate.
2584 (equal_functions): Handle template candidates.
2585 (print_z_candidate): Likewise.
2586 (print_z_candidates): Likewise.
2587 (build_new_function_call): Likewise.
2589 * cp-tree.h (LOOKUP_LIST_ONLY): New.
2590 * call.c (add_candidates): Enforce it.
2591 (build_new_method_call): Try non-list ctor if no viable list ctor.
2592 (build_user_type_conversion_1): Likewise.
2594 * call.c (add_candidates): Distinguish between type(x) and
2596 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
2597 (build_new_method_call): Give better error for conversion op.
2599 * call.c (add_candidates): Add first_arg and return_type parms.
2600 Add special constructor/conversion op handling.
2601 (convert_class_to_reference): Use it.
2602 (build_user_type_conversion_1): Likewise.
2603 (build_op_call): Likewise.
2604 (build_new_method_call): Likewise.
2605 (build_new_op): Adjust.
2606 (perform_overload_resolution): Adjust.
2608 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
2613 * pt.c (process_partial_specialization): Return error_mark_node
2614 in case of unused template parameters in partial specialization.
2616 2010-05-11 Jakub Jelinek <jakub@redhat.com>
2619 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
2620 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
2621 look at its second operand.
2623 2010-05-10 Jason Merrill <jason@redhat.com>
2626 * semantics.c (baselink_for_fns): Revert earlier change.
2629 * typeck.c (cp_build_modify_expr): Complain about assignment to
2630 array from init list.
2632 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
2635 * decl.c (check_initializer): strip array type before checking for
2636 uninitialized const or ref members.
2638 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
2641 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
2642 error count. Emit errors only if compain is true.
2643 (build_new_1): Do not return error_mark_node if
2644 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
2645 errors. Delay the check for user-provided constructor.
2646 (perform_member_init): Adjust.
2647 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
2650 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
2651 Jason Merrill <jason@redhat.com>
2653 Add support for C++0x nullptr.
2654 * cp-tree.def: Add NULLPTR_TYPE.
2655 * cp-tree.h: Add nullptr_node.
2656 (cp_tree_index): Add CPTI_NULLPTR.
2657 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
2658 * call.c (null_ptr_cst_p): Handle nullptr.
2659 (standard_conversion): Likewise.
2660 (convert_arg_to_ellipsis): Likewise.
2661 * mangle.c (write_type): Likewise.
2662 * name-lookup.c (arg_assoc_type): Likewise.
2663 * parser.c (cp_parser_primary_expression): Likewise.
2664 * typeck.c (cp_build_binary_op): Likewise.
2665 (build_reinterpret_cast_1): Likewise.
2666 * error.c (dump_type): Likewise.
2667 (dump_type_prefix, dump_type_suffix): Likewise.
2668 * decl.c (cxx_init_decl_processing): Likewise.
2669 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2670 * cvt.c (ocp_convert): Likewise.
2671 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
2672 nullptr_t tinfo in libsupc++.
2674 2010-05-06 Jason Merrill <jason@redhat.com>
2676 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
2678 2010-04-22 Jakub Jelinek <jakub@redhat.com>
2679 Dodji Seketeli <dodji@redhat.com>
2682 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
2684 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
2685 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
2686 (decay_conversion, perform_integral_promotions): Call rvalue_use.
2687 (cp_build_unary_op): Call lvalue_use.
2688 * decl.c (unused_but_set_errorcount): New variable.
2689 (poplevel): Issue -Wunused-but-set-variable diagnostics.
2690 (duplicate_decls): Merge DECL_READ_P flags.
2691 (start_cleanup_fn): Set DECL_READ_P flag.
2692 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
2693 * tree.c (rvalue): Call rvalue_use.
2694 * pt.c (convert_nontype_argument): Likewise.
2695 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
2696 finish_decltype_type): Likewise.
2697 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
2698 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
2699 or rvalue_use depending on the expr.
2700 * init.c (build_new, build_delete): Likewise.
2701 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
2703 2010-05-05 Jason Merrill <jason@redhat.com>
2706 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
2707 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
2709 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2712 * pt.c (unify): Check each elt for error_mark_node.
2714 2010-05-04 Jason Merrill <jason@redhat.com>
2717 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
2719 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2722 * call.c (build_new_method_call): Return error_mark_node if fns is
2725 2010-05-03 Dodji Seketeli <dodji@redhat.com>
2728 * pt.c (most_specialized_class): Pretend we are processing
2729 a template decl during the call to coerce_template_parms.
2731 2010-05-03 Jason Merrill <jason@redhat.com>
2735 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
2736 from the selected underlying type unless -fstrict-enums. Set
2737 ENUM_UNDERLYING_TYPE to have the restricted range.
2738 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
2739 * class.c (check_bitfield_decl): Likewise.
2741 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
2744 * init.c (build_new_1): Revert the accidental checkin in
2747 2010-04-30 Jason Merrill <jason@redhat.com>
2750 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
2751 (pp_cxx_type_specifier_seq): ...here.
2753 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
2755 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
2756 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
2758 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
2761 * typeck.c (warn_args_num): New function.
2762 (convert_arguments): Use warn_args_num to print the diagnostic
2765 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
2768 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
2769 user-provided constructor while recursing.
2771 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
2774 * error.c (print_instantiation_partial_context_line): Handle
2775 recursive instantiation.
2776 (print_instantiation_partial_context): Likewise.
2778 2010-04-27 Jason Merrill <jason@redhat.com>
2780 * init.c (perform_member_init): Check CLASS_TYPE_P.
2782 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2785 * init.c (perform_member_init): check for uninitialized const or
2786 reference members, including array types.
2788 2010-04-24 Jason Merrill <jason@redhat.com>
2790 * tree.c (get_fns): Split out from get_first_fn.
2791 * cp-tree.h: Declare it.
2792 * search.c (shared_member_p): Use it.
2793 * semantics.c (finish_qualified_id_expr): Simplify.
2794 (finish_id_expression): Simplify.
2796 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
2797 whenever object is NULL_TREE. Don't do 'this' capture here.
2798 (finish_qualified_id_expr): Pass NULL_TREE.
2799 (finish_id_expression): Likewise.
2800 (lambda_expr_this_capture): Likewise.
2802 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
2803 rather than checking current_class_ref directly.
2804 (finish_call_expr): Likewise.
2807 * name-lookup.c (qualify_lookup): Disqualify lambda op().
2808 * class.c (current_nonlambda_class_type): New fn.
2809 * semantics.c (nonlambda_method_basetype): New.
2810 * cp-tree.h: Declare them.
2811 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
2813 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
2816 * semantics.c (lambda_return_type): Complain about
2820 * tree.c (cv_unqualified): Handle error_mark_node.
2823 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
2824 if we don't want errors.
2827 * class.c (convert_to_base): Add complain parameter. Pass
2828 ba_quiet to lookup_base if we don't want errors.
2829 (build_vfield_ref): Pass complain to convert_to_base.
2830 * call.c (convert_like_real): Likewise.
2831 (initialize_reference): Likewise.
2832 (perform_direct_initialization_if_possible): Pass complain to
2834 * cp-tree.h: Adjust.
2836 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2837 Jason Merrill <jason@redhat.com>
2840 * decl.c (check_for_uninitialized_const_var): Handle classes that need
2842 (check_initializer): Call it for classes that need constructing, too.
2843 * class.c (in_class_defaulted_default_constructor): New.
2844 * cp-tree.h: Declare it.
2846 2010-04-20 Jason Merrill <jason@redhat.com>
2849 * init.c (constant_value_1): Treat error_mark_node as a constant
2850 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
2851 * cvt.c (ocp_convert): Handle getting error_mark_node from
2852 integral_constant_value.
2853 * decl.c (compute_array_index_type): Likewise.
2855 2010-04-20 Dodji Seketeli <dodji@redhat.com>
2859 * typeck.c (incompatible_dependent_types_p): If one of the
2860 compared types if not a typedef then honour their main variant
2863 2010-04-20 Jakub Jelinek <jakub@redhat.com>
2865 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
2867 2010-04-19 Dodji Seketeli <dodji@redhat.com>
2870 * typeck.c (structural_comptypes): Test dependent typedefs
2871 incompatibility before testing for their main variant based
2874 2010-04-19 Jakub Jelinek <jakub@redhat.com>
2876 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
2877 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
2879 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
2881 * decl.c (cxx_init_decl_processing): Remove second argument in call to
2882 build_common_tree_nodes.
2884 2010-04-14 Jason Merrill <jason@redhat.com>
2887 * parser.c (cp_parser_parenthesized_expression_list): Change
2888 is_attribute_list parm to int to indicate whether or not to
2889 handle initial identifier specially.
2890 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
2892 2010-04-13 Jason Merrill <jason@redhat.com>
2894 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
2896 * parser.c (cp_parser_lambda_expression): Complain about lambda in
2897 unevaluated context.
2898 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
2900 2010-04-12 Jason Merrill <jason@redhat.com>
2903 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
2904 return value directly.
2906 * call.c (type_decays_to): Call cv_unqualified for non-class type.
2908 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
2911 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2912 * init.c (build_new_1): Check for uninitialized const members and
2913 uninitialized reference members, when using new without
2914 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
2915 (diagnose_uninitialized_cst_or_ref_member): Define, call
2916 diagnose_uninitialized_cst_or_ref_member_1.
2917 (diagnose_uninitialized_cst_or_ref_member_1): New function.
2919 2010-04-12 Richard Guenther <rguenther@suse.de>
2922 * semantics.c (expand_or_defer_fn_1): Do not keep extern
2923 template inline functions.
2925 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2928 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
2931 2010-04-07 Jason Merrill <jason@redhat.com>
2934 * decl.c (start_preparsed_function): Do defer nested functions.
2936 PR c++/11094, DR 408
2937 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
2938 * decl2.c (finish_static_data_member_decl): Set it.
2939 * decl.c (duplicate_decls): Propagate it.
2940 * pt.c (tsubst_decl): Don't substitute the domain of an array
2941 VAR_DECL if it's set.
2942 (regenerate_decl_from_template): Substitute it here.
2943 (type_dependent_expression_p): Return true if it's set.
2944 * semantics.c (finish_decltype_type): Instantiate such a variable.
2945 * typeck.c (cxx_sizeof_expr): Likewise.
2946 (strip_array_domain): New.
2949 * name-lookup.c (current_decl_namespace): Non-static.
2950 (pop_nested_namespace): Sanity check.
2951 * cp-tree.h: Declare current_decl_namespace.
2952 * decl.c (grokvardecl): Use it instead of current_namespace.
2953 (grokfndecl): Likewise.
2956 * pt.c (tsubst_friend_function): Instatiate a friend that has already
2959 * pt.c (print_template_statistics): New.
2960 * cp-tree.h: Declare it.
2961 * tree.c (cxx_print_statistics): Call it.
2964 * decl.c (grokvardecl): Tweak warning message.
2965 (grokfndecl): Likewise.
2967 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2970 *pt.c (tsubst_decl): Get the arguments of a specialization from
2971 the specialization template, not from the most general template.
2973 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2976 * typeck2.c (process_init_constructor_record):
2977 value-initialize members that are are not explicitely
2980 2010-04-07 Jie Zhang <jie@codesourcery.com>
2983 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
2984 when all of its elements are non-constant and have been split out.
2986 2010-04-06 Taras Glek <taras@mozilla.com>
2987 Jason Merrill <jason@redhat.com>
2989 * parser.c (cp_parser_class_specifier): Set class location to that
2990 of IDENTIFIER_NODE instead of '{' when possible.
2991 * semantics.c (begin_class_definition): Do not overide locations
2992 with less precise ones.
2994 2010-04-06 Jason Merrill <jason@redhat.com>
2997 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
3000 * pt.c (maybe_update_decl_type): Check the return value from
3003 2010-04-01 Jason Merrill <jason@redhat.com>
3005 * decl.c (next_initializable_field): No longer static.
3006 * cp-tree.h: Declare it.
3007 * call.c (build_aggr_conv): Fail if there are more initializers
3008 than initializable fields.
3010 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
3011 instead of void_zero_node.
3013 2010-03-31 Dodji Seketeli <dodji@redhat.com>
3016 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
3017 * pt.c (end_template_parm_list): Store sibling template parms of
3018 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
3019 (push_template_decl_real): Don't store the containing template decl
3020 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
3021 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
3022 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
3025 2010-03-30 Jason Merrill <jason@redhat.com>
3028 * pt.c (push_template_decl_real): Deal better with running out of
3029 scopes before running out of template parms.
3033 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
3034 function parameter context. Don't print an error if parsing
3038 * pt.c (more_specialized_fn): Don't control cv-qualifier check
3041 2010-03-26 Jason Merrill <jason@redhat.com>
3044 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
3045 c++0x mode, but not other type-names.
3047 2010-03-26 Dodji Seketeli <dodji@redhat.com>
3050 * pt.c (add_to_template_args): Support NULL ARGS;
3051 (most_specialized_class): call coerce_template_parms on
3052 template arguments passed to get_class_bindings. Use
3053 add_to_template_args.
3054 (unify): Handle VAR_DECLs.
3056 2010-03-26 Dodji Seketeli <dodji@redhat.com>
3058 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
3060 * pt.c (get_template_parms_at_level): Adjust.
3062 2010-03-25 Dodji Seketeli <dodji@redhat.com>
3065 * cp-tree.h (get_template_parms_at_level): Declare ...
3066 * pt.c (get_template_parms_at_level): ... new function.
3067 * typeck.c (get_template_parms_of_dependent_type): If a template
3068 type parm's DECL_CONTEXT isn't yet set, get its siblings from
3069 current_template_parms. Use get_template_parms_at_level. Remove
3071 (incompatible_dependent_types_p): If we get empty parms from just one
3072 of the template type parms we are comparing then the template parms are
3075 2010-03-24 Jason Merrill <jason@redhat.com>
3078 * parser.c (make_declarator): Initialize id_loc.
3079 (cp_parser_lambda_declarator_opt): And set it.
3081 2010-03-23 Jason Merrill <jason@redhat.com>
3083 Make lambda conversion op and op() non-static.
3084 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
3085 Also add the thunk function returned by the conversion op.
3086 Mark the conversion deleted if the op() is variadic.
3087 * decl2.c (mark_used): Give helpful message about deleted conversion.
3088 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
3089 * semantics.c (finish_this_expr): Adjust.
3090 * mangle.c (write_closure_type_name): Adjust.
3091 * decl.c (grok_op_properties): Don't allow it.
3092 * call.c (build_user_type_conversion_1): No static conversion ops.
3093 (build_op_call): Or op().
3095 * decl2.c (change_return_type): Fix 'this' quals.
3097 2010-03-22 Jason Merrill <jason@redhat.com>
3100 * tree.c (pod_type_p): Use old meaning in C++98 mode.
3103 * pt.c (contains_auto_r): New fn.
3104 (do_auto_deduction): Use it.
3105 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
3107 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
3110 * decl2.c (grokfield): Handle invalid initializers for member
3113 2010-03-20 Dodji Seketeli <dodji@redhat.com>
3116 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
3118 * decl2.c (vague_linkage_p): Likewise.
3120 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
3123 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
3124 false, in the cp_parser_expression_statement call.
3126 2010-03-05 Jason Merrill <jason@redhat.com>
3128 * mangle.c (mangle_decl): Give name collision error even without
3131 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
3133 * pt.c (process_partial_specialization): Use error_n instead of
3136 2010-03-03 Jason Merrill <jason@redhat.com>
3139 * mangle.c (mangle_decl): Handle VAR_DECL, too.
3141 2010-03-03 Jason Merrill <jason@redhat.com>
3144 * mangle.c: Include cgraph.h.
3145 (mangle_decl): If the mangled name will change in a later
3146 ABI version, make the later mangled name an alias.
3147 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
3148 * Make-lang.in (mangle.o): Depend on cgraph.h.
3149 * method.c (make_alias_for): Handle VAR_DECL, too.
3150 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
3151 * tree.c (no_linkage_check): Adjust.
3152 * decl.c (maybe_commonize_var): Adjust.
3153 * cp-tree.h: Adjust.
3155 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
3157 * pt.c (redeclare_class_template): Use error_n and inform_n.
3159 2010-02-27 Mark Mitchell <mark@codesourcery.com>
3162 * cp-tree.h (push_tinst_level): Declare.
3163 (pop_tinst_level): Likewise.
3164 * pt.c (push_tinst_level): Give it external linkage.
3165 (pop_tinst_level): Likewise.
3166 * mangle.c (mangle_decl_string): Set the source location to that
3167 of the decl while mangling.
3169 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
3172 * pt.c (redeclare_class_template): Return false if there are erroneous
3173 template parameters.
3175 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
3177 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
3180 2010-02-24 Jason Merrill <jason@redhat.com>
3183 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
3185 * class.c (layout_class_type): Don't give -Wabi warning for a bug
3186 in a previous ABI version.
3188 2010-02-23 Jason Merrill <jason@redhat.com>
3191 * typeck2.c (digest_init_r): Accept value init of array.
3193 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
3196 * typeck.c (convert_arguments): Update error message.
3198 2010-02-22 Mike Stump <mikestump@comcast.net>
3201 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
3203 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
3206 * error.c (print_instantiation_partial_context_line): New.
3207 (print_instantiation_partial_context): Print at most 12 contexts,
3208 skip the rest with a message.
3210 2010-02-21 Dodji Seketeli <dodji@redhat.com>
3213 * pt.c (lookup_template_class): Better support of specialization
3214 of member of class template implicit instantiation.
3216 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
3219 * call.c (conversion_null_warnings): Replace -Wconversion with
3221 * cvt.c (build_expr_type_conversion): Likewise.
3223 2010-02-18 Jason Merrill <jason@redhat.com>
3226 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
3229 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
3231 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
3232 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
3235 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
3239 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
3240 (maybe_update_decl_type): New fn.
3241 * parser.c (cp_parser_init_declarator): Use it.
3244 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
3246 2010-02-17 Jason Merrill <jason@redhat.com>
3249 * call.c (build_over_call): Don't create zero-sized assignments.
3250 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
3251 * cp-objcp-common.c (cp_expr_size): Remove.
3252 * cp-tree.h: Remove prototype.
3255 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
3256 decl we looked up doesn't match.
3259 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
3260 have an INIT_EXPR anymore.
3263 * pt.c (convert_nontype_argument): Change assert to test.
3265 2010-02-16 Jason Merrill <jason@redhat.com>
3267 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
3270 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
3271 VIEW_CONVERT_EXPR for conversions between structural equality types
3272 that the back end can't tell are the same.
3275 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
3276 cv-quals from element here.
3277 (cp_build_qualified_type_real): Not here. Preserve typedef name.
3279 2010-02-14 Jason Merrill <jason@redhat.com>
3282 * semantics.c (finish_compound_literal): Use
3283 cp_apply_type_quals_to_decl when creating a static variable.
3285 2010-02-12 Jason Merrill <jason@redhat.com>
3288 * name-lookup.h (current_binding_level): Check for null
3291 2010-02-12 Jason Merrill <jason@redhat.com>
3294 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
3296 2010-02-12 Jakub Jelinek <jakub@redhat.com>
3299 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
3302 2010-02-10 Jason Merrill <jason@redhat.com>
3305 * semantics.c (outer_lambda_capture_p): Revert.
3306 (add_capture): Only finish_member_declaration if
3307 we're in the lambda class.
3308 (register_capture_members): New.
3309 * cp-tree.h: Declare it.
3310 * parser.c (cp_parser_lambda_expression): Call it.
3312 2010-02-10 Jason Merrill <jason@redhat.com>
3315 * semantics.c (outer_lambda_capture_p): Use current_function_decl
3316 instead of current_class_type.
3318 2010-02-10 Jason Merrill <jason@redhat.com>
3320 PR c++/42983, core issue 906
3321 * method.c (defaultable_fn_check): Check virtualness.
3323 2010-02-10 Jason Merrill <jason@redhat.com>
3326 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
3328 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
3330 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
3331 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
3333 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
3334 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
3335 (cp_parser_parameter_declaration)
3336 (cp_parser_exception_specification_opt)
3337 (cp_parser_exception_declaration): Likewise.
3338 * pt.c (check_default_tmpl_args): Likewise.
3339 * search.c (lookup_field_r): Likewise.
3341 2010-02-09 Jason Merrill <jason@redhat.com>
3344 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
3346 2010-02-09 Jason Merrill <jason@redhat.com>
3349 * decl2.c (change_return_type): New fn.
3350 * semantics.c (apply_lambda_return_type): Use it.
3351 * cp-tree.h: Declare it.
3353 2010-02-05 Richard Guenther <rguenther@suse.de>
3355 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
3356 * cp-lang.c: Include gt-cp-cp-lang.h.
3357 * config-lang.in (gtfiles): Add cp/cp-lang.c.
3359 2010-02-05 Dodji Seketeli <dodji@redhat.com>
3362 * typeck.c (get_template_parms_of_dependent_type): Try getting
3363 the template parameters fromt the type itself first.
3365 2010-02-03 Jason Merrill <jason@redhat.com>
3369 * mangle.c (write_unqualified_id): Split out from write_expression.
3370 (write_unqualified_name): Call it.
3371 (write_member_name): Likewise.
3372 (write_expression): Support TEMPLATE_ID_EXPR.
3373 Disambiguate operator names.
3376 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
3379 2010-02-02 Jason Merrill <jason@redhat.com>
3382 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
3383 * optimize.c (clone_body): Remap their initializers when making base
3385 (maybe_clone_body): Complain if multiple clones aren't safe.
3387 2010-01-29 Dodji Seketeli <dodji@redhat.com>
3394 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3395 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3396 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
3397 * pt.c (coerce_template_parms, type_unification_real,
3398 expand_template_argument_pack, coerce_template_parameter_pack):
3399 Set the non default template args count.
3400 (current_template_args): Always set non defaulted
3401 template args count when compiled with --enable-checking
3402 (tsubst_template_args, type_unification_real): Propagate the non
3403 defaulted template args count.
3404 * error.c (get_non_default_template_args_count): Renamed
3405 count_non_default_template_args into this. Don't calculate the
3406 non default template argument count anymore. Use the new
3407 accessor macros above to get it.
3408 (dump_template_argument_list, dump_type, dump_decl,
3409 dump_template_parms): Adjust.
3410 * parser.c (cp_parser_template_argument_list): Always set defaulted
3411 template args count when compiled with --enable-checking.
3413 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
3415 * decl.c (redeclaration_error_message): Wrap the return messages into
3416 G_() for easy translation.
3418 2010-01-28 Jason Merrill <jason@redhat.com>
3421 * semantics.c (begin_class_definition): Don't use type_as_string.
3423 2010-01-28 Dodji Seketeli <dodji@redhat.com>
3427 * typeck.c (get_template_parms_of_dependent_type): Factorized
3428 this out of incompatible_template_type_parms_p
3429 (incompatible_dependent_types_p): Renamed
3430 incompatible_template_type_parms_p into this. Make it detect
3431 two incompatible dependent typedefs too.
3432 (structural_comptypes): Use incompatible_dependent_types_p.
3433 * pt.c (get_template_info):
3434 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
3436 2010-01-20 Janis Johnson <janis187@us.ibm.com>
3437 Jason Merrill <jason@redhat.com>
3439 * mangle.c (write_type): Mangle transparent record as member type.
3440 * semantics.c (begin_class_definition): Recognize decimal classes
3441 and set TYPE_TRANSPARENT_AGGR.
3443 2010-01-20 Jason Merrill <jason@redhat.com>
3446 * mangle.c (write_expression): Handle tree codes that have extra
3447 arguments in the middle-end.
3449 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
3452 * except.c (expand_start_catch_block): Deal correctly with
3453 do_begin_catch returning error_mark_node.
3455 2010-01-20 Jason Merrill <jason@redhat.com>
3458 * class.c (layout_class_type): Set packed_maybe_necessary for packed
3462 * semantics.c (build_lambda_object): Call mark_used on captured
3466 * decl.c (grokdeclarator): Clear type_quals for a member function
3467 declared using a typedef. Don't complain about adding cv-quals
3468 to a function typedef in C++0x mode.
3470 2010-01-20 Jakub Jelinek <jakub@redhat.com>
3472 * decl.c (create_array_type_for_decl): Remove set but not used
3473 variable error_msg. Remove break stmts after return stmts.
3475 2010-01-19 Dodji Seketeli <dodji@redhat.com>
3477 * error.c (dump_template_parms, count_non_default_template_args):
3478 Revert fix of PR c++/42634.
3480 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3483 * error.c (dump_template_parms): Use innermost template
3484 arguments before calling count_non_default_template_args.
3485 (count_non_default_template_args): We are being called with
3486 template innermost arguments now. There is no need to ensure
3489 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3492 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
3494 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3497 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
3499 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3502 *pt.c (tsubst_decl): Get the arguments of a specialization from
3503 the specialization template, not from the most general template.
3505 2010-01-16 Jason Merrill <jason@redhat.com>
3508 * semantics.c (finish_decltype_type): Within a template, treat
3509 unresolved CALL_EXPR as dependent.
3511 2010-01-15 Dodji Seketeli <dodji@redhat.com>
3513 * error.c (dump_template_parms,count_non_default_template_args):
3514 Revert changes of PR c++/42634.
3516 2010-01-14 Jakub Jelinek <jakub@redhat.com>
3519 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
3520 functions with noreturn attribute.
3522 2010-01-14 Jason Merrill <jason@redhat.com>
3525 * call.c (build_new_method_call): Don't free the vec here.
3528 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
3530 2010-01-13 Dodji Seketeli <dodji@redhat.com>
3533 * error.c (dump_template_parms): Use innermost template
3534 arguments before calling count_non_default_template_args.
3535 (count_non_default_template_args): We are being called with
3536 template innermost arguments now. There is no need to ensure
3539 2010-01-07 Dodji Seketeli <dodji@redhat.com>
3542 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
3543 arguments that were previously deduced.
3545 2010-01-05 Jason Merrill <jason@redhat.com>
3547 * pt.c (unify_pack_expansion): Handle deduction from init-list.
3548 * call.c (build_over_call): Don't complain about it.
3550 2010-01-04 Jason Merrill <jason@redhat.com>
3553 * pt.c (tsubst_decl): Don't apply type attributes in place.
3556 * semantics.c (describable_type): Remove decltype comment and
3561 Copyright (C) 2010 Free Software Foundation, Inc.
3563 Copying and distribution of this file, with or without modification,
3564 are permitted in any medium without royalty provided the copyright
3565 notice and this notice are preserved.