OSDN Git Service

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