re PR c++/46289 (ICE in build_constexpr_constructor_member_initializers, at cp/semant...
[gcc.git] / gcc / cp / ChangeLog
1 2010-11-03 Jason Merrill <jason@redhat.com>
2
3 PR c++/46289
4 * call.c (can_convert_array): New fn.
5 (build_aggr_conv): Use it.
6
7 PR c++/46289
8 * semantics.c (build_constexpr_constructor_member_initializers):
9 Avoid ICE on error.
10
11 2010-11-02 Dodji Seketeli <dodji@redhat.com>
12
13 * cp-tree.h (enum tsubst_flags)<tf_no_class_instantiations>:
14 Remove.
15 * pt.c (tsubst): Remove the use of tf_no_class_instantiations.
16
17 2010-11-03 Jason Merrill <jason@redhat.com>
18
19 PR c++/46277
20 * init.c (expand_default_init): Avoid ICE if we can't figure out
21 which function is being called.
22
23 2010-11-02 Nathan Froyd <froydnj@codesourcery.com>
24
25 * class.c (build_base_path, add_vcall_offset): Use build_zero_cst
26 instead of fold_convert.
27 * init.c (build_zero_init): Likewise.
28 * typeck.c (cp_build_binary_op): Likewise.
29
30 2010-11-02 Dodji Seketeli <dodji@redhat.com>
31
32 PR c++/46170
33 PR c++/46162
34 * pt.c (check_valid_ptrmem_cst_expr): Add a complain parameter to
35 control diagnostic.
36 (convert_nontype_argument, convert_nontype_argument): Pass the
37 complain parameter down to check_valid_ptrmem_cst_expr.
38
39 2010-11-02 Dodji Seketeli <dodji@redhat.com>
40
41 PR c++/45606
42 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): Remove.
43 (struct template_parm_index_s)<num_siblings>: New field.
44 (TEMPLATE_PARM_NUM_SIBLINGS): New accessor.
45 (process_template_parm): Extend the API to accept the number of
46 template parms in argument.
47 (cp_set_underlying_type): Remove this.
48 * class.c (build_self_reference): Require canonical type equality
49 back on the self reference of class.
50 * decl2.c (grokfield): Require canonical type equality back on
51 typedef class fields.
52 * name-lookup.c (pushdecl_maybe_friend): Require canonical type
53 equality back on typedefs.
54 * parser.c (cp_parser_template_parameter_list): Do not require
55 canonical type equality on dependent types created during template
56 parameters parsing.
57 * pt.c (fixup_template_type_parm_type, fixup_template_parm_index)
58 (fixup_template_parm, fixup_template_parms): New private
59 functions.
60 (current_template_args): Declare this.
61 (process_template_parm): Pass the total number of template parms
62 to canonical_type_parameter.
63 (build_template_parm_index): Add a new argument to carry the total
64 number of template parms.
65 (reduce_template_parm_level, process_template_parm, make_auto):
66 Adjust.
67 (current_template_args): Fix this for template template
68 parameters.
69 (tsubst_template_parm): Split out of ...
70 (tsubst_template_parms): ... this.
71 (reduce_template_parm_level): Don't loose
72 TEMPLATE_PARM_NUM_SIBLINGS when cloning a TEMPLATE_PARM_INDEX.
73 (template_parm_to_arg): Extracted this function from
74 current_template_args. Make it represent invalid template parms
75 with an error_mark_node instead of a LIST_TREE containing an
76 error_mark_node.
77 (current_template_args): Use template_parm_to_arg.
78 (dependent_template_arg_p): Consider an invalid template argument
79 as dependent.
80 (end_template_parm_list): Do not update template sibling parms
81 here anymore. Use fixup_template_parms instead.
82 (process_template_parm): Pass the number of template parms to
83 canonical_type_parameter.
84 (make_auto): Require structural equality on auto
85 TEMPLATE_TYPE_PARM for now.
86 (unify)<BOUND_TEMPLATE_TEMPLATE_PARM>: Coerce template parameters
87 using all the arguments deduced so far.
88 (tsubst)<TEMPLATE_TYPE_PARM>: Pass the number of sibling parms to
89 canonical_type_parameter.
90 * tree.c (cp_set_underlying_type): Remove.
91 * typeck.c (get_template_parms_of_dependent_type)
92 (incompatible_dependent_types_p): Remove.
93 (structural_comptypes): Do not call incompatible_dependent_types_p
94 anymore.
95 (comp_template_parms_position): Re-organized. Take the length of
96 template parms list in account.
97
98 2010-11-01 Jason Merrill <jason@redhat.com>
99
100 * semantics.c (call_stack, call_stack_tick, cx_error_context): New.
101 (last_cx_error_tick, push_cx_call_context, pop_cx_call_context): New.
102 (cxx_eval_call_expression): Call push/pop_cx_call_context instead
103 of giving follow-on errors.
104 * error.c (maybe_print_constexpr_context): New.
105 (cp_diagnostic_starter): Call it.
106 * cp-tree.h: Declare cx_error_context.
107
108 * semantics.c (cxx_eval_constant_expression): Explain
109 unacceptable use of variable better.
110
111 2010-11-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
112 Jason Merrill <jason@redhat.com>
113
114 * call.c (null_ptr_cst_p): Use maybe_constant_value.
115 (set_up_extended_ref_temp): Support constant initialization.
116 (initialize_reference): Adjust.
117 * class.c (check_bitfield_decl): Use cxx_constant_value.
118 * cvt.c (ocp_convert): Don't use integral_constant_value when
119 converting to class type.
120 * decl.c (finish_case_label): Use maybe_constant_value.
121 (build_init_list_var_init): Support constant initialization.
122 (check_initializer): Likewise. Reorganize.
123 (cp_finish_decl): Likewise.
124 (expand_static_init): Likewise.
125 (compute_array_index_type): Use maybe_constant_value.
126 Add complain parm.
127 (create_array_type_for_decl, grokdeclarator): Pass it.
128 (build_enumerator): Use cxx_constant_value.
129 * decl2.c (grokfield): Use maybe_constant_init.
130 * except.c (check_noexcept_r): Handle constexpr.
131 (build_noexcept_spec): Use maybe_constant_value.
132 * init.c (expand_default_init): Support constant initialization.
133 (build_vec_init): Likewise.
134 (constant_value_1): Adjust.
135 (build_new_1): Adjust.
136 * parser.c (cp_parser_constant_expression): Allow non-integral
137 in C++0x mode.
138 (cp_parser_direct_declarator): Don't fold yet in C++0x mode.
139 (cp_parser_initializer_clause): Toss folded result if non-constant.
140 * pt.c (fold_decl_constant_value): Remove.
141 (convert_nontype_argument): Use maybe_constant_value. Give clearer
142 error about overflow.
143 (tsubst): Move array bounds handling into compute_array_index_type.
144 (value_dependent_expression_p): Handle constant CALL_EXPR.
145 (tsubst_decl): Don't set
146 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P yet.
147 (tsubst_expr) [DECL_EXPR]: Pass it into cp_finish_decl.
148 (instantiate_decl): Here too.
149 * semantics.c (finish_static_assert): Use maybe_constant_value.
150 (ensure_literal_type_for_constexpr_object): Make sure type is complete.
151 (potential_constant_expression): Use maybe_constant_value.
152 * tree.c (cast_valid_in_integral_constant_expression_p): Any cast
153 is potentially valid in C++0x.
154 * typeck2.c (store_init_value): Handle constant init.
155 (check_narrowing): Use maybe_constant_value.
156 (build_functional_cast): Set TREE_CONSTANT on literal T().
157 * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): Remove.
158 (LOOKUP_ALREADY_DIGESTED): New.
159 (compute_array_index_type): Adjust prototype.
160
161 * semantics.c (constexpr_call): New datatype.
162 (constexpr_call_table): New global table.
163 (constexpr_call_hash): New.
164 (constexpr_call_equal): Likewise.
165 (maybe_initialize_constexpr_call_table): Likewise.
166 (lookup_parameter_binding): Likewise.
167 (cxx_eval_builtin_function_call): Likewise.
168 (cxx_bind_parameters_in_call): Likewise.
169 (cxx_eval_call_expression): Likewise.
170 (cxx_eval_unary_expression): Likewise.
171 (cxx_eval_binary_expression): Likewise.
172 (cxx_eval_conditional_expression): Likewise.
173 (cxx_eval_array_reference): Likewise.
174 (cxx_eval_component_reference): Likewise.
175 (cxx_eval_logical_expression): Likewise.
176 (cxx_eval_object_construction): Likewise.
177 (cxx_eval_constant_expression): Likewise.
178 (cxx_eval_indirect_ref): Likewise.
179 (cxx_constant_value): Likewise.
180 (cxx_eval_bare_aggregate): Likewise.
181 (adjust_temp_type): New.
182 (reduced_constant_expression_p): New.
183 (verify_constant): New.
184 (cxx_eval_vec_init, cxx_eval_vec_init_1): New.
185 (cxx_eval_outermost_constant_expr): New.
186 (maybe_constant_value, maybe_constant_init): New.
187 (cxx_eval_constant_expression): Use them.
188 * pt.c (iterative_hash_template_arg): No longer static.
189 * cp-tree.h: Declare fns.
190
191 * cp-tree.h (register_constexpr_fundef): Declare.
192 * decl.c (maybe_save_function_definition): New.
193 (finish_function): Use it.
194 * semantics.c (constexpr_fundef): New datatype.
195 (constexpr_fundef_table): New global table.
196 (constexpr_fundef_equal): New.
197 (constexpr_fundef_hash): Likewise.
198 (retrieve_constexpr_fundef): Likewise.
199 (validate_constexpr_fundecl): Store in the table.
200 (build_data_member_initialization): New fn.
201 (build_constexpr_constructor_member_initializers): New.
202 (register_constexpr_fundef): Define.
203 (is_this_parameter): New.
204 (get_function_named_in_call): Likewise.
205 (get_nth_callarg): Likewise.
206 (check_automatic_or_tls): New.
207 (morally_constexpr_builtin_function_p): New.
208 (potential_constant_expression): New.
209
210 2010-11-01 Jason Merrill <jason@redhat.com>
211
212 * decl2.c (decl_constant_var_p): New fn.
213 (decl_maybe_constant_var_p): New fn.
214 (mark_used): Rework instantiation of things needed for constant
215 expressions.
216 * cp-tree.h: Declare new fns.
217 * pt.c (instantiate_decl): Handle cp_unevaluated_operand.
218 (always_instantiate_p): Use decl_maybe_constant_var_p.
219 (instantiate_decl): Don't defer constexpr functions.
220 * repo.c (repo_emit_p): Use decl_maybe_constant_var_p.
221 * semantics.c (finish_id_expression): Use decl_constant_var_p.
222 Check for valid name in constant expr after mark_used.
223
224 2010-10-31 Jason Merrill <jason@redhat.com>
225
226 * class.c (is_really_empty_class): Work when type is not complete.
227 (synthesized_default_constructor_is_constexpr): New.
228 (add_implicitly_declared_members): Use it.
229 (type_has_constexpr_default_constructor): Likewise.
230 * cp-tree.h: Declare it.
231 * method.c (synthesized_method_walk): Use it.
232
233 * decl.c (pop_switch): Use EXPR_LOC_OR_HERE.
234 * typeck.c (convert_for_assignment): Likewise.
235
236 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
237 message about constexpr without -std=c++0x.
238
239 * decl.c (grokdeclarator): Don't ICE on constexpr non-static data
240 member.
241
242 2010-10-30 Nathan Froyd <froydnj@codesourcery.com>
243
244 * class.c (layout_vtable_decl): Call build_array_of_n_type.
245 (build_vtt, build_ctor_vtabl_group): Likewise.
246
247 2010-10-30 Nicola Pero <nicola.pero@meta-innovation.com>
248
249 Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
250 * parser.c (cp_parser_objc_at_property_declaration): Removed
251 parsing of RID_COPIES and RID_IVAR. Updated call to
252 objc_add_property_declaration.
253 * typecheck.c (finish_class_member_access_expr): Call
254 objc_maybe_build_component_ref instead of objc_build_setter_call.
255 (cp_build_modify_expr): Call objc_maybe_build_modify_expr instead
256 of objc_build_getter_call.
257
258 2010-10-27 Jason Merrill <jason@redhat.com>
259
260 * cp-tree.h (cp_trait_kind): Add CPTK_IS_LITERAL_TYPE.
261 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle it.
262 * semantics.c (trait_expr_value, finish_trait_expr): Likewise.
263 * parser.c (cp_parser_primary_expression): Handle RID_IS_LITERAL_TYPE.
264 (cp_parser_trait_expr): Likewise.
265
266 2010-10-27 Gabriel Dos Reis <gdr@cse.tamu.edu>
267 Jason Merrill <jason@redhat.com>
268
269 * decl.c (finish_case_label): Use decl_constant_value.
270
271 * method.c (synthesized_method_walk): Track constexprness too.
272 (process_subob_fn, walk_field_subobs): Likewise.
273 (implicitly_declare_fn): Set DECL_DECLARED_CONSTEXPR_P.
274 (defaulted_late_check): Handle DECL_DECLARED_CONSTEXPR_P.
275 * class.c (add_implicitly_declared_members): Handle
276 constexpr default ctor.
277
278 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
279 Make sure a constexpr ctor has an empty body.
280 * class.c (type_has_constexpr_default_constructor): New.
281 * cp-tree.h: Declare it.
282 * init.c (perform_member_init): Complain about uninitialized
283 member in constexpr ctor.
284 (emit_mem_initializers): And uninitialized base.
285 * decl.c (check_tag_decl): Fix typo.
286
287 * semantics.c (valid_type_in_constexpr_fundecl_p): New fn.
288 (is_valid_constexpr_fn): New fn.
289 (validate_constexpr_fundecl): Use it.
290 * decl.c (validate_constexpr_redeclaration): New.
291 (duplicate_decls): Use it.
292 (cp_finish_decl): Call validate_constexpr_fundecl and
293 ensure_literal_type_for_constexpr_object here.
294 (start_decl): Not here. Don't ICE on constexpr reference.
295 (check_for_uninitialized_const_var): Don't handle constexpr specially.
296 (grokfndecl): Set DECL_DECLARED_CONSTEXPR_P.
297 (check_static_variable_definition): Give friendly message about
298 missing constexpr.
299 (grokdeclarator): Complain about typedef and volatile with constexpr.
300 Reorganize. Give sorry about non-static data members in C++0x mode.
301 (start_preparsed_function): Check validate_constexpr_fundecl here.
302 (check_function_type): Not here.
303 * decl2.c (finish_static_data_member_decl): Don't complain about
304 in-class init.
305 * parser.c (CP_PARSER_FLAGS_ONLY_TYPE_OR_CONSTEXPR): New.
306 (cp_parser_condition): Pass it to cp_parser_decl_specifier_seq.
307 (cp_parser_decl_specifier_seq): Handle it.
308 (cp_parser_explicit_instantiation): Diagnose inline and constexpr.
309
310 * class.c (check_bases): Propagate non-literality.
311 (check_field_decls): Likewise.
312 (finalize_literal_type_property): New.
313 (check_bases_and_members): Call it.
314 * cp-tree.h (TYPE_HAS_CONSTEXPR_CTOR): New.
315 (lang_type_class): Add has_constexpr_ctor field.
316 (DECL_DECLARED_CONSTEXPR_P): Strip template.
317 * decl.c (grok_special_member_properties): Set
318 TYPE_HAS_CONSTEXPR_CTOR.
319
320 2010-10-27 Jason Merrill <jason@redhat.com>
321
322 * call.c (build_integral_nontype_arg_conv): New.
323 * cp-tree.h: Declare it.
324 * pt.c (convert_nontype_argument): Use it.
325
326 * error.c (dump_simple_decl): Print constexpr.
327
328 * cvt.c (build_up_reference): Use target_type for the temporary var.
329
330 * except.c (build_throw): Set EXPR_LOCATION.
331
332 * tree.c (build_cplus_new): Handle CONSTRUCTOR.
333
334 * semantics.c (finish_compound_stmt): Avoid creating an
335 unnecessary BIND_EXPR.
336
337 * call.c (convert_like_real): Don't check narrowing if the element
338 is also an initializer-list.
339
340 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
341
342 * parser.c (cp_parser_objc_at_property_declaration): Recognize
343 RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
344 Do not use objc_set_property_attr, but use local variables
345 instead. Detect repeated usage of setter, getter and ivar
346 attributes. Improved error processing when a setter name does not
347 end in ':'. Do not check for CPP_CLOSE_PAREN after we determined
348 that the token is a keyword. Updated call to
349 objc_add_property_declaration.
350
351 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
352
353 * parser.c (cp_parser_objc_property_decl): Renamed to
354 cp_parser_objc_struct_declaration. Return the parsed trees
355 instead of calling objc_add_property_variable directly. Detect
356 missing or invalid declspecs. Implemented attributes. Do not eat
357 the ';' at the end. Exit loop whenever a non-comma is parsed, not
358 just EOF.
359 (cp_parser_objc_at_property): Renamed to
360 cp_parser_objc_at_property_declaration. Updated calls to
361 objc_add_property_variable, now objc_add_property_declaration, and
362 to cp_parser_objc_property_decl, now
363 cp_parser_objc_struct_declaration. Rewritten all code to be more
364 robust in dealing with syntax errors, and almost identical to the
365 one in c_parser_objc_at_property_declaration.
366 (cp_parser_objc_property_attrlist): Removed.
367 (cp_parser_objc_method_prototype_list): Updated call to
368 cp_parser_objc_at_property.
369 (cp_parser_objc_method_definition_list): Same change.
370 (cp_parser_objc_class_ivars): Detect a number of invalid
371 declarations of instance variables and produce errors when they
372 are found.
373
374 2010-10-26 Jason Merrill <jason@redhat.com>
375
376 * tree.c (build_vec_init_expr): Split out from...
377 (build_array_copy): ...here.
378 * init.c (perform_member_init): Use it.
379 * cp-tree.h: Declare it.
380 * cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for
381 VEC_INIT_EXPR and AGGR_INIT_EXPR here. Drop pre/post parameters.
382 (cp_gimplify_expr): Handle array default-initialization via
383 VEC_INIT_EXPR.
384
385 * tree.c (stabilize_expr): Handle xvalues properly.
386
387 * call.c (build_over_call): Use argarray[0] for 'this' argument.
388
389 * decl.c (finish_function): Don't look at function_depth.
390
391 2010-10-25 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
392
393 Implement opaque-enum-specifiers for C++0x.
394 * cp-tree.h (SET_OPAQUE_ENUM_P): New.
395 (OPAQUE_ENUM_P): New.
396 (ENUM_FIXED_UNDERLYING_TYPE_P): New.
397 (start_enum): Update prototype.
398 (finish_enum_value_list): New prototype.
399 * parser.c (cp_parser_elaborated_type_specifier): Issue a pedwarn if
400 "enum class" is used in an elaborated-type-specifier.
401 (cp_parser_enum_specifier): Rewrite to parse opaque-enum-specifiers.
402 * decl.c (copy_type_enum): New.
403 (finish_enum_value_list): New, with code from finish_enum.
404 (finish_enum): A lot of code removed. Added a gcc_assert.
405 (start_enum): Add parameters enumtype and is_new.
406 Rewrite to work with opaque-enum-specifiers.
407 * pt.c (maybe_process_partial_specialization): Allow for template
408 specialization of enumerations, with a pedwarn.
409 (lookup_template_class): Update call to start_enum. Call to
410 SET_OPAQUE_ENUM_P.
411 (tsubst_enum): Call to begin_scope, finish_scope and
412 finish_enum_value_list.
413
414 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com>
415
416 Removed Objective-C++ specific replacement of cxx_printable_name.
417 * cp-objcp-common.h: Added LANG_HOOKS_DECL_PRINTABLE_NAME, set
418 to cxx_printable_name for both C++ and Objective-C++.
419 * cp-lang.h: Removed LANG_HOOKS_DECL_PRINTABLE_NAME.
420
421 * error.c (dump_decl): For Objective-C++, call
422 objc_maybe_printable_name here ...
423 * tree.c (cxx_printable_name_internal): ... instead of here.
424
425 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com>
426
427 * tree.c (cxx_printable_name_internal): In Objective-C++, call
428 objc_maybe_printable_name.
429
430 2010-10-22 Jason Merrill <jason@redhat.com>
431
432 PR c++/46129
433 * pt.c (instantiate_class_template): Don't instantiate default
434 arguments.
435
436 PR c++/46103
437 * init.c (build_vec_init): Handle memberwise move.
438
439 2010-10-21 Paolo Carlini <paolo.carlini@oracle.com>
440
441 PR c++/46117
442 * call.c (add_function_candidate): Don't use TREE_VALUE on null
443 parmnode.
444
445 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
446
447 * parser.c (cp_parser_objc_method_type): Mark inline. Return a
448 bool instead of calling objc_set_method_type.
449 (cp_parser_objc_method_signature): Updated calls to
450 cp_parser_objc_method_type and to objc_build_method_signature.
451 (cp_parser_objc_method_prototype_list): Updated calls to
452 objc_add_method_declaration. Use token->type to determine if it
453 is a class method or not.
454 (cp_parser_objc_method_definition_list): Same change.
455
456 2010-10-20 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
457
458 PR c++/46056
459 * parser.c (cp_convert_range_for): Call cp_finish_decl
460 instead of finish_expr_stmt.
461
462 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
463
464 * cp-lang.c (finish_file): Removed.
465 * decl2.c (cp_write_global_declarations): Call
466 objc_write_global_declarations when compiling Objective-C++.
467
468 2010-10-19 Paolo Carlini <paolo.carlini@oracle.com>
469
470 PR c++/46046
471 * pt.c (add_to_template_args): Check extra_args for error_mark_node.
472 (coerce_template_parms): Likewise for args.
473
474 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
475
476 Implemented parsing @synthesize and @dynamic for Objective-C++.
477 * parser.c (cp_parser_objc_method_definition_list): Recognize
478 RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
479 (cp_parser_objc_at_dynamic_declaration): New.
480 (cp_parser_objc_at_synthesize_declaration): New.
481
482 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
483
484 * parser.c (cp_parser_objc_identifier_list): Check the return
485 value of cp_parser_identifier and react if it is error_mark_node.
486
487 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
488
489 Merge from apple/trunk branch on FSF servers.
490
491 2005-03-01 Fariborz Jahanian <fjahanian@apple.com>
492
493 Radar 4451818
494 * call.c (standard_conversion, implicit_conversion): Ignore
495 'volatile' attribute of artificially volatized type in objc when
496 evaluating various conversion weights.
497
498 2005-11-08 Fariborz Jahanian <fjahanian@apple.com>
499
500 Radar 4330422
501 * typeck.c (comp_ptr_ttypes_real): Remove the hack. un-volatize the
502 artiificially 'volatized' type before doing pointer comparison.
503
504 2010-10-18 Jakub Jelinek <jakub@redhat.com>
505
506 PR c/46015
507 * semantics.c (finish_goto_stmt): Call mark_rvalue_use on computed
508 goto destination.
509
510 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
511
512 Merge from apple/trunk branch on FSF servers.
513
514 2006-04-19 Fariborz Jahanian <fjahanian@apple.com>
515
516 Radar 4516785
517 * parser.c (cp_parser_simple_type_specifier): Don't lookup for
518 objc object types if type is scope qualified.
519
520 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
521
522 Merge from apple/trunk branch on FSF servers.
523
524 2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
525
526 Radar 4133425
527 * lex.c (unqualified_name_lookup_error): Issue diagnostic
528 for private 'ivar' access.
529
530 2010-10-17 Iain Sandoe <iains@gcc.gnu.org>
531
532 * parser.c (cp_parser_objc_visibility_spec): Update to use visibility
533 enum, and handle @package.
534
535 2010-10-15 Jason Merrill <jason@redhat.com>
536
537 PR c++/45983
538 * tree.c (cp_build_qualified_type_real): Don't reuse a variant
539 with a different typedef variant of the element type.
540
541 2010-10-14 Iain Sandoe <iains@gcc.gnu.org>
542
543 merge from FSF apple 'trunk' branch.
544 2006 Fariborz Jahanian <fjahanian@apple.com>
545
546 Radars 4436866, 4505126, 4506903, 4517826
547 * typeck.c (finish_class_member_access_expr): Handle CLASS.property
548 syntax.
549 (cp_build_modify_expr): Likewise.
550 * parser.c (cp_parser_objc_method_prototype_list): Handle @property.
551 (cp_parser_objc_method_definition_list): Likewise.
552 (cp_parser_objc_property_decl): New.
553 (cp_parser_objc_property_attrlist): New.
554 (cp_parser_objc_at_property): New.
555
556 2010-10-14 Richard Guenther <rguenther@suse.de>
557
558 PR lto/44561
559 * cp-tree.h (NULLPTR_TYPE_P): Adjust.
560 * decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node,
561 use build_int_cst.
562 * error.c (dump_type): Handle NULLPTR_TYPE.
563 (dump_type_prefix): Likewise.
564 (dump_type_suffix): Likewise.
565 * mangle.c (write_type): Likewise.
566 * name-lookup.c (arg_assoc_type): Likewise.
567 * rtti.c (typeinfo_in_lib_p): Likewise.
568 * pt.c (tsubst): Likewise.
569
570 2010-10-13 Jason Merrill <jason@redhat.com>
571
572 PR c++/45984
573 * class.c (fixup_attribute_variants): New fn.
574 * cp-tree.h: Declare it.
575 * pt.c (instantiate_class_template): Call it.
576 * semantics.c (begin_class_definition): Call it.
577
578 2010-10-13 Richard Henderson <rth@redhat.com>
579
580 * cp-lang.c (cp_eh_personality): Update call to
581 build_personality_function.
582 * except.c (choose_personality_routine): Update function comment.
583
584 2010-10-13 Richard Guenther <rguenther@suse.de>
585
586 * tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and
587 clear DECL_CHAIN of NAMESPACE_DECLs.
588
589 2010-10-11 Martin Jambor <mjambor@suse.cz>
590
591 PR c++/45562
592 * cp-tree.h (current_class_ref): Check that cp_function_chain is
593 non-NULL.
594 * call.c (build_cxx_call): Likewise.
595
596 2010-10-10 Jason Merrill <jason@redhat.com>
597
598 * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
599 (tsubst_default_arguments): Only do this once for cloned fns.
600 (tsubst): Use typedef_variant_p. Handle LANG_TYPE. Don't
601 handle expressions.
602 (tsubst_expr): Avoid calling tsubst_expr for non-expressions.
603 (tsubst_copy_and_build): Likewise.
604 (tsubst_initializer_list): Likewise.
605 (tsubst_copy): Change default to gcc_unreachable. Handle
606 OVERLOAD and PTRMEM_CST.
607
608 2010-10-10 Jason Merrill <jason@redhat.com>
609
610 PR lto/45959
611 PR lto/45960
612 * pt.c (tsubst_copy) [INTEGER_CST]: Instantiate the type.
613
614 2010-10-07 Andi Kleen <ak@linux.intel.com>
615
616 * Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
617 (cc1plus-dummy): Remove.
618 (cc1plus-checksum): Change to run checksum over object files
619 and options only.
620
621 2010-10-08 Joseph Myers <joseph@codesourcery.com>
622
623 * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
624
625 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
626
627 * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to
628 tcc_expression.
629 * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for
630 AT_ENCODE_EXPR.
631 * error.c (dump_expr): Added case for AT_ENCODE_EXPR.
632 * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR.
633 (value_dependent_expression_p): Added case for AT_ENCODE_EXPR.
634 (type_dependent_expression_p): Added case for AT_ENCODE_EXPR.
635 * parser.c (cp_parser_objc_encode_expression): Updated comment.
636
637 2010-10-07 Nicola Pero <nicola@nicola.brainstorm.co.uk>
638
639 Merge from apple/trunk branch on FSF servers.
640
641 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
642
643 Radar 4508851
644 * parser.c (cp_parser_objc_interstitial_code): Recognize
645 and parse RID_NAMESPACE keyword.
646
647 2010-10-07 Iain Sandoe <iains@gcc.gnu.org>
648
649 * parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
650 finding ellipsis, before checking for attributes.
651
652 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
653
654 Merge from apple/trunk branch on FSF servers.
655 * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
656 longer existing gcc/c-common.def.
657
658 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
659
660 Radar 4278774
661 * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
662 * parser.c (cp_parser_objc_encode_expression): Build a templatized
663 parse tree for @encode(T).
664
665 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
666
667 Radar 4278774
668 * c-common.def: Add new expression code AT_ENCODE_EXPR.
669
670 2010-10-06 Eric Botcazou <ebotcazou@adacore.com>
671
672 PR c++/45908
673 * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
674 code folding offsetof-like computations.
675
676 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
677
678 PR objc++/31125
679 * parser.c (cp_parser_objc_class_interface): If no identifier
680 follows an @interface token, stop parsing the interface after
681 printing an error.
682 (cp_parser_objc_class_implementation): If no identifier follows an
683 @implementation token, stop parsing the implementation after
684 printing an error.
685
686 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
687
688 PR objc++/23707
689 * parser.c (cp_parser_objc_method_keyword_params): If the required
690 colon is not found while parsing parameters, stop parsing them.
691
692 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
693
694 PR objc++/31126
695 * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
696 @end after detecting it. Print an error if @end is found without
697 a '}'.
698 (cp_parser_objc_method_prototype_list): Do not eat the EOF after
699 detecting it. Fixed reading the next token when continuing
700 because of an error in a method signature. Print an error if EOF
701 is found without an '@end'.
702 (cp_parser_objc_method_definition_list): Same change.
703
704 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
705
706 Merge from apple/trunk branch on FSF servers:
707
708 2005-10-17 Fariborz Jahanian <fjahanian@apple.com>
709
710 Radar 4290840
711 * parser.c (cp_parser_objc_method_keyword_params): Check for valid
712 method parameters and issue error.
713 (cp_parser_objc_method_definition_list): Check for invalid tokens
714 which cannot start a function definition.
715
716 2005-10-14 Fariborz Jahanian <fjahanian@apple.com>
717
718 Radar 4294425
719 * parser.c (cp_parser_objc_message_args): Check for missing message
720 arguments and syntax error.
721
722 2005-10-13 Fariborz Jahanian <fjahanian@apple.com>
723
724 Radar 4261146
725 * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
726 looking for '}'.
727
728 2005-08-15 Ziemowit Laski <zlaski@apple.com>
729
730 Radar 4093475
731 * parser.c (cp_parser_objc_interstitial_code): Catch stray
732 '{' and '}' tokens and issue appropriate errors.
733
734 2005-08-02 Ziemowit Laski <zlaski@apple.com>
735
736 Radar 4185810
737 (cp_parser_statement_seq_opt): In addition to '}' and
738 end-of-file, a statement sequence may also be terminated
739 by a stray '@end'.
740
741 2010-10-05 Joseph Myers <joseph@codesourcery.com>
742
743 * cp-tree.h (cxx_print_error_function,
744 cxx_initialize_diagnostics): Declare using diagnostic_context
745 typedef.
746
747 2010-10-04 Andi Kleen <ak@linux.intel.com>
748
749 * Make-lang.in (g++, cc1plus): Add + to build rule.
750
751 2010-10-04 Jason Merrill <jason@redhat.com>
752
753 * tree.c (decl_storage_duration): New.
754 * cp-tree.h: Declare it.
755 (duration_kind): Return values.
756
757 2010-10-03 Jason Merrill <jason@redhat.com>
758
759 * typeck.c (require_complete_type_sfinae): Add complain parm to...
760 (require_complete_type): ...this function.
761 (cp_build_array_ref, convert_arguments): Use it.
762 (convert_for_initialization, cp_build_modify_expr): Likewise.
763 * cp-tree.h: Declare it.
764 * call.c (build_over_call): Use it.
765
766 2010-09-30 Iain Sandoe <iains@gcc.gnu.org>
767
768 merge from FSF 'apple/trunk' branch.
769 2006-01-30 Fariborz Jahanian <fjahanian@apple.com>
770
771 Radar 4386773
772 * cp/parser.c (cp_parser_objc_interstitial_code): For
773 @optional/@required set the optional/required flag.
774
775 2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>
776
777 * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
778 and indentation when finding an Objective-C++ CPP_AT_NAME token.
779
780 2010-09-29 Richard Guenther <rguenther@suse.de>
781
782 * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
783 (CP_TYPE_CONTEXT): Similar.
784 (FROB_CONTEXT): Frob global_namespace to the global
785 TRANSLATION_UNIT_DECL.
786 * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
787 set DECL_CONTEXT of global_namespace to it.
788 (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
789 instead of zeroing context.
790 (cp_finish_decl): Use DECL_FILE_SCOPE_P.
791 (grokfndecl): Likewise.
792 (start_preparsed_function): Likewise.
793 * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
794 (namespace_binding): Use SCOPE_FILE_SCOPE_P.
795 * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
796 (is_specialization_of_friend): Use CP_DECL_CONTEXT.
797 (push_template_decl_real): Likewise.
798 (tsubst_friend_class): Likewise. Adjust context comparisons.
799 (instantiate_class_template): Use CP_TYPE_CONTEXT.
800 (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
801 * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
802 SCOPE_FILE_SCOPE_P.
803
804 2010-09-29 Yao Qi <yao@codesourcery.com>
805
806 * decl.c (get_atexit_node): Fix typo.
807
808 2010-09-28 Jason Merrill <jason@redhat.com>
809
810 * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
811 (real_lvalue_p): Take const_tree.
812 * cp-tree.h: Adjust.
813 * typeck.c (lvalue_or_else): Make temporary arg a permerror.
814 (cp_build_addr_expr_1): Likewise.
815
816 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
817
818 Partially merged from apple/trunk branch on FSF servers:
819 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
820 Radar 3803157 (method attributes)
821
822 * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
823 (cp_parser_objc_method_tail_params_opt): Likewise.
824 (cp_parser_objc_method_signature): Likewise.
825 (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
826 (cp_parser_objc_method_prototype_list): Handle attributes.
827 (cp_parser_objc_method_definition_list): Likewise.
828
829 2010-09-28 Richard Henderson <rth@redhat.com>
830
831 * cp-lang.c: Include "target.h".
832 (cp_eh_personality): Use targetm.except_unwind_info.
833 * Make-lang.in (cp-lang.o): Update deps.
834
835 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
836
837 * parser.c (cp_parser_objc_valid_prefix_attributes): New.
838 (cp_parser_declaration): Parse prefix attributes for ObjC++.
839 (cp_parser_objc_protocol_declaration): Handle attributes.
840 (cp_parser_objc_class_interface): Likewise.
841 (cp_parser_objc_declaration): Likewise.
842
843 2010-09-27 Jason Merrill <jason@redhat.com>
844
845 Require lvalues as specified by the standard.
846 * typeck.c (lvalue_or_else): Use real_lvalue_p.
847 (cp_build_addr_expr_1): Split out of cp_build_unary_op.
848 (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
849 (decay_conversion, get_member_function_from_ptrfunc): Adjust.
850 (build_x_unary_op, build_reinterpret_cast_1): Adjust.
851 (build_const_cast_1): Adjust.
852 * cp-tree.h: Declare new fns.
853 * call.c (build_this, convert_like_real, build_over_call): Adjust.
854 (initialize_reference): Adjust.
855 * class.c (build_base_path, convert_to_base_statically): Adjust.
856 (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
857 * cvt.c (build_up_reference, convert_to_reference): Adjust.
858 * decl.c (register_dtor_fn): Adjust.
859 * decl2.c (build_offset_ref_call_from_tree): Adjust.
860 * except.c (initialize_handler_parm): Adjust.
861 * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
862 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
863 * tree.c (stabilize_expr): Adjust.
864
865 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
866
867 Merge from apple/trunk branch on FSF servers:
868
869 2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
870
871 Radar 4229905
872 * typeck.c (composite_pointer_type): Call objc_have_common_type
873 when comparing two objective-c pointer types.
874
875 2005-07-18 Ziemowit Laski <zlaski@apple.com>
876
877 Radar 4175534
878 * call.c (standard_conversion): Do not issue warnings when
879 comparing ObjC pointer types.
880
881 2005-06-22 Ziemowit Laski <zlaski@apple.com>
882
883 Radar 4154928
884 * call.c (standard_conversion): Allow for a pointer conversion
885 between any two ObjC pointer types.
886 * typeck.c (composite_pointer_type): Determine common type
887 for two ObjC pointer types.
888
889 2010-09-24 Jan Hubicka <jh@suse.cz>
890
891 * decl.c (finish_function): Use decl_replaceable_p
892 * method.c (make_alias_for_thunk): Update call of
893 cgraph_same_body_alias.
894
895 2010-09-24 Jason Merrill <jason@redhat.com>
896
897 * decl.c (compute_array_index_type): Remember type dependence of
898 array bound.
899 * pt.c (dependent_type_p_r): Don't recompute it here.
900
901 * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
902 reference and pointer to the same type as "*" or "&".
903
904 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
905
906 * typeck.c (warn_args_num): Use warning 'too many arguments to
907 method [methodname]' for an Objective-C method instead of the less
908 satisfactory 'too many arguments to function' (with no method
909 name).
910
911 2010-09-21 Jason Merrill <jason@redhat.com>
912
913 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
914 special handling if we know the member.
915
916 2010-09-18 Jason Merrill <jason@redhat.com>
917
918 * call.c (compare_ics): Do lvalue/rvalue reference binding
919 comparison for ck_list, too.
920
921 2010-09-15 Jason Merrill <jason@redhat.com>
922
923 * semantics.c (finish_id_expression): Diagnose use of function
924 parms in evaluated context outside function body.
925
926 * decl2.c (grokbitfield): Diagnose non-integral width.
927
928 * call.c (convert_like_real): Use the underlying type of the
929 reference for the temporary.
930
931 2010-09-15 Jakub Jelinek <jakub@redhat.com>
932
933 PR c++/45635
934 * class.c (build_vtbl_initializer): Use fn instead of init's operand
935 as first argument to FDESC_EXPR.
936
937 2010-09-15 Paolo Carlini <paolo.carlini@oracle.com>
938
939 PR c++/45665
940 * decl.c (grokdeclarator): Check build_memfn_type return value
941 for error_mark_node.
942
943 2010-09-13 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
944
945 * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
946 (begin_range_for_stmt): Likewise.
947
948 2010-09-11 Rodrigo Rivas <rodrigorivascosta@gmail.com>
949
950 Implement range-based for-statements.
951 * cp-tree.def (RANGE_FOR_STMT): New.
952 * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
953 (cp_convert_range_for): Declare.
954 * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
955 (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
956 * semantics.c (begin_range_for_stmt): New.
957 (finish_range_for_decl): New.
958 (finish_for_stmt): Accept also RANGE_FOR_STMT.
959 (perform_koenig_lookup): Add extra argument include_std.
960 * parser.c (cp_parser_c_for): New with code from
961 cp_parser_iteration_statement().
962 (cp_parser_range_for): New.
963 (cp_convert_range_for): New.
964 (cp_parser_iteration_statement): Add range-for support.
965 (cp_parser_condition): Adjust comment.
966 (cp_parser_postfix_expression): perform_koenig_lookup takes extra
967 argument.
968 * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
969 * cxx-pretty-print.c: Likewise.
970 * lex.c (cxx_init): Likewise.
971 * name-lookup.c (lookup_function_nonclass): Add extra argument
972 include_std.
973 (lookup_arg_dependent): Likewise.
974 * name-lookup.h: Likewise.
975
976 2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
977
978 PR c++/43824
979 * error.c (maybe_warn_cpp0x): Add new warning
980 CPP0X_INLINE_NAMESPACES.
981 * parser.c (cp_parser_namespace_definition): Likewise.
982 * cp-tree.h (cpp0x_warn_str): Likewise.
983
984 2010-09-10 Richard Guenther <rguenther@suse.de>
985
986 * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
987 TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
988
989 2010-09-10 Jan Hubicka <jh@suse.cz>
990
991 PR tree-optimization/45605
992 * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
993 ADDR_EXPR.
994
995 2010-09-08 Jakub Jelinek <jakub@redhat.com>
996
997 PR c++/45588
998 * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
999 before calling fold_decl_constant_value.
1000
1001 2010-09-07 Arnaud Charlet <charlet@adacore.com>
1002
1003 * cp-tree.h (build_enumerator): Add new location_t parameter.
1004 (build_lang_decl_loc): New function.
1005 * decl.c (build_enumerator): New parameter loc. Use it when calling
1006 build_decl. Replace build_lang_decl with build_lang_decl_loc.
1007 * pt.c (tsubst_enum): Adjust call to build_enumerator.
1008 * parser.c (cp_parser_enumerator_definition): Ditto.
1009 * lex.c (build_lang_decl_loc): New function.
1010
1011 2010-09-06 Dodji Seketeli <dodji@redhat.com>
1012
1013 PR c++/45200
1014 PR c++/45293
1015 PR c++/45558
1016 * tree.c (strip_typedefs): Strip typedefs from the context of
1017 TYPENAME_TYPEs.
1018
1019 2010-09-06 Mark Mitchell <mark@codesourcery.com>
1020
1021 * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
1022 * call.c (build_conditional_expr): Likewise.
1023 (convert_arg_to_ellipsis): Likewise.
1024
1025 2010-09-06 Arnaud Charlet <charlet@adacore.com>
1026
1027 * parser.c (make_pointer_declarator, make_reference_declarator,
1028 make_call_declarator, make_array_declarator): Set declarator->id_loc.
1029 (cp_parser_init_declarator): Adjust location of decl if appropriate.
1030
1031 2010-09-06 Jason Merrill <jason@redhat.com>
1032
1033 * call.c (implicit_conversion): Fix value-init of enums.
1034 (convert_like_real): Likewise.
1035
1036 * decl.c (cp_finish_decl): Don't change init for auto deduction.
1037
1038 * pt.c (fold_non_dependent_expr_sfinae): Split out from...
1039 (fold_non_dependent_expr): ...here.
1040 (convert_nontype_argument): Use it. Take complain parm.
1041 Use perform_implicit_conversion instead of ocp_convert.
1042 Allow cv-qual changes.
1043 (convert_template_argument): Pass complain down.
1044 (tsubst_template_arg): Suppress constant expression warnings.
1045 Don't fold here.
1046
1047 * method.c (synthesized_method_walk): In constructors, also check
1048 subobject destructors.
1049
1050 * semantics.c (finish_compound_literal): Always build a
1051 TARGET_EXPR.
1052
1053 2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
1054
1055 PR c++/45043
1056 * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
1057
1058 2010-08-30 Jakub Jelinek <jakub@redhat.com>
1059
1060 PR middle-end/45423
1061 * parser.c (cp_parser_omp_atomic): Handle boolean
1062 {PRE,POST}_INCREMENT.
1063
1064 2010-08-29 Jason Merrill <jason@redhat.com>
1065
1066 PR c++/44991
1067 * parser.c (cp_parser_parameter_declaration): Pop parameter decls
1068 after tentative parsing.
1069
1070 2010-08-22 Joseph Myers <joseph@codesourcery.com>
1071
1072 * Make-lang.in (g++spec.o): Update dependencies.
1073 * g++spec.c: Include opts.h
1074 (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
1075 (lang_specific_driver): Use cl_decoded_option structures.
1076
1077 2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
1078
1079 * call.c: Use FOR_EACH_VEC_ELT.
1080 * class.c: Likewise.
1081 * decl.c: Likewise.
1082 * decl2.c: Likewise.
1083 * error.c: Likewise.
1084 * except.c: Likewise.
1085 * mangle.c: Likewise.
1086 * method.c: Likewise.
1087 * name-lookup.c: Likewise.
1088 * parser.c: Likewise.
1089 * pt.c: Likewise.
1090 * repo.c: Likewise.
1091 * semantics.c: Likewise.
1092 * typeck2.c: Likewise.
1093
1094 2010-08-19 Jason Merrill <jason@redhat.com>
1095
1096 * call.c (reference_related_p): Check for error_mark_node.
1097 (add_function_candidate): Check it instead of
1098 same_type_ignoring_top_level_qualifiers_p.
1099
1100 PR c++/45315
1101 * init.c (build_new_1): Don't use build_value_init in a template.
1102 (build_value_init): Make sure we don't.
1103
1104 PR c++/45307
1105 * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
1106 of empty class CONSTRUCTOR.
1107
1108 * except.c (pending_noexcept, pending_noexcept_checks): New.
1109 (perform_deferred_noexcept_checks): New.
1110 (maybe_noexcept_warning): Split from...
1111 (finish_noexcept_expr): ...here. Adjust.
1112 * decl2.c (cp_write_global_declarations): Call
1113 perform_deferred_noexcept_checks.
1114 * cp-tree.h: And declare it.
1115
1116 2010-08-18 Nathan Froyd <froydnj@codesourcery.com>
1117
1118 PR c++/45049
1119 * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
1120 TREE_CHAIN.
1121
1122 2010-08-17 Kai Tietz <kai.tietz@onevision.com>
1123
1124 * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
1125 or if -fms-extensions is enabled check, check permissive.
1126
1127 2010-08-09 Jason Merrill <jason@redhat.com>
1128
1129 PR c++/45236
1130 * pt.c (lookup_template_class): Don't re-coerce outer parms.
1131
1132 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1133
1134 * call.c (add_builtin_candidates): Use VECs for local variable
1135 `types'. Adjust remainder of function accordingly.
1136
1137 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1138
1139 * name-lookup.c (is_associated_namespace): Convert local variables
1140 to be VECs instead of TREE_LISTs.
1141
1142 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1143
1144 * tree.c (varargs_function_p): Use stdarg_p.
1145
1146 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1147
1148 * parser.c (cp_default_arg_entry): Declare. Declare a VEC of it.
1149 (cp_unparsed_functions_entry): Declare. Declare a VEC of it.
1150 (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
1151 Change type to a VEC.
1152 (unparsed_funs_with_default_args): Define.
1153 (unparsed_funs_with_definitions): Define.
1154 (push_unparsed_function_queues): New function.
1155 (cp_parser_new): Call it.
1156 (pop_unparsed_function_queues): New function.
1157 (cp_parser_class_specifier): Adjust processing of unparsed functions.
1158 (cp_parser_template_declaration_after_export): Use VEC_safe_push.
1159 (cp_parser_save_member_function_body): Likewise.
1160 (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
1161 and pop_unparsed_function_queues.
1162 (cp_parser_late_parsing_default_args): Likewise.
1163 (cp_parser_save_default_args): Use VEC_safe_push.
1164
1165 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1166
1167 * name-lookup.h (cp_label_binding): Declare. Declare a VEC type
1168 containing it.
1169 (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
1170 fields to VECs.
1171 * decl.c (poplevel): Adjust for type changes.
1172 (declare_local_label): Likewise.
1173
1174 2010-08-06 Jason Merrill <jason@redhat.com>
1175
1176 * typeck.c (complete_type_or_maybe_complain): Split out from...
1177 (complete_type_or_else): Here.
1178 (build_class_member_access_expr): Call it.
1179 (finish_class_member_access_expr): Likewise.
1180 * call.c (build_special_member_call): Likewise.
1181 * cvt.c (build_expr_type_conversion): Likewise.
1182 * init.c (build_new): Likewise.
1183 * typeck2.c (build_functional_cast): Likewise.
1184 * cp-tree.h: Declare it.
1185
1186 * init.c (build_value_init): Add complain parm.
1187 (build_value_init_noctor): Likewise.
1188 (perform_member_init): Pass it.
1189 (expand_aggr_init_1): Likewise.
1190 (build_new_1): Likewise.
1191 (build_vec_init): Likewise.
1192 * pt.c (tsubst_expr): Likewise.
1193 * typeck2.c (build_functional_cast): Likewise.
1194 * cp-tree.h: Adjust.
1195 * tree.c (build_target_expr_with_type): Handle error_mark_node.
1196
1197 * typeck.c (decay_conversion): Any expression with type nullptr_t
1198 decays to nullptr.
1199
1200 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1201
1202 PR c++/45112
1203 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
1204
1205 2010-07-27 Jason Merrill <jason@redhat.com>
1206
1207 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
1208 from build_value_init.
1209 * init.c (build_value_init_noctor): Give error for unknown array
1210 bound.
1211
1212 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1213
1214 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
1215
1216 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1217
1218 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
1219 c_common_initialize_diagnostics.
1220 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
1221 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
1222
1223 2010-07-21 Jason Merrill <jason@redhat.com>
1224
1225 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
1226
1227 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
1228 to cp_finish_decl.
1229
1230 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
1231
1232 PR c++/44641
1233 * pt.c (instantiate_class_template): Propagate the template's
1234 location to its instance.
1235
1236 2010-07-20 Jason Merrill <jason@redhat.com>
1237
1238 PR c++/44967
1239 * pt.c (tsubst_copy_and_build): Rework last change.
1240
1241 PR c++/44967
1242 * pt.c (tsubst_copy_and_build): Handle partial substitution of
1243 CALL_EXPR.
1244
1245 2010-07-19 Jason Merrill <jason@redhat.com>
1246
1247 PR c++/44996
1248 * semantics.c (finish_decltype_type): Correct decltype
1249 of parenthesized rvalue reference variable.
1250
1251 PR c++/44969
1252 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
1253 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
1254
1255 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
1256
1257 PR c++/44969
1258 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
1259 parameter.
1260 * cp-tree.h: Adjust declaration.
1261 * init.c (perform_member_init): Adjust caller.
1262 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
1263 * typeck2.c (store_init_value): Likewise.
1264 (build_functional_cast): Pass complain argument to
1265 build_x_compound_expr_from_list.
1266
1267 2010-07-16 Jason Merrill <jason@redhat.com>
1268
1269 PR c++/32505
1270 * pt.c (process_partial_specialization): Diagnose partial
1271 specialization after instantiation.
1272 (most_specialized_class): Add complain parm.
1273
1274 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
1275
1276 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1277
1278 * init.c (build_new_1): Use cp_build_function_call_nary instead of
1279 cp_build_function_call.
1280
1281 2010-07-15 Jason Merrill <jason@redhat.com>
1282
1283 PR c++/44909
1284 * call.c (add_function_candidate): If we're working on an implicit
1285 declaration, don't consider candidates that won't match.
1286 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
1287 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
1288
1289 Revert:
1290 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1291 (TYPE_HAS_USER_OPEQ): New.
1292 * decl.c (grok_special_member_properties): Set it.
1293 * class.c (add_implicitly_declared_members): Don't lazily declare
1294 constructors/operator= if a base or member has a user-declared one.
1295 (check_bases_and_members, check_bases): Adjust.
1296 (check_field_decls, check_field_decl): Adjust.
1297
1298 2010-07-15 Anatoly Sokolov <aesok@post.ru>
1299
1300 * decl.c (integer_three_node): Remove.
1301 (cxx_init_decl_processing): Do not initialize the integer_three_node.
1302 * cp-tree.h (integer_three_node): Remove.
1303
1304 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1305
1306 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
1307 * call.c: Likewise.
1308 * class.c: Likewise.
1309 * cp-gimplify.c: Likewise.
1310 * decl.c: Likewise.
1311 * decl2.c: Likewise.
1312 * init.c: Likewise.
1313 * mangle.c: Likewise.
1314 * name-lookup.c: Likewise.
1315 * optimize.c: Likewise.
1316 * parser.c: Likewise.
1317 * pt.c: Likewise.
1318 * rtti.c: Likewise.
1319 * search.c: Likewise.
1320 * semantics.c: Likewise.
1321 * typeck.c: Likewise.
1322 * typeck2.c: Likewise.
1323
1324 2010-07-14 Jason Merrill <jason@redhat.com>
1325
1326 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
1327 (build_field_list): Cache field type.
1328
1329 Implement C++0x unrestricted unions (N2544)
1330 * class.c (check_field_decl): Loosen union handling in C++0x.
1331 * method.c (walk_field_subobs): Split out from...
1332 (synthesized_method_walk): ...here. Set msg before loops.
1333 (process_subob_fn): Check for triviality in union members.
1334 * init.c (sort_mem_initializers): Splice out uninitialized
1335 anonymous unions and union members.
1336 (push_base_cleanups): Don't automatically destroy anonymous unions
1337 and union members.
1338
1339 2010-07-13 Jason Merrill <jason@redhat.com>
1340
1341 PR c++/44909
1342 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1343 (TYPE_HAS_USER_OPEQ): New.
1344 * decl.c (grok_special_member_properties): Set it.
1345 * class.c (add_implicitly_declared_members): Don't lazily declare
1346 constructors/operator= if a base or member has a user-declared one.
1347 (check_bases_and_members, check_bases): Adjust.
1348 (check_field_decls, check_field_decl): Adjust.
1349 * method.c (synthesized_method_walk): Initialize check_vdtor.
1350
1351 PR c++/44540
1352 * mangle.c (write_type): Canonicalize.
1353 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
1354 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
1355
1356 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
1357
1358 PR c++/44908
1359 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
1360 complain argument.
1361 * typeck.c (get_delta_difference): Update prototype, add a
1362 tsubst_flags_t parameter; update get_delta_difference_1 calls and
1363 add checks for error_mark_node.
1364 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
1365 parameter; update lookup_base call.
1366 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
1367 parameter; update get_delta_difference call and add check for
1368 error_mark_node.
1369 (convert_ptrmem): Update prototype, add a tsubst_flags_t
1370 parameter; update get_delta_difference call and add check for
1371 error_mark_node; update build_ptrmemfunc call.
1372 (build_static_cast_1): Adjust convert_ptrmem call.
1373 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
1374 (cp_build_unary_op): Adjust build_ptrmemfunc call.
1375 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
1376 and build_ptrmemfunc calls.
1377 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
1378
1379 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
1380
1381 PR c++/44907
1382 * call.c (build_temp): Add tsubst_flags_t complain parameter;
1383 adjust build_special_member_call call, pass complain.
1384 (convert_like_real): Adjust build_temp call, pass complain.
1385
1386 2010-07-09 Jason Merrill <jason@redhat.com>
1387
1388 PR c++/43120
1389 * cp-tree.h (BV_LOST_PRIMARY): New macro.
1390 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
1391 Set BV_LOST_PRIMARY.
1392 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
1393
1394 2010-07-08 Jason Merrill <jason@redhat.com>
1395
1396 PR c++/43120
1397 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
1398 virtual bases for covariant thunks.
1399
1400 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
1401
1402 * cp-tree.h: Do not include toplev.h.
1403
1404 2010-07-06 Jason Merrill <jason@redhat.com>
1405
1406 PR c++/44703
1407 * call.c (is_std_init_list): Look through typedefs.
1408
1409 PR c++/44778
1410 * init.c (build_offset_ref): If scope isn't dependent,
1411 don't exit early. Look at TYPE_MAIN_VARIANT.
1412 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
1413
1414 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
1415
1416 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
1417
1418 * cp-tree.h (impl_conv_void): New type.
1419 (convert_to_void): Adjust prototype.
1420 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
1421 diagnostic for easy translation. Change caller.
1422 * typeck.c: Update call to convert_to_void.
1423 * semantics.c: Likewise.
1424 * init.c: Likewise.
1425
1426 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
1427
1428 * decl.c (cp_finish_decl): Call add_local_decl.
1429 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
1430
1431 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
1432
1433 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
1434 throughout.
1435
1436 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
1437
1438 PR c++/22138
1439 * parser.c (cp_parser_primary_expression): Error if local template is
1440 declared.
1441
1442 2010-07-02 Le-Chun Wu <lcwu@google.com>
1443
1444 PR/44128
1445 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
1446 (variable or type) shadows another type.
1447
1448 2010-07-02 Jakub Jelinek <jakub@redhat.com>
1449
1450 PR c++/44780
1451 * typeck.c (convert_for_assignment): When converting a convertible
1452 vector type or objc++ types, call mark_rvalue_use.
1453 * typeck2.c (build_m_component_ref): Use return values from
1454 mark_rvalue_use or mark_lvalue_use.
1455 * class.c (build_base_path): Likewise.
1456 * call.c (build_conditional_expr): Likewise.
1457
1458 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1459
1460 PR c++/44039
1461 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
1462 returns NULL_TREE.
1463
1464 2010-07-01 Richard Guenther <rguenther@suse.de>
1465
1466 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
1467 predicate we are looking for, allow non-gimplified
1468 INDIRECT_REFs.
1469
1470 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
1471
1472 PR c++/44628
1473 * typeck.c (cp_build_unary_op): Early return error_mark_node when
1474 arg is NULL_TREE too.
1475 * call.c (convert_class_to_reference): Return error_mark_node when
1476 expr is NULL_TREE.
1477
1478 2010-06-30 Michael Matz <matz@suse.de>
1479
1480 * repo.c (finish_repo): Fix typo.
1481
1482 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1483
1484 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
1485
1486 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1487
1488 * repo.c (pending_repo): Change type to a VEC.
1489 (finish_repo): Adjust for new type of pending_repo.
1490 (repo_emit_p): Likewise.
1491
1492 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
1493
1494 * tree.c: Include gimple.h. Do not include tree-flow.h
1495 * decl.c: Do not include tree-flow.h
1496 * Make-lang.in: Adjust dependencies.
1497
1498 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1499
1500 * decl.c (incomplete_var): Declare. Declare VECs containing them.
1501 (incomplete_vars): Adjust comment. Change type to a VEC.
1502 (maybe_register_incomplete_var): Adjust for new type.
1503 (complete_vars): Adjust iteration over incomplete_vars.
1504
1505 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1506
1507 * decl.c (struct named_label_entry): Change type of bad_decls field
1508 to a VEC.
1509 (poplevel_named_label_1): Adjust for new type of bad_decls.
1510 (check_goto): Likewise.
1511
1512 2010-06-29 Jason Merrill <jason@redhat.com>
1513
1514 Enable implicitly declared move constructor/operator= (N3053).
1515 * class.c (add_implicitly_declared_members): A class with no
1516 explicitly declared copy or move constructor gets both declared
1517 implicitly, and similarly for operator=.
1518 (check_bases): A type with no copy ctor does not inhibit
1519 a const copy ctor in a derived class. It does mean the derived
1520 one is non-trivial.
1521 (check_field_decl): Likewise.
1522 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
1523 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
1524 (trivially_copyable_p): Likewise.
1525 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
1526 * class.c (finish_struct_bits): Likewise.
1527 * tree.c (build_target_expr_with_type): Likewise.
1528 * typeck2.c (store_init_value): Likewise.
1529
1530 Enable implicitly deleted functions (N2346)
1531 * class.c (check_bases_and_members): Adjust lambda flags.
1532 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
1533
1534 * decl2.c (mark_used): Adjust error for use of deleted function.
1535
1536 Machinery to support implicit delete/move.
1537 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
1538 has_complex_move_ctor, has_complex_move_assign bitfields.
1539 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
1540 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
1541 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
1542 (enum special_function_kind): Add sfk_move_assignment.
1543 (LOOKUP_SPECULATIVE): New.
1544 * call.c (build_over_call): Return early if it's set.
1545 (build_over_call): Use trivial_fn_p.
1546 * class.c (check_bases): If the base has no default constructor,
1547 the derived one is non-trivial. Handle move ctor/op=.
1548 (check_field_decl): Likewise.
1549 (check_bases_and_members): Handle move ctor/op=.
1550 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
1551 (type_has_move_constructor, type_has_move_assign): New.
1552 * decl.c (grok_special_member_properties): Handle move ctor/op=.
1553 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
1554 (trivial_fn_p): New.
1555 (do_build_copy_constructor): Use it.
1556 (do_build_assign_ref): Likewise. Handle move assignment.
1557 (build_stub_type, build_stub_object, locate_fn_flags): New.
1558 (locate_ctor): Use locate_fn_flags.
1559 (locate_copy, locate_dtor): Remove.
1560 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
1561 (process_subob_fn, synthesized_method_walk): New.
1562 (maybe_explain_implicit_delete): New.
1563 (implicitly_declare_fn): Use synthesized_method_walk,
1564 type_has_trivial_fn, and type_set_nontrivial_flag.
1565 (defaulted_late_check): Set DECL_DELETED_FN.
1566 (defaultable_fn_check): Handle sfk_move_assignment.
1567 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
1568 implicitly deleted move ctor/op=.
1569 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
1570 (lookup_fnfields_slot): New.
1571 * semantics.c (omp_clause_info_fndecl): Remove.
1572 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
1573 get_copy_assign, trivial_fn_p.
1574 (trait_expr_value): Adjust call to locate_ctor.
1575 * tree.c (special_function_p): Handle sfk_move_assignment.
1576
1577 * class.c (type_has_virtual_destructor): New.
1578 * cp-tree.h: Declare it.
1579 * semantics.c (trait_expr_value): Use it.
1580
1581 * call.c (build_over_call): Only give warnings with tf_warning.
1582
1583 * name-lookup.c (pop_scope): Handle NULL_TREE.
1584
1585 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
1586 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
1587 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
1588 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
1589 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
1590 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
1591 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
1592 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
1593 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
1594 (sfk_assignment_operator): Rename to sfk_copy_assignment.
1595 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
1596 * search.c, semantics.c, tree.c: Adjust.
1597
1598 * pt.c (dependent_scope_ref_p): Remove.
1599 (value_dependent_expression_p): Don't call it.
1600 (type_dependent_expression_p): Here either.
1601 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
1602 if the scope isn't dependent.
1603
1604 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
1605 a reference.
1606
1607 PR c++/44587
1608 * pt.c (has_value_dependent_address): New.
1609 (value_dependent_expression_p): Check it.
1610 (convert_nontype_argument): Likewise. Call decay_conversion before
1611 folding if we want a pointer.
1612 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
1613 scope is the current instantiation.
1614
1615 2010-06-28 Jakub Jelinek <jakub@redhat.com>
1616
1617 PR c++/44682
1618 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
1619 on expr.
1620
1621 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
1622
1623 * init.c: Do not include except.h.
1624 * decl.c: Likewise.
1625 * expr.c: Likewise.
1626 * cp-lang.c: Likewise.
1627 * pt.c: Likewise.
1628 * semantics.c: Likewise.
1629 * decl2.c: Likewise.
1630 * except.c: Likewise.
1631 (init_exception_processing): Do not set the removed
1632 lang_protect_cleanup_actions here.
1633 (cp_protect_cleanup_actions): Make non-static and remove prototype.
1634 (doing_eh): New, moved from except.c but removed the do_warning flag.
1635 (expand_start_catch_block): Update doing_eh call.
1636 (expand_end_catch_block): Likewise.
1637 (build_throw): Likewise.
1638 * cp-tree.h: Prototype cp_protect_cleanup_actions.
1639 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
1640 cp_protect_cleanup_actions.
1641 * Make-lang.in: Update dependencies.
1642
1643 2010-06-26 Jason Merrill <jason@redhat.com>
1644
1645 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
1646 constructor called with a single argument that takes a reference
1647 to the constructor's class.
1648 (BAD_CONVERSION_RANK): New.
1649 (compare_ics): Use it to compare bad ICSes.
1650
1651 2010-06-25 Joseph Myers <joseph@codesourcery.com>
1652
1653 * lang-specs.h: Remove +e handling.
1654
1655 2010-06-24 Andi Kleen <ak@linux.intel.com>
1656
1657 * parser.c: (cp_parser_question_colon_clause):
1658 Switch to use cp_lexer_peek_token.
1659 Call warn_for_omitted_condop. Call pedwarn for omitted
1660 middle operand.
1661
1662 2010-06-22 Jakub Jelinek <jakub@redhat.com>
1663
1664 PR c++/44619
1665 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
1666 datum and mark_rvalue_use on component.
1667
1668 PR c++/44627
1669 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
1670 the CALL_EXPR has no arguments.
1671
1672 2010-06-21 Jason Merrill <jason@redhat.com>
1673
1674 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
1675
1676 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
1677 element type.
1678
1679 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
1680
1681 * name-lookup.c (struct arg_lookup): Convert namespaces and
1682 classes fields to VEC.
1683 (arg_assoc_namespace): Adjust for new type of namespaces.
1684 (arg_assoc_class): Adjust for new type of classes.
1685 (lookup_arg_dependent): Use make_tree_vector and
1686 release_tree_vector.
1687 * typeck2.c (build_x_arrow): Use vec_member.
1688
1689 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
1690
1691 PR c++/44486
1692 * error.c (dump_decl): Better wording for anonymous namespace.
1693
1694 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
1695
1696 * class.c (build_vtbl_initializer): Adjust computation of new_position
1697 and which entry to add padding for.
1698
1699 2010-06-16 Jason Merrill <jason@redhat.com>
1700
1701 * except.c (check_noexcept_r): Return the problematic function.
1702 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
1703 * pt.c (tsubst_copy_and_build): Pass it.
1704 * parser.c (cp_parser_unary_expression): Likewise.
1705 * cp-tree.h: Adjust prototype.
1706
1707 * method.c (defaulted_late_check): Give the defaulted method
1708 the same exception specification as the implicit declaration.
1709
1710 2010-06-15 Jason Merrill <jason@redhat.com>
1711
1712 * class.c (add_implicitly_declared_members): Implicit assignment
1713 operators can also be virtual overriders.
1714 * method.c (lazily_declare_fn): Likewise.
1715
1716 * call.c (convert_like_real): Give "initializing argument of"
1717 information for ambiguous conversion. Give source position
1718 of function.
1719
1720 * call.c (print_z_candidates): Do print viable deleted candidates.
1721 (joust): Don't choose a deleted function just because its worst
1722 conversion is better than another candidate's worst.
1723
1724 * call.c (convert_like_real): Don't complain about
1725 list-value-initialization from an explicit constructor.
1726
1727 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
1728 DECL_SOURCE_LOCATION directly.
1729
1730 * class.c (type_has_user_provided_default_constructor): Use
1731 sufficient_parms_p.
1732
1733 * call.c (is_subseq): Handle ck_aggr, ck_list.
1734 (compare_ics): Treat an aggregate or ambiguous conversion to the
1735 same type as involving the same function.
1736
1737 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
1738
1739 * typeck.c (convert_for_assignment): Fix comment. Change message
1740 format from %d to %qP.
1741 (convert_for_initialization): Fix comment.
1742
1743 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
1744
1745 * cp-tree.h (expr_list_kind): New type.
1746 (impl_conv_rhs): New type.
1747 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
1748 prototype.
1749 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
1750 diagnostics for easy translation. Change caller.
1751 (convert_for_initialization): Use impl_conv_rhs and change caller.
1752 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
1753 diagnostics for easy translation. Change caller.
1754 * decl.c (bad_spec_place): New enum.
1755 (bad_specifiers): Use it and emit the diagnostics for easy
1756 translation. Change caller.
1757 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
1758
1759 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1760
1761 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
1762 to a VEC.
1763 * decl2.c (cp_write_global_declarations): Adjust for new type of
1764 decl_namespace_list.
1765 * name-lookup.c (current_decl_namespace): Likewise.
1766 (push_decl_namespace): Likewise.
1767 (pop_decl_namespace): Likewise.
1768
1769 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1770
1771 * call.c (build_java_interface_fn_ref): Call build_function_type_list
1772 instead of build_function_type.
1773 * decl.c (cxx_init_decl_processing): Likewise.
1774 (declare_global_var): Likewise.
1775 (get_atexit_node): Likewise.
1776 (expand_static_init): Likewise.
1777 * decl2.c (start_objects): Likewise.
1778 (start_static_storage_duration_function): Likewise.
1779 * except.c (init_exception_processing): Likewise.
1780 (build_exc_ptr): Likewise.
1781 (build_throw): Likewise.
1782 * rtti.c (throw_bad_cast): Likewise.
1783 (throw_bad_typeid): Likewise.
1784 (build_dynamic_cast_1): Likewise.
1785
1786 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1787
1788 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
1789 (build_op_delete_call): Likewise.
1790 (build_over_call): Likewise.
1791 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1792 * pt.c (process_partial_specialization): Likewise.
1793 (tsubst_template_args): Likewise.
1794 * semantics.c (finish_asm_stmt): Likewise.
1795
1796 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
1797
1798 * decl.c (record_key_method_defined): New, broken out of ...
1799 (finish_function): ... here. Call it.
1800 (start_decl): Treat aliases as definitions.
1801
1802 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1803
1804 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
1805
1806 * pt.c (maybe_process_partial_specialization): Likewise.
1807 (register_specialization): Likewise.
1808 (add_pending_template): Likewise.
1809 (lookup_template_class): Likewise.
1810 (push_tinst_level): Likewise.
1811
1812 * parser.c (cp_lexer_new_main): Likewise.
1813 (cp_lexer_new_from_tokens): Likewise.
1814 (cp_token_cache_new): Likewise.
1815 (cp_parser_context_new): Likewise.
1816 (cp_parser_new): Likewise.
1817 (cp_parser_nested_name_specifier_opt): Likewise.
1818 (cp_parser_template_id): Likewise.
1819
1820 * name-lookup.c (binding_entry_make): Likewise.
1821 (binding_table_construct): Likewise.
1822 (binding_table_new): Likewise.
1823 (cxx_binding_make): Likewise.
1824 (pushdecl_maybe_friend): Likewise.
1825 (begin_scope): Likewise.
1826 (push_to_top_level): Likewise.
1827
1828 * lex.c (init_reswords): Likewise.
1829 (retrofit_lang_decl): Likewise.
1830 (cxx_dup_lang_specific_decl): Likewise.
1831 (copy_lang_type): Likewise.
1832 (cxx_make_type): Likewise.
1833
1834 * decl.c (make_label_decl): Likewise.
1835 (check_goto): Likewise.
1836 (start_preparsed_function): Likewise.
1837 (save_function_data): Likewise.
1838
1839 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
1840
1841 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1842
1843 * class.c (finish_struct_1): Likewise.
1844
1845 * cp-tree.h (struct lang_type): Add variable_size GTY option.
1846 (struct lang_decl): Likewise.
1847
1848 * parser.c (cp_parser_new): Update comment to not reference
1849 ggc_alloc.
1850
1851 2010-06-07 Jason Merrill <jason@redhat.com>
1852
1853 PR c++/44366
1854 * error.c (dump_parameters): Mask out TFF_SCOPE.
1855 (dump_simple_decl): Don't print the scope of a PARM_DECL.
1856 (dump_scope): Remove no-op mask.
1857
1858 PR c++/44401
1859 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
1860
1861 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
1862 * init.c (build_offset_ref): Use it.
1863 * pt.c (maybe_process_partial_specialization): Use it.
1864 (instantiate_class_template): Use it.
1865 * search.c (lookup_base): Use it.
1866
1867 2010-06-07 Jakub Jelinek <jakub@redhat.com>
1868
1869 PR c++/44444
1870 * expr.c (mark_exp_read): Handle INDIRECT_REF.
1871 * cvt.c (convert_to_void): Handle INDIRECT_REF like
1872 handled_component_p.
1873
1874 PR c++/44443
1875 * decl.c (initialize_local_var): If TREE_USED is set on the type,
1876 set also DECL_READ_P on the decl.
1877
1878 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1879
1880 PR c++/44188
1881 * cp-tree.h (typedef_variant_p): Move this declaration to
1882 gcc/tree.h.
1883 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1884 * decl.c (grokdeclarator): Do not rename debug info of an
1885 anonymous tagged type named by a typedef.
1886
1887 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
1888
1889 PR c++/44086
1890 * class.c (check_field_decls): Move the call to
1891 check_bitfield_decl before trying to set the
1892 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
1893
1894 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
1895
1896 * typeck.c: Update include path for moved files.
1897 * decl.c: Likewise.
1898 * rtti.c: Likewise.
1899 * cp-gimplify.c: Likewise.
1900 * cp-lang.c: Likewise.
1901 * pt.c: Likewise.
1902 * semantics.c: Likewise.
1903 * cxx-pretty-print.h: Likewise.
1904 * decl2.c: Likewise.
1905 * parser.c: Likewise.
1906 * cp-objcp-common.c: Likewise.
1907 * cp-tree.h: Likewise.
1908 * name-lookup.c: Likewise.
1909 * lex.c: Likewise.
1910 * name-lookup.h: Likewise.
1911 * config-lang.in: Update paths in gtfiles for files in c-family/.
1912 * Make-lang.in: Likewise.
1913
1914 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
1915
1916 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
1917 * typeck.c (build_ptrmemfunc): Likewise.
1918
1919 2010-06-04 Jason Merrill <jason@redhat.com>
1920
1921 * typeck2.c (merge_exception_specifiers): Adjust merging of
1922 throw() and noexcept(true).
1923
1924 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
1925 using an uninitialized variable.
1926
1927 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
1928 (pp_cxx_expression): Likewise.
1929
1930 Implement noexcept-specification (15.4)
1931 * parser.c (cp_parser_exception_specification_opt): Parse it.
1932 Give -Wdeprecated warning about throw() specs.
1933 * pt.c (tsubst_exception_specification): Handle it.
1934 * error.c (dump_exception_spec): Handle it.
1935 (dump_expr): Handle NOEXCEPT_EXPR.
1936 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
1937 * typeck.c (comp_except_specs): Handle compatibility rules.
1938 Change exact parm to take an enum.
1939 * typeck2.c (merge_exception_specifiers): Handle noexcept.
1940 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
1941 (type_throw_all_p, build_noexcept_spec): New fns.
1942 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
1943 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
1944 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
1945 (noexcept_true_spec, noexcept_false_spec): New macros.
1946 * name-lookup.c (pushdecl_maybe_friend): Adjust.
1947 * search.c (check_final_overrider): Adjust.
1948 * decl.c (check_redeclaration_exception_specification): Adjust.
1949 (use_eh_spec_block): Use type_throw_all_p.
1950 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
1951 Give operator new a noexcept-specification in C++0x mode.
1952 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
1953 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
1954
1955 Implement noexcept operator (5.3.7)
1956 * cp-tree.def (NOEXCEPT_EXPR): New.
1957 * except.c (check_noexcept_r, finish_noexcept_expr): New.
1958 * cp-tree.h: Declare finish_noexcept_expr.
1959 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
1960 * pt.c (tsubst_copy_and_build): And tsubst it.
1961 (type_dependent_expression_p): Handle it.
1962 (value_dependent_expression_p): Handle it.
1963
1964 * call.c (build_conditional_expr): Never fold in unevaluated context.
1965 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
1966 * semantics.c (simplify_aggr_init_expr): Likewise.
1967 * typeck.c (merge_types): Call merge_exception_specifiers.
1968 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
1969 DECL_ANTICIPATED for preferring new type.
1970
1971 2010-06-04 Joseph Myers <joseph@codesourcery.com>
1972
1973 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
1974 diagnostics.
1975
1976 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1977
1978 PR c++/44412
1979 * typeck.c (build_class_member_access_expr): Call mark_exp_read
1980 on object for static data members.
1981
1982 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1983 Jason Merrill <jason@redhat.com>
1984
1985 PR c++/44362
1986 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
1987 with the same type, call mark_lvalue_use on both.
1988
1989 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
1990
1991 * class.c (struct vtbl_init_data_s): Remove last_init field.
1992 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
1993 to a VEC.
1994 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
1995 initializers.
1996 (build_vtt): Likewise.
1997 (initialize_vtable): Take a VEC instead of a tree.
1998 (build_vtt_inits): Change return type to void. Take a VEC **
1999 instead of a tree *; accumulate results into said VEC.
2000 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
2001 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
2002 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
2003 instead of a tree.
2004 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
2005 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
2006 into it.
2007 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
2008 rather than tree_cons.
2009 (build_vbase_offset_vtbl_entries): Likewise.
2010 (add_vcall_offset): Likewise.
2011 (build_rtti_vtbl_entries): Likewise.
2012 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
2013 * decl.c (initialize_artificial_var): Use build_constructor instead
2014 of build_constructor_from_list.
2015
2016 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
2017
2018 PR c++/44294
2019 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
2020 bit-field.
2021
2022 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
2023
2024 * parser.c (cp_parser_mem_initializer_list): Change error text.
2025
2026 2010-06-02 Jakub Jelinek <jakub@redhat.com>
2027
2028 * cp-objcp-common.c (shadowed_var_for_decl): Change into
2029 tree_decl_map hashtab from tree_map.
2030 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
2031 (init_shadowed_var_for_decl): Adjust initialization.
2032
2033 PR c++/44361
2034 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
2035 instead of calling mark_exp_read only when not an assignment.
2036
2037 PR debug/44367
2038 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
2039 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
2040 Set DECL_VALUE_EXPR on var.
2041
2042 2010-06-02 Jason Merrill <jason@redhat.com>
2043
2044 * error.c (dump_type): Improve typedef handling.
2045
2046 PR c++/9726
2047 PR c++/23594
2048 PR c++/44333
2049 * name-lookup.c (same_entity_p): New.
2050 (ambiguous_decl): Multiple declarations of the same entity
2051 are not ambiguous.
2052
2053 2010-06-01 Jason Merrill <jason@redhat.com>
2054
2055 DR 990
2056 * call.c (add_list_candidates): Prefer the default constructor.
2057 (build_aggr_conv): Treat missing initializers like { }.
2058 * typeck2.c (process_init_constructor_record): Likewise.
2059 * init.c (expand_default_init): Use digest_init for
2060 direct aggregate initialization, too.
2061
2062 * call.c (add_list_candidates): Split out...
2063 (build_user_type_conversion_1): ...from here.
2064 (build_new_method_call): And here.
2065 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
2066
2067 PR c++/44358
2068 * call.c (build_list_conv): Set list-initialization flags properly.
2069
2070 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
2071
2072 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
2073
2074 2010-06-01 Arnaud Charlet <charlet@adacore.com>
2075 Matthew Gingell <gingell@adacore.com>
2076
2077 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
2078 * decl2.c: Include langhooks.h and c-ada-spec.h.
2079 (cpp_check, collect_source_refs, collect_ada_namespace,
2080 collect_all_refs): New functions.
2081 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
2082 * lang-specs.h: Ditto.
2083
2084 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2085
2086 * cp-tree.h (cp_build_function_call_nary): Declare.
2087 * typeck.c (cp_build_function_call_nary): Define.
2088 * decl.c (register_dtor_fn): Use it instead of
2089 cp_build_function_call.
2090 (cxx_maybe_build_cleanup): Likewise.
2091 * decl2.c (generate_ctor_or_dtor_function): Likewise.
2092 * except.c (do_get_exception_ptr): Likewise.
2093 (do_begin_catch): Likewise.
2094 (do_allocate_exception): Likewise.
2095 (do_free_exception): Likewise.
2096 (build_throw): Likewise. Use cp_build_function_call_vec instead
2097 of cp_build_function_call.
2098 (do_end_catch): Likewise.
2099
2100 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2101
2102 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
2103 (struct cp_declarator): Move id_loc field up.
2104
2105 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2106
2107 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
2108 this file is included before c-common.h. Define GCC_DIAG_STYLE
2109 before including diagnostic-core.h and toplev.h.
2110 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
2111 * pt.c: Include cp-tree.h before c-common.h.
2112
2113 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2114
2115 * tree.c (c_register_addr_space): Add stub.
2116
2117 2010-05-28 Joseph Myers <joseph@codesourcery.com>
2118
2119 * g++spec.c (lang_specific_driver): Use fatal_error instead of
2120 fatal.
2121
2122 2010-05-28 Dodji Seketeli <dodji@redhat.com>
2123
2124 Revert fix of PR c++/44188
2125 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
2126 gcc/tree.h.
2127 * tree.c (typedef_variant_p): Revert moving this definition to
2128 gcc/tree.c.
2129 * decl.c (grokdeclarator): Revert naming typedef handling.
2130
2131 2010-05-27 Joseph Myers <joseph@codesourcery.com>
2132
2133 * call.c: Include diagnostic-core.h instead of diagnostic.h.
2134 * cp-lang.c: Don't include diagnostic.h
2135 * name-lookup.c: Include diagnostic-core.h instead of
2136 diagnostic.h.
2137 (cp_emit_debug_info_for_using): Use seen_error.
2138 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
2139 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
2140 * pt.c (iterative_hash_template_arg): Use seen_error.
2141 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
2142 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
2143 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
2144 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
2145 dependencies.
2146
2147 2010-05-25 Dodji Seketeli <dodji@redhat.com>
2148
2149 PR c++/44188
2150 * cp-tree.h (typedef_variant_p): Move this declaration to
2151 gcc/tree.h.
2152 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
2153 * decl.c (grokdeclarator): Do not rename debug info of an
2154 anonymous tagged type named by a typedef.
2155
2156 2010-05-27 Jason Merrill <jason@redhat.com>
2157
2158 PR c++/43555
2159 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
2160 anonymous VLA size.
2161
2162 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
2163
2164 PR bootstrap/44287
2165 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
2166 * class.c (layout_class_type): Likewise.
2167 * decl.c (finish_enum): Likewise.
2168 * mangle.c (write_builitin_type): Likewise.
2169
2170 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
2171
2172 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
2173 explicit_int128_p.
2174 * decl.c (grokdeclarator): Handle __int128.
2175 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
2176 (cp_parser_simple_type_specifier): Likewise.
2177 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
2178 * typeck.c (cp_common_type): Handle __int128.
2179 * mangle.c (integer_type_codes): Add itk_int128 and
2180 itk_unsigned_int128.
2181
2182 2010-05-26 Jason Merrill <jason@redhat.com>
2183
2184 PR c++/43382
2185 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
2186 unification.
2187
2188 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2189
2190 * cp-lang.c: Do not include expr.h.
2191
2192 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2193
2194 * decl.c: Do not include rtl.h
2195 * semantics.c: Likewise.
2196
2197 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
2198
2199 * cp-tree.h: Do not include splay-tree.h.
2200 (struct prtmem_cst): Remove unused field and false comment.
2201 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
2202 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
2203 * init.c: Do not include rtl.h and expr.h.
2204 * class.c: Do not include rtl.h. Include splay-tree.h.
2205 (build_clone): Use plain NULL instead of NULL_RTX.
2206 * decl.c: Do not include expr.h. Explain why rtl.h has to be
2207 included. Include splay-tree.h.
2208 * method.c: Do not include rtl.h and expr.h.
2209 (use_thunk): Use plain NULL instead of NULL_RTX.
2210 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
2211 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
2212 and target.h. Include splay-tree.h.
2213 * expr.c: Do not include rtl.h and expr.h.
2214 * pt.c: Do not include obstack.h and rtl.h.
2215 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
2216 (tsubst_decl): Likewise.
2217 (instantiate_decl): Likewise.
2218 * semantics.c: Do not include exprt.h and debug.h. Explain why
2219 rtl.h has to be included.
2220 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
2221 * call.c: Do not include rtl.h and expr.h.
2222 * search.c: Do not include obstack.h and rtl.h.
2223 * friend.c: Do not include rtl.h and expr.h.
2224 * Make-lang.in: Update dependencies.
2225
2226 2010-05-25 Jakub Jelinek <jakub@redhat.com>
2227
2228 PR c++/18249
2229 * parser.c (non_integral_constant): Add NIC_NONE.
2230 (required_token): Add RT_NONE.
2231 (cp_parser_unary_expression): Initialize non_constant_p
2232 to NIC_NONE.
2233 (cp_parser_asm_definition): Initialize missing to RT_NONE.
2234 (cp_parser_primary_expression, cp_parser_postfix_expression,
2235 cp_parser_cast_expression, cp_parser_binary_expression,
2236 cp_parser_functional_cast): Fix formatting.
2237
2238 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
2239
2240 PR c++/18249
2241 * parser.c: Remove inclusion of dyn-string.h.
2242 (non_integral_constant): New enum.
2243 (name_lookup_error): New enum.
2244 (required_token): New enum.
2245 (cp_parser_required_error): New function.
2246 (cp_parser_require): Change the type of variable token_desc to
2247 required_token and use cp_parser_required_error.
2248 (cp_parser_require_keyword): Likewise.
2249 (cp_parser_error): Use gmsgid as parameter.
2250 (cp_parser_name_lookup_error): Change the type of variable desired to
2251 name_lookup_error and put the diagnostic in the full sentences. Change
2252 caller.
2253 (cp_parser_non_integral_constant_expression): Change the type of the
2254 variable thing to non_integral_constant and put the diagnostics in
2255 full sentences. Change caller.
2256
2257 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
2258
2259 PR middle-end/44100
2260 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
2261
2262 2010-05-24 Joseph Myers <joseph@codesourcery.com>
2263
2264 * error.c (cp_diagnostic_starter): Update call to
2265 diagnostic_build_prefix.
2266 (cp_print_error_function,
2267 print_instantiation_partial_context_line): Check show_column flag
2268 in context.
2269
2270 2010-05-24 Jason Merrill <jason@redhat.com>
2271
2272 PR c++/41510
2273 * decl.c (check_initializer): Don't wrap an init-list in a
2274 TREE_LIST.
2275 * init.c (build_aggr_init): Don't assume copy-initialization if
2276 init has CONSTRUCTOR_IS_DIRECT_INIT.
2277 * call.c (build_new_method_call): Sanity check.
2278
2279 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
2280
2281 * rtti.c (tinfo_base_init): Use build_constructor instead of
2282 build_constructor_from_list. Don't cons a tree node for
2283 returning.
2284 (generic_initializer): Use build_constructor_single instead of
2285 build_constructor_from_list.
2286 (ptr_initializer): Use build_constructor instead of
2287 build_constructor_from_list
2288 (ptm_initializer): Likewise.
2289 (class_initializer): Likewise. Take varargs instead of TRAIL.
2290 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
2291 build_constructor instead of build_constructor_from_list.
2292
2293 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
2294
2295 * semantics.c: Include bitmap.h.
2296 * Make-lang.in: Update dependencies.
2297
2298 2010-05-22 Jan Hubicka <jh@suse.cz>
2299
2300 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
2301 comdat vtables.
2302 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
2303
2304 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2305
2306 * cxx-pretty-print.c: Correct merge error.
2307
2308 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2309
2310 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
2311 (cp_print_error_function): Use diagnostic_abstract_origin macro.
2312 (cp_printer): Handle %K here using percent_K_format.
2313 * cxx-pretty-print.c: Include tree-pretty-print.h.
2314 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
2315 dependencies.
2316
2317 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
2318
2319 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
2320 Clean up redundant includes.
2321
2322 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2323
2324 PR c++/30298
2325 * decl.c (xref_basetypes): Return false in case of ill-formed
2326 redefinition.
2327
2328 2010-05-19 Jason Merrill <jason@redhat.com>
2329
2330 * call.c (reference_binding): Use cp_build_qualified_type_real
2331 and cp_type_quals consistently.
2332 (add_function_candidate): Likewise.
2333 (build_conditional_expr): Likewise.
2334 (convert_like_real): Likewise.
2335 (type_passed_as): Likewise.
2336 * class.c (add_method): Likewise.
2337 (same_signature_p): Likewise.
2338 (layout_class_type): Likewise.
2339 * decl.c (cxx_init_decl_processing): Likewise.
2340 (cp_fname_init): Likewise.
2341 (grokdeclarator): Likewise.
2342 * decl2.c (cp_reconstruct_complex_type): Likewise.
2343 * init.c (build_new_1): Likewise.
2344 * method.c (do_build_copy_constructor): Likewise.
2345 (implicitly_declare_fn): Likewise.
2346 * pt.c (tsubst_aggr_type): Likewise.
2347 (tsubst): Likewise.
2348 * rtti.c (init_rtti_processing): Likewise.
2349 (build_headof): Likewise.
2350 (build_dynamic_cast_1): Likewise.
2351 (tinfo_base_init): Likewise.
2352 (emit_support_tinfos): Likewise.
2353 * semantics.c (capture_decltype): Likewise.
2354 * tree.c (cv_unqualified): Likewise.
2355 * typeck.c (composite_pointer_type): Likewise.
2356 (string_conv_p): Likewise.
2357
2358 * mangle.c (write_CV_qualifiers_for_type): Tweak.
2359
2360 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
2361 * decl.c (start_decl): Likewise.
2362 * semantics.c (finish_compound_literal): Likewise.
2363 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
2364 (cp_type_readonly): Remove.
2365 * cp-tree.h: Remove declaration.
2366
2367 * typeck.c (merge_types): Preserve memfn quals.
2368
2369 * decl.c (grokdeclarator): Don't check quals on fn type.
2370 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
2371 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
2372
2373 PR c++/44193
2374 * typeck.c (type_memfn_quals): New fn.
2375 (apply_memfn_quals): New fn.
2376 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
2377 (cp_type_readonly): Use cp_type_quals.
2378 * cp-tree.h: Add declarations.
2379 * tree.c (cp_build_qualified_type_real): Don't set, but do
2380 preserve, quals on FUNCTION_TYPE.
2381 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
2382 * decl.c (build_ptrmem_type): Likewise.
2383 (grokdeclarator): Likewise.
2384 (static_fn_type): Likewise.
2385 * decl2.c (change_return_type): Likewise.
2386 (cp_reconstruct_complex_type): Likewise.
2387 * pt.c (tsubst_function_type): Likewise.
2388 (unify): Likewise.
2389 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
2390
2391 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
2392
2393 * tree.c (build_min_non_dep_call_vec): Update comment.
2394
2395 2010-05-17 Jason Merrill <jason@redhat.com>
2396
2397 * call.c (struct z_candidate): Add explicit_targs field.
2398 (add_template_candidate_real): Set it.
2399 (build_over_call): Use it to control init-list warning.
2400
2401 PR c++/44157
2402 * call.c (build_over_call): Limit init-list deduction warning to
2403 cases where the argument is actually an init-list.
2404
2405 PR c++/44158
2406 * call.c (build_over_call): Don't do bitwise copy for move ctor.
2407
2408 2010-05-17 Dodji Seketeli <dodji@redhat.com>
2409 Jason Merrill <jason@redhat.com>
2410
2411 PR c++/44108
2412 * decl.c (compute_array_index_type): Call mark_rvalue_use.
2413
2414 2010-05-15 Jason Merrill <jason@redhat.com>
2415
2416 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
2417 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
2418 TYPE_NOEXCEPT_P.
2419 (finish_eh_spec_block): Adjust.
2420
2421 2010-05-15 Jakub Jelinek <jakub@redhat.com>
2422
2423 PR c++/44148
2424 * pt.c (tsubst): Unshare template argument.
2425
2426 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
2427
2428 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
2429 * Make-lang.in: Fix dependencies accordingly.
2430
2431 2010-05-14 Jason Merrill <jason@redhat.com>
2432
2433 C++ DR 475
2434 * except.c (build_throw): Simplify, adjust for DR 475.
2435
2436 PR c++/44127
2437 * except.c (dtor_nothrow): Return nonzero for type with
2438 trivial destructor.
2439
2440 PR c++/44127
2441 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
2442 gimple_build_eh_must_not_throw.
2443
2444 2010-05-14 Martin Jambor <mjambor@suse.cz>
2445
2446 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
2447 and define.
2448
2449 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
2450
2451 * call.c (build_new_method_call): Change warning text.
2452 * typeck2.c (build_functional_cast): Change error text.
2453
2454 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
2455
2456 PR c++/30566
2457 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
2458 shadowing the outer parameter or variables by the declaration of
2459 nested function in nested structure or class. Warn the shadowing by
2460 the declaration of nested lambda expression.
2461
2462 2010-05-13 Jason Merrill <jason@redhat.com>
2463
2464 * typeck.c (cp_build_array_ref): Factor out from...
2465 (build_array_ref): ...here. Drop complain parm.
2466 (build_new_op): Adjust.
2467 * class.c (build_vtbl_ref_1): Adjust.
2468 * decl2.c (grok_array_decl): Adjust.
2469 * cp-tree.h: Adjust prototypes.
2470
2471 2010-05-13 Jan Hubicka <jh@suse.cz>
2472
2473 * decl.c (cp_finish_decl): Do not worry about used attribute.
2474
2475 2010-05-12 Jason Merrill <jason@redhat.com>
2476
2477 * typeck.c (build_array_ref): Take complain parm.
2478 * cp-tree.h: Add it to prototype.
2479 * call.c (build_new_op): Pass it.
2480 * class.c (build_vtbl_ref): Pass it.
2481 * decl2.c (grok_array_decl): Pass it.
2482
2483 PR bootstrap/44048
2484 PR target/44099
2485 * cp-tree.def (NULLPTR_TYPE): Remove.
2486 * cp-tree.h (NULLPTR_TYPE_P): New.
2487 (SCALAR_TYPE_P): Use it.
2488 (nullptr_type_node): New.
2489 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
2490 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
2491 nullptr_type_node.
2492 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
2493 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2494 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
2495 * mangle.c (write_type): Likewise.
2496 * name-lookup.c (arg_assoc_type): Likewise.
2497 * typeck.c (build_reinterpret_cast_1): Likewise.
2498 * rtti.c (typeinfo_in_lib_p): Likewise.
2499 (emit_support_tinfos): Remove local nullptr_type_node.
2500
2501 * cp-tree.h (UNKNOWN_TYPE): Remove.
2502 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
2503 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
2504 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
2505 * class.c (instantiate_type): Check unknown_type_node rather than
2506 UNKNOWN_TYPE.
2507 * name-lookup.c (maybe_push_decl): Likewise.
2508 * rtti.c (get_tinfo_decl_dynamic): Likewise.
2509 (get_typeid): Likewise.
2510 * semantics.c (finish_offsetof): Likewise.
2511
2512 PR c++/20669
2513 * call.c (add_template_candidate_real): If deduction fails, still
2514 add the template as a non-viable candidate.
2515 (equal_functions): Handle template candidates.
2516 (print_z_candidate): Likewise.
2517 (print_z_candidates): Likewise.
2518 (build_new_function_call): Likewise.
2519
2520 * cp-tree.h (LOOKUP_LIST_ONLY): New.
2521 * call.c (add_candidates): Enforce it.
2522 (build_new_method_call): Try non-list ctor if no viable list ctor.
2523 (build_user_type_conversion_1): Likewise.
2524
2525 * call.c (add_candidates): Distinguish between type(x) and
2526 x.operator type().
2527 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
2528 (build_new_method_call): Give better error for conversion op.
2529
2530 * call.c (add_candidates): Add first_arg and return_type parms.
2531 Add special constructor/conversion op handling.
2532 (convert_class_to_reference): Use it.
2533 (build_user_type_conversion_1): Likewise.
2534 (build_op_call): Likewise.
2535 (build_new_method_call): Likewise.
2536 (build_new_op): Adjust.
2537 (perform_overload_resolution): Adjust.
2538
2539 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
2540
2541 PR c++/34272
2542 PR c++/43630
2543 PR c++/34491
2544 * pt.c (process_partial_specialization): Return error_mark_node
2545 in case of unused template parameters in partial specialization.
2546
2547 2010-05-11 Jakub Jelinek <jakub@redhat.com>
2548
2549 PR c++/44062
2550 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
2551 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
2552 look at its second operand.
2553
2554 2010-05-10 Jason Merrill <jason@redhat.com>
2555
2556 PR c++/44017
2557 * semantics.c (baselink_for_fns): Revert earlier change.
2558
2559 PR c++/44045
2560 * typeck.c (cp_build_modify_expr): Complain about assignment to
2561 array from init list.
2562
2563 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
2564
2565 PR c++/43719
2566 * decl.c (check_initializer): strip array type before checking for
2567 uninitialized const or ref members.
2568
2569 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
2570
2571 PR c++/43951
2572 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
2573 error count. Emit errors only if compain is true.
2574 (build_new_1): Do not return error_mark_node if
2575 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
2576 errors. Delay the check for user-provided constructor.
2577 (perform_member_init): Adjust.
2578 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
2579 prototype.
2580
2581 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
2582 Jason Merrill <jason@redhat.com>
2583
2584 Add support for C++0x nullptr.
2585 * cp-tree.def: Add NULLPTR_TYPE.
2586 * cp-tree.h: Add nullptr_node.
2587 (cp_tree_index): Add CPTI_NULLPTR.
2588 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
2589 * call.c (null_ptr_cst_p): Handle nullptr.
2590 (standard_conversion): Likewise.
2591 (convert_arg_to_ellipsis): Likewise.
2592 * mangle.c (write_type): Likewise.
2593 * name-lookup.c (arg_assoc_type): Likewise.
2594 * parser.c (cp_parser_primary_expression): Likewise.
2595 * typeck.c (cp_build_binary_op): Likewise.
2596 (build_reinterpret_cast_1): Likewise.
2597 * error.c (dump_type): Likewise.
2598 (dump_type_prefix, dump_type_suffix): Likewise.
2599 * decl.c (cxx_init_decl_processing): Likewise.
2600 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2601 * cvt.c (ocp_convert): Likewise.
2602 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
2603 nullptr_t tinfo in libsupc++.
2604
2605 2010-05-06 Jason Merrill <jason@redhat.com>
2606
2607 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
2608
2609 2010-04-22 Jakub Jelinek <jakub@redhat.com>
2610 Dodji Seketeli <dodji@redhat.com>
2611
2612 PR c/18624
2613 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
2614 Declare ...
2615 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
2616 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
2617 (decay_conversion, perform_integral_promotions): Call rvalue_use.
2618 (cp_build_unary_op): Call lvalue_use.
2619 * decl.c (unused_but_set_errorcount): New variable.
2620 (poplevel): Issue -Wunused-but-set-variable diagnostics.
2621 (duplicate_decls): Merge DECL_READ_P flags.
2622 (start_cleanup_fn): Set DECL_READ_P flag.
2623 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
2624 * tree.c (rvalue): Call rvalue_use.
2625 * pt.c (convert_nontype_argument): Likewise.
2626 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
2627 finish_decltype_type): Likewise.
2628 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
2629 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
2630 or rvalue_use depending on the expr.
2631 * init.c (build_new, build_delete): Likewise.
2632 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
2633
2634 2010-05-05 Jason Merrill <jason@redhat.com>
2635
2636 PR c++/43787
2637 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
2638 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
2639
2640 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2641
2642 PR c++/43028
2643 * pt.c (unify): Check each elt for error_mark_node.
2644
2645 2010-05-04 Jason Merrill <jason@redhat.com>
2646
2647 PR c++/38064
2648 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
2649
2650 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2651
2652 PR c++/43705
2653 * call.c (build_new_method_call): Return error_mark_node if fns is
2654 NULL_TREE.
2655
2656 2010-05-03 Dodji Seketeli <dodji@redhat.com>
2657
2658 PR c++/43953
2659 * pt.c (most_specialized_class): Pretend we are processing
2660 a template decl during the call to coerce_template_parms.
2661
2662 2010-05-03 Jason Merrill <jason@redhat.com>
2663
2664 PR c++/42810
2665 PR c++/43680
2666 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
2667 from the selected underlying type unless -fstrict-enums. Set
2668 ENUM_UNDERLYING_TYPE to have the restricted range.
2669 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
2670 * class.c (check_bitfield_decl): Likewise.
2671
2672 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
2673
2674 PR c++/43951
2675 * init.c (build_new_1): Revert the accidental checkin in
2676 revision 158918.
2677
2678 2010-04-30 Jason Merrill <jason@redhat.com>
2679
2680 PR c++/43868
2681 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
2682 (pp_cxx_type_specifier_seq): ...here.
2683
2684 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
2685
2686 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
2687 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
2688
2689 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
2690
2691 PR c++/43779
2692 * typeck.c (warn_args_num): New function.
2693 (convert_arguments): Use warn_args_num to print the diagnostic
2694 messages.
2695
2696 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
2697
2698 PR c++/43890
2699 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
2700 user-provided constructor while recursing.
2701
2702 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
2703
2704 PR c++/9335
2705 * error.c (print_instantiation_partial_context_line): Handle
2706 recursive instantiation.
2707 (print_instantiation_partial_context): Likewise.
2708
2709 2010-04-27 Jason Merrill <jason@redhat.com>
2710
2711 * init.c (perform_member_init): Check CLASS_TYPE_P.
2712
2713 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2714
2715 PR c++/29043
2716 * init.c (perform_member_init): check for uninitialized const or
2717 reference members, including array types.
2718
2719 2010-04-24 Jason Merrill <jason@redhat.com>
2720
2721 * tree.c (get_fns): Split out from get_first_fn.
2722 * cp-tree.h: Declare it.
2723 * search.c (shared_member_p): Use it.
2724 * semantics.c (finish_qualified_id_expr): Simplify.
2725 (finish_id_expression): Simplify.
2726
2727 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
2728 whenever object is NULL_TREE. Don't do 'this' capture here.
2729 (finish_qualified_id_expr): Pass NULL_TREE.
2730 (finish_id_expression): Likewise.
2731 (lambda_expr_this_capture): Likewise.
2732
2733 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
2734 rather than checking current_class_ref directly.
2735 (finish_call_expr): Likewise.
2736
2737 PR c++/43856
2738 * name-lookup.c (qualify_lookup): Disqualify lambda op().
2739 * class.c (current_nonlambda_class_type): New fn.
2740 * semantics.c (nonlambda_method_basetype): New.
2741 * cp-tree.h: Declare them.
2742 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
2743
2744 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
2745
2746 PR c++/43875
2747 * semantics.c (lambda_return_type): Complain about
2748 braced-init-list.
2749
2750 PR c++/43790
2751 * tree.c (cv_unqualified): Handle error_mark_node.
2752
2753 PR c++/41468
2754 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
2755 if we don't want errors.
2756
2757 PR c++/41468
2758 * class.c (convert_to_base): Add complain parameter. Pass
2759 ba_quiet to lookup_base if we don't want errors.
2760 (build_vfield_ref): Pass complain to convert_to_base.
2761 * call.c (convert_like_real): Likewise.
2762 (initialize_reference): Likewise.
2763 (perform_direct_initialization_if_possible): Pass complain to
2764 convert_like_real.
2765 * cp-tree.h: Adjust.
2766
2767 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2768 Jason Merrill <jason@redhat.com>
2769
2770 PR c++/42844
2771 * decl.c (check_for_uninitialized_const_var): Handle classes that need
2772 constructing, too.
2773 (check_initializer): Call it for classes that need constructing, too.
2774 * class.c (in_class_defaulted_default_constructor): New.
2775 * cp-tree.h: Declare it.
2776
2777 2010-04-20 Jason Merrill <jason@redhat.com>
2778
2779 PR c++/9335
2780 * init.c (constant_value_1): Treat error_mark_node as a constant
2781 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
2782 * cvt.c (ocp_convert): Handle getting error_mark_node from
2783 integral_constant_value.
2784 * decl.c (compute_array_index_type): Likewise.
2785
2786 2010-04-20 Dodji Seketeli <dodji@redhat.com>
2787
2788 PR c++/43800
2789 PR c++/43704
2790 * typeck.c (incompatible_dependent_types_p): If one of the
2791 compared types if not a typedef then honour their main variant
2792 equivalence.
2793
2794 2010-04-20 Jakub Jelinek <jakub@redhat.com>
2795
2796 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
2797
2798 2010-04-19 Dodji Seketeli <dodji@redhat.com>
2799
2800 PR c++/43704
2801 * typeck.c (structural_comptypes): Test dependent typedefs
2802 incompatibility before testing for their main variant based
2803 equivalence.
2804
2805 2010-04-19 Jakub Jelinek <jakub@redhat.com>
2806
2807 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
2808 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
2809
2810 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
2811
2812 * decl.c (cxx_init_decl_processing): Remove second argument in call to
2813 build_common_tree_nodes.
2814
2815 2010-04-14 Jason Merrill <jason@redhat.com>
2816
2817 PR c++/36625
2818 * parser.c (cp_parser_parenthesized_expression_list): Change
2819 is_attribute_list parm to int to indicate whether or not to
2820 handle initial identifier specially.
2821 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
2822
2823 2010-04-13 Jason Merrill <jason@redhat.com>
2824
2825 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
2826 CLASS_TYPE_P.
2827 * parser.c (cp_parser_lambda_expression): Complain about lambda in
2828 unevaluated context.
2829 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
2830
2831 2010-04-12 Jason Merrill <jason@redhat.com>
2832
2833 PR c++/43641
2834 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
2835 return value directly.
2836
2837 * call.c (type_decays_to): Call cv_unqualified for non-class type.
2838
2839 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
2840
2841 PR c++/25811
2842 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2843 * init.c (build_new_1): Check for uninitialized const members and
2844 uninitialized reference members, when using new without
2845 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
2846 (diagnose_uninitialized_cst_or_ref_member): Define, call
2847 diagnose_uninitialized_cst_or_ref_member_1.
2848 (diagnose_uninitialized_cst_or_ref_member_1): New function.
2849
2850 2010-04-12 Richard Guenther <rguenther@suse.de>
2851
2852 PR c++/43611
2853 * semantics.c (expand_or_defer_fn_1): Do not keep extern
2854 template inline functions.
2855
2856 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2857
2858 PR c++/28584
2859 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
2860 pointer type.
2861
2862 2010-04-07 Jason Merrill <jason@redhat.com>
2863
2864 PR c++/43016
2865 * decl.c (start_preparsed_function): Do defer nested functions.
2866
2867 PR c++/11094, DR 408
2868 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
2869 * decl2.c (finish_static_data_member_decl): Set it.
2870 * decl.c (duplicate_decls): Propagate it.
2871 * pt.c (tsubst_decl): Don't substitute the domain of an array
2872 VAR_DECL if it's set.
2873 (regenerate_decl_from_template): Substitute it here.
2874 (type_dependent_expression_p): Return true if it's set.
2875 * semantics.c (finish_decltype_type): Instantiate such a variable.
2876 * typeck.c (cxx_sizeof_expr): Likewise.
2877 (strip_array_domain): New.
2878
2879 PR c++/43145
2880 * name-lookup.c (current_decl_namespace): Non-static.
2881 (pop_nested_namespace): Sanity check.
2882 * cp-tree.h: Declare current_decl_namespace.
2883 * decl.c (grokvardecl): Use it instead of current_namespace.
2884 (grokfndecl): Likewise.
2885
2886 PR c++/38392
2887 * pt.c (tsubst_friend_function): Instatiate a friend that has already
2888 been used.
2889
2890 * pt.c (print_template_statistics): New.
2891 * cp-tree.h: Declare it.
2892 * tree.c (cxx_print_statistics): Call it.
2893
2894 PR c++/41970
2895 * decl.c (grokvardecl): Tweak warning message.
2896 (grokfndecl): Likewise.
2897
2898 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2899
2900 PR c++/42697
2901 *pt.c (tsubst_decl): Get the arguments of a specialization from
2902 the specialization template, not from the most general template.
2903
2904 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2905
2906 PR c++/40239
2907 * typeck2.c (process_init_constructor_record):
2908 value-initialize members that are are not explicitely
2909 initialized.
2910
2911 2010-04-07 Jie Zhang <jie@codesourcery.com>
2912
2913 PR c++/42556
2914 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
2915 when all of its elements are non-constant and have been split out.
2916
2917 2010-04-06 Taras Glek <taras@mozilla.com>
2918 Jason Merrill <jason@redhat.com>
2919
2920 * parser.c (cp_parser_class_specifier): Set class location to that
2921 of IDENTIFIER_NODE instead of '{' when possible.
2922 * semantics.c (begin_class_definition): Do not overide locations
2923 with less precise ones.
2924
2925 2010-04-06 Jason Merrill <jason@redhat.com>
2926
2927 PR c++/43648
2928 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
2929
2930 PR c++/43621
2931 * pt.c (maybe_update_decl_type): Check the return value from
2932 push_scope.
2933
2934 2010-04-01 Jason Merrill <jason@redhat.com>
2935
2936 * decl.c (next_initializable_field): No longer static.
2937 * cp-tree.h: Declare it.
2938 * call.c (build_aggr_conv): Fail if there are more initializers
2939 than initializable fields.
2940
2941 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
2942 instead of void_zero_node.
2943
2944 2010-03-31 Dodji Seketeli <dodji@redhat.com>
2945
2946 PR c++/43558
2947 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
2948 * pt.c (end_template_parm_list): Store sibling template parms of
2949 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2950 (push_template_decl_real): Don't store the containing template decl
2951 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
2952 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
2953 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2954 Simplify the logic.
2955
2956 2010-03-30 Jason Merrill <jason@redhat.com>
2957
2958 PR c++/43076
2959 * pt.c (push_template_decl_real): Deal better with running out of
2960 scopes before running out of template parms.
2961
2962 PR c++/41185
2963 PR c++/41786
2964 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
2965 function parameter context. Don't print an error if parsing
2966 tentatively.
2967
2968 PR c++/43559
2969 * pt.c (more_specialized_fn): Don't control cv-qualifier check
2970 with same_type_p.
2971
2972 2010-03-26 Jason Merrill <jason@redhat.com>
2973
2974 PR c++/43509
2975 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
2976 c++0x mode, but not other type-names.
2977
2978 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2979
2980 PR c++/43327
2981 * pt.c (add_to_template_args): Support NULL ARGS;
2982 (most_specialized_class): call coerce_template_parms on
2983 template arguments passed to get_class_bindings. Use
2984 add_to_template_args.
2985 (unify): Handle VAR_DECLs.
2986
2987 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2988
2989 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
2990 into int.
2991 * pt.c (get_template_parms_at_level): Adjust.
2992
2993 2010-03-25 Dodji Seketeli <dodji@redhat.com>
2994
2995 PR c++/43206
2996 * cp-tree.h (get_template_parms_at_level): Declare ...
2997 * pt.c (get_template_parms_at_level): ... new function.
2998 * typeck.c (get_template_parms_of_dependent_type): If a template
2999 type parm's DECL_CONTEXT isn't yet set, get its siblings from
3000 current_template_parms. Use get_template_parms_at_level. Remove
3001 useless test.
3002 (incompatible_dependent_types_p): If we get empty parms from just one
3003 of the template type parms we are comparing then the template parms are
3004 incompatible.
3005
3006 2010-03-24 Jason Merrill <jason@redhat.com>
3007
3008 PR c++/43502
3009 * parser.c (make_declarator): Initialize id_loc.
3010 (cp_parser_lambda_declarator_opt): And set it.
3011
3012 2010-03-23 Jason Merrill <jason@redhat.com>
3013
3014 Make lambda conversion op and op() non-static.
3015 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
3016 Also add the thunk function returned by the conversion op.
3017 Mark the conversion deleted if the op() is variadic.
3018 * decl2.c (mark_used): Give helpful message about deleted conversion.
3019 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
3020 * semantics.c (finish_this_expr): Adjust.
3021 * mangle.c (write_closure_type_name): Adjust.
3022 * decl.c (grok_op_properties): Don't allow it.
3023 * call.c (build_user_type_conversion_1): No static conversion ops.
3024 (build_op_call): Or op().
3025
3026 * decl2.c (change_return_type): Fix 'this' quals.
3027
3028 2010-03-22 Jason Merrill <jason@redhat.com>
3029
3030 PR c++/43333
3031 * tree.c (pod_type_p): Use old meaning in C++98 mode.
3032
3033 PR c++/43281
3034 * pt.c (contains_auto_r): New fn.
3035 (do_auto_deduction): Use it.
3036 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
3037
3038 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
3039
3040 PR c++/43081:
3041 * decl2.c (grokfield): Handle invalid initializers for member
3042 functions.
3043
3044 2010-03-20 Dodji Seketeli <dodji@redhat.com>
3045
3046 PR c++/43375
3047 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
3048 is NULL.
3049 * decl2.c (vague_linkage_p): Likewise.
3050
3051 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
3052
3053 PR c++/43418
3054 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
3055 false, in the cp_parser_expression_statement call.
3056
3057 2010-03-05 Jason Merrill <jason@redhat.com>
3058
3059 * mangle.c (mangle_decl): Give name collision error even without
3060 ASM_OUTPUT_DEF.
3061
3062 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
3063
3064 * pt.c (process_partial_specialization): Use error_n instead of
3065 error.
3066
3067 2010-03-03 Jason Merrill <jason@redhat.com>
3068
3069 PR c++/12909
3070 * mangle.c (mangle_decl): Handle VAR_DECL, too.
3071
3072 2010-03-03 Jason Merrill <jason@redhat.com>
3073
3074 PR c++/12909
3075 * mangle.c: Include cgraph.h.
3076 (mangle_decl): If the mangled name will change in a later
3077 ABI version, make the later mangled name an alias.
3078 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
3079 * Make-lang.in (mangle.o): Depend on cgraph.h.
3080 * method.c (make_alias_for): Handle VAR_DECL, too.
3081 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
3082 * tree.c (no_linkage_check): Adjust.
3083 * decl.c (maybe_commonize_var): Adjust.
3084 * cp-tree.h: Adjust.
3085
3086 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
3087
3088 * pt.c (redeclare_class_template): Use error_n and inform_n.
3089
3090 2010-02-27 Mark Mitchell <mark@codesourcery.com>
3091
3092 PR c++/42748
3093 * cp-tree.h (push_tinst_level): Declare.
3094 (pop_tinst_level): Likewise.
3095 * pt.c (push_tinst_level): Give it external linkage.
3096 (pop_tinst_level): Likewise.
3097 * mangle.c (mangle_decl_string): Set the source location to that
3098 of the decl while mangling.
3099
3100 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
3101
3102 PR c++/42054
3103 * pt.c (redeclare_class_template): Return false if there are erroneous
3104 template parameters.
3105
3106 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
3107
3108 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
3109 -ftemplate-depth=.
3110
3111 2010-02-24 Jason Merrill <jason@redhat.com>
3112
3113 PR c++/12909
3114 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
3115
3116 * class.c (layout_class_type): Don't give -Wabi warning for a bug
3117 in a previous ABI version.
3118
3119 2010-02-23 Jason Merrill <jason@redhat.com>
3120
3121 PR c++/43143
3122 * typeck2.c (digest_init_r): Accept value init of array.
3123
3124 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
3125
3126 PR c++/43126
3127 * typeck.c (convert_arguments): Update error message.
3128
3129 2010-02-22 Mike Stump <mikestump@comcast.net>
3130
3131 PR c++/43125
3132 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
3133
3134 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
3135
3136 PR c++/23510
3137 * error.c (print_instantiation_partial_context_line): New.
3138 (print_instantiation_partial_context): Print at most 12 contexts,
3139 skip the rest with a message.
3140
3141 2010-02-21 Dodji Seketeli <dodji@redhat.com>
3142
3143 PR c++/42824
3144 * pt.c (lookup_template_class): Better support of specialization
3145 of member of class template implicit instantiation.
3146
3147 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
3148
3149 PR c++/35669
3150 * call.c (conversion_null_warnings): Replace -Wconversion with
3151 -Wconversion-null.
3152 * cvt.c (build_expr_type_conversion): Likewise.
3153
3154 2010-02-18 Jason Merrill <jason@redhat.com>
3155
3156 PR c++/42837
3157 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
3158
3159 PR c++/43108
3160 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
3161 C build_binary_op.
3162 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
3163 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
3164
3165 PR c++/43070
3166 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
3167
3168 PR c++/26261
3169 PR c++/43101
3170 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
3171 (maybe_update_decl_type): New fn.
3172 * parser.c (cp_parser_init_declarator): Use it.
3173
3174 PR c++/43109
3175 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
3176
3177 2010-02-17 Jason Merrill <jason@redhat.com>
3178
3179 PR c++/43075
3180 * call.c (build_over_call): Don't create zero-sized assignments.
3181 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
3182 * cp-objcp-common.c (cp_expr_size): Remove.
3183 * cp-tree.h: Remove prototype.
3184
3185 PR c++/43069
3186 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
3187 decl we looked up doesn't match.
3188
3189 PR c++/43093
3190 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
3191 have an INIT_EXPR anymore.
3192
3193 PR c++/43079
3194 * pt.c (convert_nontype_argument): Change assert to test.
3195
3196 2010-02-16 Jason Merrill <jason@redhat.com>
3197
3198 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
3199
3200 PR c++/43031
3201 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
3202 VIEW_CONVERT_EXPR for conversions between structural equality types
3203 that the back end can't tell are the same.
3204
3205 PR c++/43036
3206 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
3207 cv-quals from element here.
3208 (cp_build_qualified_type_real): Not here. Preserve typedef name.
3209
3210 2010-02-14 Jason Merrill <jason@redhat.com>
3211
3212 PR c++/41997
3213 * semantics.c (finish_compound_literal): Use
3214 cp_apply_type_quals_to_decl when creating a static variable.
3215
3216 2010-02-12 Jason Merrill <jason@redhat.com>
3217
3218 PR c++/43024
3219 * name-lookup.h (current_binding_level): Check for null
3220 cp_function_chain.
3221
3222 2010-02-12 Jason Merrill <jason@redhat.com>
3223
3224 PR c++/43054
3225 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
3226
3227 2010-02-12 Jakub Jelinek <jakub@redhat.com>
3228
3229 PR c++/43033
3230 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
3231 instead of x.
3232
3233 2010-02-10 Jason Merrill <jason@redhat.com>
3234
3235 PR c++/41896
3236 * semantics.c (outer_lambda_capture_p): Revert.
3237 (add_capture): Only finish_member_declaration if
3238 we're in the lambda class.
3239 (register_capture_members): New.
3240 * cp-tree.h: Declare it.
3241 * parser.c (cp_parser_lambda_expression): Call it.
3242
3243 2010-02-10 Jason Merrill <jason@redhat.com>
3244
3245 PR c++/41896
3246 * semantics.c (outer_lambda_capture_p): Use current_function_decl
3247 instead of current_class_type.
3248
3249 2010-02-10 Jason Merrill <jason@redhat.com>
3250
3251 PR c++/42983, core issue 906
3252 * method.c (defaultable_fn_check): Check virtualness.
3253
3254 2010-02-10 Jason Merrill <jason@redhat.com>
3255
3256 PR c++/43016
3257 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
3258
3259 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
3260
3261 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
3262 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
3263 translation.
3264 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
3265 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
3266 (cp_parser_parameter_declaration)
3267 (cp_parser_exception_specification_opt)
3268 (cp_parser_exception_declaration): Likewise.
3269 * pt.c (check_default_tmpl_args): Likewise.
3270 * search.c (lookup_field_r): Likewise.
3271
3272 2010-02-09 Jason Merrill <jason@redhat.com>
3273
3274 PR c++/42399
3275 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
3276
3277 2010-02-09 Jason Merrill <jason@redhat.com>
3278
3279 PR c++/42370
3280 * decl2.c (change_return_type): New fn.
3281 * semantics.c (apply_lambda_return_type): Use it.
3282 * cp-tree.h: Declare it.
3283
3284 2010-02-05 Richard Guenther <rguenther@suse.de>
3285
3286 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
3287 * cp-lang.c: Include gt-cp-cp-lang.h.
3288 * config-lang.in (gtfiles): Add cp/cp-lang.c.
3289
3290 2010-02-05 Dodji Seketeli <dodji@redhat.com>
3291
3292 PR c++/42915
3293 * typeck.c (get_template_parms_of_dependent_type): Try getting
3294 the template parameters fromt the type itself first.
3295
3296 2010-02-03 Jason Merrill <jason@redhat.com>
3297
3298 PR c++/4926
3299 PR c++/38600
3300 * mangle.c (write_unqualified_id): Split out from write_expression.
3301 (write_unqualified_name): Call it.
3302 (write_member_name): Likewise.
3303 (write_expression): Support TEMPLATE_ID_EXPR.
3304 Disambiguate operator names.
3305
3306 PR c++/12909
3307 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
3308 -fabi-version=4.
3309
3310 2010-02-02 Jason Merrill <jason@redhat.com>
3311
3312 PR c++/41090
3313 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
3314 * optimize.c (clone_body): Remap their initializers when making base
3315 variants.
3316 (maybe_clone_body): Complain if multiple clones aren't safe.
3317
3318 2010-01-29 Dodji Seketeli <dodji@redhat.com>
3319
3320 PR c++/42758
3321 PR c++/42634
3322 PR c++/42336
3323 PR c++/42797
3324 PR c++/42880
3325 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3326 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3327 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
3328 * pt.c (coerce_template_parms, type_unification_real,
3329 expand_template_argument_pack, coerce_template_parameter_pack):
3330 Set the non default template args count.
3331 (current_template_args): Always set non defaulted
3332 template args count when compiled with --enable-checking
3333 (tsubst_template_args, type_unification_real): Propagate the non
3334 defaulted template args count.
3335 * error.c (get_non_default_template_args_count): Renamed
3336 count_non_default_template_args into this. Don't calculate the
3337 non default template argument count anymore. Use the new
3338 accessor macros above to get it.
3339 (dump_template_argument_list, dump_type, dump_decl,
3340 dump_template_parms): Adjust.
3341 * parser.c (cp_parser_template_argument_list): Always set defaulted
3342 template args count when compiled with --enable-checking.
3343
3344 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
3345
3346 * decl.c (redeclaration_error_message): Wrap the return messages into
3347 G_() for easy translation.
3348
3349 2010-01-28 Jason Merrill <jason@redhat.com>
3350
3351 PR c++/42880
3352 * semantics.c (begin_class_definition): Don't use type_as_string.
3353
3354 2010-01-28 Dodji Seketeli <dodji@redhat.com>
3355
3356 PR c++/42713
3357 PR c++/42820
3358 * typeck.c (get_template_parms_of_dependent_type): Factorized
3359 this out of incompatible_template_type_parms_p
3360 (incompatible_dependent_types_p): Renamed
3361 incompatible_template_type_parms_p into this. Make it detect
3362 two incompatible dependent typedefs too.
3363 (structural_comptypes): Use incompatible_dependent_types_p.
3364 * pt.c (get_template_info):
3365 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
3366
3367 2010-01-20 Janis Johnson <janis187@us.ibm.com>
3368 Jason Merrill <jason@redhat.com>
3369
3370 * mangle.c (write_type): Mangle transparent record as member type.
3371 * semantics.c (begin_class_definition): Recognize decimal classes
3372 and set TYPE_TRANSPARENT_AGGR.
3373
3374 2010-01-20 Jason Merrill <jason@redhat.com>
3375
3376 PR c++/42338
3377 * mangle.c (write_expression): Handle tree codes that have extra
3378 arguments in the middle-end.
3379
3380 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
3381
3382 PR c++/42038
3383 * except.c (expand_start_catch_block): Deal correctly with
3384 do_begin_catch returning error_mark_node.
3385
3386 2010-01-20 Jason Merrill <jason@redhat.com>
3387
3388 PR c++/41788
3389 * class.c (layout_class_type): Set packed_maybe_necessary for packed
3390 non-PODs.
3391
3392 PR c++/41920
3393 * semantics.c (build_lambda_object): Call mark_used on captured
3394 variables.
3395
3396 PR c++/40750
3397 * decl.c (grokdeclarator): Clear type_quals for a member function
3398 declared using a typedef. Don't complain about adding cv-quals
3399 to a function typedef in C++0x mode.
3400
3401 2010-01-20 Jakub Jelinek <jakub@redhat.com>
3402
3403 * decl.c (create_array_type_for_decl): Remove set but not used
3404 variable error_msg. Remove break stmts after return stmts.
3405
3406 2010-01-19 Dodji Seketeli <dodji@redhat.com>
3407
3408 * error.c (dump_template_parms, count_non_default_template_args):
3409 Revert fix of PR c++/42634.
3410
3411 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3412
3413 PR c++/42634
3414 * error.c (dump_template_parms): Use innermost template
3415 arguments before calling count_non_default_template_args.
3416 (count_non_default_template_args): We are being called with
3417 template innermost arguments now. There is no need to ensure
3418 that again.
3419
3420 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3421
3422 PR c++/42766
3423 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
3424
3425 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3426
3427 PR c++/42697
3428 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
3429
3430 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3431
3432 PR c++/42697
3433 *pt.c (tsubst_decl): Get the arguments of a specialization from
3434 the specialization template, not from the most general template.
3435
3436 2010-01-16 Jason Merrill <jason@redhat.com>
3437
3438 PR c++/42761
3439 * semantics.c (finish_decltype_type): Within a template, treat
3440 unresolved CALL_EXPR as dependent.
3441
3442 2010-01-15 Dodji Seketeli <dodji@redhat.com>
3443
3444 * error.c (dump_template_parms,count_non_default_template_args):
3445 Revert changes of PR c++/42634.
3446
3447 2010-01-14 Jakub Jelinek <jakub@redhat.com>
3448
3449 PR middle-end/42674
3450 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
3451 functions with noreturn attribute.
3452
3453 2010-01-14 Jason Merrill <jason@redhat.com>
3454
3455 PR c++/42701
3456 * call.c (build_new_method_call): Don't free the vec here.
3457
3458 PR c++/42655
3459 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
3460
3461 2010-01-13 Dodji Seketeli <dodji@redhat.com>
3462
3463 PR c++/42634
3464 * error.c (dump_template_parms): Use innermost template
3465 arguments before calling count_non_default_template_args.
3466 (count_non_default_template_args): We are being called with
3467 template innermost arguments now. There is no need to ensure
3468 that again.
3469
3470 2010-01-07 Dodji Seketeli <dodji@redhat.com>
3471
3472 c++/40155
3473 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
3474 arguments that were previously deduced.
3475
3476 2010-01-05 Jason Merrill <jason@redhat.com>
3477
3478 * pt.c (unify_pack_expansion): Handle deduction from init-list.
3479 * call.c (build_over_call): Don't complain about it.
3480
3481 2010-01-04 Jason Merrill <jason@redhat.com>
3482
3483 PR c++/42555
3484 * pt.c (tsubst_decl): Don't apply type attributes in place.
3485
3486 PR c++/42567
3487 * semantics.c (describable_type): Remove decltype comment and
3488 semantics.
3489
3490
3491 \f
3492 Copyright (C) 2010 Free Software Foundation, Inc.
3493
3494 Copying and distribution of this file, with or without modification,
3495 are permitted in any medium without royalty provided the copyright
3496 notice and this notice are preserved.
3497