OSDN Git Service

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