OSDN Git Service

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