OSDN Git Service

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