OSDN Git Service

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