OSDN Git Service

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