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