OSDN Git Service

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