OSDN Git Service

PR c++/21008, DR 515
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2009-11-13  Jason Merrill  <jason@redhat.com>
2
3         PR c++/21008, DR 515
4         * semantics.c (finish_non_static_data_member): Don't check
5         derivation in a template.
6
7         PR c++/11987
8         * parser.c (cp_parser_direct_declarator): Give helpful error about
9         trying to define member of a dependent typedef.
10         * pt.c (resolve_typename_type): Don't resolve a typedef typename.
11         * tree.c (typedef_variant_p): New.
12         * cp-tree.h: Declare it.
13
14 2009-11-12  Jason Merrill  <jason@redhat.com>
15
16         PR c++/27078
17         * parser.c (cp_parser_primary_expression): Don't give a duplicate
18         ambiguity error.
19
20         PR c++/39560
21         * decl2.c (build_anon_union_vars): Set DECL_ARTIFICIAL.
22
23         PR c++/37037
24         * decl.c (grokdeclarator): Don't generate a void PARM_DECL.
25
26         PR c++/42013
27         * call.c (build_conditional_expr): Check specifically for folding
28         to CALL_EXPR rather than TREE_SIDE_EFFECTS.
29
30         * typeck.c (cv_qualified_p): New fn.
31         (decay_conversion): Use it.
32         * cp-tree.h: Declare it.
33         * tree.c (rvalue): Use it and cv_unqualified.
34         * init.c (build_aggr_init): Likewise.
35
36         PR c++/42013
37         * call.c (build_conditional_expr): Don't fold a TREE_SIDE_EFFECTS
38         COND_EXPR in unevaluated context.
39
40 2009-11-12  Jan Hubicka  <jh@suse.cz>
41
42         * decl2.c (constrain_visibility): Clear WEAK and COMMON flags.
43
44 2009-11-11  Jason Merrill  <jason@redhat.com>
45
46         PR c++/39131
47         * rtti.c (emit_support_tinfos): Add DFP types.
48
49         * call.c (build_op_delete_call): Downgrade error about
50         placement/non-placement confusion to permerror.
51
52 2009-11-10  Jason Merrill  <jason@redhat.com>
53
54         * call.c (build_op_delete_call): Tweak error.
55
56         PR c++/34158
57         PR c++/36406
58         * call.c (non_placement_deallocation_fn_p): Split out...
59         (build_op_delete_call): ...from here.  Use instantiate_type
60         for placement delete.  Simplify logic.
61         * pt.c (primary_template_instantiation_p): Non-static.
62         * cp-tree.h: Declare it.
63
64 2009-11-09  Jason Merrill  <jason@redhat.com>
65
66         PR c++/41972
67         * parser.c (cp_parser_template_argument): Accept SCOPE_REF around
68         VAR_DECL.
69
70         PR c++/41994
71         * pt.c (tsubst_baselink): tsubst the name.
72
73 2009-11-07  Jason Merrill  <jason@redhat.com>
74
75         PR c++/37920
76         * pt.c (tsubst) [TYPEOF_TYPE]: Set cp_unevaluated_operand.
77
78         PR c++/18451
79         PR c++/40738
80         * cp-tree.h (cp_decl_specifier_seq): Add any_type_specifiers_p.
81         * parser.c (cp_parser_single_declaration): Call
82         cp_parser_parse_and_diagnose_invalid_type_name here, too.
83         (cp_parser_parameter_declaration): And here.
84         (cp_parser_parse_and_diagnose_invalid_type_name): Be
85         less picky about declarator form.  Don't skip to
86         the end of the block if we're in a declarator.
87         (cp_parser_decl_specifier_seq): Set any_type_specifiers_p.
88         (cp_parser_simple_declaration): Check it.
89         (cp_parser_member_declaration): Likewise.
90         (cp_parser_diagnose_invalid_type_name): Tweak error message.
91         (cp_parser_expression_statement): Likewise.
92         * decl2.c (grokfield): Mention decltype instead of typeof.
93
94 2009-11-06  Jason Merrill  <jason@redhat.com>
95
96         PR c++/15946
97         * parser.c (cp_parser_check_template_parameters): Don't talk about
98         specialization at function scope.
99         (cp_parser_diagnose_invalid_type_name): Handle dependent scope.
100         (cp_parser_parse_and_diagnose_invalid_type_name): Likewise.
101         (cp_parser_expression_statement): Suggest typename.
102         * error.c (dump_decl) [SCOPE_REF]: Print the type here.
103         (dump_expr) [SCOPE_REF]: Call it.
104         (dump_type) [UNBOUND_CLASS_TEMPLATE]: Check TFF_UNQUALIFIED_NAME.
105         * cxx-pretty-print.c (pp_cxx_unqualified_id): Print class template
106         args.
107
108         PR c++/9381
109         * decl2.c (build_memfn_type): Preserve attributes.
110         (cp_reconstruct_complex_type): Likewise.
111         (maybe_retrofit_in_chrg): Likewise.
112         * class.c (adjust_clone_args): Likewise.
113         * call.c (standard_conversion): Use build_memfn_type.
114         * pt.c (tsubst): Likewise.
115         * decl.c (build_ptrmem_type): Likewise
116         (check_function_type): Preserve attributes.
117         * tree.c (cp_build_type_attribute_variant): Propagate exception
118         specs on METHOD_TYPE, too.
119         (strip_typedefs): Preserve exception specs and attributes.
120
121 2009-11-06  Andrew Pinski  <andrew_pinski@playstation.sony.com>
122
123         PR c++/41536
124         * optimize.c (maybe_clone_body): Copy DECL_ATTRIBUTES and
125         DECL_DISREGARD_INLINE_LIMITS also.
126
127 2009-11-06  Jakub Jelinek  <jakub@redhat.com>
128
129         PR c++/41967
130         * parser.c (cp_parser_omp_for_loop): After diagnosing not perfectly
131         nested loop and parsing statements, don't cp_parser_require }, instead
132         exit the loop if next token is CPP_EOF.
133
134 2009-11-05  Jason Merrill  <jason@redhat.com>
135
136         PR c++/34180
137         * method.c (do_build_copy_constructor): Don't drop cv-quals from
138         the field type.
139
140         PR c++/7046
141         * class.c (finish_struct): Store maximum_field_alignment in
142         TYPE_PRECISION.
143         * pt.c (instantiate_class_template): Set maximum_field_alignment.
144
145         PR c++/34870
146         * name-lookup.c (arg_assoc_class): Call complete_type.
147         * pt.c (instantiate_class_template): Call uses_template_parms
148         instead of dependent_type_p.
149
150         PR c++/41703
151         * pt.c (check_undeduced_parms): New subroutine of...
152         (more_specialized_fn): ...here.  Undeduced template parms can make
153         a template less specialized than another.
154
155 2009-11-04  Jason Merrill  <jason@redhat.com>
156
157         PR c++/39413
158         * search.c (lookup_base): Don't complete_type (base).
159
160         PR c++/35067
161         * method.c (use_thunk): Check DECL_WEAK as well as
162         DECL_ONE_ONLY.
163
164         PR c++/17365, DR 218
165         * name-lookup.c (add_function): Ignore non-functions.
166
167 2009-11-03  Jason Merrill  <jason@redhat.com>
168
169         PR c++/36959
170         * decl2.c (cxx_callgraph_analyze_expr): Don't reference a function
171         just because a static variable in it is needed unless -frepo.
172
173         PR c++/41876
174         * parser.c (cp_parser_type_specifier_seq): Rename is_condition to
175         is_declaration.
176         (cp_parser_exception_declaration): Pass true.
177         (cp_parser_omp_for_loop): Likewise.
178
179         PR c++/41927
180         * typeck.c (build_x_binary_op): Don't do warn_parentheses
181         if we're in a SFINAE context.
182
183         PR c++/41815
184         * call.c (build_call_a): Strip cv-quals from rvalue result.
185
186         PR c++/40944
187         * call.c (initialize_reference): Add complain parm.
188         * typeck.c (convert_for_initialization): Pass it.
189         * decl.c (grok_reference_init): Likewise.
190         * cp-tree.h: Declare it.
191
192         PR c++/40687
193         * pt.c (do_auto_deduction): Diagnose inconsistent deduction.
194
195 2009-11-02  Dodji Seketeli  <dodji@redhat.com>
196
197         PR c++/37093
198         * pt.c (check_valid_ptrmem_cst_expr): New function.
199         (convert_nontype_argument): Use it to output an error for
200         illegal pointer to member expressions used as template arguments.
201
202 2009-11-02  Jason Merrill  <jason@redhat.com>
203
204         Restrict DR 757 change to C++0x mode.
205         * decl2.c (mark_used): Check cxx_dialect.
206         * decl.c (grokfndecl): Do check type linkage in C++98 mode.
207         (grokvardecl): Likewise.
208         * pt.c (check_instantiated_arg): Likewise.
209
210 2009-11-02  Jakub Jelinek  <jakub@redhat.com>
211
212         PR c++/41774
213         * name-lookup.c (handle_namespace_attrs): Pass 1 as last argument to
214         push_visibility.
215         * parser.c (cp_parser_namespace_definition): Pass 1 as argument to
216         pop_visibility.
217         * rtti.c (push_abi_namespace): Pass 2 as last argument to
218         push_visibility.
219         (pop_abi_namespace): Pass 2 as argument to pop_visibility.
220
221 2009-10-31  Jason Merrill  <jason@redhat.com>
222
223         * tree.c (cv_unqualified): New fn.
224         * cp-tree.h: Declare it.
225         * typeck.c (decay_conversion): Use it instead of TYPE_MAIN_VARIANT.
226
227         * rtti.c (tinfo_name): Fix lengths for private case.
228
229 2009-10-31  Jason Merrill  <jason@redhat.com>
230
231         PR c++/41754
232         * call.c (compare_ics): Avoid bad union use when
233         comparing two ck_lists.
234
235 2009-10-30  Jerry Quinn  <jlquinn@optonline.net>
236
237         * mangle.c (mangle_type_string_for_rtti): Reapply 153734.
238         (needs_fake_anon): Likewise.
239         (write_name): Likewise.
240         (write_nested_name): Likewise.
241         * cp-tree.h (mangle_type_string_for_rtti): Likewise.
242         (get_anonymous_namespace): Likewise.
243         * name-lookup.c (get_anonymous_namespace_name): Likewise.
244         * rtti.c (tinfo_name): Likewise, with +1 in the second
245         build_string call fixed.
246         (tinfo_base_init): Likewise.
247
248 2009-10-30  Jason Merrill  <jason@redhat.com>
249
250         Revert:
251         * decl.c (cp_fname_init): Correct build_string argument.
252
253 2009-10-30  Jerry Quinn  <jlquinn@optonline.net>
254
255         * mangle.c (mangle_type_string_for_rtti): Revert 153734.
256         (needs_fake_anon): Likewise.
257         (write_name): Likewise.
258         (write_nested_name): Likewise.
259         * cp-tree.h (mangle_type_string_for_rtti): Likewise.
260         (get_anonymous_namespace): Likewise.
261         * name-lookup.c (get_anonymous_namespace_name): Likewise.
262         * rtti.c (tinfo_name): Likewise.
263         (tinfo_base_init): Likewise.
264
265 2009-10-30  Dodji Seketeli  <dodji@redhat.com>
266
267         PR c++/41863
268         * pt.c (iterative_hash_template_arg): articifial parms
269         don't have DECL_PARM_INDEX set. Do not hash it.
270
271 2009-10-28  Jerry Quinn  <jlquinn@optonline.net>
272
273         * mangle.c (mangle_type_string_for_rtti): Revert r149964.
274         (needs_fake_anon): Likewise.
275         (write_name): Likewise.
276         (write_nested_name): Likewise.
277         * cp-tree.h (mangle_type_string_for_rtti): Likewise.
278         (get_anonymous_namespace): Likewise.
279         * name-lookup.c (get_anonymous_namespace_name): Likewise.
280         * rtti.c (tinfo_name): Insert '*' in front of private names.
281         (tinfo_base_init): Use it.
282
283 2009-10-28  Jason Merrill  <jason@redhat.com>
284
285         Core issue 812, 861
286         * name-lookup.c (set_decl_namespace): Deal properly with inline
287         namespaces.
288         (qualified_lookup_using_namespace): Overhaul.
289         * pt.c (print_candidates): Handle getting an OVERLOAD.
290
291 2009-10-28  Jason Merrill  <jason@redhat.com>
292
293         * decl.c (cp_fname_init): Correct build_string argument.
294
295 2009-10-27  Jason Merrill  <jason@redhat.com>
296
297         Allow no-capture lambdas to convert to function pointer.
298         * semantics.c (maybe_add_lambda_conv_op): New.
299         * parser.c (cp_parser_lambda_expression): Call it.
300         (cp_parser_lambda_declarator_opt): Make op() static if
301         no captures.
302         * mangle.c (write_closure_type_name): Adjust.
303         * semantics.c (finish_this_expr): Adjust.
304         * decl.c (grok_op_properties): Allow it.
305         * call.c (build_user_type_conversion_1): Handle static conversion op.
306         (build_op_call): And op().
307
308 2009-10-26  Jakub Jelinek  <jakub@redhat.com>
309
310         PR debug/41828
311         * cp-lang.c (cxx_dwarf_name): Return NULL instead of
312         <anonymous ...> for anonymous aggregate names.
313
314 2009-10-26  Jason Merrill  <jason@redhat.com>
315
316         PR c++/38796, Core issue 906
317         * cp-tree.h (DECL_DEFAULTED_OUTSIDE_CLASS_P): New.
318         (DECL_DEFAULTED_IN_CLASS_P): New.
319         * class.c (user_provided_p): Non-static.
320         (check_methods): Use it.
321         (check_bases_and_members): Check defaulted fns.
322         (defaultable_fn_p): Move and rename to...
323         * method.c (defaultable_fn_check): ...this.
324         (defaulted_late_check): New.
325         * pt.c (tsubst_decl): Call it.
326         * decl2.c (grokfield): Adjust.
327         * decl.c (cp_finish_decl): Adjust.
328         (grok_special_member_properties): Use user_provided_p.
329
330 2009-10-26  Dodji Seketeli  <dodji@redhat.com>
331
332         PR c++/41785
333         * pt.c (template_args_equal): Handle comparison of
334         an ARGUMENT_PACK_SELECT node with the arguments node it selects into.
335         * cp-tree.def: Fix a typo in the description of TYPE_PACK_EXPANSION.
336
337 2009-10-26  Dodji Seketeli  <dodji@redhat.com>
338
339         PR c++/41020
340         * decl.c (decls_match): Use DECL_IS_BUILTIN instead of
341         DECL_BUILT_IN.
342
343 2009-10-23  Dodji Seketeli  <dodji@redhat.com>
344
345         PR c++/40808
346         * mangle.c (write_template_args): Allow mangling of empty template
347         argument list. Updated function comments.
348
349 2009-10-23  Jason Merrill  <jason@redhat.com>
350
351         * semantics.c (lambda_expr_this_capture): Use thisify_lambda_field.
352
353         * semantics.c (outer_lambda_capture_p): New fn.
354         (thisify_lambda_field): Factor out...
355         (add_default_capture): ...from here.
356         (finish_id_expression): Use them.
357
358         Core issue 899
359         * call.c (add_function_candidate): Only permit explicit conversion
360         ops if copy ctor was called with a single argument.
361
362         * call.c (initialize_reference): Tweak error message.
363
364 2009-10-21  Jakub Jelinek  <jakub@redhat.com>
365
366         * mangle.c (finish_mangling_get_identifier): Use
367         obstack_base (mangle_obstack) instead of name_base.
368
369 2009-10-19  Jakub Jelinek  <jakub@redhat.com>
370
371         * parser.c (cp_lexer_print_token, cp_parser_is_string_literal,
372         cp_parser_string_literal, cp_parser_primary_expression): Likewise.
373         (cp_lexer_get_preprocessor_token): Use C_LEX_STRING_JOIN instead
374         of C_LEX_RAW_STRINGS.
375
376 2009-10-15  Jason Merrill  <jason@redhat.com>
377
378         PR c++/38888
379         * error.c (dump_template_bindings): Wrap argument packs in {}.
380
381         PR c++/38798
382         * parser.c (CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS): New.
383         (cp_parser_type_specifier): Don't try to parse a class-specifier
384         or enum-specifier in that case.
385         (cp_parser_trailing_type_id): New.
386         (cp_parser_late_return_type_opt): Call it.
387         (cp_parser_type_id_1): Add is_trailing_return parm.
388         (cp_parser_type_specifier_seq): Likewise.
389
390 2009-10-14  Jason Merrill  <jason@redhat.com>
391
392         PR c++/39866
393         * call.c (print_z_candidates): Don't print deleted candidates.
394         (print_z_candidate): Note deleted candidates.
395
396 2009-10-14  Larry Evans  <cppljevans@suddenlink.net>
397
398         PR c++/40092
399         * tree.c (cp_tree_equal): Add test for TEMPLATE_PARM_PARAMETER_PACK
400         equality.
401
402 2009-10-12  Jason Merrill  <jason@redhat.com>
403
404         PR c++/37875
405         * parser.c (cp_parser_decltype): Set greater_than_is_operator_p.
406
407         PR c++/37766
408         * pt.c (type_unification_real): Call convert_template_argument
409         for function default template arguments.
410         (check_default_tmpl_args): Suggest -std=c++0x when function default
411         template args seen in C++98 mode.
412
413 2009-10-11  Jason Merrill  <jason@redhat.com>
414
415         PR c++/37204
416         * typeck.c (build_reinterpret_cast_1): Handle rvalue refs
417         properly.
418
419 2009-10-11  Richard Guenther  <rguenther@suse.de>
420
421         * tree.c (cp_free_lang_data): Drop anonymous aggregate names.
422
423 2009-10-08  Jason Merrill  <jason@redhat.com>
424
425         PR c++/36816
426         * pt.c (maybe_adjust_types_for_deduction): Do rvalue ref adjustment
427         even when DEDUCE_EXACT.
428
429         PR c++/37177
430         * pt.c (resolve_nondeduced_context): New.
431         * cvt.c (convert_to_void): Call it.
432         * semantics.c (finish_decltype_type): Likewise.
433         * typeck.c (decay_conversion): Here too.
434         * pt.c (tsubst_decl): Don't clobber input_location.
435         Don't register a bad specialization.
436
437 2009-10-07  Gabriel Dos Reis  <gdr@cs.tamu.edu>
438
439         * cp-tree.h: Fix location of documentation for DECL_LANG_FLAG_7.
440
441 2009-10-07  Jason Merrill  <jason@redhat.com>
442
443         PR c++/39863
444         * pt.c (tsubst_pack_expansion): Don't do anything now if we
445         have incomplete packs of different lengths.
446
447         PR c++/41038
448         * tree.c (build_qualified_name): Call convert_from_reference.
449
450 2009-10-06  Jason Merrill  <jason@redhat.com>
451
452         Fix lookup of initialized captures in unevaluated context.
453         * cp-tree.h (DECL_NORMAL_CAPTURE_P): New.
454         * name-lookup.c (qualify_lookup): Check it.
455         * parser.c (cp_parser_lambda_introducer): Pass explicit_init_p
456         to add_capture.
457         * semantics.c (add_capture): Set DECL_NORMAL_CAPTURE_P
458         on captures without explicit init.
459         (add_default_capture): Pass explicit_init_p.
460
461         Fix capture by copy of types with explicit copy constructor.
462         * cp-tree.h (TARGET_EXPR_DIRECT_INIT_P): New.
463         (DIRECT_INIT_EXPR_P): New.
464         * typeck.c (convert_for_initialization): Just return if
465         DIRECT_INIT_EXPR_P.
466         * semantics.c (build_lambda_object): Use
467         TARGET_EXPR_DIRECT_INIT_P for normal captures.
468
469 2009-10-05  Jason Merrill  <jason@redhat.com>
470
471         * parser.c: Mark lambda_scope and lambda_count for PCH.
472
473 2009-10-03  Jason Merrill  <jason@redhat.com>
474
475         PR c++/41553
476         * parser.c (cp_parser_lambda_introducer): Avoid infinite loop on
477         parse error.
478
479 2009-10-02  Jason Merrill  <jason@redhat.com>
480
481         * mangle.c (write_unnamed_type_name): Implement.
482         (local_class_index): Split out from...
483         (discriminator_for_local_entity): ...here.
484         (nested_anon_class_index): New.
485         * cp-tree.h (TYPE_FUNCTION_SCOPE_P): New.
486
487 2009-10-02  Janis Johnson  <janis187@us.ibm.com>
488
489         * call.c (convert_arg_to_ellipsis): Avoid promoting decimal32
490         to double.
491
492 2009-10-01  Jason Merrill  <jason@redhat.com>
493
494         * parser.c (cp_parser_lambda_expression): Compute visibility.
495         (no_linkage_lambda_type_p): Remove.
496         * cp-tree.h: Remove declaration.
497         * tree.c (no_linkage_check): Don't call it.  Don't check template
498         args.  Don't check TREE_PUBLIC Types.
499
500 2009-10-01  Gabriel Dos Reis  <gdr@cse.tamu.edu>
501             Jason Merrill <jason@redhat.com>
502
503         * decl.c (grokdeclarator): Set constexprness before announcing
504         friendship.
505
506 2009-10-01  Gabriel Dos Reis  <gdr@cs.tamu.edu>
507
508         * decl.c (record_builtin_java_type): Undo unintended change.
509         (cxx_init_decl_processing): Likewise.
510
511 2009-10-01  Jason Merrill  <jason@redhat.com>
512
513         * pt.c (register_specialization): Push DECL_SOURCE_LOCATION to the
514         clones.
515
516         * decl.c (grok_special_member_properties): Only adjust
517         TYPE_HAS_COMPLEX_* if the function is defaulted in the class body.
518         (cp_finish_decl): Push DECL_DELETED_FN/DECL_DEFAULTED_FN to the
519         clones.
520
521 2009-09-30  Gabriel Dos Reis  <gdr@cs.tamu.edu>
522
523         * decl.c (check_for_uninitialized_const_var): Check constexpr
524         variables too.
525         (grokdeclarator): Handle `constexpr'.
526         (check_tag_decl): Reject `constexpr'.
527         (check_function_type): Check constexpr functions.
528         * cp-tree.h (ds_constexpr): New cp_decl_spec enumerator.
529         (CLASSTYPE_LITERAL_P): New.
530         (lang_type_class::is_literal): New.
531         (lang_type_class::dummy): Adjust width.
532         (literal_type_p): Declare.
533         * parser.c (cp_parser_check_decl_spec): Print it.
534         (cp_parser_decl_specifier_seq): Accept "constexpr".
535         * semantics.c (validate_constexpr_fundecl): Define.
536         (literal_type_p): Define.
537
538 2009-09-30  Jason Merrill  <jason@redhat.com>
539
540         * semantics.c (lambda_expr_this_capture): Fix default capture
541         of explicit capture of 'this'.
542
543 2009-09-30  Jason Merrill  <jason@redhat.com>
544
545         * parser.c (cp_parser_lambda_expression): Don't add __ to __this.
546
547 2009-09-30  Jason Merrill  <jason@redhat.com>
548
549         * cp-tree.h (LANG_DECL_U2_CHECK): Check LANG_DECL_HAS_MIN.
550
551 2009-09-29  John Freeman  <jfreeman08@gmail.com>
552             Jason Merrill  <jason@redhat.com>
553
554         Add support for lambda-expressions as per N2927.
555         * cp-tree.def (VEC_INIT_EXPR, LAMBDA_EXPR): New.
556         * cp-tree.h (LAMBDA_TYPE_P, LAMBDA_FUNCTION_P): New.
557         (LAMBDA_EXPR_DEFAULT_CAPTURE_MODE): New.
558         (LAMBDA_EXPR_DEFAULT_CAPTURE_LIST): New.
559         (LAMBDA_EXPR_THIS_CAPTURE, LAMBDA_EXPR_CAPTURES_THIS_P): New.
560         (LAMBDA_EXPR_MUTABLE_P, LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): New.
561         (LAMBDA_EXPR_RETURN_TYPE, LAMBDA_EXPR_LOCATION): New.
562         (LAMBDA_EXPR_EXTRA_SCOPE, LAMBDA_EXPR_DISCRIMINATOR): New.
563         (struct tree_lambda_expr): New.
564         (union lang_tree_node): Add lambda_expression.
565         (struct lang_type_class): Add lazy_move_ctor flag, lambda_expr field.
566         (CLASSTYPE_LAZY_MOVE_CTOR, CLASSTYPE_LAMBDA_EXPR): New.
567         (LAMBDA_TYPE_EXTRA_SCOPE, VEC_INIT_EXPR_SLOT): New.
568         (VEC_INIT_EXPR_INIT, DECLTYPE_FOR_LAMBDA_CAPTURE): New.
569         (DECLTYPE_FOR_LAMBDA_RETURN): New.
570         (enum special_function_kind): Add sfk_move_constructor.
571         (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT, LAMBDANAME_P): New.
572         * parser.c (cp_parser_lambda_expression, cp_parser_lambda_introducer)
573         (cp_parser_lambda_declarator_opt, cp_parser_lambda_body): New.
574         (start_lambda_scope, record_lambda_scope, finish_lambda_scope): New.
575         (no_linkage_lambda_type_p): New.
576         (cp_parser_primary_expression): Recognize lambda expression.
577         (cp_parser_init_declarator): Note lambda scope.
578         (cp_parser_function_definition_after_declarator): Likewise.
579         (cp_parser_late_parsing_default_args): Likewise.
580         (cp_parser_skip_to_closing_parenthesis): Skip to end of lambda capture
581         lists, too.
582         (cp_parser_parameter_declaration): Don't defer lambda default args.
583         * semantics.c (finish_non_static_data_member, finish_id_expression):
584         Handle default capture for lambda expressions.
585         (finish_this_expr): Handle 'this' keyword inside of lambda expressions.
586         (outer_automatic_var_p): New.
587         (finish_decltype_type): Handle decltypes within lambda expressions.
588         (classtype_has_nothrow_assign_or_copy_p): Synthesized move constructor.
589         (build_lambda_expr, build_lambda_object, begin_lambda_type)
590         (lambda_return_type, lambda_capture_field_type, apply_lambda_return_type)
591         (capture_decltype, add_capture, add_default_capture)
592         (lambda_expr_this_capture): New.
593         * mangle.c (write_unnamed_type_name): New. Incomplete.
594         (write_closure_type_name): New.
595         (write_unqualified_name): Recognize unnamed, closure types.
596         (write_type): Do not write decltypes from lambda expressions.
597         (decl_mangling_context): New.
598         (write_name): Use it.  Handle PARM_DECL scope.
599         (write_prefix): Likewise.  Handle VAR_DECL/FIELD_DECL scope.
600         (write_compact_number): Factor out from...
601         (write_expression, write_template_param): ...here.
602         (discriminator_for_local_entity): Recognize lambdas.
603         (write_local_name): Handle PARM_DECL scope.
604         * typeck.c (structural_comptypes): Compare decltypes from lambda
605         expressions.
606         (check_return_expr): Deduce lambda return type from multiple return
607         statements.
608         * class.c (add_implicitly_declared_members): Add lazy move constructor
609         for lambda types.
610         (check_bases_and_members): Delete default constructor and assignment
611         operator for lambda types.
612         (maybe_note_name_used_in_class): Do not confuse lambda expression with
613         defining a class.
614         * decl.c (reshape_init_r): Array copy.
615         (grokfndecl): Synthesized move constructor.
616         (cp_tree_node_structure): Lambda expression.
617         * method.c (use_thunk): Synthesized move constructor.
618         (do_build_copy_constructor): Likewise.
619         (locate_copy): Likewise.
620         (implicitly_declare_fn): Likewise.
621         * cp-objcp-common.c (cp_tree_size): Handle LAMBDA_EXPR.
622         * error.c (dump_aggr_type): Recognize lambda type.
623         (dump_function_decl): Recognize lambda function.
624         (function_category): Likewise.
625         (dump_function_name): Hide lambda name.
626         * tree.c (build_array_copy, move): New.
627         (special_function_p): Synthesized move constructor.
628         (no_linkage_check): Handle lambdas.
629         * search.c (lookup_fnfields_1): Synthesized move constructor.
630         * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr):
631         Handle VEC_INIT_EXPR.
632         * typeck2.c (digest_init_r): Array copy.
633         * pt.c (get_template_info): Don't touch typedefs.
634         (instantiate_decl): Don't resubstitute artificial decls.
635         (tsubst_decl, tsubst, tsubst_copy_and_build): Handle lambdas.
636         (lookup_template_class): Don't fall back on name lookup.
637         * name-lookup.c (make_lambda_name): New.
638         (pushdecl_class_level): Handle default capture for lambda expressions.
639         (qualify_lookup): Handle decltypes within lambda expressions.
640         (pushtag): Handle ts_within_enclosing_non_class in function scope.
641
642 2009-09-28  Janis Johnson  <janis187@us.ibm.com>
643
644         * mangle.c (write_builtin_type): Support decimal float types.
645
646 2009-09-28  Richard Henderson  <rth@redhat.com>
647
648         * cp-objcp-common.h (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New.
649
650 2009-09-24  Jakub Jelinek  <jakub@redhat.com>
651
652         * method.c (make_thunk, make_alias_for): Don't set
653         DECL_NO_STATIC_CHAIN.
654         * decl.c (builtin_function_1, grokfndecl): Likewise.
655         * lex.c (build_lang_decl): Likewise.
656
657 2009-09-23  Dodji Seketeli  <dodji@redhat.com>
658
659         PR debug/41065
660         * decl.c (cp_finish_decl): Record the types used by the global
661         variable declaration we've just parsed.
662
663 2009-09-22  Dodji Seketeli  <dodji@redhat.com>
664
665         * cp-lang.c (LANG_HOOKS_FUNCTION_PARAMETER_PACK_P,
666         LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P,
667         LANG_HOOKS_GET_GENERIC_FUNCTION_DECL): Initialize these
668         hooks for the c++ FE.
669         * cp-tree.h (function_parameter_pack_p, get_function_template_decl,
670         function_parameter_expanded_from_pack_p): Declare ...
671         * pt.c (function_parameter_pack_p, get_function_template_decl,
672         function_parameter_expanded_from_pack_p): ... new hooks.
673         (get_template_info): Make this more robust.
674         (template_args_variadic_p, make_ith_pack_parameter_name): Add a new
675         line between comment and function.
676         (get_template_argument_pack_elems): Fix comment.
677         (tsubst_decl): Arguments of function parameter packs are not
678         parameter packs themselves.
679
680 2009-09-21  Jason Merrill  <jason@redhat.com>
681
682         PR c++/41421
683         * tree.c (trivial_type_p): Fix logic.
684
685 2009-09-21  Jason Merrill  <jason@redhat.com>
686
687         * name-lookup.c (push_class_level_binding): Sanity check.
688
689 2009-09-18  Jason Merrill  <jason@redhat.com>
690
691         * decl2.c (determine_visibility): Make anonymous types internal.
692         (mark_used): Complain about types without linkage used in
693         decls with internal linkage.
694         (vague_linkage_fn_p): Split out from...
695         * decl.c (maybe_commonize_var): ...here.
696         (grokdeclarator): Adjust linkage when a typedef gives linkage name.
697         * tree.c (no_linkage_check): Check the enclosing class and template
698         arguments.
699
700         * cp-tree.h (TYPE_NAMESPACE_SCOPE_P): New.
701
702         * pt.c (get_pattern_parm): New.
703         (listify): Split out from...
704         (listify_autos): ...here.
705         (unify): Deduce std::initializer_list for T.
706         * call.c (build_over_call): Warn about it.
707
708 2009-09-17  Andrew Pinski  <pinskia@gcc.gnu.org>
709
710         PR c++/39365
711         * typeck.c (cp_build_unary_op): Check TREE_CODE for bools instead of
712         using same_type_p.
713         (convert_for_assignment): Likewise.
714         * cvt.c (type_promotes_to): Likewise.
715
716 2009-09-14  Richard Henderson  <rth@redhat.com>
717             Jakub Jelinek  <jakub@redhat.com>
718
719         * cp-tree.h (finish_asm_stmt): Update decl.
720         * parser.c (cp_parser_asm_definition): Parse asm goto.
721         (cp_parser_asm_label_list): New.
722         * pt.c (tsubst_copy_asm_operands): Don't recurse on labels.
723         (tsubst_expr): Handle asm labels.
724         * semantics.c (finish_asm_stmt): Add and use labels parameter.
725
726 2009-09-14  Richard Henderson  <rth@redhat.com>
727
728         * except.c (init_exception_processing): Don't call
729         default_init_unwind_resume_libfunc.
730         (cp_protect_cleanup_actions): Return the decl to call.
731         (build_exc_ptr): Use __builtin_eh_pointer.
732         * optimize.c (clone_body): Set eh_lp_nr, not eh_region.
733
734 2009-09-13  Richard Guenther  <rguenther@suse.de>
735         Rafael Avila de Espindola  <espindola@google.com>
736
737         * except.c (init_exception_processing): Do not set
738         lang_eh_runtime_type.
739         (choose_personality_routine): Do not set eh_personality_decl,
740         set pragma_java_exceptions.
741         * cp-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
742         (LANG_HOOKS_EH_PERSONALITY): Likewise.
743         (cp_eh_personality_decl): New.
744         (cp_eh_personality): Likewise.
745         * Make-lang.in (cp-lang.o): Add $(EXPR_H) and $(EXCEPT_H)
746         dependencies.
747
748 2009-09-13  Wei Guozhi  <carrot@google.com>
749
750         PR c++/3187
751         * cp/optimize.c (build_delete_destructor_body): New function.
752         (maybe_clone_body): Call build_delete_destructor_body for
753         deleting destructor.
754
755 2009-09-10  Jason Merrill  <jason@redhat.com>
756
757         * repo.c (extract_string, get_base_filename, init_repo): constify.
758
759 2009-09-09  Jason Merrill  <jason@redhat.com>
760
761         * error.c (find_typenames_r): Also add decltypes.
762
763 2009-09-09  Paolo Carlini  <paolo.carlini@oracle.com>
764
765         PR c++/28293
766         * decl2.c (grokfield): Check for explicit template argument lists.
767
768 2009-09-09  Jack Howarth  <howarth@bromo.med.uc.edu>
769
770         PR bootstrap/41180
771         * Make-lang.in: Remove redundant code from linkage for darwin10.
772
773 2009-09-08  Paolo Carlini  <paolo.carlini@oracle.com>
774
775         PR c++/39923
776         * decl.c (build_init_list_var_init): Check return value of
777         perform_implicit_conversion.
778
779 2009-09-08  Jason Merrill  <jason@redhat.com>
780
781         * class.c (currently_open_class): Make sure we're dealing with the
782         main variant.
783
784         * cp-tree.h (enum overload_flags): Remove OP_FLAG.
785         * method.c (lazily_declare_fn): Check for dtorness in ABI warning.
786
787         * name-lookup.c (is_class_level): Remove.
788         (push_binding_level, leave_scope, resume_scope): Adjust.
789         (pushlevel_class): Adjust.
790         (poplevel_class): Make sure we're on class_binding_level.
791
792         * decl.c (grokmethod): Rename from start_method.
793         (finish_method): Remove.
794         * cp-tree.h: Adjust.
795         * parser.c (cp_parser_save_member_function_body): Adjust.
796
797 2009-09-03  Doug Kwan  <dougkwan@google.com>
798
799         * tree.c (cp_fix_function_decl_p): New.
800         (cp_free_lang_data): New.
801
802 2009-09-03  Diego Novillo  <dnovillo@google.com>
803
804         * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H).
805         * decl2.c: Include pointer-set.h.
806         (collect_candidates_for_java_method_aliases): New.
807         (cp_write_global_declarations): Call it.
808         Add local variable CANDIDATES.  If set, call
809         build_java_method_aliases.
810         (build_java_method_aliases): Add argument CANDIDATES.
811         Use it to determine if FNDECL should get a hidden alias.
812         * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define.
813         * cp-tree.h (cp_free_lang_data): Declare.
814
815 2009-09-03  Richard Guenther  <rguenther@suse.de>
816
817         * method.c (use_thunk): Use cgraph_finalize_function to hand
818         off thunks to the cgraph.
819         * semantics.c (emit_associated_thunks): Do not emit thunks
820         for really extern functions.
821
822 2009-09-03  Diego Novillo  <dnovillo@google.com>
823
824         * cp-lang.c (lang_hooks): Remove const qualifier.
825
826 2009-09-02  Jason Merrill  <jason@redhat.com>
827
828         * semantics.c (describable_type): Don't pretend to be in a template.
829
830         * ptree.c (cxx_print_type) [DECLTYPE_TYPE]: Print the expression.
831
832 2009-09-01  Alexandre Oliva  <aoliva@redhat.com>
833
834         * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New.
835         * cp-lang.c (cxx_dwarf_name): Pass it.
836         * error.c (count_non_default_template_args): Take flags as
837         argument.  Adjust all callers.  Skip counting of default
838         arguments if the new flag is given.
839
840 2009-09-01  Dodji Seketeli  <dodji@redhat.com>
841
842         PR bootstrap/41205
843         * pt.c (make_ith_pack_parameter_name): Don't use strnlen that is a
844         GNU extension.
845
846 2009-09-01  Richard Guenther  <rguenther@suse.de>
847
848         * cp-objcp-common.c (cp_expr_size): Use tree_expr_size.
849         * cp-objcp-common.h (LANG_HOOKS_EXPR_SIZE): Do not define.
850
851 2009-09-01  Richard Guenther  <rguenther@suse.de>
852
853         * cp-objcp-common.h (LANG_HOOKS_MARK_ADDRESSABLE): Remove.
854
855 2009-08-31  Dodji Seketeli  <dodji@redhat.com>
856
857         PR debug/30161
858         * cp-tree.h (get_template_info): Parameter should be const.
859         (CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): Fix typo.
860         (get_template_argument_pack_elems,
861         get_primary_template_innermost_parameters,
862         get_template_innermost_arguments, template_template_parameter_p):
863         Declare ...
864         * pt.c (get_template_argument_pack_elems,
865         get_template_innermost_parameters, get_template_innermost_arguments,
866         template_template_parameter_p):
867         ... New C++ front end implementation of new language hooks.
868         (primary_template_instantiation_p): New private helper.
869         (make_ith_pack_parameter_name): Use snprintf and strnlen instead of
870         printf and strlen.
871         (get_template_info): Const-ify parameter.
872         * cp-lang.c (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
873         LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
874         LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
875         LANG_HOOKS_GENERIC_TYPE_PARAMETER_DECL_P): Initialize these
876         interfaces for the C++ front-end.
877
878 2009-08-31  Jason Merrill  <jason@redhat.com>
879
880         PR c++/41127
881         * parser.c (cp_parser_enum_specifier): Make sure the : is followed by a
882         type-specifier-seq before we commit.
883
884 2009-08-28  Richard Guenther  <rguenther@suse.de>
885
886         PR lto/41058
887         * cp-gimplify.c (cp_genericize_r): Do not leak zero-sized stores
888         into the generic IL.
889
890 2009-08-27  Richard Guenther  <rguenther@suse.de>
891
892         * class.c (build_vtbl_ref_1): Remove excess vertical space.
893         * Make-lang.in (CXX_TREE_H): Remove c-common.def dependency
894         tracked by $(TREE_H).
895         * semantics.c (expand_or_defer_fn): Zero DECL_SAVED_TREE.
896
897 2009-08-26  Jason Merrill  <jason@redhat.com>
898
899         * call.c (build_builtin_candidate): Don't set LOOKUP_ONLYCONVERTING
900         if we're contextually converting to bool.
901         (build_conditional_expr): Likewise.
902         * typeck.c (condition_conversion): Likewise.
903
904         * call.c (build_conditional_expr): Fix logic errors.
905         (build_new_op): Remove dead COND_EXPR handling.
906
907 2009-08-24  Jason Merrill  <jason@redhat.com>
908
909         * cp-tree.h (DECL_DEFERRED_FN): Remove.
910         (struct lang_decl_fn): Remove deferred flag.
911         * class.c (build_clone): Don't set it.
912         * decl2.c (note_vague_linkage_fn): Don't check or set it.
913         (mark_used): Don't check it.
914         * method.c (make_thunk, make_alias_for): Don't set it.
915
916         * decl2.c (mark_used): Streamline logic.
917
918         PR c++/41109
919         PR c++/41110
920         PR c++/41134
921         * cp-tree.h (DECL_ODR_USED): New macro.
922         (struct lang_decl_base): Add odr_used flag.
923         * decl.c (duplicate_decls): Propagate it.  Use it for error.
924         * pt.c (register_specialization): Use it for error.
925         * decl2.c (mark_used): Use it as gating flag rather than TREE_USED.
926         (cp_write_global_declarations): Use it for error.
927         (tree_used_ok): Remove.
928         * cp-tree.h: Remove tree_used_ok.
929         * call.c (build_call_a): Don't call it.
930         * init.c (build_offset_ref): Likewise.
931
932 2009-08-21  Jakub Jelinek  <jakub@redhat.com>
933
934         PR c++/41131
935         * tree.c (lvalue_p_1) <case CONST_DECL>: Return clk_none if
936         not TREE_STATIC.
937
938 2009-08-19  Jason Merrill  <jason@redhat.com>
939
940         PR c++/41119
941         PR c++/41120
942         * decl2.c (mark_used): Increment function_depth during synthesis.
943         * parser.c (cp_parser_default_argument): Not here.
944
945 2009-08-19  Jakub Jelinek  <jakub@redhat.com>
946
947         * method.c (use_thunk): Call free_after_compilation after
948         assemble_end_function.
949
950 2009-08-17  Richard Guenther  <rguenther@suse.de>
951
952         * decl.c (build_ptrmemfunc_type): Keep variant chain intact.
953         Avoid useless copy.
954         (finish_enum): Keep variant chain intact.
955         * tree.c (cp_build_reference_type): Likewise.
956
957 2009-08-16  Jason Merrill  <jason@redhat.com>
958
959         Make TREE_USED match the [basic.def.odr] concept for FUNCTION_DECL
960         and VAR_DECL, so mark_used only has effect the first time.
961         * decl2.c (mark_used): Just return if TREE_USED is already set.
962         Don't set TREE_USED if cp_unevaluated_operand is set.
963         (tree_used_ok): New fn.
964         * init.c (build_offset_ref): Check it instead of TREE_USED.
965         * call.c (build_call_a): Likewise.
966         * cp-tree.h: Declare it.
967         (DECL_NO_LINKAGE_CHECKED): No longer needed.
968         (struct lang_decl_base): Remove no_linkage_checked bitfield.
969
970         * decl2.c (finish_static_data_member_decl): Don't set TREE_USED.
971
972         * decl2.c (mark_used): It's ok to synthesize for default args now.
973
974 2009-08-10  Jason Merrill  <jason@redhat.com>
975
976         Implement DR 757: It's OK for a decl to use a type without linkage
977         so long as the decl is defined in the current translation unit.
978         * decl2.c (no_linkage_decls): New vector.
979         (mark_used): Add decls that use types with no linkage.
980         (cp_write_global_declarations): Check that they are defined.
981         (decl_defined_p, no_linkage_error): New fns.
982         * cp-tree.h (DECL_NO_LINKAGE_CHECKED): New macro.
983         (struct lang_decl_base): Add flag.
984         * decl.c (grokfndecl): Don't check type linkage.
985         (grokvardecl): If the type has no linkage, just make sure
986         DECL_LANG_SPECIFIC is set.
987         * pt.c (check_instantiated_arg): Don't check type linkage.
988         * name-lookup.c (is_local_extern): New fn.
989         * name-lookup.h: Declare it.
990
991 2009-08-05  Jason Merrill  <jason@redhat.com>
992
993         PR c++/40948
994         * init.c (build_vec_init): Evaluate the initializer before
995         starting the initialization try block.
996
997 2009-08-05  Manuel López-Ibáñez  <manu@gcc.gnu.org>
998
999         PR c++/36069
1000         * typeck.c (convert_for_assignment): Do not warn for any boolean
1001         variant. Use explicit location.
1002
1003 2009-08-04  Dodji Seketeli  <dodji@redhat.com>
1004
1005         PR c++/39987
1006         * pt.c (tsubst_default_argument): Let access checks of the
1007         default argument happen in the context of the current function.
1008
1009 2009-08-04  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1010
1011         PR c++/16696
1012         * call.c (build_new_op): Only try prefix operator if -fpermissive,
1013         otherwise just error.
1014
1015 2009-08-04  Dodji Seketeli  <dodji@redhat.com>
1016
1017         PR debug/39706
1018         * error.c (lang_decl_name): Print qualified names for decls
1019         in  namespace scope.
1020
1021 2009-08-03  Jason Merrill  <jason@redhat.com>
1022             Jakub Jelinek  <jakub@redhat.com>
1023
1024         PR c++/40948
1025         * init.c (build_vec_init): Look through a TARGET_EXPR around a
1026         CONSTRUCTOR.
1027
1028 2009-07-31  Jason Merrill  <jason@redhat.com>
1029             Douglas Gregor  <doug.gregor@gmail.com>
1030
1031         Remove implicit binding of lvalues to rvalue references (N2831)
1032         * call.c (convert_class_to_reference): Binding an lvalue to an
1033         rvalue reference is bad.  If the user-defined conversion is bad,
1034         set bad_p before merging conversions.
1035         (maybe_handle_ref_bind): Don't push down bad_p.
1036         (reference_binding): Binding an lvalue to an rvalue reference is bad.
1037         (convert_like_real): Give a helpful error about binding lvalue
1038         to rvalue reference.
1039         (reference_related_p): No longer static.
1040         * typeck.c (build_typed_address): New.
1041         (build_static_cast_1): Add static_cast from lvalue to &&.
1042         * cp-tree.h: Adjust.
1043
1044 2009-07-31  Jason Merrill  <jason@redhat.com>
1045
1046         * call.c (reference_binding): Rename lvalue_p to is_lvalue.
1047         Do direct binding of "rvalues" in memory to rvalue references.
1048         * tree.c (lvalue_p_1): Can't be both non-addressable lvalue and
1049         "rvalue" in memory.
1050         * typeck.c (build_static_cast_1): Do direct binding of memory
1051         "rvalues" to rvalue references.
1052         * cvt.c (cp_fold_convert): New.
1053         * cp-tree.h: Declare it.
1054
1055 2009-07-31  Jason Merrill  <jason@redhat.com>
1056
1057         * typeck.c (build_address): Do fold away ADDR_EXPR of INDIRECT_REF.
1058         * tree.c (rvalue): Use cp_build_qualified_type, not TYPE_MAIN_VARIANT.
1059
1060 2009-07-29  Jason Merrill  <jason@redhat.com>
1061
1062         PR c++/14912
1063         * cp-tree.h (enum tsubst_flags): Add tf_no_class_instantiations.
1064         * error.c (count_non_default_template_args): Pass it.
1065         * pt.c (tsubst) [TYPENAME_TYPE]: Don't complete type if it's set.
1066
1067 2009-07-29  Richard Guenther  <rguenther@suse.de>
1068
1069         PR c++/40834
1070         * cp-gimplify.c (cp_genericize_r): Properly walk the BIND_EXPR
1071         vars.
1072
1073 2009-07-26  Simon Martin  <simartin@users.sourceforge.net>
1074
1075         PR c++/40749
1076         * decl.c (grokdeclarator): Do not set TREE_NO_WARNING for functions
1077         with a qualified return type.
1078
1079 2009-07-24  Jason Merrill  <jason@redhat.com>
1080
1081         Core issue 901
1082         * call.c (build_op_delete_call): If this is for a new-expression
1083         and the op delete is deleted, do nothing.
1084
1085         Core issue 702
1086         * call.c (compare_ics): Give list-initialization of std::init_list
1087         priority over conversion to scalar, too.
1088
1089 2009-07-22  Jason Merrill  <jason@redhat.com>
1090
1091         * mangle.c (mangle_type_string_for_rtti): Rename to be clearer.
1092         (needs_fake_anon): New.
1093         (write_name): Check it.
1094         (write_nested_name): Add a fake anonymous namespace scope if true.
1095         * name-lookup.c (get_anonymous_namespace_name): No longer static.
1096         * rtti.c, cp-tree.h: Adjust.
1097
1098 2009-07-22  Richard Guenther  <rguenther@suse.de>
1099
1100         PR c++/40799
1101         * cp-gimplify.c (cp_gimplify_expr): Move handling of using
1102         related exprs to ...
1103         (cp_genericize_r): ... genericization stage.
1104         (cp_genericize): Adjust.
1105
1106 2009-07-21  Jason Merrill  <jason@redhat.com>
1107
1108         Core issue 934
1109         * call.c (reference_binding): Implement binding to { }.
1110         (initialize_reference): Binding temporary to non-const && is fine.
1111         * decl.c (grok_reference_init): Remove error for CONSTRUCTOR.
1112
1113         * decl.c (reshape_init_r): { T } is not an aggregate initializer
1114         for class T.
1115
1116 2009-07-17  Richard Guenther  <rguenther@suse.de>
1117
1118         PR c/40401
1119         * decl.c (finish_function): Do not emit unused result warnings
1120         from here.
1121         * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use
1122         c_warn_unused_result_pass.
1123         * semantics.c (expand_or_defer_fn): Adjust assertion about IL status.
1124         * optimize.c (clone_body): Clone in GENERIC.
1125         (maybe_clone_body): Do not clear DECL_SAVED_TREE.
1126         * decl2.c (cp_write_global_declarations): Fix body test.
1127         Do not call cgraph_optimize.
1128         * Make-lang.in (optimize.o): Add tree-iterator.h dependency.
1129         * method.c (use_thunk): Register thunk with
1130         cgraph_finalize_function.
1131         * error.c (function_category): Guard access of DECL_LANG_SPECIFIC.
1132
1133 2009-07-17  Richard Guenther  <rguenther@suse.de>
1134
1135         * init.c (build_vec_delete_1): Do not set DECL_REGISTER on the
1136         temporary pointer.
1137
1138 2009-07-17  Aldy Hernandez  <aldyh@redhat.com>
1139             Manuel López-Ibáñez  <manu@gcc.gnu.org>
1140
1141         PR 40435 
1142         * typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c,
1143         tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c,
1144         call.c, cvt.c, mangle.c: Add location argument to
1145         fold_{unary,binary,ternary}, fold_build[123], build_call_expr,
1146         build_size_arg, build_fold_addr_expr, build_call_array,
1147         non_lvalue, size_diffop, fold_build1_initializer,
1148         fold_build2_initializer, fold_build3_initializer,
1149         fold_build_call_array, fold_build_call_array_initializer,
1150         fold_single_bit_test, omit_one_operand, omit_two_operands,
1151         invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref,
1152         fold_indirect_ref, combine_comparisons, fold_builtin_*,
1153         fold_call_expr, build_range_check, maybe_fold_offset_to_address,
1154         round_up, round_down.
1155
1156 2009-07-16  Jason Merrill  <jason@redhat.com>
1157
1158         PR libstdc++/37907
1159         Split POD into "standard-layout" and "trivial" as per N2230,
1160         Support std::is_standard_layout and std::is_trivial traits.
1161         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_STD_LAYOUT,
1162         CPTK_IS_TRIVIAL.
1163         (struct lang_type_class): Add non_std_layout.
1164         (CLASSTYPE_NON_STD_LAYOUT): New.
1165         * class.c (check_bases): Set it.
1166         (check_field_decls): Likewise.
1167         (check_bases_and_members): Likewise.
1168         * parser.c (cp_parser_primary_expression): Handle RID_IS_STD_LAYOUT,
1169         RID_IS_TRIVIAL.
1170         (cp_parser_trait_expr): Likewise.
1171         * semantics.c (trait_expr_value): Handle CPTK_IS_STD_LAYOUT,
1172         CPTK_IS_TRIVIAL.
1173         (finish_trait_expr): Likewise.
1174         * tree.c (scalarish_type_p, trivial_type_p, std_layout_type_p): New.
1175         (pod_type_p): Use them.
1176         (type_has_nontrivial_copy_init, type_has_nontrivial_default_init): New.
1177
1178         Adjust bits of the language that no longer refer to POD types.
1179         * call.c (convert_arg_to_ellipsis): Use type_has_nontrivial_copy_init
1180         and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
1181         (build_x_va_arg): Likewise.
1182         (call_builtin_trap): Remove.
1183         * decl.c (declare_local_label): Use type_has_nontrivial_default_init
1184         and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
1185         (cp_finish_decl): Likewise.
1186         (check_previous_goto_1, check_goto): Adjust error.
1187         * typeck.c (build_class_member_access_expr): Check
1188         CLASSTYPE_NON_STD_LAYOUT rather than CLASSTYPE_NON_POD_P.
1189
1190 2009-07-14  Taras Glek  <tglek@mozilla.com>
1191             Rafael Espindola  <espindola@google.com>
1192
1193         * Make-lang.in: Added CP_PLUGIN_HEADERS and
1194         c.install-target to export cp-tree.h cxx-pretty-print.h
1195         name-lookup.h headers for plugins.
1196
1197 2009-07-14  Jason Merrill  <jason@redhat.com>
1198
1199         PR c++/37276
1200         * decl.c (decls_match): A non-extern-C declaration doesn't match
1201         a builtin extern-C declaration.
1202
1203         PR c++/40746
1204         * name-lookup.c (qualified_lookup_using_namespace): Don't stop
1205         looking in used namespaces just because we found something on
1206         another branch.
1207
1208         PR c++/40740
1209         * semantics.c (perform_koenig_lookup): Handle empty template args.
1210
1211         * call.c (build_over_call): Use can_trust_pointer_alignment.
1212
1213 2009-07-14  Dodji Seketeli  <dodji@redhat.com>
1214
1215         PR debug/40705
1216         PR c++/403057
1217         * decl2.c (grokfield): Don't call set_underlying_type on typedef
1218         decls that are type names.
1219
1220 2009-07-13  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1221
1222         PR C++/22154
1223         * parser.c (cp_parser_elaborated_type_specifier): Accept typename in
1224         front of qualified names.
1225
1226 2009-07-12  Jason Merrill  <jason@redhat.com>
1227
1228         PR c++/36628
1229         * tree.c (rvalue): Use lvalue_or_rvalue_with_address_p.
1230
1231         PR c++/37206
1232         * cp-tree.h (enum cp_lvalue_kind_flags): Add clk_rvalueref.
1233         * tree.c (lvalue_p_1): Return it.  Remove
1234         treat_class_rvalues_as_lvalues parm.
1235         (real_lvalue_p): Disallow pseudo-lvalues here.
1236         (lvalue_or_rvalue_with_address_p): New fn.
1237         * call.c (initialize_reference): Use it instead of real_lvalue_p.
1238
1239         PR c++/40689
1240         * init.c (build_new_1): Handle initializer list as array initializer.
1241         (build_vec_init): Likewise.
1242         * typeck.c (cp_build_modify_expr): Likewise.
1243         * typeck2.c (process_init_constructor_array): Error rather than abort
1244         if too many initializers.
1245
1246 2009-07-10  Jakub Jelinek  <jakub@redhat.com>
1247
1248         PR c++/40502
1249         * error.c (cp_print_error_function): Check for NULL block.
1250
1251 2008-07-09  Simon Martin  <simartin@users.sourceforge.net>
1252             Jason Merrill  <jason@redhat.com>
1253
1254         * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
1255         append_type_to_template_for_access_check_1): Use CLASS_TYPE_P.
1256
1257 2009-07-09  Dodji Seketeli  <dodji@redhat.com>
1258
1259         PR c++/40684
1260         * pt.c (type_unification_real): Use tsubst_template_arg instead
1261         of tsubst to substitute default template arguments.
1262
1263 2009-07-08  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1264
1265         PR c++/31246
1266         * init.c (build_new_1): Set TREE_NO_WARNING for compiler-generated
1267         code.
1268         * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1269         
1270
1271 2009-07-07  Jason Merrill  <jason@redhat.com>
1272
1273         PR c++/35828
1274         * pt.c (tsubst_decl): Don't abort if we didn't change anything
1275         in a TEMPLATE_DECL's args.
1276
1277 2009-07-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1278
1279         * semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by
1280         EXPR_LOCATION.
1281         
1282 2009-07-07  Jason Merrill  <jason@redhat.com>
1283
1284         PR c++/37816
1285         * decl.c (build_enumerator): Don't add enumerators for a
1286         scoped enum to the enclosing class.
1287
1288         PR c++/40639
1289         * decl.c (start_enum): Allow dependent underlying type.
1290
1291         PR c++/40633
1292         * decl.c (finish_enum): Finish scope even in a template.
1293
1294 2009-07-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1295
1296         * init.c: Replace %J by an explicit location. Update all calls.
1297         * decl.c: Likewise.
1298         * typeck2.c: Likewise.
1299         * pt.c: Likewise.
1300         * name-lookup.c: Likewise.
1301         
1302 2009-07-06  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1303
1304         * decl.c: Replace %H by an explicit location. Update all calls.
1305         * except.c: Likewise.
1306         * semantics.c: Likewise.
1307         * parser.c: Likewise.
1308
1309 2009-07-06  Simon Martin  <simartin@users.sourceforge.net>
1310
1311         PR c++/40557
1312         * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
1313         append_type_to_template_for_access_check_1): Use
1314         RECORD_OR_UNION_CODE_P.
1315
1316 2009-07-04  Jason Merrill  <jason@redhat.com>
1317
1318         * pt.c (retrieve_specialization): Don't get confused by a
1319         using-declaration that brings in another instance of this template
1320         from a base class.
1321
1322         * ptree.c (cxx_print_type): Fix logic.
1323
1324         * cp-tree.h (LANG_DECL_FN_CHECK): Fix non-checking version.
1325
1326         PR c++/40619
1327         * cp-tree.h (struct lang_decl_parm): New.
1328         (struct lang_decl): Add it.
1329         (LANG_DECL_PARM_CHECK): New.
1330         (DECL_PARM_INDEX): New.
1331         * decl2.c (parm_index): Remove.
1332         * lex.c (retrofit_lang_decl): Handle parms.
1333         (cxx_dup_lang_specific_decl): Likewise.
1334         * mangle.c (write_expression): Adjust.
1335         * tree.c (cp_tree_equal): Adjust.
1336         (decl_linkage): Only check DECL_COMDAT for functions and variables.
1337         * parser.c (cp_parser_parameter_declaration_list): Set
1338         DECL_PARM_INDEX.
1339         * pt.c (iterative_hash_template_arg): Hash it.
1340
1341 2009-07-03  Jason Merrill  <jason@redhat.com>
1342
1343         * cp-tree.h (struct lang_decl): Overhaul.
1344         (struct lang_decl_flags): Remove.
1345         (struct lang_decl_base): New.
1346         (struct lang_decl_min): New.
1347         (struct lang_decl_fn): New.
1348         (struct lang_decl_ns): New.
1349         (CAN_HAVE_FULL_LANG_DECL_P): Replace with LANG_DECL_HAS_MIN.
1350         (LANG_DECL_MIN_CHECK): New.
1351         (LANG_DECL_FN_CHECK): New.
1352         (LANG_DECL_NS_CHECK): New.
1353         (STRIP_TEMPLATE): New.
1354         (NON_THUNK_FUNCTION_CHECK): Remove.
1355         (DECL_DECLARES_FUNCTION_P): New.
1356         (lots): Adjust.
1357         * lex.c (retrofit_lang_decl, cxx_dup_lang_specific_decl): Adjust.
1358         * decl.c (push_local_name, duplicate_decls): Adjust.
1359         * decl2.c (start_objects): Don't set u2sel.
1360         * semantics.c (finish_omp_threadprivate): Adjust.
1361         * class.c (build_clone): Don't do much on TEMPLATE_DECLs.
1362         (decl_cloned_function_p): Out-of-line implementation of macros.
1363         (clone_function_decl, adjust_clone_args): Use DECL_CLONED_FUNCTION_P.
1364         * mangle.c (write_unqualified_name): Don't check function flags
1365         on non-functions.
1366         * method.c (make_alias_for): Don't set DECL_CLONED_FUNCTION.
1367         * pt.c (build_template_decl): Don't set function flags.
1368         (check_default_tmpl_args): Check that it's a function.
1369         (instantiate_template): Use DECL_ABSTRACT_ORIGIN to find the
1370         cloned template.
1371
1372         * pt.c (tsubst_decl) [FUNCTION_DECL]: Don't tsubst
1373         DECL_CLONED_FUNCTION.
1374
1375         * cp-tree.h (struct lang_type_class): Move sorted_fields here.
1376         * class.c (finish_struct_1): Adjust.
1377         * ptree.c (cxx_print_decl, cxx_print_type): Adjust.
1378         * search.c (lookup_field_1): Adjust.
1379
1380         * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Remove.
1381         * decl.c (finish_method): Don't add to it.
1382         * class.c (fixup_pending_inline): Remove.
1383         (fixup_inline_methods): Remove.
1384         (finish_struct_1): Don't call it.
1385
1386         * error.c (dump_function_name): Handle null name.
1387
1388 2009-07-02  Mark Mitchell  <mark@codesourcery.com>
1389
1390         * typeck.c (cp_build_binary_op): Move warnings about use of NULL
1391         in arithmetic earlier and allow comparisions of NULL with
1392         pointers-to-members.
1393
1394 2009-07-02  Jason Merrill  <jason@redhat.com>
1395
1396         Use hash tables for template specialization lookup.
1397         * pt.c (struct spec_entry): New type.
1398         (decl_specializations, type_specializations): New hash tables.
1399         (register_specialization, retrieve_specialization): Use them.
1400         (reregister_specialization, lookup_template_class): Use them.
1401         (eq_specializations, hash_tmpl_and_args, hash_specialization): New.
1402         (iterative_hash_template_arg): New.
1403         (init_template_processing): New
1404         (process_partial_specialization): Don't look to see if we already
1405         have this partial specialization.
1406         (maybe_process_partial_specialization): Handle reassigning
1407         full specializations when we get an explicit specialization
1408         of the partial instantiation.
1409         (tsubst_friend_function): Adjust specialization reassignment code.
1410         (instantiate_template): Only do one lookup.
1411         (instantiate_decl): Don't do any lookup.
1412         * cp-tree.h: Declare init_template_processing.
1413         * decl.c (duplicate_decls): Pass args to reregister_specialization.
1414
1415 2009-07-01  Jason Merrill  <jason@redhat.com>
1416
1417         * cp-tree.h (DECL_CLASS_TEMPLATE_P): Use DECL_IMPLICIT_TYPEDEF_P.
1418
1419         * pt.c (register_specialization): Use duplicate_decls to merge
1420         the argument with a previous specialization.
1421         (check_explicit_specialization): Call register_specialization to
1422         merge the TEMPLATE_DECL with a previous version.
1423         (determine_specialization): Return the args even if fn is a template.
1424
1425 2009-07-01  Ian Lance Taylor  <iant@google.com>
1426
1427         * g++spec.c (lang_specific_driver): Bump num_args by 1.
1428
1429 2009-06-30  Jason Merrill  <jason@redhat.com>
1430
1431         PR c++/40595
1432         * pt.c (tsubst_pack_expansion): Handle unexpanded packs in an
1433         EXPR_PACK_EXPANSION.
1434
1435 2009-06-29  Jason Merrill  <jason@redhat.com>
1436
1437         PR c++/40274
1438         * error.c (dump_template_parms): Pass all args to
1439         count_non_default_template_args.
1440         (count_non_default_template_args): Pull out the inner ones.
1441
1442 2009-06-26  H.J. Lu  <hongjiu.lu@intel.com>
1443
1444         * decl.c (duplicate_decls): Re-indent.
1445
1446 2009-06-25  Ian Lance Taylor  <iant@google.com>
1447
1448         * call.c (avoid_sign_compare_warnings): New static function.
1449         (build_new_op): Call it.
1450         * typeck.c (cp_build_binary_op): Don't call warn_sign_compare if
1451         TREE_NO_WARNING is set on either operand.
1452
1453 2009-06-25  Ian Lance Taylor  <iant@google.com>
1454
1455         * g++spec.c (SKIPOPT): define.
1456         (lang_specific_driver): Handle -static-libstdc++.  Only add
1457         LIBSTDCXX_STATIC if we add LIBSTDCXX.
1458
1459 2009-06-25  Ian Lance Taylor  <iant@google.com>
1460
1461         * cvt.c (convert_to_void): Only warn about COND_EXPR if neither
1462         the second nor third operand has side effects.
1463
1464 2009-06-25  Ian Lance Taylor  <iant@google.com>
1465
1466         * parser.c (cp_parser_binary_expression): Increment
1467         c_inhibit_evaluation_warnings while parsing the right hand side of
1468         "true || x" or "false && x".
1469         * typeck.c (cp_build_binary_op): Only call warn_for_sign_compare
1470         if c_inhibit_evaluation_warnings is zero.
1471
1472 2009-06-24  Jason Merrill  <jason@redhat.com>
1473
1474         * error.c (dump_decl): Do say "typedef" for the injected class name.
1475
1476         * pt.c (lookup_template_class): Use currently_open_class,
1477         compare template args later.
1478
1479         PR c++/40342
1480         * decl.c (decls_match): Check DECL_TI_TEMPLATE too.
1481         * class.c (resolve_address_of_overloaded_function): Fix typo.
1482
1483 2009-06-18  Aldy Hernandez  <aldyh@redhat.com>
1484
1485         * class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.
1486         * decl.c (finish_decl): Remove.
1487         (declare_global_var): Replace finish_decl with cp_finish_decl.
1488         (start_method): Same.
1489         * rtti.c (emit_tinfo_decl): Same.
1490         * pt.c (tsubst_expr): Same.
1491         (instantiate_decl): Same.
1492         * decl2.c (grokbitfield): Same.
1493         * name-lookup.c (pushdecl_top_level_1): Same.
1494         * cp-tree.h: Remove finish_decl.
1495
1496 2009-06-16  David Edelsohn  <edelsohn@gnu.org>
1497
1498         * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL.
1499         (lang_specific_driver): Always allocate extra argument.
1500         Add LIBSTDCXX_STATIC to arglist if defined and linking
1501         statically.
1502
1503 2009-06-16  Ian Lance Taylor  <iant@google.com>
1504
1505         * Make-lang.in (cp/class.o): Depend upon gt-cp-class.h.
1506         (cp/semantics.o): Depend upon gt-cp-semantics.h.
1507
1508 2009-06-16  Ian Lance Taylor  <iant@google.com>
1509
1510         * parser.c (cp_unevaluated_operand): Define global variable.
1511         (cp_parser_question_colon_clause): Increment
1512         c_inhibit_evaluation_warnings when evaluating an expression which
1513         will never be executed.
1514         (cp_parser_decltype): Increment cp_unevaluated_operand and
1515         c_inhibit_evaluation_warnings, not skip_evaluation.
1516         (cp_parser_sizeof_operand): Likewise.
1517         (cp_parser_enclosed_template_argument_list): Save
1518         cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
1519         skip_evaluation.
1520         * cp-tree.h (struct saved_scope): Remove skip_evaluation field.
1521         Add unevaluated_operand and inhibit_evaluation_warnings fields.
1522         (cp_unevaluated_operand): Declare.
1523         * name-lookup.c (push_to_top_level): Save cp_unevaluated_operand
1524         and c_inhibit_evaluation_warnings rather than skip_evaluation.
1525         (pop_from_top_level): Restore cp_unevaluated_operand and
1526         c_inhibit_evaluation_warnings rather than skip_evaluation.
1527         * class.c (build_base_path): Check cp_unevaluated_operand rather
1528         than skip_evaluation.
1529         * typeck.c (build_class_member_access_expr): Likewise.
1530         (cp_build_binary_op): Don't warn about bad shift counts if
1531         c_inhibit_evaluation_warnings is non-zero.
1532         * pt.c (coerce_template_parms): Save state of
1533         cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
1534         skip_evaluation.
1535         (tsubst_aggr_type): Likewise.
1536         (tsubst_pack_expansion): Check cp_unevaluated_operand rather than
1537         skip_evaluation.
1538         (tsubst_copy): Likewise.
1539         (tsubst): Set cp_unevaluated_operand and
1540         c_inhibit_evaluation_warnings, not skip_evaluation.
1541         (tsubst_copy_and_build): Likewise.
1542         * call.c (convert_arg_to_ellipsis): Check cp_unevaluated_operand
1543         rather than skip_evaluation.
1544         * decl2.c (mark_used): Likewise.
1545         * semantics.c (finish_non_static_data_member): Likewise.
1546         * cvt.c (cp_convert_and_check): Check
1547         c_inhibit_evaluation_warnings rather than skip_evaluation.
1548         * mangle.c (write_type): Set cp_unevaluated_operand rather than
1549         skip_evaluation.
1550
1551 2009-06-15  Ian Lance Taylor  <iant@google.com>
1552
1553         * parser.c (cp_parser_direct_declarator): Add braces around
1554         variables declared before label.
1555
1556 2009-06-15  Rafael Avila de Espindola  <espindola@google.com>
1557
1558         * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove.
1559         * cp-tree.h (cxx_comdat_group): Change signature.
1560         * decl.c (duplicate_decls): Use DECL_COMDAT_GROUP.
1561         (cxx_comdat_group): Change signature.
1562         * decl2.c (comdat_linkage, maybe_make_one_only): Update call to
1563         make_decl_one_only.
1564         (constrain_visibility, get_guard): Use DECL_COMDAT_GROUP.
1565         * method.c (use_thunk): Update call to make_decl_one_only.
1566         * optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP
1567
1568 2009-06-12  Aldy Hernandez  <aldyh@redhat.com>
1569
1570         * typeck.c (cp_build_binary_op): Pass location to overflow_warning.
1571         (build_modify_expr): New arg.
1572         * semantics.c (finish_unary_op_expr): Pass location to
1573         overflow_warning.
1574         (handle_omp_for_class_iterator): Pass location to build_modify_expr.
1575         * typeck.c (cxx_sizeof_or_alignof_type): Pass location to
1576         c_sizeof_or_alignof_type.
1577         (build_array_ref): New argument.
1578         (build_compound_expr): Same.
1579         (build_const_cast): Same.
1580         (build_ptrmemfunc): Pass location to build_c_cast.
1581         * init.c (avoid_placement_new_aliasing): Pass location to
1582         build_stmt.
1583         (build_vec_delete_1): Pass location to cp_build_modify_expr,
1584         build_compound_expr.
1585         * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
1586         * decl.c (poplevel): Pass location to c_build_bind_expr.
1587         (finish_case_label): Pass location to build_case_label.
1588         (finish_constructor_body): Same.
1589         (finish_destructor_body): Pass location to build_stmt.
1590         (cxx_maybe_build_cleanup): Same, but to build_compound_expr.
1591         * call.c (build_new_op): Pass location to build_array_ref.
1592         (build_x_va_arg): Pass location to build_va_arg.
1593         * except.c (expand_end_catch_block): Pass location to
1594         build_stmt.
1595         * cp-tree.h (build_array_ref): New argument.
1596         (build_compound_expr): Same.
1597         (build_c_cast): Same.
1598         * cp-gimplify.c (gimplify_if_stmt): Pass location on down.
1599         (gimplify_switch_stmt): Same.
1600         * typeck2.c (split_nonconstant_init_1): Same.
1601         * pt.c (tsubst_copy): Same.
1602         * semantics.c (add_decl_expr): Same.
1603         (do_poplevel): Same.
1604         (push_cleanup): Same.
1605         (finish_goto_stmt): Same.
1606         (finish_expr_stmt): Same.
1607         (begin_if_stmt): Same.
1608         (begin_while_stmt): Same.
1609         (begin_do_stmt): Same.
1610         (finish_return_stmt): Same.
1611         (begin_for_stmt): Same.
1612         (finish_break_stmt): Same.
1613         (finish_continue_stmt): Same.
1614         (begin_switch_stmt): Same.
1615         (begin_try_block): Same.
1616         (begin_handler): Same.
1617         (finish_asm_stmt): Same.
1618         (finish_label_stmt): Same.
1619         (finish_stmt_expr_expr): Same.
1620         (finalize_nrv_r): Same.
1621         (finish_omp_atomic): Same.
1622         * name-lookup.c (do_using_directive): Same.
1623         * decl2.c (grok_array_decl): Same.
1624         * parser.c (cp_parser_cast_expression): Same.
1625         (cp_parser_selection_statement): Same.
1626         (cp_parser_implicitly_scoped_statement): Same.
1627         (cp_parser_objc_selector_expression): Same.
1628         (cp_parser_objc_synchronized_statement): Same.
1629         (cp_parser_objc_throw_statement): Same.
1630         (cp_parser_omp_critical): Same.
1631         (cp_parser_omp_master): Same.
1632         * typeck.c (build_function_call): Add location argument.
1633         * init.c: Add location argument to all build_decl calls.
1634         * class.c: Same.
1635         * method.c: Same.
1636         * rtti.c: Same.
1637         * tree.c: Same.
1638         * pt.c: Same.
1639         * semantics.c: Same.
1640         * lex.c: Same.
1641         * decl2.c: Same.
1642         * cp-gimplify.c: Same.
1643         * decl.c: Same.
1644         (cp_make_fname_decl): Add location argument.  Pass location ot
1645         build_decl.
1646         (finish_case_label): Same.
1647         * cp-tree.h (finish_case_label): Add location argument.
1648         * parser.c (cp_parser_label_for_labeled_statement): Pass location to
1649         finish_case_label.
1650         
1651 2009-06-09  Jason Merrill  <jason@redhat.com>
1652
1653         PR c++/40381
1654         * decl2.c (mark_used): Return after complaining about deleted fn.
1655
1656 2009-06-08  Jason Merrill  <jason@redhat.com>
1657
1658         * parser.c (cp_parser_type_id_1): 'auto' type is ok with a
1659         late-specified return type.
1660
1661 2009-06-08  Jakub Jelinek  <jakub@redhat.com>
1662
1663         PR c++/40373
1664         * call.c (check_dtor_name): Return false even if
1665         get_type_value (name) is error_mark_node.
1666
1667         PR c++/40370
1668         PR c++/40372
1669         * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
1670         on error_mark_node.  Check for VLAs outside of function context
1671         before check whether to wrap bounds into a NOP_EXPR with
1672         TREE_SIDE_EFFECTS.
1673
1674 2009-06-08  Alexandre Oliva  <aoliva@redhat.com>
1675
1676         * repo.c (get_base_filename): Use aux_base_name rather than
1677         alternate temporary file during second compare debug compilation.
1678         (finish_repo): Skip during -fcompare-debug-second.
1679
1680 2009-06-06  Ian Lance Taylor  <iant@google.com>
1681
1682         * parser.c (cp_parser_label_for_labeled_statement): Support
1683         attribute on labels if immediately followed by semicolon.
1684         * semantics.c (finish_label_stmt): Return new label.
1685         * pt.c (tsubst_expr): Handle attributes for LABEL_EXPR.
1686
1687 2009-06-03  Ian Lance Taylor  <iant@google.com>
1688
1689         * Make-lang.in (cc1plus-checksum.o): Depend upon $(CONFIG_H) and
1690         $(SYSTEM_H).
1691
1692 2009-06-02  Mark Mitchell  <mark@codesourcery.com>
1693
1694         * decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
1695
1696 2009-06-02  Jason Merrill  <jason@redhat.com>
1697
1698         PR c++/40308
1699         PR c++/40311
1700         * typeck.c (cp_build_modify_expr): Always pass init-lists to the
1701         conversion code.
1702         * call.c (implicit_conversion): Allow init-list conversion to scalar
1703         during direct-initialization, too.  Mark the conversion bad if it
1704         has too many levels of braces.
1705         (convert_like_real): And give a helpful error.
1706
1707         PR c++/40306
1708         PR c++/40307
1709         * decl.c (cp_finish_decl): Handle auto deduction from ().
1710         * typeck.c (build_x_indirect_ref): Handle dereferencing an operand
1711         with dependent type that is known to be a pointer.
1712
1713 2009-06-02  Simon Martin  <simartin@users.sourceforge.net>
1714
1715         PR c++/38089
1716         * pt.c (register_specialization): Properly setup DECL_CONTEXT for
1717         specializations in an invalid namespace.
1718
1719 2009-06-01  Aldy Hernandez  <aldyh@redhat.com>
1720
1721         * error.c (print_instantiation_partial_context): Print column
1722         numbers.
1723
1724 2009-05-29  Ian Lance Taylor  <iant@google.com>
1725
1726         * error.c (cp_printer): Don't use va_arg with enum type.
1727
1728 2009-05-28  Dodji Seketeli  <dodji@redhat.com>
1729
1730         PR c++/39754
1731         * cp-tree.h (canonical_type_variant): Remove this function declaration.
1732         (strip_typedefs): New function declaration.
1733         * tree.c (strip_typedefs): New function definition.
1734         (canonical_type_variant): Remove function definition.
1735         * cvt.c (convert_from_reference): No need to use
1736         canonical_type_variant.
1737         * typeck.c (cp_build_indirect_ref): Likewise.
1738         * error.c (dump_template_bindings): Use strip_typedefs instead of
1739         canonical_type_variant.
1740         * pt.c (convert_template_argument, unify): Likewise.
1741         * mangle.c (canonicalize_for_substitution): Don't use
1742         canonical_type_variant.
1743
1744 2009-05-27  Jason Merrill  <jason@redhat.com>
1745
1746         * call.c (implicit_conversion): Handle conversion from
1747         initializer-list to scalar.
1748         (convert_like_real): Likewise.  Avoid crashing on list
1749         initialization with bad conversions.
1750         (can_convert): Use LOOKUP_EXPLICIT.
1751         (can_convert_arg_bad): Add flags parm.
1752         * cp-tree.h: Adjust.
1753         * typeck.c (convert_for_assignment): Pass flags.
1754
1755 2009-05-27  Ian Lance Taylor  <iant@google.com>
1756
1757         * Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
1758         (cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
1759
1760 2009-05-26  Ian Lance Taylor  <iant@google.com>
1761
1762         * Make-lang.in (g++spec.o): Use $(COMPILER).
1763         (g++$(exeext), cc1plus-dummy$(exeext)): Likewise.
1764         (cc1plus$(exeext)): Likewise.
1765
1766 2009-05-26  Dodji Seketeli  <dodji@redhat.com>
1767
1768         PR c++/40007
1769         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Remove this accessor.
1770         (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): New accessor.
1771         (get_types_needing_access_check): Declare new entry point.
1772         * pt.c (append_type_to_template_for_access_check_1,
1773         get_types_needing_access_check): New functions.
1774         (perform_typedefs_access_check): Accept FUNCTION_DECLs and
1775         RECORD_TYPEs rather than TEMPLATE_DECLs. Use the new
1776         get_types_needing_access_check, no more
1777         MEMBER_TYPES_NEEDING_ACCESS_CHECK.
1778         (instantiate_class_template): Set input_location to the source
1779         location of the most specialized template definition.
1780         Perform access check using the RECORD_TYPE of the template, not its
1781         associated most generic TEMPLATE_DECL.
1782         (append_type_to_template_for_access_check): Augment function
1783         comments. Use the new get_types_needing_access_check, not
1784         MEMBER_TYPE_NEEDING_ACCESS_CHECK. Use the new
1785         append_type_to_template_for_access_check_1 subroutine.
1786
1787 2009-05-22  Jason Merrill  <jason@redhat.com>
1788
1789         PR c++/38064
1790         * typeck.c (cp_build_binary_op): Allow ENUMERAL_TYPE in
1791         arithmetic comparisons.
1792         (cp_common_type): Handle scoped enums.
1793
1794         * call.c (promoted_arithmetic_type_p): Don't use INTEGRAL_TYPE_P.
1795         (add_builtin_candidate, add_builtin_candidates): Likewise.
1796         (convert_like_real): Likewise.
1797         * class.c (check_bitfield_decl): Likewise.
1798         * decl.c (check_static_variable_definition): Likewise.
1799         (compute_array_index_type): Likewise.
1800         * decl2.c (grokbitfield): Likewise.
1801         * init.c (build_new_1): Likewise.
1802         * pt.c (convert_nontype_argument): Likewise.
1803         (current_instantiation): Likewise.
1804         * tree.c (pod_type_p): Likewise.
1805         * typeck.c (build_static_cast_1): Likewise.
1806         (build_reinterpret_cast_1): Likewise.
1807
1808 2009-05-22  Richard Guenther  <rguenther@suse.de>
1809
1810         PR middle-end/38964
1811         * init.c (avoid_placement_new_aliasing): Remove.
1812         (build_new_1): Do not call it.
1813
1814 2009-05-22  Mark Mitchell  <mark@codesourcery.com>
1815
1816         * decl2.c (decl_needed_p): Consider dllexport'd functions needed.
1817         * semantics.c (expand_or_defer_fn): Similarly.
1818
1819 2009-05-20  Ian Lance Taylor  <iant@google.com>
1820
1821         * parser.c (cp_parser_postfix_expression): Change args to a vec.
1822         Release it when done.
1823         (tree_vector): Define typedef.  Define VEC functions.
1824         (cp_parser_parenthesized_expression_list): Change return type to
1825         vec.  Change all callers.
1826         (cp_parser_new_expression): Change placement and initializer to
1827         vecs.  Release them when done.
1828         (cp_parser_new_placement): Change return type to vec.  Change all
1829         callers.
1830         (cp_parser_new_initializer): Likewise.
1831         * typeck.c (build_function_call_vec): Just call
1832         cp_build_function_call_vec.
1833         (cp_build_function_call): Just build a vec and call
1834         cp_build_function_call_vec.
1835         (cp_build_function_call_vec): New function based on old
1836         cp_build_function_call.
1837         (convert_arguments): Remove nargs and argarray parameters.  Change
1838         values to a vec.  Change caller.
1839         (build_x_compound_expr_from_vec): New function.
1840         (cp_build_modify_expr): Build vec to pass to
1841         build_special_member_call.
1842         * call.c (struct z_candidate): Add first_arg field.  Change args
1843         field to vec.
1844         (convert_class_to_reference): Handle first argument separately.
1845         (add_candidate): Add first_arg parameter.  Change args parameter
1846         to vec.  Change all callers.
1847         (add_function_candidate, add_conv_candidate): Likewise.
1848         (add_template_candidate_real, add_template_candidate): Likewise.
1849         (add_template_conv_candidate): Likewise.
1850         (build_user_type_conversion_1): Handle first argument separately.
1851         (resolve_args): Change return type and parameter type to vecs.
1852         Change all callers.
1853         (perform_overload_resolution): Change args parameter to vec.
1854         Change all callers.
1855         (build_new_function_call, build_operator_new_call): Likewise.
1856         (add_candidates): Likewise.
1857         (build_op_call): New globally visible function, built from and
1858         replacing static function build_object_call.
1859         (build_new_op): Don't handle CALL_EXPR.  Build vec, not tree_list,
1860         of arguments.
1861         (build_op_delete_call): Build vec to pass to
1862         cp_build_function_call_vec.
1863         (build_temp): Build vec to pass to build_special_member_call.
1864         (convert_like_real): Likewise.
1865         (perform_direct_initialization_if_possible): Likewise.
1866         (build_over_call): Handle first_arg field.  Use build_call_array
1867         rather than build_call_list.
1868         (build_special_member_call): Change args parameter to vec.  Change
1869         all callers.
1870         (build_new_method_call): Likewise.
1871         * init.c (expand_default_init): Change parms to vec.
1872         (build_raw_new_expr): Change placement and init to vecs.  Change
1873         all callers.
1874         (build_new_1, build_new): Likewise.
1875         * class.c (resolve_address_of_overloaded_function): Build array to
1876         pass to fn_type_unification.
1877         * pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
1878         build_new.  For CALL_EXPR create a vec rather than a tree_list;
1879         expand a pack if necessary.
1880         (fn_type_unification): Change args parameter to const tree *.  Add
1881         nargs parameter.  Change all callers.
1882         (type_unification_real): Likewise.
1883         (unify): Build array to pass to type_unification_real.
1884         (get_bindings): Build array to pass to fn_type_unification.
1885         (any_type_dependent_arguments_p): Change args parameter to a vec.
1886         Change all callers.
1887         (make_args_non_dependent): Renamed from build_non_dependent_args.
1888         Change return type to void.  Change parameter type to vec.  Change
1889         all callers.
1890         (do_auto_deduction): Pass an array to type_unification_real.
1891         * semantics.c (perform_koenig_lookup): Change args to vec.  Change
1892         all callers.
1893         (finish_call_expr): Change args to vec.  Change all callers.  Call
1894         build_op_call instead of passing CALL_EXPR to build_new_op.
1895         (cxx_omp_create_clause_info): Allocate vec to pass to
1896         build_special_member_call.
1897         * decl2.c (build_offset_ref_call_from_tree): Change args parameter
1898         to vec.  Change all callers.
1899         * name-lookup.c (lookup_function_nonclass): Likewise.
1900         (struct arg_lookup): Change args to vec.
1901         (arg_assoc_namespace): Handle args as a vec.
1902         (arg_assoc_args_vec): New static function.
1903         (lookup_arg_dependent): Change args parameter to vec.  Change all
1904         callers.
1905         * method.c (do_build_assign_ref): Allocate vec to pass to
1906         build_special_member_call.
1907         * except.c (build_throw): Likewise.
1908         * typeck2.c (build_functional_cast): Likewise.
1909         * cvt.c (ocp_convert): Likewise.
1910         * tree.c (build_min_non_dep_call_vec): Change last parameter to
1911         vec.  Change all callers.
1912         * cp-tree.h: Update declarations.
1913         * name-lookup.h: Update declarations.
1914
1915 2009-05-20  Sandra Loosemore  <sandra@codesourcery.com>
1916
1917         * typeck.c (default_conversion): Check targetm.promoted_type.
1918         * decl.c (grokdeclarator): Check targetm.invalid_return_type.
1919         (grokparms): Check targetm.invalid_parameter_type.
1920         * cvt.c (ocp_convert): Check targetm.convert_to_type.
1921         (build_expr_type_conversion): Check targetm.promoted_type.
1922
1923 2009-05-19  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1924
1925         * typeck.c (build_binary_op): Allow % on integal vectors.
1926
1927 2009-05-18  Jason Merrill  <jason@redhat.com>
1928
1929         Implement explicit conversions ops as specified in N2437.
1930         * decl.c (grokdeclarator): Handle explicit conversion ops.
1931         (check_initializer): Pass flags to store_init_value.
1932         * decl2.c (maybe_emit_vtables): Likewise.
1933         * init.c (expand_aggr_init_1): Likewise.
1934         * call.c (convert_class_to_reference): Take flags parm,
1935         check DECL_NONCONVERTING_P.
1936         (build_user_type_conversion_1): Check DECL_NONCONVERTING_P.
1937         (add_builtin_candidates): Simplify getting type of conversion.
1938         (build_object_call): Likewise.  Check DECL_NONCONVERTING_P.
1939         (implicit_conversion): Pass through LOOKUP_ONLYCONVERTING.
1940         (reference_binding): Take flags parm.  Direct-initialize copy parm.
1941         (add_function_candidate): Direct-initialize the copy parm.
1942         (add_conv_candidate): Use LOOKUP_IMPLICIT, not LOOKUP_NORMAL.
1943         (build_builtin_candidate): Add LOOKUP_ONLYCONVERTING.
1944         (conditional_conversion): Likewise.
1945         (convert_like_real): Only complain about DECL_NONCONVERTING_P
1946         constructors.
1947         (perform_implicit_conversion_flags): Add flags parm to
1948         perform_implicit_conversion.  Improve diagnostics.
1949         * cp-tree.h (LOOKUP_IMPLICIT): New macro.
1950         (LOOKUP_COPY_PARM): New bit macro.
1951         * cvt.c (build_expr_type_conversion): Check DECL_NONCONVERTING_P.
1952         * typeck.c (convert_for_assignment): Take flags parm, pass it to
1953         perform_implicit_conversion_flags.
1954         (cp_build_modify_expr): Pass flags to convert_for_assignment.
1955         (convert_for_initialization): Likewise.
1956         * typeck2.c (store_init_value): Take flags parm, pass to
1957         digest_init_flags.
1958         (digest_init_flags): Add flags parm to digest_init.
1959         (digest_init_r): Take flags parm, pass to convert_for_initialization.
1960         (process_init_constructor_array): Pass it.
1961         (process_init_constructor_record): Likewise.
1962         (process_init_constructor_union): Likewise.
1963
1964 2009-05-16  Jason Merrill  <jason@redhat.com>
1965
1966         PR c++/40139
1967         * pt.c (tsubst_qualified_id): Retain the type if we aren't dealing
1968         with a dependent type.  Actually look up the destructor.
1969         * semantics.c (finish_id_expression): Fix logic.
1970         (finish_qualified_id_expr): Don't try to use 'this' if we aren't in
1971         a function.
1972         * typeck.c (build_x_unary_op): Diagnose taking the address of a
1973         constructor or destructor.
1974         * tree.c (get_first_fn): Handle OFFSET_REF.
1975
1976 2009-05-17  Joseph Myers  <joseph@codesourcery.com>
1977
1978         * tree.c (cxx_printable_name_internal): Allow consecutive
1979         translated and untranslated cached copies of the name of the
1980         current function.
1981
1982 2009-05-15  Ian Lance Taylor  <iant@google.com>
1983
1984         * cp-tree.h (enum cp_lvalue_kind_flags): Rename from
1985         cp_lvalue_kind.  Change all uses.
1986         (enum base_access_flags): Rename from enum base_access.  Change
1987         all uses.
1988         * parser.c (enum cp_parser_flags): Remove enum tag.
1989
1990 2009-05-15  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1991
1992         PR 16302
1993         * call.c (build_new_op): Update calls to warn_logical_operator.
1994
1995 2009-05-14  Ian Lance Taylor  <iant@google.com>
1996
1997         * class.c (layout_class_type): Change itk to unsigned int.
1998         * decl.c (finish_enum): Change itk to unsigned int.
1999         * parser.c (cp_parser_check_decl_spec): Change ds to int.  Remove
2000         casts.
2001
2002 2009-05-13  David Mandelin <dmandelin@mozilla.com>:
2003
2004         * decl.c (duplicate_decls): Preserve parameter attributes.
2005
2006 2009-05-10  Jan Hubicka  <jh@suse.cz>
2007
2008         * decl2.c (cxx_callgraph_analyze_expr): Use
2009         cgraph_mark_address_taken.
2010
2011 2009-05-10  Joseph Myers  <joseph@codesourcery.com>
2012
2013         * call.c (name_as_c_string): Call type_as_string_translate.
2014         Translate identifiers to locale character set.
2015         * cp-tree.h (lang_decl_name): Update prototype.
2016         (type_as_string_translate, decl_as_string_translate,
2017         cxx_printable_name_translate): Declare.
2018         * cxx-pretty-print.c (M_): Define.
2019         (pp_cxx_unqualified_id, pp_cxx_canonical_template_parameter): Mark
2020         English fragments for conditional translation with M_.
2021         * decl.c (grokdeclarator): Translate identifiers to locale
2022         character set for diagnostics.
2023         * error.c (M_): Define.
2024         (dump_template_bindings, dump_type, dump_aggr_type,
2025         dump_type_prefix, dump_global_iord, dump_simple_decl, dump_decl,
2026         dump_function_decl, dump_template_parms, dump_expr,
2027         dump_binary_op, op_to_string, assop_to_string): Mark English
2028         fragments for conditional translation with M_.
2029         (type_as_string): Disable translation of identifiers.
2030         (type_as_string_translate): New.
2031         (expr_as_string): Disable translation of identifiers.
2032         (decl_as_string): Disable translation of identifiers.
2033         (decl_as_string_translate): New.
2034         (lang_decl_name): Add parameter translate.
2035         (args_to_string): Call type_as_string_translate.
2036         (cp_print_error_function): Call cxx_printable_name_translate.
2037         (print_instantiation_full_context,
2038         print_instantiation_partial_context): Call
2039         decl_as_string_translate.
2040         * parser.c (cp_lexer_get_preprocessor_token): Use %qE for
2041         identifier in diagnostic.
2042         * tree.c (cxx_printable_name): Change to
2043         cxx_printable_name_internal.  Add parameter translate.
2044         (cxx_printable_name, cxx_printable_name_translate): New wrappers
2045         round cxx_printable_name_internal.
2046
2047 2009-05-08  H.J. Lu  <hongjiu.lu@intel.com>
2048
2049         PR c/36892
2050         * call.c (build_call_a): Updated warn_deprecated_use call.
2051         (build_over_call): Likewise.
2052         * decl.c (grokdeclarator): Likewise.
2053         (grokparms): Likewise.
2054         * semantics.c (finish_id_expression): Likewise.
2055         * typeck.c (build_class_member_access_expr): Likewise.
2056         (finish_class_member_access_expr): Likewise.
2057
2058 2009-05-06  Dodji Seketeli  <dodji@redhat.com>
2059
2060         PR c++/17395
2061         * pt.c (tsubst_copy) <case PARM_DECL>: We don't want to tsubst the
2062         whole list of PARM_DECLs, just the current one.
2063
2064 2009-05-05  Shujing Zhao  <pearly.zhao@oracle.com>
2065
2066         * cp-tree.h:
2067         (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
2068         mangle_compound_literal): Remove unused declarations.
2069         (build_vfield_ref, cxx_print_statistics, clone_function_decl,
2070         adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
2071         pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
2072         check_for_out_of_scope_variable, print_other_binding_stack,
2073         maybe_push_decl, cxx_mark_addressable, force_target_expr,
2074         build_target_expr_with_type, finish_case_label,
2075         cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
2076         check_template_keyword, cxx_omp_predetermined_sharing,
2077         cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
2078         cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
2079         cxx_omp_privatize_by_reference): Rearrange the declarations line to
2080         match the comment that indicates the .c file which the functions are
2081         defined.
2082         (cxx_print_xnode, cxx_print_decl, cxx_print_type,
2083         cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
2084
2085 2009-05-05  Nathan Sidwell  <nathan@codesourcery.com>
2086
2087         * typeck.c (cp_build_compound_expr): Require RHS to have a known
2088         type.
2089         * class.c (resolve_address_of_overloaded_function): Use
2090         OVL_CURRENT for error message.
2091         (instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
2092         with them.  Do not copy the node.
2093
2094 2009-05-05  Jakub Jelinek  <jakub@redhat.com>
2095
2096         PR c++/40013
2097         * pt.c (tsubst): If magic NOP_EXPR with side-effects has no type,
2098         set it from its operand's type after tsubst_expr.
2099
2100 2009-05-04  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2101
2102         PR c++/28152
2103         * parser.c (cp_lexer_get_preprocessor_token):  Do not store the
2104         canonical spelling for keywords.
2105         (cp_parser_attribute_list): Use the canonical spelling for
2106         keywords in attributes.
2107
2108 2009-05-01  Joseph Myers  <joseph@codesourcery.com>
2109
2110         * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
2111         pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression,
2112         pp_cxx_new_expression, pp_cxx_delete_expression,
2113         pp_cxx_unary_expression, pp_cxx_assignment_operator,
2114         pp_cxx_assignment_expression, pp_cxx_expression,
2115         pp_cxx_function_specifier, pp_cxx_decl_specifier_seq,
2116         pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq,
2117         pp_cxx_exception_specification, pp_cxx_direct_declarator,
2118         pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement,
2119         pp_cxx_namespace_alias_definition, pp_cxx_template_parameter,
2120         pp_cxx_canonical_template_parameter, pp_cxx_template_declaration,
2121         pp_cxx_declaration, pp_cxx_typeid_expression,
2122         pp_cxx_va_arg_expression, pp_cxx_offsetof_expression,
2123         pp_cxx_trait_expression): Mostly use pp_string and
2124         pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
2125         for non-identifiers.  Mark English strings for translation.
2126         * cxx-pretty-print.h (pp_cxx_ws_string): Define.
2127         * error.c (dump_template_parameter, dump_template_bindings,
2128         dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl,
2129         dump_decl, dump_template_decl, dump_function_decl,
2130         dump_parameters, dump_exception_spec, dump_template_parms,
2131         dump_expr, dump_binary_op, dump_unary_op, op_to_string,
2132         assop_to_string, args_to_string, cp_print_error_function,
2133         print_instantiation_full_context,
2134         print_instantiation_partial_context): Mostly use pp_string and
2135         pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
2136         for non-identifiers.  Mark English strings for translation.
2137         (dump_global_iord): Mark strings for translation; use longer
2138         strings instead of substituting single words.
2139         (function_category): Return a format string marked for
2140         translation, not a single word or phrase to substitute in a longer
2141         phrase.
2142
2143 2009-04-28  Ben Elliston  <bje@au.ibm.com>
2144
2145         PR c++/35652
2146         Revert:
2147
2148         2009-03-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2149
2150         * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
2151
2152 2009-04-27  Ian Lance Taylor  <iant@google.com>
2153
2154         * semantics.c (finish_omp_clauses): Change type of c_kind to enum
2155         omp_clause_code.
2156
2157 2009-04-27  Jakub Jelinek  <jakub@redhat.com>
2158
2159         PR c++/39875
2160         * cvt.c (convert_to_void) <case INDIRECT_REF>: Only warn about
2161         -Wunused-value if implicit.
2162
2163 2009-04-24  Ian Lance Taylor  <iant@google.com>
2164
2165         * call.c (build_temp): Change 0 to enum constant.
2166         * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
2167         type.
2168         * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
2169         * decl2.c (constrain_visibility): Likewise.
2170         * parser.c (cp_lexer_get_preprocessor_token): Likewise.
2171         (cp_parser_flags): Typedef to int rather than enum type.
2172         (cp_parser_expression_stack_entry): Change prec field to enum
2173         cp_parser_prec.
2174
2175         * typeck.c (build_modify_expr): Add lhs_origtype parameter.
2176         Change all callers.
2177
2178 2009-04-22  Dodji Seketeli  <dodji@redhat.com>
2179
2180         PR c++/39639
2181         * parser.c (cp_parser_template_argument_list): Display an error
2182         when an ellipsis is not preceded by a parameter pack. Also, warn
2183         about variadic templates usage without -std=c++0x.
2184
2185 2009-04-21  Taras Glek <tglek@mozilla.com>
2186
2187         * cp-tree.h: Update GTY annotations to new syntax.
2188         * decl.c: Likewise.
2189         * mangle.c: Likewise.
2190         * name-lookup.c: Likewise.
2191         * name-lookup.h: Likewise.
2192         * parser.c: Likewise.
2193         * pt.c: Likewise.
2194         * rtti.c: Likewise.
2195         * semantics.c: Likewise.
2196         * typeck2.c: Likewise.
2197
2198 2009-04-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2199
2200         PR c++/14875
2201         * parser.c (cp_parser_error): Pass token->flags to c_parse_error.
2202
2203 2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2204
2205         PR c++/35711
2206         * typeck.c (check_for_casting_away_constness): We diagnose casting
2207         away any qualifiers not just constness.
2208         (casts_away_constness): Mention that it handles more than just
2209         constness.
2210         
2211 2009-04-21  Joseph Myers  <joseph@codesourcery.com>
2212
2213         * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
2214         ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
2215         ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
2216         ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
2217         ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
2218         cfns.gperf: Add copyright and license notices.
2219         * cfns.h: Regenerate.
2220         * ChangeLog, ChangeLog-2004: Correct dates.
2221
2222 2009-04-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2223
2224         PR 16202
2225         * tree.c (lvalue_p_1): Use const_tree.
2226         Use CONST_CAST_TREE to avoid warning.
2227         (lvalue_p): Returns bool, receives const_tree.
2228
2229 2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2230
2231         PR c++/13358
2232         * parser.c (cp_parser_check_decl_spec): Drop redundant flags.
2233         * error.c (pedwarn_cxx98): New.
2234         * cp-tree.h (pedwarn_cxx98): Declare.
2235
2236 2009-04-20  Le-Chun Wu  <lcwu@google.com>
2237
2238         PR c++/39803
2239         * init.c (build_vec_init): Set TREE_NO_WARNING on the
2240         compiler-generated INDIRECT_REF expression.
2241
2242 2009-04-20  Ian Lance Taylor  <iant@google.com>
2243
2244         * typeck.c (build_function_call_vec): New function.
2245         (cp_build_function_call): Only pass first parameter to
2246         objc_rewrite_function_call.
2247         (build_modify_expr): Add rhs_origtype parameter.  Change all
2248         callers.
2249         * decl.c (finish_decl): Add origtype parameter.  Change all
2250         callers.
2251         * semantics.c (finish_call_expr): Pass VEC to
2252         resolve_overloaded_builtin.
2253
2254 2009-04-20  Ian Lance Taylor  <iant@google.com>
2255
2256         * cp-tree.h (base_access): Change typedef to int.
2257         * parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
2258         (cp_parser_omp_threadprivate): Likewise.
2259         * pt.c (unify_pack_expansion): Add casts to enum type.
2260
2261 2009-04-19  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2262
2263         PR c/32061
2264         PR c++/36954
2265         * call.c (build_new_op): Save the original codes of operands
2266         before folding.
2267
2268 2009-04-18  Kazu Hirata  <kazu@codesourcery.com>
2269
2270         * cp-tree.h: Remove the prototype for insert_block.
2271         * decl.c (insert_block): Remove.
2272
2273 2009-04-16  Ian Lance Taylor  <iant@google.com>
2274
2275         * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t.
2276         (tsubst_flags_t): Change typedef from enum type to int.
2277
2278 2009-04-16  Paolo Bonzini  <bonzini@gnu.org>
2279
2280         * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE
2281         instead of targetm.vector_opaque_p.
2282
2283 2009-04-15  Le-Chun Wu  <lcwu@google.com>
2284
2285         PR c++/39551
2286         * call.c (build_over_call): Set TREE_NO_WARNING on the
2287         compiler-generated INDIRECT_REF expression.
2288         * cvt.c (convert_to_void): Emit warning when stripping off
2289         INDIRECT_REF.
2290
2291 2009-04-14  Diego Novillo  <dnovillo@google.com>
2292
2293         * parser.c (cp_parser_type_specifier_seq): Move call to
2294         invoke_plugin_callbacks ...
2295         (cp_parser_type_specifier_seq): ... here.
2296
2297 2009-04-14  Le-Chun Wu  <lcwu@google.com>
2298
2299         * Make-lang.in: Modify dependencies of files including plugin.h.
2300         * decl.c (finish_function): Call invoke_plugin_callbacks.
2301         * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
2302
2303 2009-04-14  Jason Merrill  <jason@redhat.com>
2304
2305         PR c++/39763
2306         * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
2307         about shadowing by tentative parms.
2308
2309 2009-04-13  Jason Merrill  <jason@redhat.com>
2310
2311         PR c++/39480
2312         * call.c (build_over_call): Don't call memcpy if the target is
2313         the same as the source.
2314
2315 2009-04-13  Jason Merrill  <jason@redhat.com>
2316
2317         PR c++/39750
2318         * pt.c (uses_template_parms): Handle CONSTRUCTOR.
2319
2320 2009-04-12  Jason Merrill  <jason@redhat.com>
2321
2322         PR c++/39742
2323         * call.c (joust): Don't crash on variadic fn.
2324
2325 2009-04-10  Jason Merrill  <jason@redhat.com>
2326
2327         PR c++/28301
2328         * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return
2329         if we see a close brace without an open brace.
2330
2331 2009-04-10  H.J. Lu  <hongjiu.lu@intel.com>
2332
2333         * parser.c (cp_parser_class_specifier): Remove the unused
2334         has_trailing_semicolon.
2335
2336 2009-04-10  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2337
2338         PR  c++/20118
2339         * parser.c (cp_parser_check_template_parameters): Take a
2340         cp_declarator parameter.
2341         (cp_parser_elaborated_type_specifier): Update to
2342         cp_parser_check_template_parameters.
2343         (cp_parser_class_head): Likewise.
2344         (cp_parser_check_declarator_template_parameters): Likewise.
2345         (cp_parser_check_template_parameters): Handle first the non-error
2346         conditions. Give more accurate diagnostics if a declarator is
2347         given. 
2348
2349 2009-04-08  Jason Merrill  <jason@redhat.com>
2350
2351         PR c++/25185
2352         * error.c (dump_aggr_type): Chase template typedefs if
2353         -fno-pretty-templates.
2354
2355 2009-04-08  Dodji Seketeli  <dodji@redhat.com>
2356
2357         PR c++/39637
2358         * parser.c (cp_parser_enumerator_definition): Make sure the
2359         initializer of the enumerator doesn't contain any bare parameter pack.
2360
2361 2009-04-07  Jason Merrill  <jason@redhat.com>
2362
2363         PR c++/34691
2364         * name-lookup.c (merge_functions): Keep multiple extern "C" functions.
2365         * call.c (joust): Complain about mismatched default arguments
2366         in extern "C" functions.
2367         * class.c (resolve_address_of_overloaded_function): Handle multiple
2368         extern "C" functions.
2369         * pt.c (resolve_overloaded_unification): Likewise.
2370
2371 2009-04-07  Jason Merrill  <jason@redhat.com>
2372
2373         PR c++/25185
2374         * error.c (dump_function_decl): Don't pretty-print templates
2375         if -fno-pretty-templates.
2376         (count_non_default_template_args): Print all args if
2377         -fno-pretty-templates.
2378
2379 2009-04-06  Jason Merrill  <jason@redhat.com>
2380
2381         PR c++/35146
2382         * pt.c (fn_type_unification): For DEDUCE_EXACT check that
2383         the deduced template arguments give us the parameter types
2384         we're looking for.
2385
2386 2009-04-05  Giovanni Bajo <giovannibajo@libero.it>
2387             Jason Merrill  <jason@redhat.com>
2388
2389         PR c++/14912
2390         * error.c (count_non_default_template_args): New fn.
2391         (dump_template_parms): Call it.
2392         (dump_template_argument_list): Call it.  Add parms parm.
2393         (dump_template_argument): Adjust call to dump_template_argument_list.
2394         (dump_type, dump_decl): Likewise.
2395         (dump_template_bindings): Refactor logic.
2396
2397 2009-04-03  Jason Merrill  <jason@redhat.com>
2398
2399         PR c++/25185
2400         * error.c (dump_template_bindings): Look through typedefs in
2401         typename results.
2402         (dump_type) [TYPENAME_TYPE]: Print the typedef name if any.
2403         (find_typenames_r): Also collect typedefs.
2404         * pt.c (unify): Strip typedefs.
2405
2406         PR c++/39608
2407         * semantics.c (finish_id_expression): Don't assume a dependent
2408         member of the current instantiation isn't a valid integral
2409         constant expression.  Check dependent_scope_p.
2410         * pt.c (dependent_scope_p): Check TYPE_P.
2411         (tsubst_copy): If args is null, just return.
2412
2413 2009-04-02  Jason Merrill  <jason@redhat.com>
2414
2415         PR c++/25185
2416         * error.c (find_typenames, find_typenames_r): New fns.
2417         (dump_function_decl): Call find_typenames.
2418         (dump_template_bindings): Print typenames as well.
2419         * pt.c (tsubst): Non-static.
2420         * cp-tree.h: Declare it.
2421
2422 2009-04-02  Dodji Seketeli  <dodji@redhat.com>
2423
2424         PR c++/26693
2425         * decl2.c (grokfield): when a typedef appears in a
2426         class, create the typedef variant type node for it.
2427         (save_template_attributes): Creating typedef variant type node
2428          here is now useless.
2429         * decl.c (grokdeclarator): If the typedef'ed struct/class was
2430         anonymous, set the proper type name to all its type variants.
2431         (xref_basetypes) : Fixup the variant types after setting
2432         TYPE_BINFO on REF.
2433         * name-lookup.c (pushdecl_maybe_friend): Reuse the
2434         set_underlying_type function to install typedef variant types.
2435         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
2436         macro.
2437         (append_type_to_template_for_access_check): New entry points.
2438         * semantics.c (check_accessibility_of_qualified_id):
2439         When a typedef that is a member of a class appears in a template,
2440         add it to the template. It will be ...
2441         * class.c (finish_struct_bits): Split type variant fixup into ...
2442         (fixup_type_variants): A new entry point.
2443         * pt.c (instantiate_class_template, instantiate_template ): ... access
2444         checked at template instantiation time.
2445         (resolve_type_name_type): The type name should be the name of the
2446         main type variant.
2447         (retrieve_specialization): Specializations of template typedefs aren't
2448         to looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
2449         (append_type_to_template_for_access_check): New entry point.
2450         (tsubst_decl): For typedefs, build the variant type from the correct
2451         original type.
2452         (get_class_bindings): Fix function comment.
2453         (perform_typedefs_access_check): New entry point.
2454
2455 2009-03-31  Jason Merrill  <jason@redhat.com>
2456
2457         PR c++/34691
2458         * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
2459         extern "C" declarations.
2460
2461         C++ DR 613
2462         * semantics.c (finish_non_static_data_member): Allow such references
2463         without an associated object in sizeof/decltype/alignof.
2464
2465         * ptree.c (cxx_print_decl): Pretty-print full name of
2466         function/template.
2467         (cxx_print_type): Pretty-print full name of class.
2468
2469         * decl.c (grokdeclarator): Reject pointer to qualified function
2470         type.
2471
2472         PR c++/37806, core issue 547
2473         * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
2474         to a typedef.
2475         * tree.c (cp_build_qualified_type_real): Don't apply restrict to a 
2476         function type.
2477         * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
2478         * decl.c (groktypename): Add is_template_arg parameter.
2479         (grokdeclarator): Allow function cv-quals on a template type arg.
2480         * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
2481         is_template_arg argument in calls to groktypename.
2482         * cp-tree.h: Adjust prototype.
2483         * error.c (dump_type_prefix, dump_type_suffix): Fix plain 
2484         FUNCTION_TYPE printing.
2485         
2486         * mangle.c (write_expression): Mangle dependent name as
2487         source-name.
2488
2489         PR c++/38030, 38850, 39070
2490         * pt.c (type_dependent_expression_p_push): New fn.
2491         (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
2492         substitution makes the call non-dependent.  Preserve koenig_p.
2493         * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
2494         for non-dependent calls.
2495         * semantics.c (finish_call_expr): Revert earlier changes.
2496         * cp-tree.h: Revert change to finish_call_expr prototype.
2497
2498 2009-03-29  Joseph Myers  <joseph@codesourcery.com>
2499
2500         PR preprocessor/34695
2501         * cp-tree.h (cp_cpp_error): Remove.
2502         * error.c (cp_cpp_error): Remove.
2503         * parser.c (cp_lexer_new_main): Set done_lexing instead of
2504         client_diagnostic and error callback.
2505
2506 2009-03-28  Paolo Bonzini  <bonzini@gnu.org>
2507
2508         * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
2509         * cp/cp-objcp-common.c (cxx_staticp): Remove.
2510         * cp/cp-tree.h (cxx_staticp): Remove.
2511
2512 2009-03-28  Jakub Jelinek  <jakub@redhat.com>
2513
2514         PR c++/39554
2515         * parser.c (cp_parser_postfix_expression): Don't call
2516         warning_if_disallowed_function_p.
2517
2518 2009-03-27  Jan Hubicka  <jh@suse.cz>
2519
2520         * except.c (choose_personality_routine): Set terminate_node to abort
2521         for java exceptions.
2522
2523 2009-03-27  Dodji Seketeli  <dodji@redhat.com>
2524             Jakub Jelinek  <jakub@redhat.com>
2525
2526         PR debug/37959
2527         * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
2528         (cp_function_decl_explicit_p): New prototype.
2529         * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
2530
2531 2009-03-27  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2532
2533         PR c++/38638
2534         * parser.c (cp_parser_elaborated_type_specifier): If we have a
2535         typename tag and don't have either a TYPE_DECL or a
2536         TEMPLATE_ID_EXPR, set the type to NULL.
2537
2538 2009-03-27  Simon Martin  <simartin@users.sourceforge.net>
2539
2540         PR c++/37647
2541         * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
2542         scope.
2543
2544 2009-03-27  Simon Martin  <simartin@users.sourceforge.net>
2545
2546         PR c++/29727
2547         * decl.c (check_array_designated_initializer): Handle error_mark_node.
2548
2549 2009-03-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2550
2551         PR c++/35652
2552         * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
2553
2554 2009-03-26  Andrew Haley  <aph@redhat.com>
2555
2556         PR C++/39380
2557         * decl2.c (possibly_inlined_p): If java exceptions are in use
2558         don't inline a decl unless it is explicitly marked inline.
2559         * lex.c: (pragma_java_exceptions): New variable.
2560         (handle_pragma_java_exceptions): Set pragma_java_exceptions.
2561         * cp-tree.h (pragma_java_exceptions): Declare new variable.
2562
2563 2009-03-24  Jason Merrill  <jason@redhat.com>
2564
2565         PR c++/28274
2566         * name-lookup.c (pushdecl_maybe_friend): Check default args later.
2567
2568 2009-03-23  Jakub Jelinek  <jakub@redhat.com>
2569
2570         PR c/39495
2571         * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
2572         code if iter is the second operand.
2573         * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
2574         argument.  If it is set, don't build the toplevel expression with
2575         build_x_binary_op, but build2.
2576         (cp_parser_assignment_expression,  cp_parser_omp_for_incr): Adjust
2577         callers.
2578         (cp_parser_omp_for_cond): Don't assume the first operand of the
2579         comparison must be decl.
2580
2581 2009-03-23  Jason Merrill  <jason@redhat.com>
2582
2583         PR c++/37729
2584         * pt.c (make_fnparm_pack): Split out from...
2585         (instantiate_decl): ...here.
2586         (tsubst_pack_expansion): Handle being called in a late-specified
2587         return type.
2588
2589         PR c++/39526
2590         * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
2591         a parm with a parm.
2592
2593 2009-03-20  Jason Merrill  <jason@redhat.com>
2594
2595         PR c++/28879
2596         * parser.c (cp_parser_direct_declarator): In a template, wrap 
2597         non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
2598         * pt.c (tsubst): Preserve it in a partial instantiation.
2599         (dependent_type_p_r): Don't check value_dependent_expression_p.
2600         * decl.c (compute_array_index_type): Don't check
2601         value_dependent_expression_p if TREE_SIDE_EFFECTS.
2602
2603         C++ core issue 703
2604         * typeck2.c (check_narrowing): Don't complain about loss of 
2605         precision when converting a floating-point constant.
2606
2607 2009-03-19  Jakub Jelinek  <jakub@redhat.com>
2608
2609         PR c/39495
2610         * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
2611         (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
2612
2613 2009-03-18  Jakub Jelinek  <jakub@redhat.com>
2614
2615         * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
2616         (eof_token): Adjust.
2617
2618 2009-03-18  H.J. Lu  <hongjiu.lu@intel.com>
2619
2620         PR c++/39425
2621         * parser.c (cp_parser_explicit_specialization): Don't skip the
2622         rest of the specialization when begin_specialization returns
2623         false.
2624
2625 2009-03-17  Jason Merrill  <jason@redhat.com>
2626
2627         * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
2628         (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
2629         * pt.c (check_explicit_specialization): Likewise.
2630         (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
2631         local specialization.
2632         * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
2633         * decl2.c (parm_index): New fn.
2634         * semantics.c (finish_decltype_type): Don't use describable_type.
2635         * mangle.c (write_expression): Likewise.  Mangle ALIGNOF_EXPR.
2636         Give a sorry for unsupported codes rather than crash.  Mangle
2637         conversions with other than 1 operand.  New mangling for PARM_DECL.
2638         * operators.def (ALIGNOF_EXPR): Mangle as "az".
2639
2640 2009-03-17  Jing Yu  <jingyu@google.com>
2641
2642         PR middle-end/39378
2643         * method.c (use_thunk): Change is_thunk from crtl to cfun.
2644
2645 2009-03-17  Paolo Carlini  <paolo.carlini@oracle.com>
2646
2647         PR c++/39475
2648         * semantics.c (check_trait_type): New.
2649         (finish_trait_expr): Use it.
2650
2651 2009-03-17  Jakub Jelinek  <jakub@redhat.com>
2652
2653         * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
2654         instead of calling imported_module_or_decl debug hook if
2655         building_stmt_tree ().
2656         * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
2657         is a NAMESPACE_DECL.
2658
2659         PR debug/37890
2660         * name-lookup.c (do_namespace_alias): Don't call global_decl debug
2661         hook at function scope.
2662
2663         PR debug/39471
2664         * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
2665         on IMPORTED_DECL.
2666
2667 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
2668
2669         PR c++/39371
2670         * semantics.c (finish_switch_cond): Don't call get_unwidened.
2671         * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
2672         instead of TREE_TYPE (cond).
2673
2674 2009-03-08  H.J. Lu  <hongjiu.lu@intel.com>
2675
2676         PR c++/39060
2677         * parser.c (cp_parser_late_parsing_default_args): Continue
2678         the loop when cp_parser_assignment_expression returns
2679         error_mark_node.
2680
2681 2009-03-07  Jason Merrill  <jason@redhat.com>
2682
2683         PR c++/39367
2684         * init.c (build_new_1): Don't use a VLA type.
2685         (build_vec_init): Handle getting a pointer for BASE.
2686
2687 2009-03-06  H.J. Lu  <hongjiu.lu@intel.com>
2688
2689         PR c++/37520
2690         * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
2691         when mangling symbols.
2692
2693 2009-03-06  Paolo Carlini  <paolo.carlini@oracle.com>
2694
2695         PR c++/33492
2696         * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
2697
2698 2009-03-06  Alexandre Oliva  <aoliva@redhat.com>
2699
2700         * decl.c (record_builtin_java_type): Use canonicalized integer
2701         types.
2702
2703 2009-03-04  Jason Merrill  <jason@redhat.com>
2704
2705         PR c++/38908
2706         * class.c (is_really_empty_class): New fn.
2707         * cp-tree.h: Declare it.
2708         * cp-objcp-common.c (cp_expr_size): Use it.
2709
2710         PR c++/13549
2711         * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
2712         * parser.c (cp_parser_postfix_expression): Call it for 
2713         TEMPLATE_ID_EXPR.
2714         * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
2715         (get_first_fn): Likewise.
2716
2717         PR c++/9634
2718         PR c++/29469
2719         PR c++/29607
2720         Implement DR 224.
2721         * decl.c (make_typename_type): Do look inside currently open classes.
2722         * parser.c (cp_parser_lookup_name): Likewise.
2723         (cp_parser_template_name): Likewise.
2724         * pt.c (dependent_scope_p): New function.
2725         * cp-tree.h: Declare it.
2726         * class.c (currently_open_class): Return fast if T isn't a class.
2727
2728 2009-02-26  H.J. Lu  <hongjiu.lu@intel.com>
2729
2730         PR c++/37789
2731         * parser.c (cp_parser_mem_initializer): Return error_mark_node
2732         if cp_parser_mem_initializer_id returns error_mark_node.
2733
2734 2009-02-24  Richard Guenther  <rguenther@suse.de>
2735
2736         PR c++/39242
2737         * pt.c (instantiate_decl): Do not instantiate extern, non-inline
2738         declared functions.
2739
2740 2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>
2741
2742         PR c++/36411
2743         * pt.c (coerce_template_template_parms): Return 0 if parameter
2744         is error_mark_node.
2745
2746 2009-02-23  Jason Merrill  <jason@redhat.com>
2747
2748         * pt.c (unify): Call maybe_adjust_types_for_deduction when
2749         deducing from an initializer list.
2750
2751 2009-02-20  Jason Merrill  <jason@redhat.com>
2752
2753         PR c++/39225
2754         * decl.c (grokdeclarator): Handle ~identifier.
2755
2756 2009-02-19  Jakub Jelinek  <jakub@redhat.com>
2757
2758         PR target/39175
2759         * decl2.c (determine_visibility): If visibility changed and
2760         DECL_RTL has been already set, call make_decl_rtl to update symbol
2761         flags.
2762
2763 2009-02-19  H.J. Lu  <hongjiu.lu@intel.com>
2764
2765         PR c++/39188
2766         * cp-tree.h (maybe_commonize_var): New.
2767
2768         * decl.c (maybe_commonize_var): Make it extern.
2769
2770         * decl2.c (finish_anon_union): Call maybe_commonize_var.
2771
2772 2009-02-18  H.J. Lu  <hongjiu.lu@intel.com>
2773
2774         PR c++/39219
2775         * parser.c (cp_parser_enum_specifier): Apply all attributes.
2776
2777 2009-02-18  Jason Merrill  <jason@redhat.com>
2778
2779         * cfns.h: Tweak pathname for cfns.gperf.
2780
2781 2009-02-13  Jason Merrill  <jason@redhat.com>
2782
2783         PR c++/39070
2784         * semantics.c (finish_call_expr): Change koenig_p parm to int.
2785         If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
2786         * cp-tree.h: Adjust prototype.
2787         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
2788
2789 2009-02-12  Jason Merrill  <jason@redhat.com>
2790
2791         PR c++/38950
2792         * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
2793
2794 2009-02-11  Jason Merrill  <jason@redhat.com>
2795
2796         PR c++/39153
2797         * decl2.c (cp_write_global_declarations): 
2798         Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
2799
2800         PR c++/30111
2801         * init.c (build_value_init_noctor): Split out from...
2802         (build_value_init): ...here.
2803         (expand_aggr_init_1): Handle value-initialization.
2804         * cp-tree.h: Add declaration.
2805         * class.c (type_has_user_provided_constructor): 
2806         Handle non-class arguments.
2807
2808 2009-02-10  Jason Merrill  <jason@redhat.com>
2809
2810         PR c++/38649
2811         * class.c (defaultable_fn_p): Handle ... properly.
2812
2813         PR c++/36744
2814         * tree.c (lvalue_p_1): Condition rvalue ref handling on
2815         treat_class_rvalues_as_lvalues, too.
2816
2817 2009-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
2818
2819         PR c++/34397
2820         * typeck.c (build_x_array_ref): New.
2821         * cp-tree.h: Declare it.
2822         * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
2823
2824 2009-02-09  Jason Merrill  <jason@redhat.com>
2825
2826         PR c++/39109
2827         * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
2828         * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
2829         * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
2830         * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
2831         for build_value_init TARGET_EXPR.
2832         * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
2833
2834 2009-02-06  Paolo Carlini  <paolo.carlini@oracle.com>
2835
2836         PR c++/35147
2837         PR c++/37737
2838         * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
2839
2840 2009-02-04  Jakub Jelinek  <jakub@redhat.com>
2841
2842         PR c++/39095
2843         * operators.def: Use COMPONENT_REF code for ->/pt operator again,
2844         remove ./dt operator.
2845         * mangle.c (write_expression): Handle COMPONENT_REF after handling
2846         ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
2847         write_string ("dt") instead of using operators.def.
2848
2849 2009-02-03  Jason Merrill  <jason@redhat.com>
2850
2851         * typeck.c (cp_build_unary_op): Only complain about taking address
2852         of main if pedantic.
2853
2854 2009-02-03  Jakub Jelinek  <jakub@redhat.com>
2855
2856         PR inline-asm/39059
2857         * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
2858
2859         PR c++/39056
2860         * typeck2.c (digest_init_r): Don't call process_init_constructor
2861         for COMPLEX_TYPE.
2862
2863 2009-02-03  Paolo Bonzini  <bonzini@gnu.org>
2864
2865         PR c++/36897
2866         * pt.c (convert_nontype_argument_function): Expect expr to be an
2867         ADDR_EXPR.
2868
2869         PR c++/37314
2870         * typeck.c (merge_types): Call resolve_typename_type if only
2871         one type is a typename.
2872
2873 2009-02-02  Jason Merrill  <jason@redhat.com>
2874
2875         PR c++/39054
2876         * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node 
2877         in BIT_NOT_EXPR.
2878
2879 2009-02-01  Paolo Carlini  <paolo.carlini@oracle.com>
2880
2881         PR c++/39053
2882         * parser.c (cp_parser_pure_specifier): If there are no tokens left
2883         do not call cp_lexer_consume_token.
2884
2885 2009-01-30  Jakub Jelinek  <jakub@redhat.com>
2886
2887         PR c++/39028
2888         * parser.c (cp_parser_already_scoped_statement): Handle __label__
2889         declarations.
2890
2891 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
2892
2893         PR c++/33465
2894         * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
2895
2896 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
2897
2898         PR c++/38655
2899         * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
2900
2901 2009-01-29  Paolo Carlini  <paolo.carlini@oracle.com>
2902
2903         * typeck.c (invalid_nonstatic_memfn_p): Use
2904         DECL_NONSTATIC_MEMBER_FUNCTION_P.
2905
2906 2009-01-27  Paolo Carlini  <paolo.carlini@oracle.com>
2907
2908         PR c++/37554
2909         * call.c (build_over_call): If convert_for_arg_passing returns
2910         error_mark_node unconditionally return it.
2911
2912 2009-01-22  Adam Nemet  <anemet@caviumnetworks.com>
2913
2914         * class.c (check_field_decls): Also inherit packed for bitfields
2915         regardless of their type.
2916
2917 2009-01-22  Dodji Seketeli  <dodji@redhat.com>
2918
2919         PR c++/38930
2920         * decl2.c (grokfield): Reverting changes of PR c++/26693
2921         (save_template_attributes): Likewise.
2922         * decl.c (grokdeclarator): Likewise.
2923         * name-lookup.c (pushdecl_maybe_friend): Likewise.
2924         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
2925         (append_type_to_template_for_access_check): Likewise.
2926         * semantics.c (check_accessibility_of_qualified_id): Likewise.
2927         * pt.c (instantiate_class_template, instantiate_template ): Likewise.
2928         (tsubst): Likewise.
2929         (resolve_type_name_type): Likewise.
2930         (append_type_to_template_for_access_check): Likewise.
2931
2932 2009-01-21  Dodji Seketeli  <dodji@redhat.com>
2933
2934         PR c++/26693
2935         * decl2.c (grokfield): when a typedef appears in a
2936         class, create the typedef variant type node for it.
2937         (save_template_attributes): Creating typedef variant type node
2938          here is now useless.
2939         * decl.c (grokdeclarator): If the typedef'ed struct/class was
2940         anonymous, set the proper type name to all its type variants.
2941         * name-lookup.c (pushdecl_maybe_friend): Reuse the
2942         set_underlying_type function to install typedef variant types.
2943         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
2944         macro.
2945         (append_type_to_template_for_access_check): New entry points.
2946         * semantics.c (check_accessibility_of_qualified_id):
2947         When a typedef that is a member of a class appears in a template,
2948         add it to the template. It will be ...
2949         * pt.c (instantiate_class_template, instantiate_template ): ... access
2950         checked at template instantiation time.
2951         (tsubst): Handle the case of being called with NULL args.
2952         (resolve_type_name_type): The type name should be the name of the
2953         main type variant.
2954         (append_type_to_template_for_access_check): New entry point.
2955
2956 2009-01-19  Jason Merrill  <jason@redhat.com>
2957
2958         PR c++/23287
2959         * parser.c (cp_parser_unqualified_id): In a template,
2960         accept ~identifier.
2961         * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
2962
2963 2009-01-16  Jason Merrill  <jason@redhat.com>
2964
2965         PR c++/38877
2966         * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
2967         * init.c (build_new): Don't call describable_type unless we
2968         have an auto.
2969
2970         PR c++/29470
2971         * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
2972
2973         PR c++/38579
2974         * search.c (protected_accessible_p): N doesn't vary.
2975
2976 2009-01-15  Jason Merrill  <jason@redhat.com>
2977
2978         PR c++/38850
2979         * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
2980         accept hidden friends.
2981
2982 2009-01-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2983
2984         PR C++/29388
2985         * decl.c (grokdeclarator): Check for a non namespace/class context.
2986
2987 2009-01-15  Jason Merrill  <jason@redhat.com>
2988
2989         PR c++/36334
2990         PR c++/37646
2991         * tree.c (lvalue_p_1): Handle BASELINK.  A COMPONENT_REF to
2992         a function isn't necessarily an lvalue. Take tree, not const_tree.
2993         (lvalue_p, real_lvalue_p): Take tree, not const_tree.
2994         * typeck.c (lvalue_or_else): Likewise.
2995         * cp-tree.h: Adjust prototypes.
2996
2997 2009-01-15  Steve Ellcey  <sje@cup.hp.com>
2998
2999         PR c++/38357
3000         * pt.c (tsubst): Check for NULL args.
3001
3002 2009-01-15  Dodji Seketeli  <dodji@redhat.com>
3003
3004         PR c++/38636
3005         * name-lookup.c (pushtag): Don't create members to types that are not
3006         being created.
3007
3008 2009-01-14  Nick Clifton  <nickc@redhat.com>
3009
3010         PR c++/37862
3011         * parser.c: Pass cp_id_kind computed in
3012         cp_parser_postfix_dot_deref_expression to
3013         cp_parser_primary_expression.
3014
3015 2009-01-13  Jakub Jelinek  <jakub@redhat.com>
3016
3017         PR c++/38795
3018         * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
3019         STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
3020         as CAST_EXPR.
3021
3022 2009-01-12  Jason Merrill  <jason@redhat.com>
3023             Steve Ellcey  <sje@cup.hp.com>
3024
3025         PR c++/35109
3026         * name-lookup.c (lookup_name_real): Keep looking past a hidden 
3027         binding.
3028
3029 2009-01-12  Dodji Seketeli  <dodji@redhat.com>
3030
3031         PR c++/36019
3032         * pt.c (parameter_of_template_p): New function.
3033         * cp-tree.h: Declare it.
3034         * name-lookup.c (binding_to_template_parms_of_scope_p): New
3035         function.
3036         (outer_binding): Take template parameters in account when looking for
3037         a name binding.
3038
3039 2009-01-12  Jason Merrill  <jason@redhat.com>
3040
3041         PR c++/31488
3042         * tree.c (pod_type_p): Return 1 for structs created by the back end.
3043
3044 2009-01-12  Jakub Jelinek  <jakub@redhat.com>
3045
3046         PR c/32041
3047         * parser.c (cp_parser_builtin_offsetof): Allow `->' in
3048         offsetof member-designator, handle it as `[0].'.
3049
3050         PR c++/38794
3051         * decl.c (start_function): If grokdeclarator hasn't returned
3052         FUNCTION_DECL nor error_mark_node, issue diagnostics.
3053
3054 2009-01-11  Jakub Jelinek  <jakub@redhat.com>
3055
3056         PR c++/36254
3057         * cp-gimplify.c (genericize_if_stmt): Renamed from ...
3058         (gimplify_if_stmt): ... this.
3059         (cp_gimplify_expr): Don't handle IF_STMT here.
3060         (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
3061
3062 2009-01-10  Andrew Pinski  <pinskia@gmail.com>
3063
3064         PR c++/38648
3065         * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
3066
3067         PR c++/36695
3068         * typeck2.c (build_functional_cast): Check for reference type and NULL
3069         PARMS.
3070
3071 2009-01-09  Steve Ellcey  <sje@cup.hp.com>
3072
3073         * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
3074
3075 2009-01-09  Jakub Jelinek  <jakub@redhat.com>
3076
3077         PR c++/35335
3078         * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
3079
3080 2009-01-09  John F. Carr  <jfc@mit.edu>
3081
3082         PR c++/37877
3083         * parser.c (cp_parser_class_specifier): Clear
3084         parser->in_unbraced_linkage_specification_p while parsing class
3085         specifiers.
3086
3087 2009-01-07  Jakub Jelinek  <jakub@redhat.com>
3088
3089         PR c++/38725
3090         * semantics.c (finish_goto_stmt): Convert destination to
3091         void *.
3092
3093 2009-01-06  Jason Merrill  <jason@redhat.com>
3094
3095         PR c++/35297
3096         PR c++/35477
3097         PR c++/35784
3098         PR c++/36846
3099         PR c++/38276
3100         * pt.c (check_default_tmpl_args): Don't complain about
3101         out-of-order parameter packs in the enclosing class
3102         or parameter packs after default args.
3103         (coerce_template_parms): If we have more than one
3104         parameter pack, don't flatten argument packs.
3105         (template_args_equal): Handle argument packs.
3106         (comp_template_args): Don't flatten argument packs.
3107         (check_instantiated_arg): Split out from...
3108         (check_instantiated_args): Here.  Handle arg packs.
3109         (convert_template_argument): Just check that nontype argument
3110         packs have the right type.
3111
3112 2009-01-05  Dodji Seketeli  <dodji@redhat.com>
3113
3114         PR c++/38472
3115         * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
3116
3117 2009-01-05  Jason Merrill  <jason@redhat.com>
3118
3119         PR c++/38698
3120         * typeck2.c (process_init_constructor_union): Handle union with
3121         no fields.
3122
3123         * mangle.c (write_expression): Remove mangling for zero-operand
3124         casts.
3125
3126         PR c++/38701
3127         * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
3128         defaulting.
3129
3130         PR c++/38702
3131         * class.c (defaultable_fn_p): Only operator== can be a copy
3132         assignment operator.
3133
3134 2009-01-02  Jason Merrill  <jason@redhat.com>
3135
3136         PR c++/38698
3137         * typeck2.c (process_init_constructor_union): Handle excess
3138         initializers.
3139         (process_init_constructor_record): Likewise.
3140
3141         PR c++/38684
3142         * typeck2.c (digest_init_r): Don't use process_init_constructor
3143         for non-aggregate classes.
3144
3145 \f
3146 Copyright (C) 2009 Free Software Foundation, Inc.
3147
3148 Copying and distribution of this file, with or without modification,
3149 are permitted in any medium without royalty provided the copyright
3150 notice and this notice are preserved.