OSDN Git Service

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