OSDN Git Service

* pretty-print.h (struct pretty_print_info): Add
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2009-05-10  Joseph Myers  <joseph@codesourcery.com>
2
3         * call.c (name_as_c_string): Call type_as_string_translate.
4         Translate identifiers to locale character set.
5         * cp-tree.h (lang_decl_name): Update prototype.
6         (type_as_string_translate, decl_as_string_translate,
7         cxx_printable_name_translate): Declare.
8         * cxx-pretty-print.c (M_): Define.
9         (pp_cxx_unqualified_id, pp_cxx_canonical_template_parameter): Mark
10         English fragments for conditional translation with M_.
11         * decl.c (grokdeclarator): Translate identifiers to locale
12         character set for diagnostics.
13         * error.c (M_): Define.
14         (dump_template_bindings, dump_type, dump_aggr_type,
15         dump_type_prefix, dump_global_iord, dump_simple_decl, dump_decl,
16         dump_function_decl, dump_template_parms, dump_expr,
17         dump_binary_op, op_to_string, assop_to_string): Mark English
18         fragments for conditional translation with M_.
19         (type_as_string): Disable translation of identifiers.
20         (type_as_string_translate): New.
21         (expr_as_string): Disable translation of identifiers.
22         (decl_as_string): Disable translation of identifiers.
23         (decl_as_string_translate): New.
24         (lang_decl_name): Add parameter translate.
25         (args_to_string): Call type_as_string_translate.
26         (cp_print_error_function): Call cxx_printable_name_translate.
27         (print_instantiation_full_context,
28         print_instantiation_partial_context): Call
29         decl_as_string_translate.
30         * parser.c (cp_lexer_get_preprocessor_token): Use %qE for
31         identifier in diagnostic.
32         * tree.c (cxx_printable_name): Change to
33         cxx_printable_name_internal.  Add parameter translate.
34         (cxx_printable_name, cxx_printable_name_translate): New wrappers
35         round cxx_printable_name_internal.
36
37 2009-05-08  H.J. Lu  <hongjiu.lu@intel.com>
38
39         PR c/36892
40         * call.c (build_call_a): Updated warn_deprecated_use call.
41         (build_over_call): Likewise.
42         * decl.c (grokdeclarator): Likewise.
43         (grokparms): Likewise.
44         * semantics.c (finish_id_expression): Likewise.
45         * typeck.c (build_class_member_access_expr): Likewise.
46         (finish_class_member_access_expr): Likewise.
47
48 2009-05-06  Dodji Seketeli  <dodji@redhat.com>
49
50         PR c++/17395
51         * pt.c (tsubst_copy) <case PARM_DECL>: We don't want to tsubst the
52         whole list of PARM_DECLs, just the current one.
53
54 2009-05-05  Shujing Zhao  <pearly.zhao@oracle.com>
55
56         * cp-tree.h:
57         (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
58         mangle_compound_literal): Remove unused declarations.
59         (build_vfield_ref, cxx_print_statistics, clone_function_decl,
60         adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
61         pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
62         check_for_out_of_scope_variable, print_other_binding_stack,
63         maybe_push_decl, cxx_mark_addressable, force_target_expr,
64         build_target_expr_with_type, finish_case_label,
65         cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
66         check_template_keyword, cxx_omp_predetermined_sharing,
67         cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
68         cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
69         cxx_omp_privatize_by_reference): Rearrange the declarations line to
70         match the comment that indicates the .c file which the functions are
71         defined.
72         (cxx_print_xnode, cxx_print_decl, cxx_print_type,
73         cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
74
75 2009-05-05  Nathan Sidwell  <nathan@codesourcery.com>
76
77         * typeck.c (cp_build_compound_expr): Require RHS to have a known
78         type.
79         * class.c (resolve_address_of_overloaded_function): Use
80         OVL_CURRENT for error message.
81         (instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
82         with them.  Do not copy the node.
83
84 2009-05-05  Jakub Jelinek  <jakub@redhat.com>
85
86         PR c++/40013
87         * pt.c (tsubst): If magic NOP_EXPR with side-effects has no type,
88         set it from its operand's type after tsubst_expr.
89
90 2009-05-04  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
91
92         PR c++/28152
93         * parser.c (cp_lexer_get_preprocessor_token):  Do not store the
94         canonical spelling for keywords.
95         (cp_parser_attribute_list): Use the canonical spelling for
96         keywords in attributes.
97
98 2009-05-01  Joseph Myers  <joseph@codesourcery.com>
99
100         * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
101         pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression,
102         pp_cxx_new_expression, pp_cxx_delete_expression,
103         pp_cxx_unary_expression, pp_cxx_assignment_operator,
104         pp_cxx_assignment_expression, pp_cxx_expression,
105         pp_cxx_function_specifier, pp_cxx_decl_specifier_seq,
106         pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq,
107         pp_cxx_exception_specification, pp_cxx_direct_declarator,
108         pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement,
109         pp_cxx_namespace_alias_definition, pp_cxx_template_parameter,
110         pp_cxx_canonical_template_parameter, pp_cxx_template_declaration,
111         pp_cxx_declaration, pp_cxx_typeid_expression,
112         pp_cxx_va_arg_expression, pp_cxx_offsetof_expression,
113         pp_cxx_trait_expression): Mostly use pp_string and
114         pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
115         for non-identifiers.  Mark English strings for translation.
116         * cxx-pretty-print.h (pp_cxx_ws_string): Define.
117         * error.c (dump_template_parameter, dump_template_bindings,
118         dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl,
119         dump_decl, dump_template_decl, dump_function_decl,
120         dump_parameters, dump_exception_spec, dump_template_parms,
121         dump_expr, dump_binary_op, dump_unary_op, op_to_string,
122         assop_to_string, args_to_string, cp_print_error_function,
123         print_instantiation_full_context,
124         print_instantiation_partial_context): Mostly use pp_string and
125         pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
126         for non-identifiers.  Mark English strings for translation.
127         (dump_global_iord): Mark strings for translation; use longer
128         strings instead of substituting single words.
129         (function_category): Return a format string marked for
130         translation, not a single word or phrase to substitute in a longer
131         phrase.
132
133 2009-04-28  Ben Elliston  <bje@au.ibm.com>
134
135         PR c++/35652
136         Revert:
137
138         2009-03-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
139
140         * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
141
142 2009-04-27  Ian Lance Taylor  <iant@google.com>
143
144         * semantics.c (finish_omp_clauses): Change type of c_kind to enum
145         omp_clause_code.
146
147 2009-04-27  Jakub Jelinek  <jakub@redhat.com>
148
149         PR c++/39875
150         * cvt.c (convert_to_void) <case INDIRECT_REF>: Only warn about
151         -Wunused-value if implicit.
152
153 2009-04-24  Ian Lance Taylor  <iant@google.com>
154
155         * call.c (build_temp): Change 0 to enum constant.
156         * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
157         type.
158         * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
159         * decl2.c (constrain_visibility): Likewise.
160         * parser.c (cp_lexer_get_preprocessor_token): Likewise.
161         (cp_parser_flags): Typedef to int rather than enum type.
162         (cp_parser_expression_stack_entry): Change prec field to enum
163         cp_parser_prec.
164
165         * typeck.c (build_modify_expr): Add lhs_origtype parameter.
166         Change all callers.
167
168 2009-04-22  Dodji Seketeli  <dodji@redhat.com>
169
170         PR c++/39639
171         * parser.c (cp_parser_template_argument_list): Display an error
172         when an ellipsis is not preceded by a parameter pack. Also, warn
173         about variadic templates usage without -std=c++0x.
174
175 2009-04-21  Taras Glek <tglek@mozilla.com>
176
177         * cp-tree.h: Update GTY annotations to new syntax.
178         * decl.c: Likewise.
179         * mangle.c: Likewise.
180         * name-lookup.c: Likewise.
181         * name-lookup.h: Likewise.
182         * parser.c: Likewise.
183         * pt.c: Likewise.
184         * rtti.c: Likewise.
185         * semantics.c: Likewise.
186         * typeck2.c: Likewise.
187
188 2009-04-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
189
190         PR c++/14875
191         * parser.c (cp_parser_error): Pass token->flags to c_parse_error.
192
193 2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
194
195         PR c++/35711
196         * typeck.c (check_for_casting_away_constness): We diagnose casting
197         away any qualifiers not just constness.
198         (casts_away_constness): Mention that it handles more than just
199         constness.
200         
201 2009-04-21  Joseph Myers  <joseph@codesourcery.com>
202
203         * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
204         ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
205         ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
206         ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
207         ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
208         cfns.gperf: Add copyright and license notices.
209         * cfns.h: Regenerate.
210         * ChangeLog, ChangeLog-2004: Correct dates.
211
212 2009-04-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
213
214         PR 16202
215         * tree.c (lvalue_p_1): Use const_tree.
216         Use CONST_CAST_TREE to avoid warning.
217         (lvalue_p): Returns bool, receives const_tree.
218
219 2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
220
221         PR c++/13358
222         * parser.c (cp_parser_check_decl_spec): Drop redundant flags.
223         * error.c (pedwarn_cxx98): New.
224         * cp-tree.h (pedwarn_cxx98): Declare.
225
226 2009-04-20  Le-Chun Wu  <lcwu@google.com>
227
228         PR c++/39803
229         * init.c (build_vec_init): Set TREE_NO_WARNING on the
230         compiler-generated INDIRECT_REF expression.
231
232 2009-04-20  Ian Lance Taylor  <iant@google.com>
233
234         * typeck.c (build_function_call_vec): New function.
235         (cp_build_function_call): Only pass first parameter to
236         objc_rewrite_function_call.
237         (build_modify_expr): Add rhs_origtype parameter.  Change all
238         callers.
239         * decl.c (finish_decl): Add origtype parameter.  Change all
240         callers.
241         * semantics.c (finish_call_expr): Pass VEC to
242         resolve_overloaded_builtin.
243
244 2009-04-20  Ian Lance Taylor  <iant@google.com>
245
246         * cp-tree.h (base_access): Change typedef to int.
247         * parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
248         (cp_parser_omp_threadprivate): Likewise.
249         * pt.c (unify_pack_expansion): Add casts to enum type.
250
251 2009-04-19  Manuel López-Ibáñez  <manu@gcc.gnu.org>
252
253         PR c/32061
254         PR c++/36954
255         * call.c (build_new_op): Save the original codes of operands
256         before folding.
257
258 2009-04-18  Kazu Hirata  <kazu@codesourcery.com>
259
260         * cp-tree.h: Remove the prototype for insert_block.
261         * decl.c (insert_block): Remove.
262
263 2009-04-16  Ian Lance Taylor  <iant@google.com>
264
265         * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t.
266         (tsubst_flags_t): Change typedef from enum type to int.
267
268 2009-04-16  Paolo Bonzini  <bonzini@gnu.org>
269
270         * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE
271         instead of targetm.vector_opaque_p.
272
273 2009-04-15  Le-Chun Wu  <lcwu@google.com>
274
275         PR c++/39551
276         * call.c (build_over_call): Set TREE_NO_WARNING on the
277         compiler-generated INDIRECT_REF expression.
278         * cvt.c (convert_to_void): Emit warning when stripping off
279         INDIRECT_REF.
280
281 2009-04-14  Diego Novillo  <dnovillo@google.com>
282
283         * parser.c (cp_parser_type_specifier_seq): Move call to
284         invoke_plugin_callbacks ...
285         (cp_parser_type_specifier_seq): ... here.
286
287 2009-04-14  Le-Chun Wu  <lcwu@google.com>
288
289         * Make-lang.in: Modify dependencies of files including plugin.h.
290         * decl.c (finish_function): Call invoke_plugin_callbacks.
291         * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
292
293 2009-04-14  Jason Merrill  <jason@redhat.com>
294
295         PR c++/39763
296         * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
297         about shadowing by tentative parms.
298
299 2009-04-13  Jason Merrill  <jason@redhat.com>
300
301         PR c++/39480
302         * call.c (build_over_call): Don't call memcpy if the target is
303         the same as the source.
304
305 2009-04-13  Jason Merrill  <jason@redhat.com>
306
307         PR c++/39750
308         * pt.c (uses_template_parms): Handle CONSTRUCTOR.
309
310 2009-04-12  Jason Merrill  <jason@redhat.com>
311
312         PR c++/39742
313         * call.c (joust): Don't crash on variadic fn.
314
315 2009-04-10  Jason Merrill  <jason@redhat.com>
316
317         PR c++/28301
318         * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return
319         if we see a close brace without an open brace.
320
321 2009-04-10  H.J. Lu  <hongjiu.lu@intel.com>
322
323         * parser.c (cp_parser_class_specifier): Remove the unused
324         has_trailing_semicolon.
325
326 2009-04-10  Manuel López-Ibáñez  <manu@gcc.gnu.org>
327
328         PR  c++/20118
329         * parser.c (cp_parser_check_template_parameters): Take a
330         cp_declarator parameter.
331         (cp_parser_elaborated_type_specifier): Update to
332         cp_parser_check_template_parameters.
333         (cp_parser_class_head): Likewise.
334         (cp_parser_check_declarator_template_parameters): Likewise.
335         (cp_parser_check_template_parameters): Handle first the non-error
336         conditions. Give more accurate diagnostics if a declarator is
337         given. 
338
339 2009-04-08  Jason Merrill  <jason@redhat.com>
340
341         PR c++/25185
342         * error.c (dump_aggr_type): Chase template typedefs if
343         -fno-pretty-templates.
344
345 2009-04-08  Dodji Seketeli  <dodji@redhat.com>
346
347         PR c++/39637
348         * parser.c (cp_parser_enumerator_definition): Make sure the
349         initializer of the enumerator doesn't contain any bare parameter pack.
350
351 2009-04-07  Jason Merrill  <jason@redhat.com>
352
353         PR c++/34691
354         * name-lookup.c (merge_functions): Keep multiple extern "C" functions.
355         * call.c (joust): Complain about mismatched default arguments
356         in extern "C" functions.
357         * class.c (resolve_address_of_overloaded_function): Handle multiple
358         extern "C" functions.
359         * pt.c (resolve_overloaded_unification): Likewise.
360
361 2009-04-07  Jason Merrill  <jason@redhat.com>
362
363         PR c++/25185
364         * error.c (dump_function_decl): Don't pretty-print templates
365         if -fno-pretty-templates.
366         (count_non_default_template_args): Print all args if
367         -fno-pretty-templates.
368
369 2009-04-06  Jason Merrill  <jason@redhat.com>
370
371         PR c++/35146
372         * pt.c (fn_type_unification): For DEDUCE_EXACT check that
373         the deduced template arguments give us the parameter types
374         we're looking for.
375
376 2009-04-05  Giovanni Bajo <giovannibajo@libero.it>
377             Jason Merrill  <jason@redhat.com>
378
379         PR c++/14912
380         * error.c (count_non_default_template_args): New fn.
381         (dump_template_parms): Call it.
382         (dump_template_argument_list): Call it.  Add parms parm.
383         (dump_template_argument): Adjust call to dump_template_argument_list.
384         (dump_type, dump_decl): Likewise.
385         (dump_template_bindings): Refactor logic.
386
387 2009-04-03  Jason Merrill  <jason@redhat.com>
388
389         PR c++/25185
390         * error.c (dump_template_bindings): Look through typedefs in
391         typename results.
392         (dump_type) [TYPENAME_TYPE]: Print the typedef name if any.
393         (find_typenames_r): Also collect typedefs.
394         * pt.c (unify): Strip typedefs.
395
396         PR c++/39608
397         * semantics.c (finish_id_expression): Don't assume a dependent
398         member of the current instantiation isn't a valid integral
399         constant expression.  Check dependent_scope_p.
400         * pt.c (dependent_scope_p): Check TYPE_P.
401         (tsubst_copy): If args is null, just return.
402
403 2009-04-02  Jason Merrill  <jason@redhat.com>
404
405         PR c++/25185
406         * error.c (find_typenames, find_typenames_r): New fns.
407         (dump_function_decl): Call find_typenames.
408         (dump_template_bindings): Print typenames as well.
409         * pt.c (tsubst): Non-static.
410         * cp-tree.h: Declare it.
411
412 2009-04-02  Dodji Seketeli  <dodji@redhat.com>
413
414         PR c++/26693
415         * decl2.c (grokfield): when a typedef appears in a
416         class, create the typedef variant type node for it.
417         (save_template_attributes): Creating typedef variant type node
418          here is now useless.
419         * decl.c (grokdeclarator): If the typedef'ed struct/class was
420         anonymous, set the proper type name to all its type variants.
421         (xref_basetypes) : Fixup the variant types after setting
422         TYPE_BINFO on REF.
423         * name-lookup.c (pushdecl_maybe_friend): Reuse the
424         set_underlying_type function to install typedef variant types.
425         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
426         macro.
427         (append_type_to_template_for_access_check): New entry points.
428         * semantics.c (check_accessibility_of_qualified_id):
429         When a typedef that is a member of a class appears in a template,
430         add it to the template. It will be ...
431         * class.c (finish_struct_bits): Split type variant fixup into ...
432         (fixup_type_variants): A new entry point.
433         * pt.c (instantiate_class_template, instantiate_template ): ... access
434         checked at template instantiation time.
435         (resolve_type_name_type): The type name should be the name of the
436         main type variant.
437         (retrieve_specialization): Specializations of template typedefs aren't
438         to looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
439         (append_type_to_template_for_access_check): New entry point.
440         (tsubst_decl): For typedefs, build the variant type from the correct
441         original type.
442         (get_class_bindings): Fix function comment.
443         (perform_typedefs_access_check): New entry point.
444
445 2009-03-31  Jason Merrill  <jason@redhat.com>
446
447         PR c++/34691
448         * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
449         extern "C" declarations.
450
451         C++ DR 613
452         * semantics.c (finish_non_static_data_member): Allow such references
453         without an associated object in sizeof/decltype/alignof.
454
455         * ptree.c (cxx_print_decl): Pretty-print full name of
456         function/template.
457         (cxx_print_type): Pretty-print full name of class.
458
459         * decl.c (grokdeclarator): Reject pointer to qualified function
460         type.
461
462         PR c++/37806, core issue 547
463         * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
464         to a typedef.
465         * tree.c (cp_build_qualified_type_real): Don't apply restrict to a 
466         function type.
467         * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
468         * decl.c (groktypename): Add is_template_arg parameter.
469         (grokdeclarator): Allow function cv-quals on a template type arg.
470         * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
471         is_template_arg argument in calls to groktypename.
472         * cp-tree.h: Adjust prototype.
473         * error.c (dump_type_prefix, dump_type_suffix): Fix plain 
474         FUNCTION_TYPE printing.
475         
476         * mangle.c (write_expression): Mangle dependent name as
477         source-name.
478
479         PR c++/38030, 38850, 39070
480         * pt.c (type_dependent_expression_p_push): New fn.
481         (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
482         substitution makes the call non-dependent.  Preserve koenig_p.
483         * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
484         for non-dependent calls.
485         * semantics.c (finish_call_expr): Revert earlier changes.
486         * cp-tree.h: Revert change to finish_call_expr prototype.
487
488 2009-03-29  Joseph Myers  <joseph@codesourcery.com>
489
490         PR preprocessor/34695
491         * cp-tree.h (cp_cpp_error): Remove.
492         * error.c (cp_cpp_error): Remove.
493         * parser.c (cp_lexer_new_main): Set done_lexing instead of
494         client_diagnostic and error callback.
495
496 2009-03-28  Paolo Bonzini  <bonzini@gnu.org>
497
498         * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
499         * cp/cp-objcp-common.c (cxx_staticp): Remove.
500         * cp/cp-tree.h (cxx_staticp): Remove.
501
502 2009-03-28  Jakub Jelinek  <jakub@redhat.com>
503
504         PR c++/39554
505         * parser.c (cp_parser_postfix_expression): Don't call
506         warning_if_disallowed_function_p.
507
508 2009-03-27  Jan Hubicka  <jh@suse.cz>
509
510         * except.c (choose_personality_routine): Set terminate_node to abort
511         for java exceptions.
512
513 2009-03-27  Dodji Seketeli  <dodji@redhat.com>
514             Jakub Jelinek  <jakub@redhat.com>
515
516         PR debug/37959
517         * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
518         (cp_function_decl_explicit_p): New prototype.
519         * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
520
521 2009-03-27  Andrew Pinski  <andrew_pinski@playstation.sony.com>
522
523         PR c++/38638
524         * parser.c (cp_parser_elaborated_type_specifier): If we have a
525         typename tag and don't have either a TYPE_DECL or a
526         TEMPLATE_ID_EXPR, set the type to NULL.
527
528 2009-03-27  Simon Martin  <simartin@users.sourceforge.net>
529
530         PR c++/37647
531         * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
532         scope.
533
534 2009-03-27  Simon Martin  <simartin@users.sourceforge.net>
535
536         PR c++/29727
537         * decl.c (check_array_designated_initializer): Handle error_mark_node.
538
539 2009-03-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
540
541         PR c++/35652
542         * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
543
544 2009-03-26  Andrew Haley  <aph@redhat.com>
545
546         PR C++/39380
547         * decl2.c (possibly_inlined_p): If java exceptions are in use
548         don't inline a decl unless it is explicitly marked inline.
549         * lex.c: (pragma_java_exceptions): New variable.
550         (handle_pragma_java_exceptions): Set pragma_java_exceptions.
551         * cp-tree.h (pragma_java_exceptions): Declare new variable.
552
553 2009-03-24  Jason Merrill  <jason@redhat.com>
554
555         PR c++/28274
556         * name-lookup.c (pushdecl_maybe_friend): Check default args later.
557
558 2009-03-23  Jakub Jelinek  <jakub@redhat.com>
559
560         PR c/39495
561         * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
562         code if iter is the second operand.
563         * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
564         argument.  If it is set, don't build the toplevel expression with
565         build_x_binary_op, but build2.
566         (cp_parser_assignment_expression,  cp_parser_omp_for_incr): Adjust
567         callers.
568         (cp_parser_omp_for_cond): Don't assume the first operand of the
569         comparison must be decl.
570
571 2009-03-23  Jason Merrill  <jason@redhat.com>
572
573         PR c++/37729
574         * pt.c (make_fnparm_pack): Split out from...
575         (instantiate_decl): ...here.
576         (tsubst_pack_expansion): Handle being called in a late-specified
577         return type.
578
579         PR c++/39526
580         * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
581         a parm with a parm.
582
583 2009-03-20  Jason Merrill  <jason@redhat.com>
584
585         PR c++/28879
586         * parser.c (cp_parser_direct_declarator): In a template, wrap 
587         non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
588         * pt.c (tsubst): Preserve it in a partial instantiation.
589         (dependent_type_p_r): Don't check value_dependent_expression_p.
590         * decl.c (compute_array_index_type): Don't check
591         value_dependent_expression_p if TREE_SIDE_EFFECTS.
592
593         C++ core issue 703
594         * typeck2.c (check_narrowing): Don't complain about loss of 
595         precision when converting a floating-point constant.
596
597 2009-03-19  Jakub Jelinek  <jakub@redhat.com>
598
599         PR c/39495
600         * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
601         (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
602
603 2009-03-18  Jakub Jelinek  <jakub@redhat.com>
604
605         * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
606         (eof_token): Adjust.
607
608 2009-03-18  H.J. Lu  <hongjiu.lu@intel.com>
609
610         PR c++/39425
611         * parser.c (cp_parser_explicit_specialization): Don't skip the
612         rest of the specialization when begin_specialization returns
613         false.
614
615 2009-03-17  Jason Merrill  <jason@redhat.com>
616
617         * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
618         (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
619         * pt.c (check_explicit_specialization): Likewise.
620         (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
621         local specialization.
622         * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
623         * decl2.c (parm_index): New fn.
624         * semantics.c (finish_decltype_type): Don't use describable_type.
625         * mangle.c (write_expression): Likewise.  Mangle ALIGNOF_EXPR.
626         Give a sorry for unsupported codes rather than crash.  Mangle
627         conversions with other than 1 operand.  New mangling for PARM_DECL.
628         * operators.def (ALIGNOF_EXPR): Mangle as "az".
629
630 2009-03-17  Jing Yu  <jingyu@google.com>
631
632         PR middle-end/39378
633         * method.c (use_thunk): Change is_thunk from crtl to cfun.
634
635 2009-03-17  Paolo Carlini  <paolo.carlini@oracle.com>
636
637         PR c++/39475
638         * semantics.c (check_trait_type): New.
639         (finish_trait_expr): Use it.
640
641 2009-03-17  Jakub Jelinek  <jakub@redhat.com>
642
643         * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
644         instead of calling imported_module_or_decl debug hook if
645         building_stmt_tree ().
646         * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
647         is a NAMESPACE_DECL.
648
649         PR debug/37890
650         * name-lookup.c (do_namespace_alias): Don't call global_decl debug
651         hook at function scope.
652
653         PR debug/39471
654         * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
655         on IMPORTED_DECL.
656
657 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
658
659         PR c++/39371
660         * semantics.c (finish_switch_cond): Don't call get_unwidened.
661         * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
662         instead of TREE_TYPE (cond).
663
664 2009-03-08  H.J. Lu  <hongjiu.lu@intel.com>
665
666         PR c++/39060
667         * parser.c (cp_parser_late_parsing_default_args): Continue
668         the loop when cp_parser_assignment_expression returns
669         error_mark_node.
670
671 2009-03-07  Jason Merrill  <jason@redhat.com>
672
673         PR c++/39367
674         * init.c (build_new_1): Don't use a VLA type.
675         (build_vec_init): Handle getting a pointer for BASE.
676
677 2009-03-06  H.J. Lu  <hongjiu.lu@intel.com>
678
679         PR c++/37520
680         * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
681         when mangling symbols.
682
683 2009-03-06  Paolo Carlini  <paolo.carlini@oracle.com>
684
685         PR c++/33492
686         * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
687
688 2009-03-06  Alexandre Oliva  <aoliva@redhat.com>
689
690         * decl.c (record_builtin_java_type): Use canonicalized integer
691         types.
692
693 2009-03-04  Jason Merrill  <jason@redhat.com>
694
695         PR c++/38908
696         * class.c (is_really_empty_class): New fn.
697         * cp-tree.h: Declare it.
698         * cp-objcp-common.c (cp_expr_size): Use it.
699
700         PR c++/13549
701         * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
702         * parser.c (cp_parser_postfix_expression): Call it for 
703         TEMPLATE_ID_EXPR.
704         * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
705         (get_first_fn): Likewise.
706
707         PR c++/9634
708         PR c++/29469
709         PR c++/29607
710         Implement DR 224.
711         * decl.c (make_typename_type): Do look inside currently open classes.
712         * parser.c (cp_parser_lookup_name): Likewise.
713         (cp_parser_template_name): Likewise.
714         * pt.c (dependent_scope_p): New function.
715         * cp-tree.h: Declare it.
716         * class.c (currently_open_class): Return fast if T isn't a class.
717
718 2009-02-26  H.J. Lu  <hongjiu.lu@intel.com>
719
720         PR c++/37789
721         * parser.c (cp_parser_mem_initializer): Return error_mark_node
722         if cp_parser_mem_initializer_id returns error_mark_node.
723
724 2009-02-24  Richard Guenther  <rguenther@suse.de>
725
726         PR c++/39242
727         * pt.c (instantiate_decl): Do not instantiate extern, non-inline
728         declared functions.
729
730 2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>
731
732         PR c++/36411
733         * pt.c (coerce_template_template_parms): Return 0 if parameter
734         is error_mark_node.
735
736 2009-02-23  Jason Merrill  <jason@redhat.com>
737
738         * pt.c (unify): Call maybe_adjust_types_for_deduction when
739         deducing from an initializer list.
740
741 2009-02-20  Jason Merrill  <jason@redhat.com>
742
743         PR c++/39225
744         * decl.c (grokdeclarator): Handle ~identifier.
745
746 2009-02-19  Jakub Jelinek  <jakub@redhat.com>
747
748         PR target/39175
749         * decl2.c (determine_visibility): If visibility changed and
750         DECL_RTL has been already set, call make_decl_rtl to update symbol
751         flags.
752
753 2009-02-19  H.J. Lu  <hongjiu.lu@intel.com>
754
755         PR c++/39188
756         * cp-tree.h (maybe_commonize_var): New.
757
758         * decl.c (maybe_commonize_var): Make it extern.
759
760         * decl2.c (finish_anon_union): Call maybe_commonize_var.
761
762 2009-02-18  H.J. Lu  <hongjiu.lu@intel.com>
763
764         PR c++/39219
765         * parser.c (cp_parser_enum_specifier): Apply all attributes.
766
767 2009-02-18  Jason Merrill  <jason@redhat.com>
768
769         * cfns.h: Tweak pathname for cfns.gperf.
770
771 2009-02-13  Jason Merrill  <jason@redhat.com>
772
773         PR c++/39070
774         * semantics.c (finish_call_expr): Change koenig_p parm to int.
775         If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
776         * cp-tree.h: Adjust prototype.
777         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
778
779 2009-02-12  Jason Merrill  <jason@redhat.com>
780
781         PR c++/38950
782         * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
783
784 2009-02-11  Jason Merrill  <jason@redhat.com>
785
786         PR c++/39153
787         * decl2.c (cp_write_global_declarations): 
788         Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
789
790         PR c++/30111
791         * init.c (build_value_init_noctor): Split out from...
792         (build_value_init): ...here.
793         (expand_aggr_init_1): Handle value-initialization.
794         * cp-tree.h: Add declaration.
795         * class.c (type_has_user_provided_constructor): 
796         Handle non-class arguments.
797
798 2009-02-10  Jason Merrill  <jason@redhat.com>
799
800         PR c++/38649
801         * class.c (defaultable_fn_p): Handle ... properly.
802
803         PR c++/36744
804         * tree.c (lvalue_p_1): Condition rvalue ref handling on
805         treat_class_rvalues_as_lvalues, too.
806
807 2009-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
808
809         PR c++/34397
810         * typeck.c (build_x_array_ref): New.
811         * cp-tree.h: Declare it.
812         * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
813
814 2009-02-09  Jason Merrill  <jason@redhat.com>
815
816         PR c++/39109
817         * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
818         * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
819         * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
820         * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
821         for build_value_init TARGET_EXPR.
822         * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
823
824 2009-02-06  Paolo Carlini  <paolo.carlini@oracle.com>
825
826         PR c++/35147
827         PR c++/37737
828         * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
829
830 2009-02-04  Jakub Jelinek  <jakub@redhat.com>
831
832         PR c++/39095
833         * operators.def: Use COMPONENT_REF code for ->/pt operator again,
834         remove ./dt operator.
835         * mangle.c (write_expression): Handle COMPONENT_REF after handling
836         ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
837         write_string ("dt") instead of using operators.def.
838
839 2009-02-03  Jason Merrill  <jason@redhat.com>
840
841         * typeck.c (cp_build_unary_op): Only complain about taking address
842         of main if pedantic.
843
844 2009-02-03  Jakub Jelinek  <jakub@redhat.com>
845
846         PR inline-asm/39059
847         * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
848
849         PR c++/39056
850         * typeck2.c (digest_init_r): Don't call process_init_constructor
851         for COMPLEX_TYPE.
852
853 2009-02-03  Paolo Bonzini  <bonzini@gnu.org>
854
855         PR c++/36897
856         * pt.c (convert_nontype_argument_function): Expect expr to be an
857         ADDR_EXPR.
858
859         PR c++/37314
860         * typeck.c (merge_types): Call resolve_typename_type if only
861         one type is a typename.
862
863 2009-02-02  Jason Merrill  <jason@redhat.com>
864
865         PR c++/39054
866         * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node 
867         in BIT_NOT_EXPR.
868
869 2009-02-01  Paolo Carlini  <paolo.carlini@oracle.com>
870
871         PR c++/39053
872         * parser.c (cp_parser_pure_specifier): If there are no tokens left
873         do not call cp_lexer_consume_token.
874
875 2009-01-30  Jakub Jelinek  <jakub@redhat.com>
876
877         PR c++/39028
878         * parser.c (cp_parser_already_scoped_statement): Handle __label__
879         declarations.
880
881 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
882
883         PR c++/33465
884         * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
885
886 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
887
888         PR c++/38655
889         * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
890
891 2009-01-29  Paolo Carlini  <paolo.carlini@oracle.com>
892
893         * typeck.c (invalid_nonstatic_memfn_p): Use
894         DECL_NONSTATIC_MEMBER_FUNCTION_P.
895
896 2009-01-27  Paolo Carlini  <paolo.carlini@oracle.com>
897
898         PR c++/37554
899         * call.c (build_over_call): If convert_for_arg_passing returns
900         error_mark_node unconditionally return it.
901
902 2009-01-22  Adam Nemet  <anemet@caviumnetworks.com>
903
904         * class.c (check_field_decls): Also inherit packed for bitfields
905         regardless of their type.
906
907 2009-01-22  Dodji Seketeli  <dodji@redhat.com>
908
909         PR c++/38930
910         * decl2.c (grokfield): Reverting changes of PR c++/26693
911         (save_template_attributes): Likewise.
912         * decl.c (grokdeclarator): Likewise.
913         * name-lookup.c (pushdecl_maybe_friend): Likewise.
914         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
915         (append_type_to_template_for_access_check): Likewise.
916         * semantics.c (check_accessibility_of_qualified_id): Likewise.
917         * pt.c (instantiate_class_template, instantiate_template ): Likewise.
918         (tsubst): Likewise.
919         (resolve_type_name_type): Likewise.
920         (append_type_to_template_for_access_check): Likewise.
921
922 2009-01-21  Dodji Seketeli  <dodji@redhat.com>
923
924         PR c++/26693
925         * decl2.c (grokfield): when a typedef appears in a
926         class, create the typedef variant type node for it.
927         (save_template_attributes): Creating typedef variant type node
928          here is now useless.
929         * decl.c (grokdeclarator): If the typedef'ed struct/class was
930         anonymous, set the proper type name to all its type variants.
931         * name-lookup.c (pushdecl_maybe_friend): Reuse the
932         set_underlying_type function to install typedef variant types.
933         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
934         macro.
935         (append_type_to_template_for_access_check): New entry points.
936         * semantics.c (check_accessibility_of_qualified_id):
937         When a typedef that is a member of a class appears in a template,
938         add it to the template. It will be ...
939         * pt.c (instantiate_class_template, instantiate_template ): ... access
940         checked at template instantiation time.
941         (tsubst): Handle the case of being called with NULL args.
942         (resolve_type_name_type): The type name should be the name of the
943         main type variant.
944         (append_type_to_template_for_access_check): New entry point.
945
946 2009-01-19  Jason Merrill  <jason@redhat.com>
947
948         PR c++/23287
949         * parser.c (cp_parser_unqualified_id): In a template,
950         accept ~identifier.
951         * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
952
953 2009-01-16  Jason Merrill  <jason@redhat.com>
954
955         PR c++/38877
956         * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
957         * init.c (build_new): Don't call describable_type unless we
958         have an auto.
959
960         PR c++/29470
961         * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
962
963         PR c++/38579
964         * search.c (protected_accessible_p): N doesn't vary.
965
966 2009-01-15  Jason Merrill  <jason@redhat.com>
967
968         PR c++/38850
969         * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
970         accept hidden friends.
971
972 2009-01-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
973
974         PR C++/29388
975         * decl.c (grokdeclarator): Check for a non namespace/class context.
976
977 2009-01-15  Jason Merrill  <jason@redhat.com>
978
979         PR c++/36334
980         PR c++/37646
981         * tree.c (lvalue_p_1): Handle BASELINK.  A COMPONENT_REF to
982         a function isn't necessarily an lvalue. Take tree, not const_tree.
983         (lvalue_p, real_lvalue_p): Take tree, not const_tree.
984         * typeck.c (lvalue_or_else): Likewise.
985         * cp-tree.h: Adjust prototypes.
986
987 2009-01-15  Steve Ellcey  <sje@cup.hp.com>
988
989         PR c++/38357
990         * pt.c (tsubst): Check for NULL args.
991
992 2009-01-15  Dodji Seketeli  <dodji@redhat.com>
993
994         PR c++/38636
995         * name-lookup.c (pushtag): Don't create members to types that are not
996         being created.
997
998 2009-01-14  Nick Clifton  <nickc@redhat.com>
999
1000         PR c++/37862
1001         * parser.c: Pass cp_id_kind computed in
1002         cp_parser_postfix_dot_deref_expression to
1003         cp_parser_primary_expression.
1004
1005 2009-01-13  Jakub Jelinek  <jakub@redhat.com>
1006
1007         PR c++/38795
1008         * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
1009         STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
1010         as CAST_EXPR.
1011
1012 2009-01-12  Jason Merrill  <jason@redhat.com>
1013             Steve Ellcey  <sje@cup.hp.com>
1014
1015         PR c++/35109
1016         * name-lookup.c (lookup_name_real): Keep looking past a hidden 
1017         binding.
1018
1019 2009-01-12  Dodji Seketeli  <dodji@redhat.com>
1020
1021         PR c++/36019
1022         * pt.c (parameter_of_template_p): New function.
1023         * cp-tree.h: Declare it.
1024         * name-lookup.c (binding_to_template_parms_of_scope_p): New
1025         function.
1026         (outer_binding): Take template parameters in account when looking for
1027         a name binding.
1028
1029 2009-01-12  Jason Merrill  <jason@redhat.com>
1030
1031         PR c++/31488
1032         * tree.c (pod_type_p): Return 1 for structs created by the back end.
1033
1034 2009-01-12  Jakub Jelinek  <jakub@redhat.com>
1035
1036         PR c/32041
1037         * parser.c (cp_parser_builtin_offsetof): Allow `->' in
1038         offsetof member-designator, handle it as `[0].'.
1039
1040         PR c++/38794
1041         * decl.c (start_function): If grokdeclarator hasn't returned
1042         FUNCTION_DECL nor error_mark_node, issue diagnostics.
1043
1044 2009-01-11  Jakub Jelinek  <jakub@redhat.com>
1045
1046         PR c++/36254
1047         * cp-gimplify.c (genericize_if_stmt): Renamed from ...
1048         (gimplify_if_stmt): ... this.
1049         (cp_gimplify_expr): Don't handle IF_STMT here.
1050         (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
1051
1052 2009-01-10  Andrew Pinski  <pinskia@gmail.com>
1053
1054         PR c++/38648
1055         * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
1056
1057         PR c++/36695
1058         * typeck2.c (build_functional_cast): Check for reference type and NULL
1059         PARMS.
1060
1061 2009-01-09  Steve Ellcey  <sje@cup.hp.com>
1062
1063         * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
1064
1065 2009-01-09  Jakub Jelinek  <jakub@redhat.com>
1066
1067         PR c++/35335
1068         * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
1069
1070 2009-01-09  John F. Carr  <jfc@mit.edu>
1071
1072         PR c++/37877
1073         * parser.c (cp_parser_class_specifier): Clear
1074         parser->in_unbraced_linkage_specification_p while parsing class
1075         specifiers.
1076
1077 2009-01-07  Jakub Jelinek  <jakub@redhat.com>
1078
1079         PR c++/38725
1080         * semantics.c (finish_goto_stmt): Convert destination to
1081         void *.
1082
1083 2009-01-06  Jason Merrill  <jason@redhat.com>
1084
1085         PR c++/35297
1086         PR c++/35477
1087         PR c++/35784
1088         PR c++/36846
1089         PR c++/38276
1090         * pt.c (check_default_tmpl_args): Don't complain about
1091         out-of-order parameter packs in the enclosing class
1092         or parameter packs after default args.
1093         (coerce_template_parms): If we have more than one
1094         parameter pack, don't flatten argument packs.
1095         (template_args_equal): Handle argument packs.
1096         (comp_template_args): Don't flatten argument packs.
1097         (check_instantiated_arg): Split out from...
1098         (check_instantiated_args): Here.  Handle arg packs.
1099         (convert_template_argument): Just check that nontype argument
1100         packs have the right type.
1101
1102 2009-01-05  Dodji Seketeli  <dodji@redhat.com>
1103
1104         PR c++/38472
1105         * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
1106
1107 2009-01-05  Jason Merrill  <jason@redhat.com>
1108
1109         PR c++/38698
1110         * typeck2.c (process_init_constructor_union): Handle union with
1111         no fields.
1112
1113         * mangle.c (write_expression): Remove mangling for zero-operand
1114         casts.
1115
1116         PR c++/38701
1117         * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
1118         defaulting.
1119
1120         PR c++/38702
1121         * class.c (defaultable_fn_p): Only operator== can be a copy
1122         assignment operator.
1123
1124 2009-01-02  Jason Merrill  <jason@redhat.com>
1125
1126         PR c++/38698
1127         * typeck2.c (process_init_constructor_union): Handle excess
1128         initializers.
1129         (process_init_constructor_record): Likewise.
1130
1131         PR c++/38684
1132         * typeck2.c (digest_init_r): Don't use process_init_constructor
1133         for non-aggregate classes.
1134
1135 \f
1136 Copyright (C) 2009 Free Software Foundation, Inc.
1137
1138 Copying and distribution of this file, with or without modification,
1139 are permitted in any medium without royalty provided the copyright
1140 notice and this notice are preserved.