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