OSDN Git Service

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