OSDN Git Service

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