OSDN Git Service

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