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