OSDN Git Service

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