OSDN Git Service

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