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