OSDN Git Service

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