re PR c++/30111 (Value-initialization of POD base class doesn't initialize members)
[platform/upstream/gcc.git] / gcc / cp / ChangeLog
1 2009-02-11  Jason Merrill  <jason@redhat.com>
2
3         PR c++/30111
4         * init.c (build_value_init_noctor): Split out from...
5         (build_value_init): ...here.
6         (expand_aggr_init_1): Handle value-initialization.
7         * cp-tree.h: Add declaration.
8         * class.c (type_has_user_provided_constructor): 
9         Handle non-class arguments.
10
11 2009-02-10  Jason Merrill  <jason@redhat.com>
12
13         PR c++/38649
14         * class.c (defaultable_fn_p): Handle ... properly.
15
16         PR c++/36744
17         * tree.c (lvalue_p_1): Condition rvalue ref handling on
18         treat_class_rvalues_as_lvalues, too.
19
20 2009-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
21
22         PR c++/34397
23         * typeck.c (build_x_array_ref): New.
24         * cp-tree.h: Declare it.
25         * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
26
27 2009-02-09  Jason Merrill  <jason@redhat.com>
28
29         PR c++/39109
30         * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
31         * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
32         * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
33         * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
34         for build_value_init TARGET_EXPR.
35         * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
36
37 2009-02-06  Paolo Carlini  <paolo.carlini@oracle.com>
38
39         PR c++/35147
40         PR c++/37737
41         * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
42
43 2009-02-04  Jakub Jelinek  <jakub@redhat.com>
44
45         PR c++/39095
46         * operators.def: Use COMPONENT_REF code for ->/pt operator again,
47         remove ./dt operator.
48         * mangle.c (write_expression): Handle COMPONENT_REF after handling
49         ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
50         write_string ("dt") instead of using operators.def.
51
52 2009-02-03  Jason Merrill  <jason@redhat.com>
53
54         * typeck.c (cp_build_unary_op): Only complain about taking address
55         of main if pedantic.
56
57 2009-02-03  Jakub Jelinek  <jakub@redhat.com>
58
59         PR inline-asm/39059
60         * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
61
62         PR c++/39056
63         * typeck2.c (digest_init_r): Don't call process_init_constructor
64         for COMPLEX_TYPE.
65
66 2009-02-03  Paolo Bonzini  <bonzini@gnu.org>
67
68         PR c++/36897
69         * pt.c (convert_nontype_argument_function): Expect expr to be an
70         ADDR_EXPR.
71
72         PR c++/37314
73         * typeck.c (merge_types): Call resolve_typename_type if only
74         one type is a typename.
75
76 2009-02-02  Jason Merrill  <jason@redhat.com>
77
78         PR c++/39054
79         * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node 
80         in BIT_NOT_EXPR.
81
82 2009-02-01  Paolo Carlini  <paolo.carlini@oracle.com>
83
84         PR c++/39053
85         * parser.c (cp_parser_pure_specifier): If there are no tokens left
86         do not call cp_lexer_consume_token.
87
88 2009-01-30  Jakub Jelinek  <jakub@redhat.com>
89
90         PR c++/39028
91         * parser.c (cp_parser_already_scoped_statement): Handle __label__
92         declarations.
93
94 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
95
96         PR c++/33465
97         * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
98
99 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
100
101         PR c++/38655
102         * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
103
104 2009-01-29  Paolo Carlini  <paolo.carlini@oracle.com>
105
106         * typeck.c (invalid_nonstatic_memfn_p): Use
107         DECL_NONSTATIC_MEMBER_FUNCTION_P.
108
109 2009-01-27  Paolo Carlini  <paolo.carlini@oracle.com>
110
111         PR c++/37554
112         * call.c (build_over_call): If convert_for_arg_passing returns
113         error_mark_node unconditionally return it.
114
115 2009-01-22  Adam Nemet  <anemet@caviumnetworks.com>
116
117         * class.c (check_field_decls): Also inherit packed for bitfields
118         regardless of their type.
119
120 2009-01-22  Dodji Seketeli  <dodji@redhat.com>
121
122         PR c++/38930
123         * decl2.c (grokfield): Reverting changes of PR c++/26693
124         (save_template_attributes): Likewise.
125         * decl.c (grokdeclarator): Likewise.
126         * name-lookup.c (pushdecl_maybe_friend): Likewise.
127         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
128         (append_type_to_template_for_access_check): Likewise.
129         * semantics.c (check_accessibility_of_qualified_id): Likewise.
130         * pt.c (instantiate_class_template, instantiate_template ): Likewise.
131         (tsubst): Likewise.
132         (resolve_type_name_type): Likewise.
133         (append_type_to_template_for_access_check): Likewise.
134
135 2009-01-21  Dodji Seketeli  <dodji@redhat.com>
136
137         PR c++/26693
138         * decl2.c (grokfield): when a typedef appears in a
139         class, create the typedef variant type node for it.
140         (save_template_attributes): Creating typedef variant type node
141          here is now useless.
142         * decl.c (grokdeclarator): If the typedef'ed struct/class was
143         anonymous, set the proper type name to all its type variants.
144         * name-lookup.c (pushdecl_maybe_friend): Reuse the
145         set_underlying_type function to install typedef variant types.
146         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
147         macro.
148         (append_type_to_template_for_access_check): New entry points.
149         * semantics.c (check_accessibility_of_qualified_id):
150         When a typedef that is a member of a class appears in a template,
151         add it to the template. It will be ...
152         * pt.c (instantiate_class_template, instantiate_template ): ... access
153         checked at template instantiation time.
154         (tsubst): Handle the case of being called with NULL args.
155         (resolve_type_name_type): The type name should be the name of the
156         main type variant.
157         (append_type_to_template_for_access_check): New entry point.
158
159 2009-01-19  Jason Merrill  <jason@redhat.com>
160
161         PR c++/23287
162         * parser.c (cp_parser_unqualified_id): In a template,
163         accept ~identifier.
164         * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
165
166 2009-01-16  Jason Merrill  <jason@redhat.com>
167
168         PR c++/38877
169         * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
170         * init.c (build_new): Don't call describable_type unless we
171         have an auto.
172
173         PR c++/29470
174         * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
175
176         PR c++/38579
177         * search.c (protected_accessible_p): N doesn't vary.
178
179 2009-01-15  Jason Merrill  <jason@redhat.com>
180
181         PR c++/38850
182         * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
183         accept hidden friends.
184
185 2009-01-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
186
187         PR C++/29388
188         * decl.c (grokdeclarator): Check for a non namespace/class context.
189
190 2009-01-15  Jason Merrill  <jason@redhat.com>
191
192         PR c++/36334
193         PR c++/37646
194         * tree.c (lvalue_p_1): Handle BASELINK.  A COMPONENT_REF to
195         a function isn't necessarily an lvalue. Take tree, not const_tree.
196         (lvalue_p, real_lvalue_p): Take tree, not const_tree.
197         * typeck.c (lvalue_or_else): Likewise.
198         * cp-tree.h: Adjust prototypes.
199
200 2009-01-15  Steve Ellcey  <sje@cup.hp.com>
201
202         PR c++/38357
203         * pt.c (tsubst): Check for NULL args.
204
205 2009-01-15  Dodji Seketeli  <dodji@redhat.com>
206
207         PR c++/38636
208         * name-lookup.c (pushtag): Don't create members to types that are not
209         being created.
210
211 2009-01-14  Nick Clifton  <nickc@redhat.com>
212
213         PR c++/37862
214         * parser.c: Pass cp_id_kind computed in
215         cp_parser_postfix_dot_deref_expression to
216         cp_parser_primary_expression.
217
218 2009-01-13  Jakub Jelinek  <jakub@redhat.com>
219
220         PR c++/38795
221         * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
222         STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
223         as CAST_EXPR.
224
225 2009-01-12  Jason Merrill  <jason@redhat.com>
226             Steve Ellcey  <sje@cup.hp.com>
227
228         PR c++/35109
229         * name-lookup.c (lookup_name_real): Keep looking past a hidden 
230         binding.
231
232 2009-01-12  Dodji Seketeli  <dodji@redhat.com>
233
234         PR c++/36019
235         * pt.c (parameter_of_template_p): New function.
236         * cp-tree.h: Declare it.
237         * name-lookup.c (binding_to_template_parms_of_scope_p): New
238         function.
239         (outer_binding): Take template parameters in account when looking for
240         a name binding.
241
242 2009-01-12  Jason Merrill  <jason@redhat.com>
243
244         PR c++/31488
245         * tree.c (pod_type_p): Return 1 for structs created by the back end.
246
247 2009-01-12  Jakub Jelinek  <jakub@redhat.com>
248
249         PR c/32041
250         * parser.c (cp_parser_builtin_offsetof): Allow `->' in
251         offsetof member-designator, handle it as `[0].'.
252
253         PR c++/38794
254         * decl.c (start_function): If grokdeclarator hasn't returned
255         FUNCTION_DECL nor error_mark_node, issue diagnostics.
256
257 2009-01-11  Jakub Jelinek  <jakub@redhat.com>
258
259         PR c++/36254
260         * cp-gimplify.c (genericize_if_stmt): Renamed from ...
261         (gimplify_if_stmt): ... this.
262         (cp_gimplify_expr): Don't handle IF_STMT here.
263         (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
264
265 2009-01-10  Andrew Pinski  <pinskia@gmail.com>
266
267         PR c++/38648
268         * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
269
270         PR c++/36695
271         * typeck2.c (build_functional_cast): Check for reference type and NULL
272         PARMS.
273
274 2009-01-09  Steve Ellcey  <sje@cup.hp.com>
275
276         * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
277
278 2009-01-09  Jakub Jelinek  <jakub@redhat.com>
279
280         PR c++/35335
281         * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
282
283 2009-01-09  John F. Carr  <jfc@mit.edu>
284
285         PR c++/37877
286         * parser.c (cp_parser_class_specifier): Clear
287         parser->in_unbraced_linkage_specification_p while parsing class
288         specifiers.
289
290 2009-01-07  Jakub Jelinek  <jakub@redhat.com>
291
292         PR c++/38725
293         * semantics.c (finish_goto_stmt): Convert destination to
294         void *.
295
296 2009-01-06  Jason Merrill  <jason@redhat.com>
297
298         PR c++/35297
299         PR c++/35477
300         PR c++/35784
301         PR c++/36846
302         PR c++/38276
303         * pt.c (check_default_tmpl_args): Don't complain about
304         out-of-order parameter packs in the enclosing class
305         or parameter packs after default args.
306         (coerce_template_parms): If we have more than one
307         parameter pack, don't flatten argument packs.
308         (template_args_equal): Handle argument packs.
309         (comp_template_args): Don't flatten argument packs.
310         (check_instantiated_arg): Split out from...
311         (check_instantiated_args): Here.  Handle arg packs.
312         (convert_template_argument): Just check that nontype argument
313         packs have the right type.
314
315 2009-01-05  Dodji Seketeli  <dodji@redhat.com>
316
317         PR c++/38472
318         * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
319
320 2009-01-05  Jason Merrill  <jason@redhat.com>
321
322         PR c++/38698
323         * typeck2.c (process_init_constructor_union): Handle union with
324         no fields.
325
326         * mangle.c (write_expression): Remove mangling for zero-operand
327         casts.
328
329         PR c++/38701
330         * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
331         defaulting.
332
333         PR c++/38702
334         * class.c (defaultable_fn_p): Only operator== can be a copy
335         assignment operator.
336
337 2009-01-02  Jason Merrill  <jason@redhat.com>
338
339         PR c++/38698
340         * typeck2.c (process_init_constructor_union): Handle excess
341         initializers.
342         (process_init_constructor_record): Likewise.
343
344         PR c++/38684
345         * typeck2.c (digest_init_r): Don't use process_init_constructor
346         for non-aggregate classes.
347
348 2008-12-31  Jakub Jelinek  <jakub@redhat.com>
349
350         PR c++/38647
351         * parser.c (cp_parser_primary_expression) <case RID_FUNCTION_NAME>:
352         Return error_mark_node if cp_parser_non_integral_constant_expression
353         returns true.
354
355         PR c++/38640
356         * semantics.c (finish_decltype_type): Handle TEMPLATE_PARM_INDEX.
357
358 2008-12-29  Jakub Jelinek  <jakub@redhat.com>
359
360         PR c++/38635
361         * parser.c (cp_parser_condition): Use cp_parser_require
362         instead of cp_lexer_consume_token to consume =.
363
364         PR c++/38637
365         * decl.c (start_enum): If enumtype is error_mark_node, exit early.
366
367 2008-12-28  Jakub Jelinek  <jakub@redhat.com>
368
369         PR c++/38650
370         * semantics.c (finish_omp_for): Don't add CLEANUP_POINT_EXPR
371         around volatile iteration var in condition and/or increment
372         expression.
373
374 2008-12-27  Jakub Jelinek  <jakub@redhat.com>
375
376         PR c++/38639
377         * pt.c (tsubst_omp_for_iterator): RECUR on whole init_expr instead of
378         just its type.
379
380 2008-12-21  Jason Merrill  <jason@redhat.com>
381
382         PR c++/38597
383         * name-lookup.c (arg_assoc_type): Handle DECLTYPE_TYPE.
384
385 2008-12-20  Jakub Jelinek  <jakub@redhat.com>
386             Manuel López-Ibáñez  <manu@gcc.gnu.org>
387
388         PR c++/36921
389         * c-common.c (warn_about_parentheses): Remove ARG_UNUSED from
390         arg_left.  Don't warn about X<=Y<=Z if comparison's type isn't
391         integral.
392
393 2008-12-19  Jakub Jelinek  <jakub@redhat.com>
394
395         PR c++/38577
396         * call.c (build_new_method_call): Handle call being COMPOUND_EXPR
397         or NOP_EXPR.
398
399 2008-12-18  Jakub Jelinek  <jakub@redhat.com>
400
401         PR c++/38427
402         * init.c (perform_member_init): For value-initialized
403         references call permerror instead of warning and don't emit any
404         INIT_EXPR.
405
406 2008-12-18  Jason Merrill  <jason@redhat.com>
407
408         PR c++/38485
409         * parser.c (cp_parser_token_starts_cast_expression): An EOF
410         can't start a cast-expression.
411
412 2008-12-17  Jason Merrill  <jason@redhat.com>
413
414         * semantics.c (describable_type): New function.
415         (finish_decltype_type): Use it for dependent exprs.
416         * cp-tree.h: Declare it.
417         * mangle.c (write_type) [DECLTYPE_TYPE]: Set skip_evaluation.
418         (write_expression): If skip_evaluation, use type stubs.
419         * tree.c (cp_tree_equal): Handle PARM_DECLs from different
420         declarations of a function.
421         * init.c (build_new): Do auto deduction if type is describable.
422         * decl.c (cp_finish_decl): Likewise.
423         * parser.c (cp_parser_omp_for_loop): Likewise.
424
425 2008-12-10  Jason Merrill  <jason@redhat.com>
426
427         PR c++/35319
428         * mangle.c (write_builtin_type): Add mangling for decimal floating 
429         point and fixed point types.
430         (write_type): Pass FIXED_POINT_TYPE along.
431
432 2008-12-09  Mark Mitchell  <mark@codesourcery.com>
433
434         PR c++/37971
435         * class.c (resolve_address_of_overloaded_function): Check
436         accessibility of member functions unless FLAGS indicates
437         otherwise.
438         * call.c (standard_conversion): Adjust flags passed to
439         instantiate_type.
440         (convert_default_arg): Do not perform access checks.
441         * cp-tree.h (tsubst_flags_t): Add tf_no_access_control.
442
443 2008-12-08  Steve Ellcey  <sje@cup.hp.com>
444
445         * decl2.c (mark_used): Remove assemble_external call.
446
447 2008-12-08  Dodji Seketeli  <dodji@redhat.com>
448
449         PR debug/38390
450         * name-lookup.c (kept_level_p): Don't forget the case of levels
451           having using directives.
452
453 2008-12-08  Richard Henderson  <rth@redhat.com>
454
455         PR 38240
456         * class.c (finish_struct_bits): Use SET_TYPE_MODE.
457         * decl.c (record_unknown_type): Likewise.
458         (start_enum, finish_enum): Likewise.
459
460 2008-12-05  Jakub Jelinek  <jakub@redhat.com>
461
462         PR c++/35336
463         * error.c (dump_expr): Handle BIT_FIELD_REF.
464
465 2008-12-05  Sebastian Pop  <sebastian.pop@amd.com>
466
467         PR bootstrap/38262
468         * Make-lang.in (cc1plus-dummy, cc1plus): Add BACKENDLIBS,
469         remove GMPLIBS.
470
471 2008-12-04  Jason Merrill  <jason@redhat.com>
472
473         PR c++/37906
474         * decl.c (grok_special_member_properties): Set TYPE_HAS_COMPLEX_DFLT
475         here.
476         * class.c (check_bases_and_members): Rather than assuming any
477         user-declared default constructor is complex here.
478
479 2008-12-04  Richard Guenther  <rguenther@suse.de>
480
481         PR c++/38334
482         * typeck.c (get_member_function_from_ptrfunc): Mark the vtbl
483         pointer access with TREE_NO_WARNING.
484
485 2008-12-03  Jason Merrill  <jason@redhat.com>
486
487         PR c++/38232
488         * init.c (build_value_init): Do initial zero-initialization
489         of a class with an implicitly-defined constructor using
490         build_zero_init rather than in build_value_init.
491         (build_value_init_1): Fold into build_value_init.
492
493         PR c++/38256
494         * parser.c (cp_parser_conversion_type_id): Diagnose
495         'operator auto' here.
496         * decl.c (grokdeclarator): Not here.
497
498         PR c++/38380
499         * decl.c (grokdeclarator): Only set DECL_NONCONVERTING_P
500         on explicit constructors.
501         * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Propagate
502         CONSTRUCTOR_IS_DIRECT_INIT.
503
504 2008-12-02  Jason Merrill  <jason@redhat.com>
505
506         PR c++/35782, c++/37860
507         * call.c (build_user_type_conversion_1): Remember
508         list-initialization.
509         (convert_like_real): Likewise.
510         (build_over_call): Don't require the copy constructor
511         for copy-list-initialization.
512         * cp-tree.h (TARGET_EXPR_LIST_INIT_P): New macro.
513
514         PR c++/37234
515         * decl.c (cp_finish_decl): Handle =default and =delete for
516         templates, too.
517
518 2008-12-01  Jakub Jelinek  <jakub@redhat.com>
519
520         PR c++/38257
521         * parser.c (cp_parser_omp_for_loop): Handle auto.
522         * pt.c (tsubst_omp_for_iterator): Likewise.
523
524 2008-11-28  Jason Merrill  <jason@redhat.com>
525
526         PR c++/38233
527         * init.c (perform_member_init): Fix value-initialization.
528         (build_value_init_1): Add assert to catch cases that will break
529         in the gimplifier.
530         (build_default_init): Remove.
531         * cp-tree.h: Remove its prototype.
532         * pt.c (tsubst_expr) [DECL_EXPR]: Use build_value_init for
533         value-initialization.
534
535         PR c++/38278
536         * parser.c (cp_parser_class_name): Only call 
537         maybe_note_name_used_in_class if we actually found a class name.
538
539 2008-11-25  Jason Merrill  <jason@redhat.com>
540
541         PR c++/28743
542         * decl2.c (check_classfn): Error rather than abort on parameter
543         list mismatch.
544
545 2008-11-20  Jason Merrill  <jason@redhat.com>
546
547         PR c++/28513
548         * parser.c (cp_parser_class_name): Call maybe_note_name_used_in_class.
549
550         PR c++/37540
551         * call.c (build_over_call): Take the address of the function even
552         in a template.
553         (build_new_method_call): Remember the type of the called function
554         in a template.
555
556 2008-11-19  Dodji Seketeli  <dodji@redhat.com>
557
558         PR c++/37142
559         * pt.c (coerce_template_template_parm): Use the more robust
560         uses_template_parms instead of dependent_type_p.
561
562 2008-11-19  Dodji Seketeli  <dodji@redhat.com>
563
564         PR c++/35405
565         * pt.c (lookup_template_class): Check pointers before dereferencing
566         them.
567         * error.c (dump_template_decl): Likewise.
568
569 2008-11-19  Jason Merrill  <jason@redhat.com>
570
571         PR c++/36410
572         * decl2.c (grokfield): Pass ATTR_FLAG_TYPE_IN_PLACE for a typedef
573         that names a class for linkage purposes.
574
575         PR c++/37563
576         * parser.c (cp_parser_pseudo_destructor_name): A pseudo-destructor
577         name is not a declaration.
578
579         PR c++/37256
580         * pt.c (instantiate_decl): Don't require a definition of
581         a template that is explicitly instantiated 'extern'.
582
583 2008-11-18  Jason Merrill  <jason@redhat.com>
584             Jakub Jelinek  <jakub@redhat.com>
585         
586         PR c++/37962
587         * parser.c (cp_parser_type_id): Complain about auto.
588         * decl.c (grokdeclarator): Complain about parameters and
589         conversion functions declared with auto.
590
591         * call.c (standard_conversion): Use CLASS_TYPE_P instead of
592         MAYBE_CLASS_TYPE_P.
593         * cp-tree.h (TYPE_NON_AGGREGATE_CLASS): Likewise.
594
595 2008-11-17  Jakub Jelinek  <jakub@redhat.com>
596
597         PR c++/36089
598         * init.c (constant_value_1): Handle TREE_LIST init.
599
600 2008-11-15  Jakub Jelinek  <jakub@redhat.com>
601
602         PR c++/37561
603         * typeck.c (cp_build_unary_op): Don't call get_unwidened.  Use
604         argtype instead of result_type.
605
606 2008-11-14  Jason Merrill  <jason@redhat.com>
607
608         PR c++/38030
609         * semantics.c (finish_call_expr): Don't repeat arg-dep lookup
610         for a non-dependent call.
611
612         PR c++/37740
613         * call.c (build_aggr_conv): Increment i.
614
615 2008-11-13  Jason Merrill  <jason@redhat.com>
616
617         PR c++/37932
618         * typeck2.c (process_init_constructor_record): Update bitfield
619         handling.
620         (check_narrowing): Update bitfield handling, print source type.
621         
622 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
623
624         PR c++/36478
625         Revert:
626         2007-05-07  Mike Stump  <mrs@apple.com>
627         * parser.c (check_empty_body): Add.
628         (cp_parser_iteration_statement): Add call to check_empty_body.
629
630 2008-11-12  Jason Merrill  <jason@redhat.com>
631
632         PR c++/38007
633         * typeck.c (cp_build_modify_expr): Update bitfield handling.
634
635 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
636
637         PR c++/34269
638         * parser.c (cp_parser_simple_declaration): Don't commit
639         to tentative parse if parse errors were seen.
640
641         PR c++/35334
642         * error.c (dump_expr): Handle COMPLEX_EXPR.
643
644 2008-11-10  Jakub Jelinek  <jakub@redhat.com>
645
646         PR c++/38021
647         * parser.c (cp_parser_enum_specifier): After parsing :,
648         parse definitely.  Don't return early if type specifier
649         is erroneous.
650
651 2008-11-06  David Edelsohn  <edelsohn@gnu.org>
652
653         PR target/26397
654         * g++spec.c (LIBSTDCXX_STATIC): New.
655         (lang_spec_driver): Use LIBSTDCXX_STATIC when not
656         shared_libgcc.
657         
658 2008-11-05  Fabien Chene <fabien.chene@gmail.com>
659
660         PR c++/32519
661         * cp-tree.h: Fix DECL_NONSTATIC_MEMBER_P to handle member template
662         functions.
663
664 2008-11-05  Richard Guenther  <rguenther@suse.de>
665
666         PR middle-end/37742
667         * decl.c (start_preparsed_function): Use the correct type for
668         building the RESULT_DECL.
669
670 2008-10-31  Jakub Jelinek  <jakub@redhat.com>
671
672         PR c++/37967
673         * decl.c (grokdeclarator): Diagnose auto function decl without
674         late return type and late return type function decl where type
675         is not auto.
676
677         PR c++/37965
678         * decl.c (cp_finish_decl): Diagnose type_uses_auto type with
679         no initializer.
680
681 2008-10-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
682
683         PR 11492
684         * class.c (check_bitfield_decl): Rename min_precision to
685         tree_int_cst_min_precision.
686         * decl.c (finish_enum): Likewise.
687
688 2008-10-29  Manuel López-Ibáñez  <manu@gcc.gnu.org>
689
690         PR c++/26997
691         * parser.c (cp_parser_token_starts_cast_expression): New.
692         (cp_parser_cast_expression): Peek the next token to decide whether
693         this could be a parenthesized constructor or is definitely an
694         actual cast.
695
696 2008-10-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>
697
698         PR c/7543
699         * typeck.c (build_x_binary_op): Update call to
700         warn_about_parentheses.
701         * parser.c (cp_parser_binary_expression): Add note about passing
702         the correct code for unary expressions.
703
704 2008-10-24  Jakub Jelinek  <jakub@redhat.com>
705
706         * Make-lang.in (check-c++-subtargets): New alias for
707         check-g++-subtargets.
708         (lang_checks_parallelized): Add check-g++.
709         (check_g++_parallelize): New variable.
710
711 2008-10-21  Richard Guenther  <rguenther@suse.de>
712
713         * semantics.c (simplify_aggr_init_exprs_r): Remove.
714         (expand_or_defer_fn): Do not walk the function body to
715         simplify aggr_init_exprs.
716
717 2008-10-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
718
719         PR c++/37004
720         * typeck.c (cp_common_type): New. The same as
721         type_after_usual_arithmetic_conversions but without promotions.
722         (type_after_usual_arithmetic_conversions): Do the promotions and
723         call cp_common_type.
724         (common_type): Make it behave like the C version of this
725         function. Do not handle pointer types.
726         (common_pointer_type): Move handling of pointer types from
727         common_type to here.
728         (cp_build_binary_op): Use common_pointer_type instead of
729         common_type in call to pointer_diff.
730         Use cp_common_type instead of common_type.
731         * cp-tree.h (common_pointer_type): Declare.
732
733 2008-10-14  Jakub Jelinek  <jakub@redhat.com>
734
735         PR c++/37819
736         * cp-gimplify.c (cp_genericize_r): Only fold_convert COND_EXPR
737         arguments if they don't already have COND_EXPR's type.
738
739 2008-10-14  Paolo Carlini  <paolo.carlini@oracle.com>
740
741         PR c++/37650
742         * pt.c (push_template_decl_real): Check that current_template_parms
743         is not null.
744         (process_partial_specialization): Assert current_template_parms not
745         null.
746
747 2008-10-13  Doug Evans  <dje@google.com>
748
749         * cp-tree.h (DECL_MAIN_P): Fix parentheses around expression.
750
751 2008-10-10  Jakub Jelinek  <jakub@redhat.com>
752
753         PR c++/37146
754         * cp-gimplify.c (cp_genericize_r): Fix up bitfield operands of
755         COND_EXPR.
756
757 2008-10-09  Jakub Jelinek  <jakub@redhat.com>
758
759         PR c++/37568
760         * semantics.c (finalize_nrv_r): Clear DECL_INITIAL instead of
761         setting it to error_mark_node.
762
763 2008-10-07  Steve Ellcey  <sje@cup.hp.com>
764
765         * decl.c (start_cleanup_fn): Declare as inline.
766
767 2008-10-06  Jason Merrill  <jason@redhat.com>
768
769         PR c++/37376, other mangling issues
770         * mangle.c (write_type): Update TYPE_PACK_EXPANSION mangling.
771         (write_member_name): Break out from...
772         (write_expression): ...here.  Handle dependent COMPONENT_REF.
773         (write_template_arg): Wrap an argument pack in 'I'/'E'.
774         (write_builtin_type): Update char16/32_t mangling.
775         (write_nested_name, write_prefix): Don't forget template args
776         for typename types.
777         * operators.def: Add ARROW_EXPR, update COMPONENT_REF and 
778         EXPR_PACK_EXPANSION.
779
780 2008-10-06  Aldy Hernandez  <aldyh@redhat.com>
781
782         * typeck.c (build_x_indirect_ref): Add location argument.
783         (cp_build_binary_op): Pass location to warn_for_div_by_zero.
784         (cp_build_unary_op): Add location argument.
785         (cp_build_modify_expr): Same.
786         * class.c (build_base_path): Pass location to build_indirect_ref.
787         * semantics.c (handle_omp_for_class_iterator): Pass elocus to
788         build_modify_expr.
789
790 2008-10-05  Dodji Seketeli  <dodji@redhat.com>
791
792         PR c++/37410
793         * cp-gimplify.c (cp_gimplify_expr): For each USING_STMT
794         make sure an IMPORTED_DECL node is added to the BLOCK_VARS list
795         of the innermost containing BLOCK.
796
797 2008-10-03  Paolo Carlini  <paolo.carlini@oracle.com>
798
799         PR c++/37719
800         * error.c (dump_function_decl): Save the exceptions in case of
801         error about incompatible specifications in a specialization.
802
803 2008-10-01  Andrew Pinski  <andrew_pinski@playstation.sony.com>
804
805         * tree.c (lvalue_p_1): COMPOUND_LITERAL_EXPR is also an lvalue.
806
807 2008-09-30  H.J. Lu  <hongjiu.lu@intel.com>
808
809         PR c++/37683
810         * parser.c (cp_parser_selection_statement): Fix uninitialized
811         variable.
812
813 2008-09-30  Simon Martin  <simartin@users.sourceforge.net>
814
815         PR c++/37555
816         PR c++/37556
817         * decl.c (grokdeclarator): Set the type for typedefs to a
818         nested-name-specifier to error_mark_node.
819
820 2008-09-30  Paolo Bonzini  <bonzini@gnu.org>
821
822         * parser.c (cp_parser_selection_statement): Implement here the
823         -Wempty-body warning for `if' and `else' statements.
824         * semantics.c (finish_if_stmt): Do not call empty_body_warning.
825
826 2008-09-25  Paolo Carlini  <paolo.carlini@oracle.com>
827
828         PR c++/37649
829         * name-lookup.c (maybe_process_template_type_declaration): Check
830         return value of push_template_decl_real for error_mark_node.
831
832 2008-09-24  Aldy Hernandez  <aldyh@redhat.com>
833
834         * semantics.c (finish_fname): Pass location to fname_decl.
835
836 2008-09-23  Jakub Jelinek  <jakub@redhat.com>
837
838         PR c++/37533
839         * semantics.c (finish_omp_for): If processing_template_decl, just build
840         MODIFY_EXPR for init instead of calling cp_build_modify_expr.
841
842 2008-09-23  Aldy Hernandez  <aldyh@redhat.com>
843
844         * typeck.c (build_array_ref): Pass location to cp_build_binary_op.
845         (get_member_function_from_ptrfunc): Same.
846         (build_x_binary_op): Same.
847         (build_binary_op): Same.
848         (cp_build_binary_op): New location argument.
849         (pointer_diff): Pass location to cp_build_binary_op.
850         (cp_truthvalue_conversion): Pass location to build_binary_op.
851         (convert_ptrmem): Pass location to cp_build_binary_op.
852         (cp_build_modify_expr): Same.
853         (build_ptrmemfunc): Same.
854         * init.c (expand_cleanup_for_base): Pass location to
855         c_common_truthvalue_conversion.
856         (build_new_1): Pass location to cp_build_binary_op.
857         (build_vec_delete_1): Pass location to *build_binary_op,
858         c_common_truthvalue_conversion.
859         (build_vec_init): Same.
860         (build_delete): Same.
861         * decl.c (compute_array_index_type): Same.
862         * call.c (build_new_op): Same.
863         * rtti.c (build_dynamic_cast_1): Same.
864         * cp-tree.h: Add argument to cp_build_binary_op.
865         * semantics.c (handle_omp_for_class_iterator): Pass location to
866         *build_binary_op, c_common_truthvalue_conversion.
867         * decl2.c (get_guard_cond): Same.
868
869 2008-09-17  Richard Guenther  <rguenther@suse.de>
870
871         PR c++/22374
872         * rtti.c (build_dynamic_cast_1): Convert the COND_EXPR
873         result to the correct type.
874
875 2008-09-17  H.J. Lu  <hongjiu.lu@intel.com>
876
877         PR c++/37450
878         * name-lookup.c (pushdecl_maybe_friend): Don't return the old
879         parameter for duplicate.
880
881 2008-09-17  Jason Merrill  <jason@redhat.com>
882
883         PR c++/37588
884         * name-lookup.c (lookup_type_scope): Look through sk_function_parms.
885
886 2008-09-17  Jakub Jelinek  <jakub@redhat.com>
887
888         PR c++/37552
889         * typeck.c (build_array_ref): Use protected_set_expr_location instead
890         of SET_EXPR_LOCATION when ret might not be an expression.
891
892 2008-09-17  Jan Hubicka  <jh@suse.cz>
893
894         PR c++/18071
895         * cp/decl.c (start_method): Set DECL_NO_INLINE_WARNING_P.
896
897 2008-09-16  Jakub Jelinek  <jakub@redhat.com>
898
899         PR c++/37531
900         * semantics.c (finish_compound_literal): Return error_mark_node if
901         type is errorneous.
902
903         PR c++/37532
904         * lex.c (init_reswords): Don't populate ridpointers for D_CONLY
905         reserved words.
906
907 2008-09-15  Aldy Hernandez  <aldyh@redhat.com>
908
909         * decl.c (duplicate_decls): Call error_at.
910         (grokfndecl): New location argument.  Use location if available.
911         (grokdeclarator): Pass declarator location to grokfndecl.
912         * cp-tree.h (struct cp_declarator): Update comment for id_loc.
913         * decl2.c (check_classfn): Use error_at.
914         * parser.c (cp_parser_init_declarator): Set function_start_locus
915         to brace location.
916         (cp_parser_member_declaration): Set id_loc for function declarators.
917
918 2008-09-09  Jan Hubicka  <jh@suse.cz>
919
920         PR middle-end/37500
921         * pt.c (tsubst_decl): Do not copy DECL_STRUCT_FUNCTION pointer.
922
923 2008-09-09  Jakub Jelinek  <jakub@redhat.com>
924
925         PR c++/37417
926         * tree.c (array_type_nelts_top): Add size_one_node instead of
927         integer_one_node.
928
929 2008-09-09  Jason Merrill  <jason@redhat.com>
930
931         PR c++/37439
932         * pt.c (tsubst_copy) [PARM_DECL]: Don't abort if the parm has
933         DECL_CONTEXT set.
934
935 2008-09-09  Jakub Jelinek  <jakub@redhat.com>
936
937         PR c++/37389
938         * decl.c (build_enumerator): Handle previous value's DECL_INITIAL
939         being error_operand_p.  Don't clear value if it was error_mark_node.
940
941 2008-09-09  Paolo Bonzini  <bonzini@gnu.org>
942
943         * cp-objcp-common.h (LANG_HOOKS_EXPAND_DECL): Remove.
944         * cp-tree.h: Don't mention DECL_ANON_UNION_ELEMS.
945         * semantics.c (anon_aggr_type_p): Remove.
946
947 2008-09-06  Jason Merrill  <jason@redhat.com>
948
949         PR c++/37302
950         * parser.c (cp_parser_parameter_declaration_list): Process the
951         PARM_DECLs as we go and push them.  Return a TREE_LIST.
952         (cp_parser_parameter_declaration_clause): Return a TREE_LIST.
953         (cp_parser_direct_declarator): Create a binding level and
954         suppress deprecated warnings in the parameter list.
955         (make_call_declarator): PARMS is now a tree.
956         * cp-tree.h (struct cp_declarator): Function parms are now a tree.
957         * decl.h (enum deprecated_states, deprecated_state): Move here.
958         * decl.c: From here.
959         (type_is_deprecated): New fn.
960         (grokparms): PARMLIST is a tree now.  Warn about parms that
961         use deprecated types.
962         * mangle.c (write_expression): Handle PARM_DECL, CALL_EXPR and
963         0-operand cast.
964         * pt.c (tsubst) [DECLTYPE_TYPE]: Set skip_evaluation.
965         (tsubst_copy) [PARM_DECL]: Handle a PARM_DECL used outside of a 
966         function.
967         * name-lookup.c (pushtag): Look through function parameter scopes.
968         (pushdecl_maybe_friend): Don't set DECL_CONTEXT on a PARM_DECL 
969         when we're parsing a function declarator.
970
971 2008-09-05  Douglas Gregor  <doug.gregor@gmail.com>
972
973        PR c++/37342
974        * tree.c (cp_build_qualified_type_real): Deal with sharing of
975        TYPE_LANG_SPECIFIC in the canonical types of pointer-to-method
976        types.
977         
978 2008-09-04  Ian Lance Taylor  <iant@google.com>
979
980         * parser.c (check_no_duplicate_clause): Change code parameter to
981         enum omp_clause_code.
982
983 2008-09-03  Jakub Jelinek  <jakub@redhat.com>
984
985         PR c++/37348
986         * decl.c (cp_finish_decl): Only set
987         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P if decl is VAR_DECL.
988
989         PR c++/37189
990         * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): New
991         extern decls.
992         * decl2.c (mark_used): If defer_mark_used_calls, push decl into
993         deferred_mark_used_calls vector and exit early.
994         * decl.c (defer_mark_used_calls, deferred_mark_used_calls): New
995         variables.
996         (finish_function): Set defer_mark_used_calls for the duration of the
997         function.  Call mark_used on any queued decls.
998
999 2008-09-02  Jason Merrill  <jason@redhat.com>
1000
1001         PR c++/37208
1002         * call.c (build_over_call): Make =delete work with SFINAE.
1003         * class.c (resolve_address_of_overloaded_function): Likewise.
1004
1005         * cp-tree.h (struct lang_decl_flags): Rename threadprivate_p to
1006         threadprivate_or_deleted_p.
1007         (CP_DECL_THREADPRIVATE_P): Adjust.
1008         (DECL_DELETED_FN): Likewise.
1009         (SD_UNINITIALIZED, SD_INITIALIZED, SD_DEFAULTED): New macros.
1010         (SD_DELETED): New macro.
1011         * parser.c (cp_parser_init_declarator): Use them.
1012         * decl.c (start_decl): Use them.
1013
1014         * decl2.c (mark_used): Give =deleted error even in sizeof.
1015
1016         * typeck2.c (check_narrowing): Downgrade narrowing error to
1017         permerror.
1018
1019 2008-09-02  Aldy Hernandez  <aldyh@redhat.com>
1020
1021         * typeck.c (build_array_ref): Use new location argument.
1022         * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
1023         * call.c (build_new_op): Same.
1024         * decl2.c (grok_array_decl): Same.
1025         * cp-tree.h (build_array_ref): Add location argument to prototype.
1026
1027 2008-09-01  Aldy Hernandez  <aldyh@redhat.com>
1028
1029         * typeck.c (build_x_indirect_ref): Add location argument.
1030         * class.c (build_base_path): Pass location to build_indirect_ref.
1031         * pt.c (tsubst_copy_and_build): Pass location to
1032         finish_label_address_expr.
1033         * parser.c (cp_parser_unary_expression): Same.
1034
1035 2008-08-31  Jason Merrill  <jason@redhat.com>
1036
1037         Implement late-specified return type using 'auto'.
1038         * cp-tree.h (struct cp_declarator): Add late_return_type field to
1039         function declarator.
1040         * parser.c (cp_parser_late_return_type_opt): New fn.
1041         (cp_parser_direct_declarator): Use it.
1042         (make_call_declarator): Put it in the declarator.
1043         * decl.c (grokdeclarator): Splice in late-specified return type.
1044         * pt.c (splice_late_return_type): New fn.
1045
1046 2008-08-29  Michael Meissner  <gnu@the-meissners.org>
1047
1048         * decl.c (builtin_function_1): Take a bool argument to decide
1049         whether to use pushdecl or pushdecl_top_level.
1050         (duplicate_decls): Copy function specific target and optimization
1051         options on duplicate declarations.
1052         (cxx_builtin_function): Update builtin_function_1 call.
1053         (cxx_builtin_function_ext_scope): New function, guarantee that the
1054         declaration is done at global scope.
1055
1056         * cp-objcp-common.h (LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE): New
1057         macro, define builtin function hook for delayed machine specific
1058         builtins.
1059
1060         * cp-tree.h (cxx_builtin_function_ext_scope): Add declaration.
1061
1062 2008-08-30  Jason Merrill  <jason@redhat.com>
1063
1064         PR c++/37288
1065         * pt.c (dependent_type_p): Don't abort on auto outside of a template.
1066
1067 2008-08-29  Jason Merrill  <jason@redhat.com>
1068
1069         Implement C++0x 'auto' semantics.
1070         * decl.c (start_decl_1): Don't complain about auto being incomplete.
1071         (cp_finish_decl): Deduce auto.
1072         * init.c (build_new): Handle 'new auto'.
1073         * typeck2.c (cxx_incomplete_type_diagnostic): Give a different
1074         message for auto than for normal template type parms.
1075         * pt.c (type_dependent_expression_p): Handle { }.
1076         (make_auto): New function.
1077         (listify_autos): New function.
1078         (do_auto_deduction): New function.
1079         (is_auto): New function.
1080         (type_uses_auto): New function.
1081         * cp-tree.h: Declare them.
1082         * parser.c (cp_parser_decl_specifier_seq): In C++0x mode, don't
1083         treat auto as a declspec.
1084         (cp_parser_simple_type_specifier): It's a type-specifier.
1085
1086 2008-08-29  Mark Mitchell  <mark@codesourcery.com>
1087
1088         * mangle.c (write_type): Add target-specific manglings for
1089         non-fundamental types to the substitution table.
1090         gcc/testsuite/
1091
1092 2008-08-29  Jakub Jelinek  <jakub@redhat.com>
1093
1094         PR fortran/29635
1095         PR fortran/23057
1096         * name-lookup.c (do_using_directive, cp_emit_debug_info_for_using):
1097         Adjust debug_hooks->imported_module_or_decl callers.
1098
1099 2008-08-29  Jan Hubicka  <jh@suse.cz>
1100
1101         * cp-gimplify.c (cp_gimplify_expr): Add PRED_CONTINUE heuristic.
1102
1103 2008-08-28  Paolo Carlini  <paolo.carlini@oracle.com>
1104
1105         PR c++/37260
1106         * decl.c (reshape_init_r): Check init for error_mark_node.
1107
1108 2008-08-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1109
1110         PR c++/17880
1111         * semantics.c (maybe_convert_cond): Call verify_sequence_points.
1112         (finish_return_stmt): Likewise.
1113         (finish_switch_condition): Likewise.
1114
1115 2008-08-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1116
1117         * cp-tree.h: Fix #error directive.
1118
1119 2008-08-26  Douglas Gregor  <doug.gregor@gmail.com>
1120
1121         * typeck.c (type_after_usual_arithmetic_conversions): Don't do the
1122         usual arithmetic conversions on scoped enumeration types.
1123         (common_type): Ditto.
1124         (default_conversion): Don't perform integral promotions on scoped
1125         enumeration types. 
1126         (build_array_ref): Scoped enumeration types can't be used as
1127         subscripts.
1128         * decl.c (start_enum): If building a C++0x scoped enumeration,
1129         enter its scope. If provided with an underlying type, check that
1130         underlying type and set up the enumeration type accordingly.
1131         (finish_enum): Only compute an underlying type if the underlying
1132         type isn't already fixed, and only convert the enumerator values
1133         now if we've just computed the underlying type. Finish the scope
1134         of C++0x scoped enumerations.
1135         (build_enumerator): For enumerations with a fixed underlying type,
1136         check the enumerator values when the enumerator is defined.
1137         (lookup_enumerator): New.
1138         * call.c (standard_conversion): Don't allow assignment from
1139         integers to scoped enumeration types, even with -fpermissive.
1140         Don't convert from scoped enumerations to bool or any arithmetic
1141         types.
1142         (build_conditional_expr): Don't per the usual arithmetic
1143         conversions for scoped enumeration types.
1144         (convert_like_real): Check complain to see if we should
1145         produce warnings.
1146         * error.c (class_key_or_enum_as_string): Print scoped enums.
1147         * cp-tree.h (MAYBE_CLASS_TYPE_P): Check CLASS_TYPE_P, not
1148         TYPE_LANG_FLAG_5.
1149         (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P): New.
1150         (SCOPED_ENUM_P): New.
1151         (UNSCOPED_ENUM_P): New.
1152         (SET_SCOPED_ENUM_P): New.
1153         (ENUM_UNDERLYING_TYPE): New.
1154         * pt.c (lookup_template_class): Update the instantiation of enum
1155         types to deal with C++0x scoped enumerations and underlying
1156         types.
1157         * name-lookup.c (begin_scope): Deal with scoped enumeration
1158         scopes.
1159         (lookup_qualified_name): Deal with lookup into enumeration types.
1160         * name-lookup.h (enum scope_kind): Add sk_scoped_enum.
1161         * parser.c (cp_parser_class_or_namespace_name): Rename to...
1162         (cp_parser_qualifying_entity): ... this. Also, in C++0x mode,
1163         parse a type-name that can be an enumeration type.
1164         (cp_parser_nested_name_specifier_opt): Update with C++0x grammar.
1165         (cp_parser_elaborated_type_specifier): Parse the
1166         optional `struct' or `class' following enum (in C++0x).
1167         (cp_parser_enum_specifier): Parse C++0x scoped enumerations and
1168         enum-base clauses.
1169
1170 2008-08-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1171
1172         * typeck.c: Update all calls to pedwarn.
1173         * decl.c: Likewise.
1174         * call.c: Likewise.
1175         * error.c: Likewise.
1176         * pt.c: Likewise.
1177         * name-lookup.c: Likewise.
1178         * parser.c: Likewise.
1179
1180 2008-08-20  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1181
1182         PR c++/35158
1183         * parser.c (cp_parser_omp_for_loop): Handle parenthesized
1184         initializers.
1185
1186 2008-08-20  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1187
1188         * parser.c: Update all calls to inform.
1189         * typeck.c: Likewise.
1190         * init.c: Likewise.
1191         * class.c: Likewise.
1192         * call.c: Likewise.
1193         * method.c: Likewise.
1194         * friend.c: Likewise.
1195         * typeck2.c: Likewise.
1196         * pt.c: Likewise.
1197         * name-lookup.c: Likewise.
1198         * lex.c: Likewise.
1199
1200 2008-08-19  Jakub Jelinek  <jakub@redhat.com>
1201
1202         PR debug/37156
1203         * error.c (cp_print_error_function): Deal with recursive BLOCK trees.
1204
1205 2008-08-18  Tomas Bily  <tbily@suse.cz>
1206
1207         * tree.c (cp_tree_equal): Use CONVERT_EXPR_CODE_P.
1208
1209 2008-08-18  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1210
1211         * typeck.c: Update all callers of permerror.
1212         * init.c: Likewise.
1213         * class.c: Likewise.
1214         * decl.c: Likewise.
1215         * call.c: Likewise.
1216         * except.c: Likewise.
1217         * cvt.c: Likewise.
1218         * typeck2.c: Likewise.
1219         * pt.c: Likewise.
1220         * semantics.c: Likewise.
1221         * name-lookup.c: Likewise.
1222         * lex.c: Likewise.
1223         * decl2.c: Likewise.
1224         * parser.c: Likewise.
1225
1226 2008-08-14  Paolo Carlini  <paolo.carlini@oracle.com>
1227
1228         PR c++/34485
1229         * pt.c (check_template_shadow): Change to return a bool.
1230         * name-lookup.c (push_class_level_binding): Early return if
1231         check_template_shadow returns false.
1232         * cp-tree.h (check_template_shadow): Adjust declaration.
1233
1234 2008-08-14  Paolo Carlini  <paolo.carlini@oracle.com>
1235
1236         PR c++/34600
1237         * decl.c (grokdeclarator): In case of extern and initializer, return
1238         error_mark_node after the error.
1239
1240 2008-08-13  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1241
1242         PR 30551
1243         * decl.c (grokfndecl): Call check_main_parameters_type only if
1244         -Wmain.
1245
1246 2008-08-12  Paolo Carlini  <paolo.carlini@oracle.com>
1247
1248         PR c++/37087
1249         * parser.c (cp_parser_class_head): Early return error_mark_node in
1250         case of global qualification of class name or qualified name that
1251         does not name a class.
1252
1253 2008-08-09  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1254
1255         PR c++/12242
1256         * cvt.c (ocp_convert): Warn for out-of-range conversions to enum.
1257
1258 2008-08-09  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1259
1260         PR 36901
1261         * cp-tree.h (struct diagnostic_context, struct diagnostic_info):
1262         Delete forward declarations. Check that toplev.h has not been
1263         included before this file. Include toplev.h and diagnostic.h.
1264         * error.c (cp_cpp_error): Use DK_PEDWARN.
1265         (cxx_incomplete_type_diagnostic): Update declaration.
1266         (cxx_incomplete_type_error): Use DK_ERROR.
1267         * typeck2.c (cxx_incomplete_type_diagnostic): Take a diagnostic_t
1268         as argument. Use emit_diagnostic.
1269         (cxx_incomplete_type_error): Use DK_ERROR.
1270         (add_exception_specifier): Use diagnostic_t instead of custom
1271         codes.  
1272         * typeck.c (complete_type_or_else): Update call to
1273         cxx_incomplete_type_diagnostic.
1274         * init.c (build_delete): Likewise.  
1275         * call.c (diagnostic_fn_t): Remove unused typedef.
1276         (build_temp): Pass a pointer to diagnostic_t.
1277         (convert_like_real): Use emit_diagnostic.
1278         (joust): Check return value of warning before giving informative
1279         note.  
1280         * friend.c (do_friend): Check return value of warning
1281         before giving informative note.
1282         * parser.c (cp_parser_template_id): Likewise.
1283
1284 2008-08-09  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1285
1286         PR 7651
1287         * class.c (check_bases_and_members): Warn with -Wuninitialized
1288         instead of -Wextra.
1289         
1290 2008-08-08  Volker Reichelt  <v.reichelt@netcologne.de>
1291
1292         PR c++/35985
1293         * decl.c (xref_basetypes): Check base for MAYBE_CLASS_TYPE_P,
1294         and make sure it is not a union.
1295
1296 2008-08-07  H.J. Lu  <hongjiu.lu@intel.com>
1297
1298         * semantics.c (finish_decltype_type): Initialize type.
1299
1300 2008-08-07  Douglas Gregor  <doug.gregor@gmail.com>
1301
1302         * semantics.c (finish_decltype_type): Handle calls to function
1303         pointers and references to functions properly.
1304
1305 2008-08-06  Douglas Gregor  <doug.gregor@gmail.com>
1306
1307         PR c++/36460
1308         * parser.c (cp_parser_template_argument): Don't assume that '>>'
1309         following a type-id is an error when in C++0x mode.
1310
1311 2008-08-06  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1312
1313         PR 26785
1314         * decl.c (grokdeclarator): Use explicit location with permerror_at.
1315
1316 2008-08-06  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1317
1318         PR 8715
1319         * typeck.c (cp_build_binary_op): Move code to c-common.c.
1320
1321 2008-08-05  Jason Merrill  <jason@redhat.com>
1322
1323         PR c++/37016
1324         * decl.c (build_ptrmemfunc_type): Don't require structural
1325         comparison of PMF types.
1326         * tree.c (cp_build_qualified_type_real): Don't clear
1327         a valid TYPE_PTRMEMFUNC_TYPE.
1328         * typeck.c (cp_build_unary_op): Still do build_ptrmemfunc in
1329         templates.
1330
1331 2008-08-04  Jason Merrill  <jason@redhat.com>
1332
1333         PR c++/36963
1334         * typeck2.c (check_narrowing): Allow narrowing conversion
1335         from an explicit floating-point constant.
1336
1337         PR c++/37006
1338         * pt.c (tsubst_decl): Leave DECL_INITIAL set on deleted
1339         instantiations.
1340
1341 2008-08-04  Simon Baldwin  <simonb@google.com>
1342
1343         PR c++/36999
1344         * parser.c (cp_parser_elaborated_type_specifier): Warn only when
1345         the declaration's id is followed by a semicolon.
1346
1347 2008-07-31  Jakub Jelinek  <jakub@redhat.com>
1348
1349         PR c++/36405
1350         * rtti.c (get_tinfo_decl_dynamic, get_typeid): Call
1351         complete_type_or_else even for UNKNOWN_TYPE to get diagnostics.
1352
1353 2008-07-31  Jason Merrill  <jason@redhat.com>
1354
1355         PR c++/36633
1356         * init.c (build_new_1): Don't convert pointer to the data type
1357         until we're actually going to treat it as that type.
1358
1359         PR c++/11309
1360         * tree.c (build_aggr_init_expr): Split out...
1361         (build_cplus_new): ...from here.
1362         (stabilize_init): Don't mess with AGGR_INIT_EXPR either.
1363         * init.c (build_new_1): new T() means value-initialization,
1364         not default-initialization.
1365         (build_vec_init): Likewise.
1366         (build_value_init_1): Use build_aggr_init_expr.
1367
1368 2008-07-30  Dodji Seketeli  <dseketel@redhat.com>
1369
1370         PR c++/36767
1371         * decl2.c (fix_temporary_vars_context_r): New function.
1372          (one_static_initialization_or_destruction): Make sure temporary
1373          variables part of the initialiser have their DECL_CONTEXT()
1374          properly set.
1375
1376 2008-07-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1377
1378         PR 34389
1379         * typeck.c (build_binary_op): Encapsulate code into
1380         shorten_binary_op.
1381
1382 2008-07-29  Jakub Jelinek  <jakub@redhat.com>
1383
1384         PR c++/36852
1385         * tree.c (cplus_array_hash, build_cplus_array_type_1): Hash on
1386         TYPE_UID instead of pointers.
1387
1388 2008-07-29  Jan Hubicka  <jh@suse.cz>
1389
1390         * optimize.c (maybe_clone_body): Remove DECL_INLINE.
1391         * decl.c (duplicate_decls): Likewise.
1392         (grokfndecl): Likewise.
1393         (start_method): Likewise.
1394         * method.c (make_thunk, make_alias_for, implicitly_declare_fn):
1395         Likewise.
1396         * pt.c (register_specialization, regenerate_decl_from_template):
1397         Likewise.
1398         * decl2.c (grokfield): Likewise.
1399
1400 2008-07-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1401
1402         PR 34985
1403         * decl.c (duplicate_decls): Merge USED flags.
1404
1405 2008-07-27  Jason Merrill  <jason@redhat.com>
1406
1407         PR c++/36943
1408         * decl.c (reshape_init_r): Allow C++0x initializer lists.
1409
1410 2008-07-28  Richard Guenther  <rguenther@suse.de>
1411
1412         Merge from gimple-tuples-branch.
1413
1414         2008-07-22  Aldy Hernandez  <aldyh@redhat.com>
1415
1416         * cp-gimplify.c (gimplify_if_stmt): Set location on newly created
1417         COND_EXPR.
1418
1419         2008-07-18  Jakub Jelinek  <jakub@redhat.com>
1420
1421         * decl.c (finish_function): Call gimple_body after cp_genericize.
1422
1423         2008-07-18  Aldy Hernandez  <aldyh@redhat.com>
1424
1425         * optimize.c: Include gimple.h instead of tree-gimple.h.
1426         * Make-lang.in (cp-gimplify.o): Depend on tree-iterator.h.
1427         * cp-gimplify.c: Rename tree-gimple.h to gimple.h.  Include
1428         tree-iterator.h.
1429
1430         2008-07-16  Jakub Jelinek  <jakub@redhat.com>
1431
1432         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE for the clone.
1433
1434         2008-07-14  Jakub Jelinek  <jakub@redhat.com>
1435
1436         * cp-gimplify.c (cp_gimplify_expr): Update comment.
1437
1438         2008-07-14  Aldy Hernandez  <aldyh@redhat.com>
1439
1440         * cp-tree.h (union lang_tree_node): Rename GENERIC_NEXT to
1441         TREE_CHAIN.
1442         * cp-gimplify.c (cxx_omp_clause_apply_fn): Rename
1443         GIMPLE_MODIFY_STMT to MODIFY_EXPR.
1444         (cxx_omp_clause_copy_ctor): Same.
1445         (cxx_omp_clause_assign_op): Same.
1446
1447         2008-05-28  Jakub Jelinek  <jakub@redhat.com>
1448
1449         * cp-gimplify.c (cp_gimplify_omp_for): Add pre_p argument.  Tuplify.
1450         (cp_gimplify_expr): Adjust caller.
1451
1452         2008-05-11 Doug Kwan  <dougkwan@google.com>
1453
1454         * init.c (build_vec_delete): Add type conversion for argument
1455         0 of POINTER_PLUS_EXPR.
1456
1457         2008-04-29  Doug Kwan  <dougkwan@google.com>
1458
1459         * decl2 (File): Include "gimple.h"
1460         (cp_write_global_declarations): Use gimple_body instead of
1461         DECL_SAVED_TREE.
1462         * Make-lang.in (cp/decl2.o): Add $(GIMPLE_H)
1463
1464         2008-04-10  Diego Novillo  <dnovillo@google.com>
1465
1466         http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00913.html
1467
1468         * optimize.c (maybe_clone_body): Re-enable call to
1469         clone_body.
1470         * cp-gimplify.c (cp_gimplify_omp_for): Mark disabled
1471         code with call to gimple_unreachable.
1472         (cp_genericize): Fix handling of clone bodies.
1473
1474         2008-04-04  Diego Novillo  <dnovillo@google.com>
1475
1476         http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00413.html
1477
1478         * optimize.c (maybe_clone_body): Re-enable.
1479
1480         2008-02-19  Diego Novillo  <dnovillo@google.com>
1481                     Oleg Ryjkov  <olegr@google.com>
1482
1483         http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00804.html
1484
1485         * cp-gimplify.c (gimplify_for_stmt): Change gimple_seq
1486         argument to gimple_seq *.  Update all users.
1487         (gimplify_must_not_throw_expr): Likewise.
1488
1489         2008-02-04  Oleg Ryjkov <olegr@google.com>
1490
1491         * except.c: Include gimple.h
1492         (cp_protect_cleanup_actions): Convert to tuples.
1493         * Make-lang.in (cp/except.o): Add dependency on gimple.h
1494
1495         2007-11-10  Aldy Hernandez  <aldyh@redhat.com>
1496
1497         * cp-gimplify.c (gimplify_cp_loop): Call tree_annotate_all_with_locus
1498         instead of annotating each block manually.
1499
1500         2007-10-30  Aldy Hernandez  <aldyh@redhat.com>
1501
1502         * cp-gimplify.c (gimplify_cp_loop): Tuplify.
1503         (gimplify_for_stmt): Same.
1504         (gimplify_switch_stmt): Same.
1505         (cp_gimplify_expr): [FOR_STMT]: Do not call gimplify_for_stmt.  Return
1506         GS_OK.
1507         [WHILE_STMT]: Return GS_OK.
1508         [SWITCH_STMT]: Same.
1509         [CONTINUE_STMT]: Same.
1510         [BREAK_STMT]: Same.
1511         (cp_genericize): Set gimple_body() of cloned functions when needed.
1512
1513         2007-10-29  Aldy Hernandez  <aldy@quesejoda.com>
1514
1515         * cp-gimplify.c: Move build_gimple_eh_filter_tree here.
1516         (cp_gimplify_init_expr): Convert to tuples.
1517         (gimplify_must_not_throw_expr): Make function return a
1518         gimplify_status and convert to tuples.
1519
1520         2007-10-18  Aldy Hernandez  <aldy@quesejoda.com>
1521
1522         * cp-gimplify.c (genericize_try_block): Enable and do not call
1523         gimplify_stmt.
1524         (genericize_catch_block): Same.
1525         (genericize_eh_spec_block): Same.
1526         Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree.
1527         (cp_gimplify_expr): Enable TRY_BLOCK, HANDLER, and EH_SPEC_BLOCK.
1528
1529         2007-10-16  Aldy Hernandez  <aldy@quesejoda.com>
1530
1531         * optimize.c (maybe_clone_body): Comment out call to clone_body.
1532         * decl.c (finish_function): Use gimple_body instead of
1533         DECL_SAVED_TREE.
1534         * cp-tree.h (cp_gimplify_expr): Last 2 arguments are sequences.
1535         * cp-gimplify.c (genericize_try_block): Comment out.
1536         (genericize_catch_block): Same.
1537         (genericize_eh_spec_block): Same.
1538         (gimplify_cp_loop): Comment out calls to gimplify_stmt.
1539         (gimplify_for_stmt): Comment out.
1540         (gimplify_switch_stmt): Comment out call to gimplify_stmt.
1541         (cp_gimplify_omp_for): Same.
1542         (gimplify_must_not_throw_expr): Argument pre_p is a sequence.
1543         Comment out call to gimplify_stmt and append_to_statement_list.
1544         Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree.
1545         (cp_gimplify_init_expr): Arguments pre_p and post_p are sequences.
1546         (cp_gimplify_expr): Same.
1547         Comment out calls to genericize_*_block.  Comment out call to
1548         gimplify_for_stmt.
1549
1550 2008-07-27  H.J. Lu  <hongjiu.lu@intel.com>
1551
1552         PR c++/36944
1553         * class.c (type_has_user_provided_default_constructor): Handle
1554         default parameters.
1555
1556 2008-07-27  Paolo Carlini  <paolo.carlini@oracle.com>
1557
1558         * decl.c (push_library_fn): Add a parameter for the exceptions that
1559         the function may throw.
1560         (push_void_library_fn, push_throw_library_fn, expand_static_init):
1561         Adjust.
1562         (build_library_fn): Change to static.
1563         * cp-tree.h: Adjust declarations.
1564         * except.c (declare_nothrow_library_fn): New.
1565         (do_get_exception_ptr, do_begin_catch, do_free_exception,
1566         do_allocate_exception):  Use the latter, adjust the declarations
1567         (ie, add empty exception-specification), consistently with the
1568         actual implementation in libsupc++.
1569
1570 2008-07-25  Jan Hubicka  <jh@suse.cz>
1571
1572         * typeck.c (inline_conversion): Remove.
1573         (cp_build_function_call): Do not use inline_conversion.
1574         * decl.c (duplicate_decls): Do not insist on inline being declared
1575         early.
1576         (start_cleanup_fn): Do not assume that INLINE flags prevent function
1577         from being output.  We now remove static functions always.
1578         (finish_function): Do return warning on all static functions.
1579         * call.c (build_over_call): Do not use inline_conversion.
1580         * cp-tree.h (possibly_inlined_p): Declare.
1581         (inline_conversion): Remove.
1582         * pt.c (instantiate_decl): Use possibly_inlined_p predicate.
1583         * decl2.c (cp_write_global_declarations): Likewise.
1584         (mark_used): Likewise.
1585         (possibly_inlined_p): New functions.
1586
1587 2008-07-25  Jason Merrill  <jason@redhat.com>
1588
1589         * class.c (type_has_user_provided_default_constructor): Handle
1590         templates.
1591
1592 2008-07-23  Jan Hubicka  <jh@suse.cz>
1593
1594         * decl.c (duplicate_decls): Update comment and unit-at-a-time.
1595         (grogfndecl): Drop flag_inline_trees code.
1596         * pt.c (instantiate_decl): Drop flag_iline_trees code.
1597         * lex.c (cxx_init): Do not set unit-at-a-time.
1598
1599 2008-07-23  Jason Merrill  <jason@redhat.com>
1600
1601         * mangle.c (write_unqualified_name): Avoid infinite recursion when
1602         trying to mangle a decl with no name.
1603
1604         Implement defaulted/deleted functions as per N2346
1605         * cp-tree.h (struct lang_decl_flags): Add defaulted_p bitfield.
1606         (DECL_DELETED_FN): New macro.
1607         (DECL_DEFAULTED_FN): New macro.
1608         * class.c (user_provided_p): New fn.
1609         (defaultable_fn_p): New fn.
1610         (type_has_user_provided_constructor): New fn.
1611         (type_has_user_provided_default_constructor): New fn.
1612         (check_methods): A defaulted fn is still trivial.
1613         (check_bases_and_members): Likewise.
1614         * decl.c (grok_special_member_properties): Likewise.
1615         (duplicate_decls): Complain about redeclaring a function as deleted.
1616         (start_decl): initialized==2 means deleted.
1617         (cp_finish_decl): Handle deleted/defaulted semantics.
1618         * decl2.c (grokfield): Likewise.
1619         (mark_used): Check DECL_DEFAULTED_FN instead of DECL_ARTIFICIAL.
1620         Complain about using a deleted fn.
1621         * init.c (build_value_init_1): Use type_has_user_provided_constructor.
1622         (perform_member_init): Check for a user-provided default constructor
1623         even if TYPE_NEEDS_CONSTRUCTING.
1624         (build_new_1): Likewise.
1625         * call.c (build_over_call): Don't call mark_used twice.
1626         * method.c (implicitly_declare_fn): Set DECL_DEFAULTED_FN.
1627         * search.c (check_final_overrider): Check for deleted mismatch.
1628         * parser.c (cp_parser_init_declarator): Tell start_decl about =delete.
1629         (cp_parser_pure_specifier): Handle =default and =delete.
1630
1631         * error.c (maybe_warn_cpp0x): Suggest -std=gnu++0x as well.
1632
1633 2008-07-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1634
1635         PR 35058
1636         * typeck.c: All calls to pedwarn changed.
1637         * decl.c: All calls to pedwarn changed.
1638         * call.c: All calls to pedwarn changed.
1639         * error.c: All calls to pedwarn changed.
1640         * typeck2.c: All calls to pedwarn changed.
1641         * pt.c: All calls to pedwarn changed.
1642         * name-lookup.c: All calls to pedwarn changed.
1643         * parser.c: All calls to pedwarn changed.
1644
1645 2008-07-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1646
1647         * call.c: Fix comment typos.
1648         * class.c: Likewise.
1649         * cp-tree.h: Likewise.
1650         * cxx-pretty-print.c: Likewise.
1651         * decl.c: Likewise.
1652         * init.c: Likewise.
1653         * name-lookup.c: Likewise.
1654         * operators.def: Likewise.
1655         * parser.c: Likewise.
1656         * pt.c: Likewise.
1657         * tree.c: Likewise.
1658         * typeck.c: Likewise.
1659
1660 2008-07-21  Paolo Carlini  <paolo.carlini@oracle.com>
1661
1662         PR c++/36871
1663         PR c++/36872
1664         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Only check
1665         copy constructors and copy assignment operators proper.
1666
1667 2008-07-21  Rafael Ávila de Espíndola  <espindola@google.com>
1668
1669         * parser.c (cp_token): Remove in_system_header.
1670         (eof_token): Remove in_system_header.
1671         (cp_lexer_get_preprocessor_token): Don't set in_system_header.
1672         (cp_lexer_set_source_position_from_token): Don't set in_system_header.
1673         (cp_parser_member_declaration):  Use in_system_header_at.
1674         * pt.c (lookup_template_class): Don't set DECL_IN_SYSTEM_HEADER.
1675         (pop_tinst_level): Don't set in_system_header.
1676         (instantiate_class_template): Don't set in_system_header.
1677         (instantiate_decl): Don't set in_system_header.
1678         (instantiate_pending_templates): Don't set in_system_header.
1679
1680 2008-07-21  Paolo Carlini  <paolo.carlini@oracle.com>
1681
1682         PR c++/36870
1683         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
1684         TYPE_NOTHROW_P, not TREE_NOTHROW.
1685         (trait_expr_value): Likewise.
1686
1687 2008-07-18  Dodji Seketeli  <dseketel@redhat.com>
1688
1689         PR c++/36407
1690         * call.c (convert_like_real): Don't take the error code path
1691           when a rvalue or base conversion has the bad_p field set.
1692
1693 2008-07-18  Kris Van Hees  <kris.van.hees@oracle.com>
1694
1695         * rtti.c (emit_support_tinfos): Add char16_type_node and
1696         char32_type_node.
1697         * typeck2.c (digest_init): Support char16_t and char32_t.
1698
1699 2008-07-18  Kavih R. Ghazi  <ghazi@caip.rutgers.edu>
1700
1701         * cvt.c (convert_to_void): Avoid C++ keywords.
1702         * decl.c (walk_namespaces_r, wrapup_globals_for_namespace):
1703         Likewise.
1704         * friend.c (is_friend): Likewise.
1705         * init.c (perform_member_init): Likewise.
1706         * mangle.c (write_template_prefix, write_template_template_param):
1707         Likewise.
1708         * name-lookup.c (do_namespace_alias, do_using_directive,
1709         parse_using_directive, ambiguous_decl, arg_assoc): Likewise.
1710         * parser.c (cp_parser_template_id, cp_parser_namespace_definition,
1711         cp_parser_objc_typename, cp_parser_objc_method_keyword_params):
1712         Likewise.
1713         * pt.c (is_specialization_of_friend, lookup_template_class,
1714         push_tinst_level, instantiate_class_template,
1715         tsubst_copy_and_build): Likewise.
1716         * tree.c (add_stmt_to_compound): Likewise.
1717         * typeck.c (finish_class_member_access_expr): Likewise.
1718
1719 2008-07-17  Julian Brown  <julian@codesourcery.com>
1720             Mark Mitchell  <mark@codesourcery.com>
1721
1722         * decl2.c (determine_visibility): Allow target to override
1723         visibility of class data.
1724
1725 2008-07-17  Paolo Carlini  <paolo.carlini@oracle.com>
1726
1727         PR c++/36855
1728         * semantics.c (trait_expr_value): Update __has_trivial_destructor
1729         semantics to the current WP (N2691).
1730
1731 2008-07-16  Dodji Seketeli  <dseketel@redhat.com>
1732
1733         PR c++/13699
1734         * name-lookup.c (lookup_extern_c_fun_binding_in_all_ns): New function.
1735         (pushdecl_maybe_friend): Check if a redeclaration of extern C function
1736         complies with exception specification constraints.
1737
1738 2008-07-14  Jason Merrill  <jason@redhat.com>
1739
1740         * lex.c (init_reswords): Always set D_OBJC.
1741
1742 2008-07-11  Tom Tromey  <tromey@redhat.com>
1743             Ian Lance Taylor  <iant@google.com>
1744
1745         * lex.c (struct resword, reswords): Don't define.
1746         (D_EXT, D_ASM, D_OBJC, D_CXX0X): Don't define.
1747         (init_reswords): Clarify mask code.  Use c_common_reswords rather
1748         than reswords.
1749
1750 2008-07-11  Dodji Seketeli  <dseketel@redhat.com>
1751
1752         PR c++/13101
1753         * decl.c (grokdeclarator): Warn about initializing variables
1754         of storage class 'extern' only after the type of the declarator
1755         has been properly computed.
1756
1757 2008-07-11  Dodji Seketeli  <dseketel@redhat.com>
1758
1759         PR c++/31754
1760         * cp-tree.h (struct cp_decl_specifier_seq): Add a location field. It
1761         carries the location of the primary type.
1762         * parser.c (cp_parser_check_type_definition): Update documentation.
1763         (cp_parser_check_for_definition_in_return_type,
1764         cp_parser_check_for_invalid_template_id,
1765         cp_parser_set_decl_spec_type,
1766         cp_parser_check_for_definition_in_return_type,
1767         cp_parser_diagnose_invalid_type_name,
1768         cp_parser_new_expression, cp_parser_explicit_instantiation,
1769         cp_parser_type_specifier, cp_parser_simple_type_specifier,
1770         cp_parser_omp_for_loop, cp_parser_pragma): Use location in error
1771         messages.
1772
1773 2008-07-11 Dodji Seketeli <dseketel@redhat.com>
1774
1775         PR c++/31754
1776         * pt.c, semantic.c:
1777         * semantic.c (qualified_name_lookup_error, finish_id_expression):
1778         Add a location_t parameter so that
1779         error message can have a more accurate location.
1780         * cp-tree.h: Updated prototype
1781         * pt.c (tsubst_qualified_id): Use location in error messages.
1782         * parser.c (cp_parser_postfix_expression,
1783         cp_parser_objc_statement, cp_parser_trait_expr,
1784         cp_parser_token_is_class_key,
1785         cp_parser_uncommitted_to_tentative_parse_p,
1786         cp_parser_check_for_invalid_template_id, cp_parser_is_string_literal,
1787         cp_parser_error, cp_parser_name_lookup_error,
1788         cp_parser_simulate_error, cp_parser_check_decl_spec,
1789         cp_parser_check_decl_spec, cp_parser_non_integral_constant_expression,
1790         cp_parser_diagnose_invalid_type_name,
1791         cp_parser_parse_and_diagnose_invalid_type_name,
1792         cp_parser_require_pragma_eol, cp_parser_make_typename_type,
1793         cp_parser_string_literal, cp_parser_primary_expression,
1794         cp_parser_primary_expression, cp_parser_unqualified_id,
1795         cp_parser_nested_name_specifier_opt, cp_parser_postfix_expression,
1796         cp_parser_postfix_dot_deref_expression, cp_parser_new_expression,
1797         cp_parser_direct_new_declarator, cp_parser_builtin_offsetof,
1798         cp_parser_label_for_labeled_statement, cp_parser_statement_seq_opt,
1799         cp_parser_jump_statement, cp_parser_block_declaration,
1800         cp_parser_simple_declaration, cp_parser_decl_specifier_seq,
1801         cp_parser_function_specifier_opt, cp_parser_decltype,
1802         cp_parser_mem_initializer_list, cp_parser_mem_initializer,
1803         cp_parser_mem_initializer_id, cp_parser_template_parameter,
1804         cp_parser_type_parameter, cp_parser_template_id,
1805         cp_parser_template_name, cp_parser_template_argument): Likewise.
1806
1807 2008-07-09  Paolo Carlini  <paolo.carlini@oracle.com>
1808
1809         PR c++/36760
1810         * pt.c (tsubst_function_type): Remove warning for type qualifiers
1811         on function return type.
1812
1813 2008-07-09  Paolo Carlini  <paolo.carlini@oracle.com>
1814
1815         PR c++/36760
1816         * pt.c (tsubst_function_type): Don't warn for type qualifiers
1817         on function return type in case of system header.
1818
1819 2008-07-09  Raksit Ashok <raksit@google.com>
1820
1821         * parser.c (cp_parser_postfix_expression): New warning based on flag
1822         warn_disallowed_functions.
1823
1824 2008-07-08  Simon Martin  <simartin@users.sourceforge.net>
1825
1826         PR c++/34963
1827         * decl.c (grokdeclarator): Reset storage_class and staticp for friend
1828         functions declared with a storage class qualifier.
1829
1830 2008-07-03  Richard Guenther  <rguenther@suse.de>
1831
1832         PR c++/36128
1833         * typeck.c (cp_build_function_call): Move code to verify
1834         builtin function arguments ...
1835         * call.c (build_cxx_call): ... here.
1836
1837 2008-07-02  Jason Merrill  <jason@redhat.com>
1838
1839         * Make-lang.in (cp/typeck2.o): Add $(REAL_H) dependency.
1840
1841         Implement WG21 N2672, Initializer List proposed wording
1842         * cp-tree.h (enum cp_tree_index): Add CPTI_INIT_LIST_TYPE.
1843         (struct lang_type_class): Add has_list_ctor bitfield.
1844         (TYPE_HAS_LIST_CTOR): New macro.
1845         (BRACE_ENCLOSED_INITIALIZER_P): Expect init_list_type_node.
1846         (CONSTRUCTOR_IS_DIRECT_INIT): New macro.
1847         (LOOKUP_NO_NARROWING): New macro.
1848         (LOOKUP_NO_COPY_CTOR_CONVERSION): New macro.
1849         * parser.c (cp_parse_braced_list): Split out from...
1850         (cp_parser_initializer_clause): ...here.
1851         (cp_parser_postfix_expression): Build up CONSTRUCTOR for compound
1852         literal here.
1853         (cp_lexer_next_token_is_not_keyword): New fn.
1854         (cp_parser_parenthesized_expression_list): Handle { }.
1855         (cp_parser_new_expression, cp_parser_new_initializer): Likewise.
1856         (cp_parser_assignment_expression, cp_parser_condition): Likewise.
1857         (cp_parser_jump_statement, cp_parser_simple_declaration): Likewise.
1858         (cp_parser_mem_initializer, cp_parser_init_declarator): Likewise.
1859         (cp_parser_initializer, cp_parser_functional_cast): Likewise.
1860         (cp_parser_omp_for_loop, cp_parser_cache_group): Likewise.
1861         (cp_parser_save_member_function_body): Likewise.
1862         * call.c (conversion_kind): Add ck_list, ck_aggr.
1863         (struct conversion): Add check_narrowing bitfield, conversion list.
1864         (build_list_conv): New fn.
1865         (build_aggr_conv): New fn.
1866         (implicit_conversion): Call them.
1867         (standard_conversion): Set check_narrowing if appropriate.
1868         (add_function_candidate): Handle LOOKUP_NO_COPY_CTOR_CONVERSION.
1869         (build_user_type_conversion_1): When converting from an init list,
1870         we allow additional conversions except when calling a copy ctor.
1871         (convert_like_real): Calling an explicit ctor for an init list is
1872         ill-formed.  Handle ck_list and ck_addr.  Check narrowing.
1873         (build_new_method_call): If CONSTRUCTOR_IS_DIRECT_INIT is set and
1874         class doesn't have a list ctor, break the {} into a TREE_LIST.
1875         (compare_ics): ck_list is better than other UDCs.
1876         (set_up_extended_ref_temp): Split out from initialize_reference.
1877         (is_std_init_list): New fn.
1878         (is_list_ctor): New fn.
1879         * decl.c (cxx_init_decl_processing): Create init_list_type_node.
1880         (reshape_init_array_1): Pass it to build_constructor.
1881         (reshape_init_class): Ditto.
1882         (initialize_artificial_var): Pass the appropriate type.
1883         (build_aggr_init_full_exprs): Split out from...
1884         (check_initializer): ...here.  Handle new semantics.
1885         (build_init_list_var_init): New subroutine of check_initializer.
1886         (grokdeclarator): Converting constructors can have more than one parm.
1887         (grok_special_member_properties): Set TYPE_HAS_LIST_CTOR.
1888         * init.c (expand_default_init): Only do digest_init for aggregates.
1889         * rtti.c (tinfo_base_init): Pass init_list_type_node to
1890         build_constructor_from_list.
1891         (generic_initializer, ptr_initializer): Ditto.
1892         (ptm_initializer, class_initializer): Ditto.
1893         (get_pseudo_ti_init): Ditto.
1894         * error.c (dump_type): Handle init_list_type_node.
1895         (maybe_warn_cpp0x): New fn.
1896         (maybe_varn_variadic_templates): Call it.
1897         * cvt.c (ocp_convert): Handle conversion from { }.
1898         * tree.c (build_array_of_n_type): New fn.
1899         * typeck2.c (store_init_value): Use init_list_type_node.
1900         (digest_init): Likewise.
1901         (check_narrowing): New fn.
1902         * semantics.c: (finish_compound_literal): Take CONSTRUCTOR instead
1903         of vector of constructor elts.  Handle non-aggregate types.  Make
1904         constant literals static.
1905         * pt.c: (tsubst_copy_and_build): Adjust.
1906         (unify): Handle { }.
1907         * name-lookup.c (arg_assoc_type): Handle init_list_type_node.
1908
1909 2008-07-01  Daniel Jacobowitz  <dan@codesourcery.com>
1910
1911         * typeck.c (comp_ptr_ttypes_real): Use vector_targets_convertible_p.
1912         (comp_ptr_ttypes_const): Likewise.
1913
1914 2008-07-01  Andrew Haley  <aph@redhat.com>
1915
1916         * decl.c (finish_constructor_body): Don't set the return value of
1917         the constructor if the constructor is that of a Java type.
1918
1919 2008-06-30  Jakub Jelinek  <jakub@redhat.com>
1920
1921         PR c++/36662
1922         * decl2.c (is_late_template_attribute): If the first attribute
1923         argument is IDENTIFIER_NODE, don't consider it when checking
1924         if arguments are value or type dependent.
1925
1926 2008-06-29  Paolo Carlini  <paolo.carlini@oracle.com>
1927
1928         PR c++/36655
1929         * pt.c (do_type_instantiation): In c++0x mode do not warn for
1930         extern template.
1931
1932 2008-06-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1933
1934         * Make-lang.in (cp-warn): Delete $(CXX_COMPAT_WARN).
1935
1936 2008-06-28  Jakub Jelinek  <jakub@redhat.com>
1937
1938         PR c++/36364
1939         * repo.c (repo_emit_p): Put const static data members initialized
1940         by const expr into *.rpo file, just return 2 if IDENTIFIER_REPO_CHOSEN
1941         for it is 0.
1942
1943 2008-06-27  Paolo Carlini  <paolo.carlini@oracle.com>
1944
1945         PR c++/36655
1946         * pt.c (do_decl_instantiation): In c++0x mode do not warn for
1947         extern template.
1948
1949 2008-06-24  Jonathan Wakely  <jwakely.gcc@gmail.com>
1950
1951         PR c++/23194
1952         * typeck.c (cp_build_function_call): Show example syntax in
1953         diagnostic.
1954
1955 2008-06-21  Jonathan Wakely  <jwakely.gcc@gmail.com>
1956
1957         * typeck.c (composite_pointer_type_r, cxx_sizeof_expr,
1958         cxx_alignof_expr, check_template_keyword, cp_build_binary_op,
1959         pointer_diff, cp_build_unary_op, build_x_compound_expr_from_list,
1960         build_reinterpret_cast_1, cp_build_c_cast, check_return_expr): Change
1961         pedwarn to permerror.
1962         * init.c (perform_member_init, build_new_1, build_new): Likewise.
1963         * decl.c (warn_extern_redeclared_static, duplicate_decls,
1964         * identify_goto, check_previous_goto_1, check_goto, define_label,
1965         check_tag_decl, start_decl, check_class_member_definition_namespace,
1966         grokfndecl, grokdeclarator): Likewise.
1967         * except.c (check_handlers): Likewise.
1968         * typeck2.c (digest_init): Likewise.
1969         * pt.c (check_specialization_namespace,
1970         check_explicit_instantiation_namespace,
1971         maybe_process_partial_specialization, check_explicit_specialization,
1972         convert_template_argument, do_decl_instantiation,
1973         do_type_instantiation, instantiate_decl): Likewise.
1974         * semantics.c (finish_template_type_parm): Likewise.
1975         * name-lookup.c (pushdecl_maybe_friend,
1976         check_for_out_of_scope_variable): Likewise.
1977         * decl2.c (finish_static_data_member_decl, build_anon_union_vars,
1978         coerce_new_type): Likewise.
1979         * parser.c (cp_parser_nested_name_specifier_opt,
1980         cp_parser_mem_initializer, cp_parser_elaborated_type_specifier,
1981         cp_parser_class_head, cp_parser_check_class_key): Likewise.
1982         (cp_parser_parameter_declaration): Check flag_permissive instead of
1983         flag_pedantic_errors.
1984         * call.c (joust): Change pedwarn to warning.
1985         * friend.c (make_friend_class): Likewise.
1986
1987 2008-06-16  Jan Hubicka  <jh@suse.cz>
1988
1989         * method.c: Include cgraph.h.
1990         (use_thunk): Use cgraph_add_new_function instead of calling backend
1991         directly.
1992
1993 2008-06-15  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1994
1995         * parser.c: Fix comment typo.
1996
1997 2008-06-14  Simon Martin  <simartin@users.sourceforge.net>
1998
1999         PR c++/35320
2000         * decl2.c (grokbitfield): Receive the list of attributes, pass it to
2001         grokdeclarator and apply it to the created declaration.
2002         * cp-tree.h (grokbitfield): Update prototype.
2003         * parser.c (cp_parser_member_declaration): Don't apply the attributes
2004         since they are now applied in grokbitfield. Adjusted the call to
2005         grokbitfield.
2006         (cp_parser_objc_class_ivars): Likewise.
2007
2008 2008-06-14  Simon Martin  <simartin@users.sourceforge.net>
2009
2010         PR c++/35317
2011         * class.c (type_requires_array_cookie): Do not consider delete[]
2012         operators with an ellipsis as second argument.
2013
2014 2008-06-09  Jakub Jelinek  <jakub@redhat.com>
2015
2016         PR c++/36408
2017         * semantics.c (stmt_expr_value_expr): Don't crash on empty
2018         STATEMENT_LIST.
2019
2020 2008-06-08  Paolo Carlini  <paolo.carlini@oracle.com>
2021
2022          PR c++/35242
2023          * pt.c (maybe_process_partial_specialization): Check the tree
2024         returned by push_template_decl for error_mark_node.
2025         * parser.c (cp_parser_class_head): Likewise, check the tree
2026         returned by the latter.
2027
2028 2008-06-07  Paolo Carlini  <paolo.carlini@oracle.com>
2029
2030          PR c++/35327
2031          * decl.c (grokdeclarator): In case of wrong return type return
2032         immediately error_mark_node.
2033
2034 2008-06-06  Jakub Jelinek  <jakub@redhat.com>
2035
2036         * cp-tree.h (cxx_omp_finish_clause, cxx_omp_create_clause_info,
2037         dependent_omp_for_p, begin_omp_task, finish_omp_task,
2038         finish_omp_taskwait): New prototypes.
2039         (cxx_omp_clause_default_ctor): Add outer argument.
2040         (finish_omp_for): Add new clauses argument.
2041         * cp-gimplify.c (cxx_omp_finish_clause): New function.
2042         (cxx_omp_predetermined_sharing): Moved from semantics.c, rewritten.
2043         (cxx_omp_clause_default_ctor): Add outer argument.
2044         (cp_genericize_r): Walk OMP_CLAUSE_LASTPRIVATE_STMT.
2045         * cp-objcp-common.h (LANG_HOOKS_OMP_FINISH_CLAUSE): Define.
2046         * parser.c (cp_parser_omp_for_loop): Parse collapsed for loops.
2047         Add par_clauses argument.  If decl is present in parallel's
2048         lastprivate clause, change that clause to shared and add
2049         a lastprivate clause for decl to OMP_FOR_CLAUSES.
2050         Fix wording of error messages.  Adjust finish_omp_for caller.
2051         Add clauses argument.  Parse loops with random access iterators.
2052         (cp_parser_omp_clause_collapse, cp_parser_omp_clause_untied): New
2053         functions.
2054         (cp_parser_omp_for, cp_parser_omp_parallel): Adjust
2055         cp_parser_omp_for_loop callers.
2056         (cp_parser_omp_for_cond, cp_parser_omp_for_incr): New helper
2057         functions.
2058         (cp_parser_omp_clause_name): Handle collapse and untied
2059         clauses.
2060         (cp_parser_omp_clause_schedule): Handle auto schedule.
2061         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_COLLAPSE
2062         and PRAGMA_OMP_CLAUSE_UNTIED.
2063         (OMP_FOR_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_COLLAPSE.
2064         (OMP_TASK_CLAUSE_MASK): Define.
2065         (cp_parser_omp_task, cp_parser_omp_taskwait): New functions.
2066         (cp_parser_omp_construct): Handle PRAGMA_OMP_TASK.
2067         (cp_parser_pragma): Handle PRAGMA_OMP_TASK and
2068         PRAGMA_OMP_TASKWAIT.
2069         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_COLLAPSE and
2070         OMP_CLAUSE_UNTIED.  Handle OMP_CLAUSE_LASTPRIVATE_STMT.
2071         (tsubst_omp_for_iterator): New function.
2072         (dependent_omp_for_p): New function.
2073         (tsubst_expr) <case OMP_FOR>: Use it.  Handle collapsed OMP_FOR
2074         loops.  Adjust finish_omp_for caller.  Handle loops with random
2075         access iterators.  Adjust for OMP_FOR_{INIT,COND,INCR} changes.
2076         (tsubst_expr): Handle OMP_TASK.
2077         * semantics.c (cxx_omp_create_clause_info): New function.
2078         (finish_omp_clauses): Call it.  Handle OMP_CLAUSE_UNTIED and
2079         OMP_CLAUSE_COLLAPSE.
2080         (cxx_omp_predetermined_sharing): Removed.
2081         * semantics.c (finish_omp_for): Allow pointer iterators.  Use
2082         handle_omp_for_class_iterator and dependent_omp_for_p.  Handle
2083         collapsed for loops.  Adjust c_finish_omp_for caller.  Add new
2084         clauses argument.  Fix check for type dependent cond or incr.
2085         Set OMP_FOR_CLAUSES to clauses.  Use cp_convert instead of
2086         fold_convert to convert incr amount to difference_type.  Only
2087         fold if not in template.  If decl is mentioned in lastprivate
2088         clause, set OMP_CLAUSE_LASTPRIVATE_STMT.  Handle loops with random
2089         access iterators.  Adjust for OMP_FOR_{INIT,COND,INCR}
2090         changes.
2091         (finish_omp_threadprivate): Allow static class members of the
2092         current class.
2093         (handle_omp_for_class_iterator, begin_omp_task, finish_omp_task,
2094         finish_omp_taskwait): New functions.
2095
2096         * parser.c (cp_parser_binary_expression): Add prec argument.
2097         (cp_parser_assignment_expression): Adjust caller.
2098         * cp-tree.h (outer_curly_brace_block): New prototype.
2099         * decl.c (outer_curly_brace_block): No longer static.
2100
2101 2008-06-02  Paolo Carlini  <paolo.carlini@oracle.com>
2102
2103          PR c++/36404
2104          * pt.c (push_template_decl_real): Consistently return error_mark_node
2105         on error.
2106
2107 2008-06-02  Tomas Bily  <tbily@suse.cz>
2108
2109          * typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT.
2110          (cp_build_unary_op): Likewise.
2111          (cp_build_indirect_ref): Use CONVERT_EXPR_P.
2112          (maybe_warn_about_returning_address_of_local): Likewise.
2113
2114 2008-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
2115
2116          PR c++/35243
2117          * pt.c (tsubst_initializer_list): Consistently check the tree
2118          returned by tsubst_pack_expansion for error_mark_node.
2119
2120 2008-05-27  Michael Matz  <matz@suse.de>
2121
2122         PR c++/27975
2123         * call.c (build_new_op): Make warning conditional on
2124         OPT_Wenum_compare.
2125
2126 2008-05-27  Alexandre Oliva  <aoliva@redhat.com>
2127
2128         PR c++/35909
2129         * call.c (convert_like_real): Convert bitfield to desired type
2130         before creating temporary.
2131
2132 2008-05-26  Daniel Franke  <franke.daniel@gmail.com>
2133
2134         * Makefile.in: Adjusted dependencies on c-incpath.o.
2135
2136 2008-05-23  Jakub Jelinek  <jakub@redhat.com>
2137
2138         PR c++/36237
2139         * cp-gimplify.c (cxx_omp_clause_apply_fn): Call
2140         fold_build_cleanup_point_expr on build_call_a results.
2141
2142         PR c++/36308
2143         * semantics.c (omp_clause_info_fndecl): New function.
2144         (finish_omp_clauses): Use it.
2145
2146 2008-05-21  Jakub Jelinek  <jakub@redhat.com>
2147
2148         PR c++/36023
2149         * cp-tree.h (check_array_initializer): New prototype.
2150         * decl.c (check_array_initializer): New function.
2151         (check_initializer): Call it.
2152         * semantics.c (finish_compound_literal): Call it for ARRAY_TYPEs.
2153
2154 2008-05-21  Tom Tromey  <tromey@redhat.com>
2155
2156         * mangle.c (save_partially_mangled_name): Remove.
2157         (restore_partially_mangled_name): Likewise.
2158         (write_encoding): Update.
2159         (write_unqualified_name): Likewise.
2160         (start_mangling): Always use name_obstack.  Remove 'ident_p'
2161         argument.
2162         (get_identifier_nocopy): Remove.
2163         (finish_mangling_internal): Rename from finish_mangling.
2164         (finish_mangling): New function.
2165         (finish_mangling_get_identifier): Likewise.
2166         (partially_mangled_name, partially_mangled_name_len): Remove.
2167         (mangle_decl_string): Change return type.  Update.
2168         (mangle_decl, mangle_type_string, mangle_special_for_type,
2169         mangle_ctor_vtbl_for_type, mangle_thunk, mangle_guard_variable,
2170         mangle_ref_init_variable): Update.
2171
2172 2008-05-12  Paolo Carlini  <paolo.carlini@oracle.com>
2173
2174          PR c++/35331
2175          * semantics.c (begin_class_definition): Extend checks on the first
2176         argument.
2177
2178 2008-05-12  Tomas Bily  <tbily@suse.cz>
2179
2180          * typeck2.c (digest_init): Use CONVERT_EXPR_P.
2181          * call.c (build_over_call): Likewise.
2182          * error.c (dump_expr): Use CASE_CONVERT.
2183          * class.c (fixed_type_or_null): Likewise.
2184
2185 2008-05-11  Volker Reichelt  <v.reichelt@netcologne.de>
2186
2187         * parser.c (cp_parser_omp_clause_reduction): Add missing "expected"
2188         in error message.
2189         (cp_parser_omp_clause_schedule): Remove superfluous "expected"
2190         in error message.
2191
2192 2008-05-07  Kenneth Zadeck  <zadeck@naturalbridge.com>
2193
2194         * decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY,
2195         DECL_LOOPING_CONST_OR_PURE_P attributes.
2196         * rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to
2197         DECL_PURE_P.
2198
2199 2008-05-02  Simon Baldwin  <simonb@google.com>
2200
2201         PR bootstrap/36108
2202         * typeck.c (build_array_ref): Remove warn_array_subscript_range.
2203
2204 2008-05-01  Simon Baldwin  <simonb@google.com>
2205
2206         * typeck.c (build_array_ref): Call warn_array_subscript_range.
2207
2208 2008-04-30  Jakub Jelinek  <jakub@redhat.com>
2209
2210         PR c++/35986
2211         * pt.c (more_specialized_fn): Stop the loop even if there are no
2212         arguments before ellipsis.
2213
2214 2008-04-29  Jakub Jelinek  <jakub@redhat.com>
2215
2216         PR c++/35650
2217         * parser.c (cp_parser_lookup_name): Look through single function
2218         OVERLOAD.
2219
2220         PR c++/35987
2221         * typeck.c (cp_build_modify_expr) <case PREINCREMENT_EXPR>: Don't build
2222         COMPOUND_EXPR if the second argument would be error_mark_node.
2223
2224 2008-04-28  Jason Merrill  <jason@redhat.com>
2225             Liu Guanwei <liu_gw@163.com>
2226
2227         PR c++/57
2228         * parser.c (cp_parser_parameter_declaration): Handle < ambiguity
2229         in default arguments.
2230
2231 2008-04-25  Jan Hubicka  <jh@suse.cz>
2232
2233         * typeck.c (check_return_expr): Update.
2234         * decl.c (start_preparsed_function): Update.
2235         * method.c (use_thunk): Update.
2236
2237 2008-04-24  Jakub Jelinek  <jakub@redhat.com>
2238
2239         PR c++/35758
2240         * cp-tree.h (cp_reconstruct_complex_type): New prototype.
2241         * cp-objcp-common.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define.
2242         * decl2.c (is_late_template_attribute): Only make vector_size
2243         late tmpl attribute if argument is type or value dependent.
2244         (cp_reconstruct_complex_type): New function.
2245
2246 2008-04-24  Richard Guenther  <rguenther@suse.de>
2247
2248         * typeck.c (cp_build_function_call): Call
2249         check_builtin_function_arguments.
2250
2251 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
2252
2253         * typeck.c (get_member_function_from_ptrfunc): Don't set TREE_INVARIANT.
2254         (build_ptrmemfunc1): Don't set TREE_INVARIANT.
2255         * init.c (build_zero_init): Don't set TREE_INVARIANT.
2256         * class.c (build_base_path): Don't set TREE_INVARIANT.
2257         (build_vtbl_ref_1): Don't set TREE_INVARIANT.
2258         (build_vtbl_initializer): Don't set TREE_INVARIANT.
2259         * decl.c (build_enumerator): Don't set TREE_INVARIANT.
2260         * rtti.c (tinfo_base_init): Don't set TREE_INVARIANT.
2261         (generic_initializer): Don't set TREE_INVARIANT.
2262         (ptr_initializer): Don't set TREE_INVARIANT.
2263         (ptm_initializer): Don't set TREE_INVARIANT.
2264         (class_initializer): Don't set TREE_INVARIANT.
2265         * typeck2.c (process_init_constructor): Don't set TREE_INVARIANT.
2266         * pt.c (push_inline_template_parms_recursive): Don't set TREE_INVARIANT.
2267         (build_template_parm_index): Don't set TREE_INVARIANT.
2268         (reduce_template_parm_level): Don't set TREE_INVARIANT.
2269         (process_template_parm): Don't set TREE_INVARIANT.
2270
2271 2008-04-22  Jason Merrill  <jason@redhat.com>
2272
2273         PR c++/35316
2274         * semantics.c (finish_decltype_type): Check DECL_BIT_FIELD_TYPE
2275         to see if DECL_BIT_FIELD_TYPE should be used, not some other flag.
2276         * typeck.c (is_bitfield_expr_with_lowered_type): Likewise.
2277
2278 2008-04-22  Jakub Jelinek  <jakub@redhat.com>
2279
2280         PR c++/35747
2281         * semantics.c (finish_stmt_expr): Call pop_stmt_list even if the stmt
2282         expression is errorneous.
2283
2284 2008-04-21  Jason Merrill  <jason@redhat.com>
2285
2286         PR c++/35325
2287         * tree.c (cp_tree_equal): Handle FIXED_CST.
2288
2289         PR c++/35678
2290         * pt.c (template_template_parm_bindings_ok_p): Set
2291         processing_template_decl while in this function.
2292
2293 2008-04-18  Kris Van Hees <kris.van.hees@oracle.com>
2294
2295         * cvt.c (type_promotes_to): Support char16_t and char32_t.
2296         * decl.c (grokdeclarator): Disallow signed/unsigned/short/long on
2297         char16_t and char32_t.
2298         * lex.c (reswords): Add char16_t and char32_t (for c++0x).
2299         * mangle.c (write_builtin_type): Mangle char16_t/char32_t as vendor
2300         extended builtin type "u8char{16,32}_t".
2301         * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Support
2302         RID_CHAR{16,32}.
2303         (cp_lexer_print_token): Support CPP_STRING{16,32}.
2304         (cp_parser_is_string_literal): Idem.
2305         (cp_parser_string_literal): Idem.
2306         (cp_parser_primary_expression): Support CPP_CHAR{16,32} and
2307         CPP_STRING{16,32}.
2308         (cp_parser_simple_type_specifier): Support RID_CHAR{16,32}.
2309         * tree.c (char_type_p): Support char16_t and char32_t as char types.
2310         * typeck.c (string_conv_p): Support char16_t and char32_t.
2311
2312 2008-04-17  Jason Merrill  <jason@redhat.com>
2313
2314         PR c++/35773
2315         * call.c (build_user_type_conversion_1): Represent second step of
2316         copy-init with an rvalue conversion.
2317         (convert_like_real) [ck_user]: Don't implicitly add it here.
2318
2319 2008-04-15  Jakub Jelinek  <jakub@redhat.com>
2320
2321         PR c/35751
2322         * decl.c (layout_var_decl): If extern or static var has variable
2323         size, set TREE_TYPE (decl) to error_mark_node.
2324
2325 2008-04-16  Danny Smith  <dannysmith@users.sourceforge.net>
2326
2327         PR target/35921
2328         * optimize.c (maybe_clone_body): Copy DECL_DLLIMPORT_P flag
2329         to clone.
2330
2331 2008-04-09  Jason Merrill  <jason@redhat.com>
2332
2333         PR c++/35708
2334         * semantics.c (finish_compound_literal): Return a TARGET_EXPR,
2335         not a pushed variable.
2336
2337 2008-04-09  Volker Reichelt  <v.reichelt@netcologne.de>
2338
2339         * call.c (build_op_delete_call): Fix quotation in warning message.
2340         * decl.c (grokdeclarator): Quote keyword in error message.
2341         * pt.c (check_for_bare_parameter_packs): Fix quotation in error
2342         message.
2343
2344         * parser.c (cp_parser_check_type_definition): Print error string
2345         directly rather than using "%s".
2346         (cp_parser_postfix_expression): Fix quotation.
2347         (cp_parser_decltype): Likewise.
2348         (cp_parser_sizeof_operand): Fix quotation. Simplify.
2349
2350         * parser.c (cp_parser_non_integral_constant_expression): Build error
2351         message with CONCAT rather than using "%s".
2352         (cp_parser_primary_expression): Fix quotation.
2353         (cp_parser_postfix_expression): Likewise.
2354         (cp_parser_postfix_dot_deref_expression): Likewise.
2355         (cp_parser_unary_expression): Likewise.
2356         (cp_parser_new_expression): Likewise.
2357         (cp_parser_delete_expression): Likewise.
2358
2359         * parser.c (cp_parser_asm_specification_opt): Print CPP_CLOSE_PAREN
2360         as `)', not as `('.  Fix quotation.
2361         (cp_parser_consume_semicolon_at_end_of_statement): Fix quotation.
2362         (cp_parser_primary_expression): Likewise.
2363         (cp_parser_nested_name_specifier_opt): Likewise.
2364         (cp_parser_postfix_expression): Likewise.
2365         (cp_parser_postfix_open_square_expression): Likewise.
2366         (cp_parser_parenthesized_expression_list): Likewise.
2367         (cp_parser_pseudo_destructor_name): Likewise.
2368         (cp_parser_new_expression): Likewise.
2369         (cp_parser_direct_new_declarator): Likewise.
2370         (cp_parser_delete_expression): Likewise.
2371         (cp_parser_cast_expression): Likewise.
2372         (cp_parser_question_colon_clause): Likewise.
2373         (cp_parser_builtin_offsetof): Likewise.
2374         (cp_parser_trait_expr): Likewise.
2375         (cp_parser_label_for_labeled_statement): Likewise.
2376         (cp_parser_compound_statement): Likewise.
2377         (cp_parser_selection_statement): Likewise.
2378         (cp_parser_condition): Likewise.
2379         (cp_parser_iteration_statement): Likewise.
2380         (cp_parser_already_scoped_statement): Likewise.
2381         (cp_parser_simple_declaration): Likewise.
2382         (cp_parser_linkage_specification): Likewise.
2383         (cp_parser_static_assert): Likewise.
2384         (cp_parser_decltype): Likewise.
2385         (cp_parser_conversion_function_id): Likewise.
2386         (cp_parser_operator_function_id): Likewise.
2387         (cp_parser_operator): Likewise.
2388         (cp_parser_type_parameter): Likewise.
2389         (cp_parser_template_id): Likewise.
2390         (cp_parser_explicit_instantiation): Likewise.
2391         (cp_parser_explicit_specialization): Likewise.
2392         (cp_parser_enum_specifier): Likewise.
2393         (cp_parser_namespace_definition): Likewise.
2394         (cp_parser_namespace_alias_definition): Likewise.
2395         (cp_parser_using_declaration): Likewise.
2396         (cp_parser_using_directive): Likewise.
2397         (cp_parser_asm_definition): Likewise.
2398         (cp_parser_direct_declarator): Likewise.
2399         (cp_parser_ptr_operator): Likewise.
2400         (cp_parser_parameter_declaration_clause): Likewise.
2401         (cp_parser_initializer_clause): Likewise.
2402         (cp_parser_class_specifier): Likewise.
2403         (cp_parser_member_specification_opt): Likewise.
2404         (cp_parser_member_declaration): Likewise.
2405         (cp_parser_pure_specifier): Likewise.
2406         (cp_parser_constant_initializer): Likewise.
2407         (cp_parser_base_clause): Likewise.
2408         (cp_parser_exception_specification_opt): Likewise.
2409         (cp_parser_try_block): Likewise.
2410         (cp_parser_function_try_block): Likewise.
2411         (cp_parser_handler): Likewise.
2412         (cp_parser_throw_expression): Likewise.
2413         (cp_parser_asm_operand_list): Likewise.
2414         (cp_parser_attributes_opt): Likewise.
2415         (cp_parser_label_declaration): Likewise.
2416         (cp_parser_constructor_declarator_p): Likewise.
2417         (cp_parser_template_declaration_after_export): Likewise.
2418         (cp_parser_single_declaration): Likewise.
2419         (cp_parser_objc_message_expression): Likewise.
2420         (cp_parser_objc_message_args): Likewise.
2421         (cp_parser_objc_encode_expression): Likewise.
2422         (cp_parser_objc_defs_expression): Likewise.
2423         (cp_parser_objc_protocol_expression): Likewise.
2424         (cp_parser_objc_selector_expression): Likewise.
2425         (cp_parser_objc_protocol_refs_opt): Likewise.
2426         (cp_parser_objc_typename): Likewise.
2427         (cp_parser_objc_method_keyword_params): Likewise.
2428         (cp_parser_objc_superclass_or_category): Likewise.
2429         (cp_parser_objc_try_catch_finally_statement): Likewise.
2430         (cp_parser_objc_synchronized_statement): Likewise.
2431         (cp_parser_objc_throw_statement): Likewise.
2432         (cp_parser_omp_var_list_no_open): Likewise.
2433         (cp_parser_omp_clause_default): Likewise.
2434         (cp_parser_omp_clause_if): Likewise.
2435         (cp_parser_omp_clause_num_threads): Likewise.
2436         (cp_parser_omp_clause_reduction): Likewise.
2437         (cp_parser_omp_clause_schedule): Likewise.
2438         (cp_parser_omp_critical): Likewise.
2439         (cp_parser_omp_for_loop): Likewise.
2440         (cp_parser_omp_sections_scope): Likewise.
2441
2442         * parser.c (cp_parser_template_parameter_list): Simplify.
2443
2444 2008-04-07  James E. Wilson  <wilson@tuliptree.org>
2445
2446         * pt.c (tsubst_copy, case SIZEOF_EXPR): Initialize len.
2447
2448 2008-04-07  Jason Merrill  <jason@redhat.com>
2449
2450         PR c++/35734
2451         * class.c (type_has_user_nondefault_constructor): A template
2452         counts as a nondefault constructor.
2453
2454 2008-04-04  Paolo Bonzini  <bonzini@gnu.org>
2455
2456         * decl.c (cxx_push_function_context): Delete.
2457         (cxx_pop_function_context): Delete.
2458         (start_preparsed_function): Merge cxx_push_function_context (!f->decl
2459         code only).
2460         * cp-objcp-common.h (LANG_HOOKS_FUNCTION_INIT,
2461         LANG_HOOKS_FUNCTION_FINAL): Delete.
2462         (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to
2463         LANG_HOOKS_MISSING_NORETURN_OK_P.
2464         * cp-tree.h (cxx_push_function_context, cxx_pop_function_context):
2465         Delete prototype.
2466         * semantics.c (current_stmt_tree): Fix comment.
2467
2468 2008-04-03  Jakub Jelinek  <jakub@redhat.com>
2469
2470         PR c++/35741
2471         * semantics.c (finish_offsetof): Undo effect of convert_from_reference
2472         before calling fold_offsetof.
2473
2474 2008-04-03  Tom Tromey  <tromey@redhat.com>
2475
2476         * Make-lang.in (c++_OBJS): New variable.
2477
2478 2008-04-03  Paolo Bonzini  <bonzini@gnu.org>
2479
2480         * optimize.c (clone_body): New, from tree-inline.c.
2481
2482 2008-04-03  Paolo Bonzini  <bonzini@gnu.org>
2483
2484          * method.c (synthesize_method): Use {push,pop}_function_context.
2485          * name-lookup.c (push_to_top_level): Likewise.
2486          * parser.c (cp_parser_late_parsing_for_member): Likewise.
2487
2488 2008-03-30  Volker Reichelt  <v.reichelt@netcologne.de>
2489
2490         PR c++/35578
2491         * parser.c (cp_parser_decl_specifier_seq): Add location to error
2492         message.
2493
2494 2008-03-27  Tom Tromey  <tromey@redhat.com>
2495
2496         * Make-lang.in: Revert automatic dependency patch.
2497
2498 2008-03-27  Douglas Gregor  <doug.gregor@gmail.com>
2499
2500         PR obj-c++/35704
2501         * typeck.c (build_x_compound_expr): Use cp_build_compound_expr.
2502         (build_compound_expr): New, for compatibility with C
2503         build_compound_expr.
2504         (cp_build_compound_expr): Renamed from build_compound_expr.
2505         (build_c_cast): New, for compatibility with C build_c_cast.
2506         (cp_build_c_cast): Renamed from build_c_cast.
2507         * init.c (build_vec_delete_1): Fix calls to build_compound_expr.
2508         * decl.c (cxx_maybe_build_cleanup): Ditto.
2509         * cp-tree.h (build_compound_expr): Add C-compatibile prototype.
2510         (cp_build_compound_expr): Renamed from build_compound_expr.
2511         (build_c_cast): Add C-compatible prototype.
2512         (cp_build_c_cast): Renamed from build_c_cast.
2513         * typeck2.c (build_functional_cast): Use cp_build_c_cast.
2514         * parser.c (cp_parser_cast_expression): Fix call to build_c_cast.
2515
2516 2008-03-27  Douglas Gregor  <doug.gregor@gmail.com>
2517
2518         * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Cope with
2519         tsubst_pack_expansion returning a pack expansion, or a TREE_VEC
2520         ending in a pack expansion, both of which can occur when
2521         substituting into a nested template.
2522         (tsubst_copy_and_build) <case SIZEOF_EXPR>: When we're
2523         instantiating the sizeof...(X) form, make tsubst_copy do the work.
2524         * parser.c (cp_parser_template_parameter): Deal with unnamed
2525         non-type template parameter packs identified by pack expansions in
2526         the parameter type.
2527
2528 2008-03-26  Jakub Jelinek  <jakub@redhat.com>
2529
2530         PR c++/35546
2531         * pt.c (apply_late_template_attributes): Don't call tsubst on
2532         first attribute argument if it is IDENTIFIER_NODE.
2533
2534         PR c++/35332
2535         * error.c (dump_expr): Pass {,UN}ORDERED_EXPR, UN{LT,LE,GT,GE,EQ}_EXPR
2536         and LTGT_EXPR to pp_expression.
2537
2538 2008-03-26  Douglas Gregor  <doug.gregor@gmail.com>
2539
2540         * pt.c (coerce_template_template_parm): Moved the body of the loop
2541         of coerce_template_template_parms here, to make iteration over a
2542         template argument pack simpler.
2543         Also, allow matching of a template parameter pack in the template
2544         template parameter to a template parameter in the template
2545         template argument.
2546         (coerce_template_template_parms): Deal with variadic template
2547         template parameters. Use coerce_template_template_parm.
2548         (unify): Make sure we coerce the template template argument's
2549         template arguments to the template template parameter's template
2550         parameters, not the other way around.
2551
2552 2008-03-25  Tom Tromey  <tromey@redhat.com>
2553
2554         * Make-lang.in: Remove .o targets.
2555         (cp/g++spec.o): Moved to cp/.  Reduce to variable setting.
2556         (GXX_OBJS): Update.
2557         (c++_OBJS): New variable.
2558         (CXX_TREE_H, CXX_PRETTY_PRINT_H): Remove.
2559
2560 2008-03-25  Douglas Gregor  <doug.gregor@gmail.com>
2561
2562         * typeck.c (composite_pointer_type_r): Add SFINAE support.
2563         (composite_pointer_type): Ditto.
2564         (common_type): Fix call to composite_pointer_type.
2565         (cxx_sizeof_nowarn): New; used to be a macro.
2566         (cxx_sizeof_expr): Add SFINAE support.
2567         (cxx_alignof_expr): Ditto.
2568         (decay_conversion): Fix calls for SFINAE support.
2569         (rationalize_conditional_expr): Add SFINAE support.
2570         (build_class_member_access_expr): Ditto.
2571         (finish_class_member_access_expr): Ditto.
2572         (build_x_indirect_ref): Ditto.
2573         (build_indirect_ref): Original version renamed to
2574         cp_build_indirect_ref; new version provides a bridge from
2575         c-common.
2576         (cp_build_indirect_ref): Was build_indirect_ref; added SFINAE
2577         support.
2578         (get_member_function_from_ptrfunc): Fix calls for SFINAE support.
2579         (build_function_call): Original version renamed to
2580         cp_build_function_call; new version provides a bridge from
2581         c-common.
2582         (cp_build_function_call): Was build_function_call; added SFINAE
2583         support.
2584         (convert_arguments): Add SFINAE support.
2585         (build_x_binary_op): Ditto.
2586         (build_binary_op): Original version renamed to cp_build_binary_op;
2587         new version provides a bridge from c-common.
2588         (cp_build_binary_op): Was build_binary_op; added SFINAE support.
2589         (pointer_diff): Fix calls for SFINAE.
2590         (build_x_unary_op): Add SFINAE support.
2591         (condition_conversion): Fix calls for SFINAE.
2592         (build_unary_op): Original version renamed to cp_build_unary_op;
2593         new version provides a bridge from c-common.
2594         (cp_build_unary_op): Was build_unary_op; added SFINAE support.
2595         (unary_complex_lvalue): Fix calls for SFINAE.
2596         (build_x_conditional_expr): Add SFINAE support.
2597         (build_x_compound_expr_from_list): Fix calls for SFINAE.
2598         (build_x_compound_expr): Add SFINAE support.
2599         (convert_ptrmem): Fix calls for SFINAE.
2600         (build_static_cast_1): Add SFINAE support.
2601         (build_static_cast): Ditto.
2602         (build_reinterpret_cast_1): Ditto.
2603         (build_reinterpret_cast): Ditto.
2604         (build_const_cast_1): Ditto.
2605         (build_const_cast): Ditto.
2606         (build_c_cast): Ditto.
2607         (build_modify_expr): Original version renamed to
2608         cp_build_modify_expr; new version provides a bridge from c-common.
2609         (cp_build_modify_expr): Was build_modify_expr; added SFINAE
2610         support.
2611         (build_x_modify_expr): Add SFINAE support.
2612         (build_ptrmemfunc): Fix calls for SFINAE.
2613         (convert_for_assignment): Add SFINAE support.
2614         (convert_for_initialization): Ditto.
2615         (check_return_expr): Fix calls for SFINAE.
2616         (lvalue_or_else): Add SFINAE support.
2617         * init.c (perform_member_init): Fix calls for SFINAE.
2618         (emit_mem_initializers): Ditto.
2619         (expand_virtual_init): Ditto.
2620         (expand_cleanup_for_base): Ditto.
2621         (build_aggr_init): Add SFINAE support.
2622         (expand_default_init): Ditto.
2623         (expand_aggr_init_1): Fix calls for SFINAE.
2624         (build_offset_ref): Ditto.
2625         (build_new_1): Add SFINAE support.
2626         (build_new): Ditto.
2627         (build_vec_delete_1): Fix calls for SFINAE.
2628         (get_temp_regvar): Ditto.
2629         (build_vec_init): Add SFINAE support.
2630         (build_dtor_call): Fix calls for SFINAE.
2631         (build_delete): Ditto.
2632         (push_base_cleanups): Ditto.
2633         (build_vec_delete_1): Ditto.
2634         * class.c (build_base_path): Fix calls for SFINAE.
2635         (build_simple_base_path): Ditto.
2636         (convert_to_base_statically): Ditto.
2637         (build_vfn_ref): Ditto.
2638         (resolve_address_of_overloaded_function): Ditto.
2639         * decl.c (check_initializer): Fix calls for SFINAE.
2640         (register_dtor_fn): Ditto.
2641         (compute_array_index_type): Ditto.
2642         (finish_enum): Ditto.
2643         (start_preparsed_function): Ditto.
2644         (cxx_maybe_build_cleanup): Ditto.
2645         * call.c (convert_like): Add COMPLAIN argument.
2646         (convert_like_with_context): Ditto.
2647         (build_this): Fix calls for SFINAE.
2648         (build_user_type_conversion): Ditto.
2649         (resolve_args): Ditto.
2650         (build_new_function_call): Add SFINAE support.
2651         (build_operator_new_call): Fix calls for SFINAE.
2652         (build_object_call): Add SFINAE support.
2653         (build_conditional_expr): Ditto.
2654         (build_new_op): Ditto.
2655         (build_op_delete_call): Fix calls for SFINAE.
2656         (build_temp): Ditto.
2657         (convert_like_real): Add SFINAE support.
2658         (build_x_va_arg): Fix calls for SFINAE.
2659         (convert_default_arg): Ditto.
2660         (build_over_call): Add SFINAE support.
2661         (build_java_interface_fn_ref): Fix calls for SFINAE.
2662         (build_special_member_call): Add SFINAE support.
2663         (build_new_method_call): Ditto.
2664         (perform_implicit_conversion): Ditto.
2665         (perform_direct_initialization_if_possible): Ditto.
2666         (initialize_reference): Fix calls for SFINAE.
2667         * method.c (do_build_assign_ref): Fix calls for SFINAE.
2668         * rtti.c (build_headof): Fix calls for SFINAE.
2669         (get_tinfo_decl_dynamic): Ditto.
2670         (get_typeid): Ditto.
2671         (build_dynamic_cast_1): Add SFINAE support.
2672         (build_dynamic_cast): Ditto.
2673         (tinfo_base_init): Fix calls for SFINAE.
2674         * except.c (do_get_exception_ptr): Fix calls for SFINAE.
2675         (do_end_catch): Ditto.
2676         (initialize_handler_parm): Ditto.
2677         (expand_start_catch_block): Ditto.
2678         (do_allocate_exception): Ditto.
2679         (do_free_exception): Ditto.
2680         (build_throw): Ditto.
2681         * cvt.c (build_up_reference): Fix calls for SFINAE.
2682         (convert_to_reference): Ditto.
2683         (ocp_convert): Ditto.
2684         (convert_to_void): Add SFINAE support.
2685         * tree.c (build_dummy_object): Fix calls for SFINAE.
2686         (stabilize_expr): Ditto.
2687         * cp-tree.h (build_conditional_expr): Add tsubst_flags_t
2688         parameter.
2689         (build_new_method_call): Ditto.
2690         (build_special_member_call): Ditto.
2691         (build_new_op): Ditto.
2692         (perform_implicit_conversion): Ditto.
2693         (perform_direct_initialization_if_possible): Ditto.
2694         (convert_to_void): Ditto.
2695         (build_aggr_init): Ditto.
2696         (build_new): Ditto.
2697         (build_vec_init): Ditto.
2698         (build_dynamic_cast): Ditto.
2699         (finish_call_expr): Ditto
2700         (cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter.
2701         (cxx_sizeof_nowarn): Remove macro; add function declaration.
2702         (build_class_member_access_expr): Add tsubst_flags_t parameter.
2703         (finish_class_member_access_expr): Ditto.
2704         (build_x_indirect_ref): Ditto.
2705         (cp_build_indirect_ref): New.
2706         (cp_build_function_call): Add tsubst_flags_t parameter.
2707         (build_x_unary_op): Ditto.
2708         (cp_build_unary_op): New.
2709         (build_x_conditional_expr): Add tsubst_flags_t parameter.
2710         (build_x_compound_expr): Ditto.
2711         (build_compound_expr): Ditto.
2712         (build_static_cast): Ditto.
2713         (build_reinterpret_cast): Ditto.
2714         (build_const_cast): Ditto.
2715         (build_c_cast): Ditto.
2716         (build_x_modify_expr): Ditto.
2717         (cp_build_modify_expr): New.
2718         (convert_for_initialization): Add tsubst_flags_t parameter.
2719         (cp_build_binary_op): Remove macro; add function declaration.
2720         (invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter.
2721         (lvalue_or_else): Ditto.
2722         (build_functional_cast): Ditto.
2723         * typeck2.c (digest_init): Fix calls for SFINAE.
2724         (process_init_constructor_array): Ditto.
2725         (process_init_constructor_record): Ditto.
2726         (build_x_arrow): Ditto.
2727         (build_m_component_ref): Ditto.
2728         (build_functional_cast): Add SFINAE support.
2729         * pt.c (tsubst_copy_and_build): Add (more) SFINAE support.
2730         * semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE.
2731         (finish_expr_stmt): Ditto.
2732         (finish_for_expr): Ditto.
2733         (finish_asm_stmt): Ditto.
2734         (finish_non_static_data_member): Ditto.
2735         (finish_qualified_id_expr): Ditto.
2736         (finish_call_expr): Add SFINAE support.
2737         (finish_increment_expr): Fix calls for SFINAE.
2738         (finish_unary_op_expr): Ditto.
2739         (simplify_aggr_init_expr): Ditto.
2740         (finish_omp_clauses): Ditto.
2741         (finish_omp_for): Ditto.
2742         (finish_omp_barrier): Ditto.
2743         (finish_omo_flush): Ditto.
2744         * decl2.c (grok_array_decl): Fix calls or SFINAE.
2745         (build_anon_union_vars): Ditto.
2746         (get_guard_cond): Ditto.
2747         (set_guard): Ditto.
2748         (one_static_initialization_or_destruction): Ditto.
2749         (do_static_initialization_or_destruction): Ditto.
2750         (generate_ctor_or_dtor_function): Ditto.
2751         (build_offset_ref_call_from_tree): Ditto.
2752         * parser.c (cp_parser_postfix_expression): Fix calls for SFINAE.
2753         (cp_parser_postfix_dot_deref_expression): Ditto.
2754         (cp_parser_unary_expression): Ditto.
2755         (cp_parser_new_expression): Ditto.
2756         (cp_parser_cast_expression): Ditto.
2757         (cp_parser_binary_expression): Ditto.
2758         (cp_parser_question_colon_clause): Ditto.
2759         (cp_parser_assignment_expression): Ditto.
2760         (cp_parser_expression): Ditto.
2761         (cp_parser_builtin_offsetof): Ditto.
2762         (cp_parser_template_argument): Ditto.
2763         (cp_parser_functional_cast): Ditto.
2764
2765 2008-03-24  Tom Tromey  <tromey@redhat.com>
2766
2767         * lex.c (handle_pragma_interface): Don't copy the filename.
2768         (handle_pragma_implementation): Copy filename using xstrdup.
2769
2770 2008-03-21  Paolo Carlini  <pcarlini@suse.de>
2771
2772         * cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
2773         (SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P.
2774         (IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P.
2775         (PROMOTES_TO_AGGR_TYPE): Remove.
2776         (CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust.
2777         * typeck.c (unary_complex_lvalue, build_modify_expr,
2778         convert_for_initialization): Adjust.
2779         * init.c (is_aggr_type): Remove.
2780         (is_class_type): Add.
2781         (build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init,
2782         build_delete): Adjust.
2783         * lex.c (make_aggr_type): Remove.
2784         (make_class_type): Add.
2785         (cxx_make_type): Adjust.
2786         * class.c (finish_struct_1, fixed_type_or_null, is_empty_class):
2787         Adjust.
2788         * decl.c (build_typename_type, make_typename_type,
2789         make_unbound_class_template, cxx_init_decl_processing,
2790         check_tag_decl, groktypename, start_decl_1, layout_var_decl,
2791         check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms,
2792         grok_op_properties, xref_tag, check_function_type): Adjust.
2793         * call.c (check_dtor_name, standard_conversion, implicit_conversion,
2794         add_builtin_candidate, add_builtin_candidates,
2795         build_user_type_conversion_1, convert_like_real, build_cxx_call,
2796         is_subseq, compare_ics): Adjust.
2797         * method.c (use_thunk): Adjust.
2798         * rtti.c (build_dynamic_cast_1, create_pseudo_type_info,
2799         create_tinfo_types): Adjust.
2800         * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
2801         build_up_reference, convert_to_reference, convert_from_reference,
2802         ocp_convert, build_expr_type_conversion): Adjust.
2803         * tree.c (bind_template_template_parm, error_type): Adjust.
2804         * dump.c (cp_dump_tree): Adjust.
2805         * search.c (lookup_member): Adjust.
2806         * friend.c (make_friend_class, do_friend): Adjust.
2807         * typeck2.c (store_init_value, process_init_constructor_array,
2808         process_init_constructor_record, build_x_arrow, build_m_component_ref,
2809         build_functional_cast): Adjust.
2810         * pt.c (finish_member_template_decl, process_template_parm,
2811         lookup_template_class, tsubst_function_type, tsubst,
2812         tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc):
2813         Adjust.
2814         * semantics.c (begin_class_definition, finish_base_specifier,
2815         finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type):
2816         Adjust.
2817         * name-lookup.c (constructor_name_p, push_overloaded_decl,
2818         do_class_using_decl, lookup_qualified_name,
2819         maybe_process_template_type_declaration): Adjust.
2820         * decl2.c (grok_array_decl, check_member_template,
2821         constrain_class_visibility): Adjust.
2822         * parser.c (cp_parser_class_name): Adjust.
2823
2824 2008-03-18  Paolo Bonzini  <bonzini@gnu.org>
2825
2826          * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.
2827
2828 2008-03-17  Jason Merrill  <jason@redhat.com>
2829
2830         PR c++/35548
2831         * call.c (reference_binding): Check LOOKUP_NO_TEMP_BIND when binding
2832         a temp directly to a reference as per DR391.
2833
2834 2008-03-12  Richard Guenther  <rguenther@suse.de>
2835
2836         PR c++/35469
2837         Revert:
2838         2008-02-04  Richard Guenther  <rguenther@suse.de>
2839
2840          PR java/35035
2841          * decl.c (record_builtin_java_type): Make jboolean a
2842          integer type again where its mode doesn't match that of bool.
2843
2844         2008-01-25  Richard Guenther  <rguenther@suse.de>
2845
2846          PR c++/33887
2847          * decl.c (record_builtin_java_type): Make __java_boolean
2848          a variant of bool.
2849          * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
2850          after TYPE_MAIN_VARIANT check.
2851
2852 2008-03-10  Jakub Jelinek  <jakub@redhat.com>
2853
2854         PR c++/35328
2855         * semantics.c (finish_omp_clauses): Look through NOP_EXPR even
2856         if errorcount.
2857
2858         PR c++/35337
2859         * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
2860         DECL_P in not a variable and appears more than once error messages.
2861
2862 2008-03-07  Paolo Bonzini  <bonzini@gnu.org>
2863
2864         Revert:
2865
2866         2008-02-06  Douglas Gregor  <doug.gregor@gmail.com>
2867
2868         PR c++/35049
2869         PR c++/35096
2870         * typeck.c (structural_comptypes): Call cp_comptypes.
2871         (comptypes): New; called from the C/C++ common bits to perform
2872         strict checks.
2873         (cp_comptypes): Renamed from comptypes, which is already used,
2874         with a different signature, by the C++ front end.
2875         (build_reinterpret_cast_1): Call cp_comptypes.
2876         (ptr_reasonably_similar): Ditto.
2877         * decl.c (decls_match): Ditto.
2878         * cvt.c (convert_to_reference): Ditto.
2879         * cp-tree.h (same_type_p): Ditto.
2880         (same_or_base_type_p): Ditto.
2881         (comptypes): Rename to cp_comptypes.
2882         * pt.c (canonical_type_parameter): Call cp_comptypes.
2883
2884 2008-03-07  Paolo Bonzini  <bonzini@gnu.org>
2885
2886         * cp-objcp-common.c (cxx_types_compatible_p): Remove obsolete
2887         test for equivalence between pointer and references.
2888
2889 2008-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2890
2891         PR 24924
2892         * class.c (finish_struct_anon): Use permerror instead of pedwarn.
2893         (check_field_decls): Likewise.
2894         (note_name_declared_in_class): Likewise.
2895         * call.c (build_new_op): Likewise.
2896         (convert_like_real): Likewise.
2897         (build_over_call): Likewise.
2898         * lex.c (unqualified_fn_lookup_error): Likewise.
2899         * parser.c (cp_parser_template_id): Likewise.
2900         * cvt.c (warn_ref_binding): Likewise.
2901         (convert_to_reference): Likewise.
2902         (ocp_convert): Likewise.
2903         (convert_to_void): Use error instead of pedwarn.
2904         * error.c (cp_cpp_error): Use pedantic_warning_kind.
2905         * decl.c (compute_array_index_type): Use constant_expression_error.
2906
2907 2008-03-01  Douglas Gregor  <doug.gregor@gmail.com>
2908
2909         * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Note
2910         that auto is either a storage class or a simple type specifier,
2911         depending on the dialect.
2912         (cp_parser_decl_specifier_seq): Complain about `auto' as a storage
2913         specifier in C++98 mode, error in C++0x mode (since we don't
2914         support auto as a type specifier, yet).
2915         (cp_parser_storage_class_specifier_opt): Don't treat `auto' as a
2916         storage specifier in C++0x mode.
2917         (cp_parser_simple_type_specifier): Parse `auto' as a
2918         simple-type-specifier, but error because we don't support it yet.
2919
2920 2008-02-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2921
2922         * parser.c (cp_parser_nonclass_name): New.
2923         (cp_parser_pseudo_destructor_name): Use it instead of
2924         cp_parser_type_name.
2925         (cp_parser_type_name): Move code to cp_parser_nonclass_name.
2926
2927 2008-02-29  Tom Tromey  <tromey@redhat.com>
2928
2929         * parser.c (struct cp_token) <input_file_stack_index>: Remove.
2930         (cp_lexer_get_preprocessor_token): Update.
2931         (cp_lexer_set_source_position_from_token): Don't call
2932         restore_input_file_stack.
2933         * lex.c (cxx_init): Don't use push_srcloc or pop_srcloc.
2934
2935 2008-02-28  Richard Guenther  <rguenther@suse.de>
2936
2937         Revert:
2938         2008-02-26  Richard Guenther  <rguenther@suse.de>
2939
2940         * decl.c (duplicate_decls): Remove decl from global mapping
2941         before ggc_freeing it.
2942
2943 2008-02-27  Jakub Jelinek  <jakub@redhat.com>
2944
2945         PR c++/35368
2946         * rtti.c: Include c-pragma.h.
2947         (push_abi_namespace, pop_abi_namespace): New functions.
2948         (build_dynamic_cast_1, tinfo_base_init, get_pseudo_ti_index,
2949         create_tinfo_types, emit_support_tinfos): Use them.
2950         * Make-lang.in (cp/rtti.o): Depend on $(C_PRAGMA_H).
2951
2952 2008-02-26  Jason Merrill  <jason@redhat.com>
2953
2954         PR c++/35315
2955         * decl.c (grokdeclarator): Allow a typedef of an unnamed struct
2956         to name the struct for linkage purposes even if it has attributes.
2957         (start_decl): In that case, set ATTR_FLAG_TYPE_IN_PLACE.
2958
2959 2008-02-26  Tom Tromey  <tromey@redhat.com>
2960
2961         * parser.c (eof_token): Remove old location code.
2962         (check_empty_body): Remove test of USE_MAPPED_LOCATION.
2963         * decl2.c (generate_ctor_or_dtor_function): Remove old location
2964         code.
2965         (cp_write_global_declarations): Likewise.
2966         * lex.c (cxx_init): Remove old location code.
2967         (handle_pragma_implementation): Remove test of
2968         USE_MAPPED_LOCATION.
2969         * pt.c (tsubst): Remove old location code.
2970         * error.c (cp_print_error_function): Remove test of
2971         USE_MAPPED_LOCATION.
2972         * decl.c (pop_label): Remove old location code.
2973         (finish_function): Likewise.
2974
2975 2008-02-26  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2976
2977         PR 26264
2978         * call.c (magic_varargs_p):  Remove BUILT_IN_STDARG_START.
2979
2980 2008-02-26  Richard Guenther  <rguenther@suse.de>
2981
2982         * decl.c (duplicate_decls): Remove decl from global mapping
2983         before ggc_freeing it.
2984
2985 2008-02-26  Paolo Carlini  <pcarlini@suse.de>
2986
2987          PR c++/35323
2988          * name-lookup.c (arg_assoc_type): Handle FIXED_POINT_TYPE.
2989
2990 2008-02-26  Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2991
2992         * typeck.c (build_class_member_access_expr): Add appropriate
2993         OPT_W* parameter to warning.
2994         (build_reinterpret_cast_1): Likewise.
2995         * name-lookup.c (push_overloaded_decl): Likewise.
2996
2997 2008-02-25  Paolo Carlini  <pcarlini@suse.de>
2998
2999          PR c++/35333
3000          * error.c (dump_expr): Handle CONJ_EXPR.
3001
3002 2008-02-25  Paolo Carlini  <pcarlini@suse.de>
3003
3004          PR c++/35338
3005          * error.c (dump_type): Handle FIXED_POINT_TYPE.
3006         (dump_expr): Handle FIXED_CST.
3007
3008 2008-02-24  Jason Merrill  <jason@redhat.com>
3009
3010         * parser.c (cp_parser_declaration): Handle "inline namespace".
3011         (cp_parser_namespace_definition): Likewise.
3012
3013         PR c++/33486
3014         * name-lookup.c (arg_assoc_namespace): Look down into inline
3015         namespaces, too.
3016
3017 2008-02-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3018
3019         * typeck.c (check_for_casting_away_constness): Use 1 single
3020         argument, the type of cast, to decide what diagnostics generate.
3021         (build_static_cast_1): Remove unused code. Update call to
3022         check_for_casting_away_constness.
3023         (build_reinterpret_cast_1): Update call to
3024         check_for_casting_away_constness.
3025         (build_const_cast_1): Likewise.
3026
3027 2008-02-24  Paolo Carlini  <pcarlini@suse.de>
3028
3029         * error.c (dump_expr): Don't deal directly with NEW_EXPR (and
3030         VEC_NEW_EXPR), forward to pp_expression.
3031         * cxx-pretty-print.c (pp_cxx_new_expression): Fix FIXME.
3032
3033 2008-02-24  Danny Smith  <dannysmith@users.sourceforge.net>
3034
3035         PR c++/34749
3036         * friend.c (do_friend): Call cplus_decl_attributes earlier.
3037
3038 2008-02-22  Andrew Pinski  <andrew_pinski@playstation.sony.com>
3039
3040         PR C++/34715
3041         * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS for
3042         template decls' function decl.
3043
3044 2008-02-22  Paolo Carlini  <pcarlini@suse.de>
3045
3046         PR c++/35282
3047         Revert:
3048         2008-02-14  Paolo Carlini  <pcarlini@suse.de>
3049
3050          PR c++/28743
3051          * pt.c (determine_specialization): In case of function templates,
3052         when the type of DECL does not match FN there is no match.
3053
3054 2008-02-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3055
3056         PR c/19999
3057         * typeck.c (build_binary_op): Warn about floating point
3058         comparisons if FLOAT_TYPE_P, not only for REAL_TYPE.
3059
3060 2008-02-19  Jason Merrill  <jason@redhat.com>
3061
3062         PR c++/34950
3063         * pt.c (resolve_overloaded_unification): Set processing_template_decl
3064         while we look for possible bindings.
3065
3066 2008-02-19  Jakub Jelinek  <jakub@redhat.com>
3067
3068         PR c++/35028
3069         * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors.
3070
3071         PR c++/34964
3072         PR c++/35244
3073         * semantics.c (finish_omp_threadprivate): Do nothing for error_operand_p
3074         vars.  Afterwards ensure v is VAR_DECL.
3075
3076         PR c++/35078
3077         * parser.c (cp_parser_omp_for_loop): If DECL has REFERENCE_TYPE, don't
3078         call cp_finish_decl.
3079         * semantics.c (finish_omp_for): Fail if DECL doesn't have integral type
3080         early.
3081
3082 2008-02-15  Douglas Gregor  <doug.gregor@gmail.com>
3083
3084         PR c++/35023
3085         PR c++/35024
3086         PR c++/35026
3087         * pt.c (finish_member_template_decl): If the type in a TYPE_DECL
3088         is error_mark_node, return an error early.
3089         (find_parameter_packs_r): Pass the pointer set along to recursive
3090         calls of cp_walk_subtrees; don't try to manage the pointer set
3091         ourselves.
3092         (uses_parameter_packs): Pass the pointer set to cp_walk_tree.
3093         (make_pack_expansion): Ditto.
3094         (check_for_bare_parameter_packs): Ditto. Also, don't bother taking
3095         a second pass through the tree with find_parameter_packs_r; that
3096         second pass no longer does anything.
3097         (push_template_decl_real): If we have an erroneous declaration,
3098         set its type to error_mark_node before returning an error.
3099
3100 2008-02-14  Douglas Gregor  <doug.gregor@gmail.com>
3101
3102         PR c++/34050
3103         * pt.c (tsubst_initializer_list): Deal with the use of
3104         VOID_TYPE_NODE to indicate value-initialization of the bases.
3105
3106 2008-02-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3107             Jason Merrill  <jason@redhat.com>
3108
3109         PR c++/5645
3110         PR c++/11159
3111         * class.c (type_has_user_nondefault_constructor): New fn.
3112         * cp-tree.h: Declare it.
3113         * init.c (emit_mem_initializers): Use it for -W warning about
3114         missing base initializer.
3115
3116 2008-02-14  Paolo Carlini  <pcarlini@suse.de>
3117
3118          PR c++/28743
3119          * pt.c (determine_specialization): In case of function templates,
3120         when the type of DECL does not match FN there is no match.
3121
3122 2008-02-13  Jakub Jelinek  <jakub@redhat.com>
3123             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3124
3125         PR c++/35138
3126         * parser.c (cp_parser_pseudo_destructor_name): If next tokens
3127         are not identifier :: ~, return before calling cp_parser_type_name.
3128
3129 2008-02-13  Jason Merrill  <jason@redhat.com>
3130
3131         PR c++/34962, c++/34937, c++/34939
3132         * decl2.c (is_late_template_attribute): Always defer attributes
3133         vector_size and weak.
3134
3135         PR c++/34774
3136         * pt.c (value_dependent_expression_p): Look into DECL_INITIAL
3137         of enumerators, too.
3138
3139 2008-02-12  Jason Merrill  <jason@redhat.com>
3140
3141         PR c++/34824
3142         * call.c (convert_like_real): Pass LOOKUP_NO_CONVERSION to build_temp
3143         if we're doing conversions to call a user-defined conversion function.
3144
3145 2008-02-12  Steven Bosscher  <steven@gcc.gnu.org>
3146
3147         PR c++/29048
3148         * semantics.c (finish_qualified_id_expr): Avoid duplicate access
3149         check here, too.
3150
3151 2008-02-12  Jakub Jelinek  <jakub@redhat.com>
3152
3153         PR c++/34862
3154         * init.c (build_new_1): Don't create placement_expr before
3155         constructing alloc_call.  Verify that the pointer is passed by
3156         value to operator new.
3157
3158 2008-02-11  Jason Merrill  <jason@redhat.com>
3159
3160         PR c++/35097
3161         * pt.c (tsubst): Don't look up a template typedef in an explicit
3162         specialization.
3163
3164 2008-02-11  Douglas Gregor  <doug.gregor@gmail.com>
3165
3166         PR c++/35113
3167         * tree.c (cp_build_qualified_type_real): When building a
3168         cv-qualified array type, build it as a unique type with
3169         build_cplus_array_type_1 and then adopt the unqualified type's
3170         main variant.
3171
3172 2008-02-11  Paolo Carlini  <pcarlini@suse.de>
3173
3174         PR c++/35077
3175         * decl.c (groktypename): Check grokdeclarator return.
3176
3177 2008-02-10  Jason Merrill  <jason@redhat.com>
3178
3179         PR c++/34094
3180         * decl2.c (cp_write_global_declarations): Don't write out static
3181         data members with DECL_IN_AGGR_P set.
3182
3183 2008-02-08  Jason Merrill  <jason@redhat.com>
3184
3185         PR c++/35116
3186         * tree.c (build_target_expr_with_type): Handle void initializer.
3187         (bot_manip): Remap slot before recursing.
3188
3189 2008-02-06  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3190
3191         PR other/35107
3192         * Make-lang.in (cc1plus-dummy, cc1plus): Add $(GMPLIBS).
3193
3194 2008-02-06  Alexandre Oliva  <aoliva@redhat.com>
3195
3196         PR c++/35056
3197         * tree.c: Include tree-flow.h.
3198         (build_target_expr): Check type compatibility.
3199         * Make-lang.in (cp/tree.o): Depend on $(TREE_FLOW_H).
3200         * call.c (convert_like_real): Convert bitfield to expected type.
3201
3202 2008-02-06  Douglas Gregor  <doug.gregor@gmail.com>
3203
3204         PR c++/35049
3205         PR c++/35096
3206         * typeck.c (structural_comptypes): Call cp_comptypes.
3207         (comptypes): New; called from the C/C++ common bits to perform
3208         strict checks.
3209         (cp_comptypes): Renamed from comptypes, which is already used,
3210         with a different signature, by the C++ front end.
3211         (build_reinterpret_cast_1): Call cp_comptypes.
3212         (ptr_reasonably_similar): Ditto.
3213         * decl.c (decls_match): Ditto.
3214         * cvt.c (convert_to_reference): Ditto.
3215         * cp-tree.h (same_type_p): Ditto.
3216         (same_or_base_type_p): Ditto.
3217         (comptypes): Rename to cp_comptypes.
3218         * pt.c (canonical_type_parameter): Call cp_comptypes.
3219
3220 2008-02-05  Jakub Jelinek  <jakub@redhat.com>
3221
3222         PR c++/33553
3223         * pt.c (tsubst) <case INTEGER_TYPE>: Don't issue error if max is
3224         value dependent expression.
3225
3226 2008-02-05  Douglas Gregor  <doug.gregor@gmail.com>
3227
3228         PR c++/35074
3229         * decl2.c (save_template_attributes): When we're modifying the
3230         TYPE_MAIN_VARIANT to add new attributes, be sure to also modify
3231         all of the other variants to add those same attributes. Otherwise,
3232         the main variant will be inconsistent with those other variants.
3233
3234 2008-02-04  Richard Guenther  <rguenther@suse.de>
3235
3236         PR java/35035
3237         * decl.c (record_builtin_java_type): Make jboolean a
3238         integer type again where its mode doesn't match that of bool.
3239
3240 2008-02-02  Jason Merrill  <jason@redhat.com>
3241             Mark Mitchell  <mark@codesourcery.com>
3242
3243         PR c++/33916
3244         * init.c (build_value_init_1): New function.
3245         (build_value_init): New function.
3246         * typeck2.c (build_functional_cast): Call it.
3247         * cp-gimplify.c (cp_gimplify_init_expr): Handle its output.
3248
3249         * cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from
3250         TYPE_HAS_CONSTRUCTOR.
3251         * class.c (finish_struct_bits, maybe_warn_about_overly_private_class,
3252         add_implicitly_declared_members): Adjust.
3253         (check_field_decls): Adjust. Remove warnings about reference/const
3254         in class without constructor.
3255         (check_bases_and_members): Adjust.  Give those warnings here instead.
3256         * decl.c (fixup_anonymous_aggr): Adjust.
3257         (check_initializer): Adjust, clarify logic slightly.
3258         (grok_special_member_properties): Adjust, only set if user-provided.
3259         * rtti.c (create_tinfo_types): Don't set.
3260         * cvt.c (ocp_convert): Remove exception for vtable_entry_type et al.
3261         Use same_type_ignoring_top_level_qualifiers_p.
3262         * pt.c (check_explicit_specialization): Adjust.
3263         (instantiate_class_template): Adjust.
3264
3265 2008-01-31  Douglas Gregor  <doug.gregor@gmail.com>
3266             Jakub Jelinek  <jakub@redhat.com>
3267
3268         PR c++/34935
3269         PR c++/34936
3270         * typeck.c (structural_comptypes): Handle comparisons of
3271         VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, FIXED_POINT_TYPE, and
3272         REAL_TYPE nodes.
3273         * mangle.c (write_builtin_type): Map down to the canonical type,
3274         which will be one of the predefined type nodes.
3275
3276 2008-01-29  Michael Meissner  <michael.meissner@amd.com>
3277
3278         PR 35004
3279         * cp-tree.h (struct full_lang_decl): Make tree_code bitfield 16
3280         bits to allow for expansion of the number of middle end tree
3281         codes.
3282
3283 2008-01-29  Douglas Gregor  <doug.gregor@gmail.com>
3284
3285         PR c++/34055
3286         PR c++/34103
3287         PR c++/34219
3288         PR c++/34606
3289         PR c++/34753
3290         PR c++/34754
3291         PR c++/34755
3292         PR c++/34919
3293         PR c++/34961
3294         * typeck.c (check_return_expr): Tweak call to
3295         check_for_bare_parameter_packs.
3296         * class.c (add_method): Be careful with error_mark_nodes.
3297         * cp-tree.h (check_for_bare_parameter_packs): Remove "*" from
3298         signature.
3299         * pt.c (struct find_parameter_pack_data): Remove
3300         SET_PACKS_TO_ERROR.
3301         (find_parameter_packs_r): Don't use SET_PACKS_TO_ERROR.
3302         (uses_parameter_packs): Don't set SET_PACKS_TO_ERROR.
3303         (make_pack_expansion): Ditto.
3304         (check_for_bare_parameter_packs): Parameter is now a tree, not a
3305         tree*.
3306         (process_template_parm): Tweak call to
3307         check_for_bare_parameter_packs.
3308         (push_template_decl_real): Tweak calls to
3309         check_for_bare_parameter_packs. If bare parameter packs are found
3310         in the list of exceptions, clear out that list after giving an
3311         error.
3312         * semantics.c (finish_cond): Tweak call to
3313         check_for_bare_parameter_packs.
3314         (finish_expr_stmt): Ditto.
3315         (finish_for_expr): Ditto.
3316         (finish_switch_cond): Ditto.
3317         (finish_mem_initializers): Ditto.
3318         (finish_member_declaration): Ditto.
3319         (finish_static_assert): Check for bare parameter packs in the
3320         condition.
3321         * decl2.c (cplus_decl_attributes): Check for bare parameter packs in the
3322         attributes of a declaration.
3323         * parser.c (cp_parser_using_declaration): Tweak call to
3324         check_for_bare_parameter_packs.
3325         (cp_parser_base_clause): Ditto.
3326
3327 2008-01-28  Jason Merrill  <jason@redhat.com>
3328
3329         PR c++/35007
3330         * class.c (build_base_path): Fix !want_pointer case.
3331
3332 2008-01-27  Jason Merrill  <jason@redhat.com>
3333
3334         PR c++/27177
3335         * class.c (build_base_path): Fix previous change.
3336
3337 2008-01-26  Jakub Jelinek  <jakub@redhat.com>
3338
3339         PR c++/34965
3340         * error.c (dump_expr): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR
3341         and TRUTH_XOR_EXPR.
3342
3343 2008-01-26  Richard Guenther  <rguenther@suse.de>
3344
3345         PR c++/34235
3346         * typeck.c (build_binary_op): Remove code to shorten compares.
3347
3348 2008-01-25  Richard Guenther  <rguenther@suse.de>
3349
3350         PR c++/33887
3351         * decl.c (record_builtin_java_type): Make __java_boolean
3352         a variant of bool.
3353         * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
3354         after TYPE_MAIN_VARIANT check.
3355
3356 2008-01-25  Jason Merrill  <jason@redhat.com>
3357
3358         PR c++/27177
3359         * class.c (build_base_path): Don't mess with virtual access if
3360         skip_evaluation.
3361         * call.c (standard_conversion): Don't check whether source type
3362         is complete.
3363
3364         * decl2.c (is_late_template_attribute): Don't defer attribute
3365         visibility just because the type is dependent.
3366
3367 2008-01-25  Jason Merrill  <jason@redhat.com>
3368             Mark Mitchell  <mark@codesourcery.com>
3369
3370         PR c++/31780
3371         * call.c (standard_conversion): Allow conversion from integer/real
3372         to complex.
3373         (compare_ics): Such a conversion is worse than a normal arithmetic
3374         conversion.
3375
3376 2008-01-25  Richard Guenther  <rguenther@suse.de>
3377
3378         PR c++/33887
3379         * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define
3380         to true.
3381
3382 2008-01-24  Paolo Carlini  <pcarlini@suse.de>
3383
3384          PR c++/34603
3385          * pt.c (push_template_decl_real): Return error_mark_node in case
3386         of template definition of non-template.
3387
3388 2008-01-24  Jason Merrill  <jason@redhat.com>
3389
3390         PR c++/34913
3391         * decl2.c (is_late_template_attribute): Defer any attribute with
3392         dependent args.  Also defer type attributes if the type is dependent.
3393
3394 2008-01-22  Jakub Jelinek  <jakub@redhat.com>
3395             Alexandre Oliva  <aoliva@redhat.com>
3396
3397         PR c++/33984
3398         * call.c (reference_binding): For bitfields use the declared bitfield
3399         type.
3400         (add_builtin_candidates): Likewise.
3401         * class.c (layout_class_type): For bitfields copy over the
3402         original type quals.
3403
3404 2008-01-22  Jason Merrill  <jason@redhat.com>
3405
3406         PR c++/28560
3407         * decl.c (groktypename): Also ignore attributes on dependent
3408         possibly-class types.
3409
3410         PR c++/34912
3411         * friend.c (do_friend): Check for prior declaration of a friend
3412         function of a local class.
3413         * name-lookup.c (lookup_name_innermost_nonclass_level):
3414         No longer static.
3415         * name-lookup.h: Declare it.
3416
3417 2008-01-22  Tom Tromey  <tromey@redhat.com>
3418
3419         PR c++/34829:
3420         * init.c (build_new_1): Only disallow Java aggregates.
3421
3422 2008-01-22  Jakub Jelinek  <jakub@redhat.com>
3423
3424         PR c++/34607
3425         * semantics.c (finish_omp_for): Don't call c_finish_omp_for
3426         if decl or init is error_mark_node.
3427
3428         PR c++/34918
3429         * error.c (dump_expr): Handle VECTOR_CST.
3430
3431 2008-01-21  Jason Merrill  <jason@redhat.com>
3432
3433         PR c++/33959
3434         * pt.c (tsubst_aggr_type): Make sure our context is complete.
3435
3436         PR c++/34573
3437         * pt.c (retrieve_local_specialization): Robustify.
3438         (tsubst_pack_expansion, tsubst_decl): Remove redundant checks.
3439
3440         PR c++/34846
3441         * pt.c (tsubst): Only call retrieve_local_specialization if the
3442         original typedef was in a function template.
3443
3444         PR c++/34196
3445         * decl.c (wrap_cleanups_r): Set TRY_CATCH_IS_CLEANUP.
3446
3447 2008-01-21  Richard Guenther  <rguenther@suse.de>
3448
3449         PR c++/34850
3450         * error.c (cp_print_error_function): Deal with recursive
3451         BLOCK trees.
3452
3453 2008-01-20  Paolo Carlini  <pcarlini@suse.de>
3454
3455          PR c++/34891
3456          * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR.
3457
3458 2008-01-20  Paolo Carlini  <pcarlini@suse.de>
3459
3460          PR c++/34776
3461         PR c++/34486
3462          * name-lookup.c (do_class_using_decl): Do not call constructor_name_p
3463         on non-IS_AGGR_TYPE scope.
3464         (constructor_name_p): Assert IS_AGGR_TYPE.
3465
3466 2008-01-18  Ian Lance Taylor  <iant@google.com>
3467
3468         PR c++/33407
3469         * decl.c (duplicate_decls): Copy DECL_IS_OPERATOR_NEW flag.
3470         (grok_op_properties): For NEW_EXPR and VEC_NEW_EXPR set
3471         DECL_IS_OPERATOR_NEW flag.
3472
3473 2008-01-16  Richard Guenther  <rguenther@suse.de>
3474
3475         PR c++/33819
3476         * typeck.c (is_bitfield_expr_with_lowered_type): Recurse
3477         for conversions to type variants.
3478
3479 2008-01-15  Andreas Tobler  <a.tobler@schweiz.org>
3480
3481         * parser.c (cp_parser_template_parameter): Fix C90 issue with mixing
3482         declaration and code.  Update copyright year.
3483
3484 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3485
3486         PR c++/34399
3487         * friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we
3488         know we have a class type.
3489
3490 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3491
3492         PR c++/34751
3493         * pt.c (coerce_template_parameter_pack): When substituting into
3494         the type of a non-type template parameter pack. use the
3495         deduced/substituted arguments.
3496         * parser.c (declarator_can_be_parameter_pack): A pointer-to-member
3497         can be a parameter pack with the ellipsis following it.  When we
3498         have an erroneous declaration, allow it to be a parameter pack.
3499         (cp_parser_template_parameter): Complain about default
3500         arguments on non-type template parameter packs, and parse them
3501         using the new cp_parser_default_argument.
3502         (cp_parser_parameter_declaration): Complain about parameter packs
3503         with default arguments. Move parsing of default arguments into a
3504         new function, cp_parser_default_argument.
3505         (cp_parser_default_argument): New; extracted from
3506         cp_parser_parameter_declaration.
3507
3508 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3509
3510         PR c++/34051
3511         PR c++/34055
3512         PR c++/34102
3513         PR c++/34103
3514         * typeck.c (check_return_expr): If there are bare parameter packs
3515         in the return value, set it to error_mark_node.
3516         * tree.c (cp_walk_subtrees): Walk USING_DECL nodes.
3517         * pt.c (find_parameter_packs_r): Look at the type of
3518         IDENTIFIER_NODEs (e.g., for user-defined conversions).
3519         (check_for_bare_parameter_packs): Flip the result: now returns
3520         TRUE when there were bare parameter packs, FALSE otherwise.
3521         (push_template_decl_real): Deal with flipped result of
3522         check_for_bare_parameter_packs.
3523         * semantics.c (finish_cond): If there are bare parameter packs in
3524         the conditional, set it to error_mark_node.
3525         (finish_expr_stmt): If there are bare parameter packs in the
3526         expression, set it to error_mark_node.
3527         (finish_for_expr): Ditto.
3528         (finish_switch_cond): If there are bare parameter packs in
3529         the conditional, set it to error_mark_node.
3530         (finish_mem_initializers): If there are bare parameter packs in
3531         the member initializer, set it to error_mark_node.
3532         (finish_member_declaration): Check the attributes of the
3533         declaration for bare parameter packs, and remove the attributes if
3534         any have bare parameter packs.
3535         * parser.c (cp_parser_using_declaration): Check the using
3536         declaration for bare parameter packs.
3537         (cp_parser_base_clause): If there are bare parameter packs in a
3538         base specifier, don't add it to the chain.
3539
3540 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3541
3542         PR c++/34314
3543         * error.c (dump_simple_decl): Display ellipsis for template
3544         non-type parameter packs.
3545         (dump_decl): Display ellipsis for template type parameter packs.
3546         (dump_template_decl): Display ellipsis for template template
3547         parameter packs.
3548         * pt.c (redeclare_class_template): When redeclaring a class
3549         template, check for collisions between template parameters and
3550         template parameter packs.
3551
3552 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3553
3554         PR c++/33964
3555         * pt.c (process_partial_specialization): Don't mark template
3556         parameters that occur in non-deduced contexts.
3557         (struct pair_fn_data): Add include_nondeduced_p.
3558         (for_each_template_parm_r): Only visit non-deduced contexts if
3559         include_nondeduced_p is set.
3560         (for_each_template_parm): Added parameter include_nondeduced_p,
3561         which states whether template parameters found in non-deduced
3562         contexts should be visited.
3563         (uses_template_parms): Visit all template parameters, even those
3564         in non-deduced contexts.
3565
3566 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3567
3568         PR c++/34052
3569         * pt.c (check_default_tmpl_args): Check for parameter packs that
3570         aren't at the end of a primary template.
3571         (push_template_decl_real): Remove check for parameter packs that
3572         aren't at the end of a primary template; that now happens in
3573         check_default_tmpl_args.
3574         * semantics.c (finish_template_template_parm): Use
3575         check_default_tmpl_args to check for errors in the template
3576         parameter list.
3577
3578 2008-01-12  Doug Kwan  <dougkwan@google.com>
3579
3580         * decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers
3581         instead of OPT_Wreturn_type in warning due to ignored return type
3582         qualifiers.
3583         * pt.c: (tsubst_function_type): Use OPT_Wignored_qualifiers
3584         instead of OPT_Wreturn_type in warning due to ignored return type
3585         qualifiers.
3586
3587 2008-01-08  Jakub Jelinek  <jakub@redhat.com>
3588
3589         PR c++/33890
3590         * semantics.c (finish_omp_for): Don't call
3591         fold_build_cleanup_point_expr if processing_template_decl.
3592
3593 2008-01-04  Paolo Carlini  <pcarlini@suse.de>
3594             Jakub Jelinek  <jakub@redhat.com>
3595
3596         PR c++/34611
3597         * error.c (dump_template_argument): Deal with TREE_LIST.
3598
3599 2008-01-01  Douglas Gregor  <doug.gregor@gmail.com>
3600
3601         * parser.c (cp_parser_check_decl_spec): Don't warn about "long
3602         long" in C++0x mode; change the warning to note that "long long"
3603         is only unsupported in C++98 mode.
3604
3605 2007-12-20  Jason Merrill  <jason@redhat.com>
3606
3607         PR c++/34111
3608         * call.c (standard_conversion): Derived-to-base is considered a
3609         standard conversion.
3610
3611 2007-12-19  Jakub Jelinek  <jakub@redhat.com>
3612
3613         PR c++/34513
3614         * parser.c (cp_parser_omp_parallel): For non-combined parallel
3615         call cp_parser_statement rather than
3616         cp_parser_already_scoped_statement.
3617
3618 2007-12-18  Jason Merrill  <jason@redhat.com>
3619
3620         PR c++/34206
3621         * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't
3622         use template parms.
3623         (dependent_type_p_r): Handle the domain of an array.
3624
3625 2007-12-18  Douglas Gregor  <doug.gregor@gmail.com>
3626              Jakub Jelinek  <jakub@redhat.com>
3627
3628         PR c++/32565
3629         PR c++/33943
3630         PR c++/33965
3631         * pt.c (template_template_parm_bindings_ok_p): New; verifies
3632         bindings of template template parameters after all template
3633         arguments have been deduced.
3634         (coerce_template_parms): Don't complain when COMPLAIN doesn't
3635         include tf_error.
3636         (fn_type_unification): Use template_template_parm_bindings_ok_p.
3637         (unify): Deal with variadic, bound template template parameters.
3638         (get_class_bindings): Use template_template_parm_bindings_ok_p.
3639
3640 2007-12-18  Jakub Jelinek  <jakub@redhat.com>
3641
3642         PR c++/34488
3643         * decl.c (grokdeclarator): Reject friend sfk_constructor
3644         FUNCTION_TYPE.
3645
3646 2007-12-17  Jakub Jelinek  <jakub@redhat.com>
3647
3648         PR c/34506
3649         * parser.c (cp_parser_omp_all_clauses): Accept optional comma
3650         in between clauses.
3651
3652 2007-12-15  Alexandre Oliva  <aoliva@redhat.com>
3653
3654         PR debug/7081
3655         * cp-lang.c (cp_classify_record): New.
3656         (LANG_HOOKS_CLASSIFY_RECORD): Override.
3657
3658 2007-12-11  Jakub Jelinek  <jakub@redhat.com>
3659
3660         PR c++/34238
3661         * decl2.c (cp_write_global_declarations): Revert 2007-11-22 change.
3662
3663         PR c++/34364
3664         * rtti.c (build_dynamic_cast): Call convert_from_reference even for
3665         dynamic_cast in a template.
3666
3667 2007-12-10  Simon Martin  <simartin@users.sourceforge.net>
3668
3669         PR c++/34059
3670         * typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from
3671         MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO.
3672
3673 2007-12-10  Jakub Jelinek  <jakub@redhat.com>
3674
3675         PR c++/34395
3676         * error.c (dump_type_prefix, dump_type_suffix): Handle
3677         TYPE_PACK_EXPANSION.
3678
3679         PR c++/34394
3680         * error.c (dump_expr): Handle ABS_EXPR.
3681
3682 2007-12-09  Jakub Jelinek  <jakub@redhat.com>
3683
3684         PR c++/34178
3685         PR c++/34340
3686         * repo.c (repo_emit_p): Return 2 for DECL_INTEGRAL_CONSTANT_VAR_P
3687         in class scope rather than DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3688         Return 2 also if DECL_EXPLICIT_INSTANTIATION.
3689         * decl2.c (import_export_decl): Don't make VAR_DECLs import_p when
3690         flag_use_repository and repo_emit_p returned 2.
3691
3692 2007-12-06  Jakub Jelinek  <jakub@redhat.com>
3693
3694         PR c++/34336
3695         * tree.c (stabilize_call, stabilize_init): Do nothing if
3696         processing_template_decl.
3697
3698 2007-12-05  Jakub Jelinek  <jakub@redhat.com>
3699
3700         PR c++/34271
3701         * semantics.c (finish_decltype_type): For SCOPE_REF issue an
3702         error instead of assertion failure.
3703         * parser.c (cp_parser_decltype): If closing paren is not found,
3704         return error_mark_node.
3705
3706 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
3707
3708         PR c++/34101
3709         * name-lookup.c (arg_assoc_template_arg): Recurse on argument
3710         packs.
3711         (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
3712         since arg_assoc_template_arg will deal with them (better).
3713
3714 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
3715
3716         PR c++/33509
3717         * pt.c (tsubst_exception_specification): Handle substitutions into
3718         member templates, where tsubst_pack_expansion returns a
3719         TYPE_PACK_EXPANSION.
3720
3721 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
3722
3723         PR c++/33091
3724         * pt.c (unify_pack_expansion): If we didn't deduce any actual
3725         bindings for the template parameter pack, don't try to keep the
3726         empty deduced arguments.
3727         (unify): If a parameter is a template-id whose template argument
3728         list contains a pack expansion that is not at the end, then we
3729         cannot unify against that template-id.
3730
3731 2007-12-02  Paolo Carlini  <pcarlini@suse.de>
3732
3733          PR c++/34061
3734          * pt.c (current_template_args): Use error_operand_p.
3735
3736 2007-12-02  Paolo Carlini  <pcarlini@suse.de>
3737
3738          PR c++/34273
3739          * error.c (dump_decl): Handle TREE_BINFO.
3740
3741 2007-12-01  Ollie Wild  <aaw@google.com>
3742
3743         PR c++/8171
3744         * typeck.c (build_binary_op): Add conversion of pointers to function
3745         members appearing as operands to the equality operators.
3746
3747 2007-11-30  Jakub Jelinek  <jakub@redhat.com>
3748
3749         PR c++/34275
3750         * error.c (dump_expr): Handle OBJ_TYPE_REF.
3751
3752 2007-11-29  Jakub Jelinek  <jakub@redhat.com>
3753
3754         PR c++/34270
3755         * tree.c (lvalue_p_1) <case COND_EXPR>: Handle x ?: y
3756         in templates.
3757         * typeck.c (is_bitfield_expr_with_lowered_type) <case COND_EXPR>:
3758         Likewise.
3759
3760         PR c++/34267
3761         PR c++/34268
3762         * parser.c (cp_parser_decltype): Don't call finish_id_expression
3763         on ~type.
3764         * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs
3765         and ~type early.
3766
3767 2007-11-27  Jakub Jelinek  <jakub@redhat.com>
3768
3769         PR tree-optimization/34181
3770         * method.c (use_thunk): Don't inline the call in the thunk.
3771
3772         PR c++/34213
3773         * tree.c (decl_linkage): Static data members and static member
3774         functions in anonymous ns classes are lk_external.
3775
3776 2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>
3777
3778         PR c++/34081
3779         * decl.c (start_preparsed_function): Pass
3780         processing_template_decl for the new allocate_struct_function
3781         parameter.
3782
3783 2007-11-25  Richard Guenther  <rguenther@suse.de>
3784
3785         * decl.c (poplevel): Use BLOCK_CHAIN.
3786
3787 2007-11-24  Ollie Wild  <aaw@google.com>
3788
3789         * typeck.c (delta_from_ptrmemfunc): New function.
3790         (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc.
3791         (build_binary_op): Call delta_from_ptrmemfunc.
3792
3793 2007-11-23  Jakub Jelinek  <jakub@redhat.com>
3794
3795         PR c++/30293
3796         PR c++/30294
3797         * decl.c (cp_finish_decl): Disallow variable or field
3798         definitions if extern "Java" aggregates.
3799         (grokparms): Disallow parameters with extern "Java"
3800         aggregates.
3801         (check_function_type): Disallow function return values
3802         with extern "Java" aggregates.
3803         * init.c (build_new_1): Disallow placement new with
3804         extern "Java" aggregates.
3805
3806 2007-11-23  Mark Mitchell  <mark@codesourcery.com>
3807             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3808
3809         PR c++/5310
3810         * call.c (convert_like_real): Build a zero constant when __null is
3811         converted to an integer type.
3812
3813 2007-11-22  Jakub Jelinek  <jakub@redhat.com>
3814
3815         PR c++/34094
3816         * decl2.c (cp_write_global_declarations): Issue error about static
3817         data members in anonymous namespace which are declared and used,
3818         but not defined.
3819
3820 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
3821
3822         PR c++/34089
3823         * parser.c (cp_parser_class_head): Reject function template ids.
3824
3825         PR c++/28879
3826         * tree.c (build_cplus_array_type_1): Don't pass any VLA types
3827         when processing_template_decl to build_array_type.
3828
3829         PR c++/33962
3830         * pt.c (more_specialized_fn): Don't segfault if one or
3831         both argument list end with ellipsis.
3832
3833 2007-11-18  Jakub Jelinek  <jakub@redhat.com>
3834
3835         PR c++/30988
3836         * semantics.c (finish_call_expr): Set
3837         current_function_returns_abnormally if fn is noreturn FUNCTION_DECL
3838         or OVERLOAD with all noreturn functions.
3839
3840 2007-11-16  Jakub Jelinek  <jakub@redhat.com>
3841
3842         PR c++/34100
3843         * pt.c (apply_late_template_attributes): Do nothing if decl's type is
3844         error_mark_node.
3845
3846 2007-11-13  Jakub Jelinek  <jakub@redhat.com>
3847
3848         PR c++/34054
3849         PR c++/34056
3850         PR c++/34057
3851         PR c++/34058
3852         PR c++/34060
3853         * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error,
3854         set to error_mark_node the outermost POINTER_TYPE to the pack if
3855         it is seen in a POINTER_TYPE.
3856         (push_template_decl_real): If check_for_bare_parameter_packs
3857         fails for function return type, set the return type to
3858         integer_type_node.  If check_for_bare_parameter_packs failed
3859         for non-function, return error_mark_node.
3860
3861         PR c++/29225
3862         * call.c (build_new_op): Call resolve_args before calling
3863         build_over_call.
3864
3865 2007-11-11  Tom Tromey  <tromey@redhat.com>
3866
3867         PR c++/17577:
3868         * lex.c (handle_pragma_implementation): Use cpp_included_before.
3869
3870 2007-11-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3871
3872         PR c++/8570
3873         * pt.c (redeclare_class_template): Update error message. Use a
3874         note to show the previous declaration.
3875         (tsubst_friend_class): Use the location of the friend template as
3876         the input location before calling redeclare_class_template.
3877
3878 2007-11-11  Jakub Jelinek  <jakub@redhat.com>
3879
3880         PR c++/34068
3881         * semantics.c (finish_pseudo_destructor_expr): Handle
3882         object == error_mark_node.
3883
3884 2007-11-10  Jakub Jelinek  <jakub@redhat.com>
3885
3886         PR c++/32241
3887         * pt.c (tsubst_copy_and_build) <case COMPONENT_REF>: If object_type
3888         is not scalar type, let finish_class_member_access_expr handle
3889         diagnostics.  Pass BIT_NOT_EXPR argument to
3890         finish_pseudo_destructor_expr.  Handle SCOPE_REF properly.
3891
3892 2007-11-09  Douglas Gregor  <doug.gregor@gmail.com>
3893
3894         PR c++/33510
3895         * decl.c (cp_complete_array_type): If any of the initializer
3896         elements are pack expansions, don't compute the array size yet.
3897
3898 2007-11-08  Andrew Pinski  <pinskia@gmail.com>
3899
3900         PR c++/30297:
3901         * tree.c (decl_linkage): Fields have no linkage.
3902
3903 2007-11-08  Daniel Jacobowitz  <dan@codesourcery.com>
3904
3905         * class.c (build_ctor_vtbl_group): Lay out the new type and decl.
3906
3907 2007-11-07  Douglas Gregor  <doug.gregor@gmail.com>
3908
3909         PR c++/33045
3910         PR c++/33837
3911         PR c++/33838
3912         * semantics.c (finish_decltype_type): See through INDIRECT_REFs.
3913         Be careful with ERROR_MARK_NODEs.
3914         * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL
3915         argument.
3916
3917 2007-11-07  Jakub Jelinek  <jakub@redhat.com>
3918
3919         PR c++/33501
3920         * call.c (build_over_call): Don't check TREE_ADDRESSABLE
3921         on incomplete type.
3922
3923 2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>
3924
3925         PR c++/33977
3926         PR c++/33886
3927         * tree.c (c_build_qualified_type): Define bridge to
3928         cp_build_qualified_type.
3929
3930 2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>
3931
3932         PR c++/31439
3933         PR c++/32114
3934         PR c++/32115
3935         PR c++/32125
3936         PR c++/32126
3937         PR c++/32127
3938         PR c++/32128
3939         PR c++/32253
3940         PR c++/32566
3941         * typeck.c (check_return_expr): Pass address of retval to
3942         check_for_bare_parameter_packs.
3943         * class.c (build_base_field): Tolerate bases that have no layout
3944         due to errors.
3945         (end_of_base): Ditto.
3946         * tree.c (canonical_type_variant): Be careful with
3947         ERROR_MARK_NODE.
3948         * cp-tree.h (check_for_bare_parameter_packs): Now accepts a
3949         tree*.
3950         * pt.c (find_parameter_pack_data): Add set_packs_to_error field,
3951         which states whether parameter packs should be replaced with
3952         ERROR_MARK_NODE.
3953         (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever
3954         possible. If set_packs_to_error is set true, replace the parameter
3955         pack with ERROR_MARK_NODE. Manage our own pointer sets.
3956         (uses_parameter_packs): Don't set parameter packs to
3957         ERROR_MARK_NODE.
3958         (check_for_bare_parameter_packs): Now takes a pointer to a tree,
3959         which may be modified (if it is a parameter pack). Instructs
3960         find_parameter_packs_r to replace parameter packs with
3961         ERROR_MARK_NODE (so that they won't cause errors later on).
3962         (process_template_parm): Pass pointer to
3963         check_for_bare_parameter_packs.
3964         (process_partial_specialization): Replace pack expansions before
3965         the end of the template argument list with ERROR_MARK_NODE.
3966         (push_template_decl_real): Pass pointer to
3967         check_for_bare_parameter_packs. Replace parameter packs not at the
3968         end of the template parameter list with ERROR_MARK_NODE.
3969         (convert_template_argument): Be more careful about using DECL_NAME
3970         on only declarations.
3971         (unify): Can't unify against ERROR_MARK_NODE.
3972         * semantics.c (finish_cond): Pass pointer to
3973         check_for_bare_parameter_packs.
3974         (finish_expr_stmt): Ditto.
3975         (finish_for_expr): Ditto.
3976         (finish_switch_cond): Pass pointer to
3977         check_for_bare_parameter_packs, and call it before we put the
3978         condition into the statement.
3979         (finish_mem_initializers): Pass pointer to
3980         check_for_bare_parameter_packs.
3981         (finish_member_declaration): Ditto.
3982         * parser.c (cp_parser_base_clause): Ditto.
3983
3984 2007-11-06  Jakub Jelinek  <jakub@redhat.com>
3985
3986         PR target/33168
3987         * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already
3988         with the final TREE_READONLY flag in place.  processing_template_decl
3989         is known to be 0 in this part of function.
3990
3991         PR c++/33894
3992         * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not
3993         OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC.
3994         * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P.
3995         * semantics.c (finish_omp_atomic): Revert most of the
3996         2007-02-05 changes, just keep the new representation of
3997         OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC.
3998
3999 2007-11-05  H.J. Lu  <hongjiu.lu@intel.com>
4000
4001         PR c++/33871
4002         * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked
4003         local.
4004
4005 2007-11-05  Douglas Gregor  <doug.gregor@gmail.com>
4006
4007         PR c++/33996
4008         PR c++/33235
4009         PR c++/33930
4010         * typeck.c (merge_types): Don't lose rvalue references when
4011         merging types.
4012         * call.c (build_over_call): Don't elide move constructors just
4013         because the copy constructor is trivial (!).
4014         (compare_ics): If comparing cv-qualifiers fails, we can still order
4015         based on binding lvalues vs. rvalues.
4016
4017 2007-11-05  Douglas Gregor  <doug.gregor@gmail.com>
4018
4019         PR c++/33939
4020         * pt.c (unify_pack_expansion): bring handling of function call
4021         arguments into line with type_unification_real.
4022
4023 2007-11-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
4024
4025         * typeck.c (build_binary_op): Use pedwarn instead of error for
4026         consistency.
4027
4028 2007-11-05  Jakub Jelinek  <jakub@redhat.com>
4029
4030         PR c++/33836
4031         * parser.c (cp_parser_unary_expression): For &&label call
4032         cp_parser_non_integral_constant_expression and return error_mark_node
4033         if it returned true.
4034
4035         PR c++/33969
4036         * decl.c (grokdeclarator): Don't call build_memfn_type if type
4037         is neither FUNCTION_TYPE nor METHOD_TYPE.
4038
4039 2007-11-02  Jakub Jelinek  <jakub@redhat.com>
4040
4041         PR c++/33516
4042         * parser.c (cp_parser_nested_name_specifier_opt): Use
4043         TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete
4044         typedef of currently open class.
4045
4046 2007-11-02  Paolo Carlini  <pcarlini@suse.de>
4047
4048         PR c++/33495
4049         * error.c (dump_expr): Deal specially with statements.
4050
4051 2007-11-01  Jason Merrill  <jason@redhat.com>
4052
4053         PR c++/30897
4054         * pt.c (push_template_decl_real): Set DECL_CONTEXT on template
4055         template parms.
4056         (lookup_template_class): Use it to get the outer template args
4057         for instantiating one.
4058
4059         PR c++/29236
4060         * pt.c (reduce_template_parm_level): tsubst the parameters
4061         of a template template parm.
4062
4063 2007-11-01  Douglas Gregor  <doug.gregor@gmail.com>
4064
4065         PR c++/33955
4066         * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
4067
4068 2007-11-01  Jakub Jelinek  <jakub@redhat.com>
4069
4070         PR c++/32384
4071         * parser.c (cp_parser_postfix_dot_deref_expression): If
4072         POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor
4073         first and if that succeeds and type is SCALAR_TYPE_P, create
4074         PSEUDO_DTOR_EXPR.
4075
4076         PR c++/32260
4077         * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment.
4078         (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo
4079         as for std::type_info.
4080
4081 2007-10-31  Paolo Carlini  <pcarlini@suse.de>
4082
4083         PR c++/33494
4084         * cxx-pretty-print.c (pp_cxx_typeid_expression,
4085         pp_cxx_delete_expression): Change to static linkage.
4086         * cxx-pretty-print.h: Adjust declarations.
4087         * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
4088         MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
4089         MODOP_EXPR): Forward to pp_expression.
4090
4091         * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
4092         Fix typo.
4093
4094 2007-10-31 Christian Bruel  <christian.bruel@st.com>
4095             Mark Mitchell  <mark@codesourcery.com>
4096
4097         PR c++/19531
4098         * typeck.c (check_return_expr): Don't set named_return_value_okay_p
4099         if retval is volatile.
4100
4101 2007-10-30  Jakub Jelinek  <jakub@redhat.com>
4102
4103         PR c++/33616
4104         * decl2.c (build_offset_ref_call_from_tree): Call
4105         build_non_dependent_expr on object prior to building ADDR_EXPR from it
4106         if FN is DOTSTAR_EXPR.
4107
4108 2007-10-30  Douglas Gregor  <doug.gregor@gmail.com>
4109
4110         PR c++/31993
4111         PR c++/32252
4112         * pt.c (find_parameter_packs_r): Fix typo in comment.
4113         (convert_template_argument): Look at the pattern of a pack
4114         expansion to determine what kind of entity we're converting.
4115         (coerce_template_parameter_pack): When we have coerced a non-type
4116         template parameter pack, substitute into the type of that pack.
4117         (tsubst_pack_expansion): When our substitution of a parameter pack
4118         is a "trivial" substitution of itself, just substitute into the
4119         pack expansion rather than actually expanding.
4120
4121 2007-10-29  Jakub Jelinek  <jakub@redhat.com>
4122
4123         PR c++/33841
4124         * class.c (check_bitfield_decl): Don't set field's type to error_mark_node
4125         for non-integral type bitfields.  Return true if bitfield is correct, false
4126         error has been diagnosed.
4127         (check_field_decls): If check_bitfield_decl returned false, call also
4128         check_field_decl.
4129
4130 2007-10-28  Paolo Carlini  <pcarlini@suse.de>
4131             Mark Mitchell  <mark@codesourcery.com>
4132
4133         PR c++/30659
4134         * pt.c (do_decl_instantiation): If the VAR_DECL is not a
4135         class member error out and return.
4136
4137 2007-10-27  Jakub Jelinek  <jakub@redhat.com>
4138
4139         * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
4140         to current_function_decl rather than 0.
4141
4142         PR c++/33844
4143         * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
4144         ->* rather than .*.
4145         * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
4146
4147 2007-10-27  Jason Merrill  <jason@redhat.com>
4148
4149         PR c++/5247
4150         * call.c (convert_default_arg): Detect recursion.
4151
4152 2007-10-27  Jakub Jelinek  <jakub@redhat.com>
4153
4154         PR c++/33842
4155         * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
4156         * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
4157         OFFSETOF_EXPR.
4158         (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
4159         functions.
4160         * error.c (dump_expr): Handle OFFSETOF_EXPR.
4161
4162 2007-10-26  Jason Merrill  <jason@redhat.com>
4163
4164         PR c++/24791
4165         * pt.c (get_template_info): New fn.
4166         (template_class_depth): Use it.
4167         (push_template_decl_real): Check that the template args of the
4168         definition match the args of the previous declaration.
4169
4170 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
4171
4172         PR c++/31988
4173         * decl2.c (coerce_new_type): Do not allow a default argument for
4174         the first parameter.
4175
4176 2007-10-26  Douglas Gregor  <doug.gregor@gmail.com>
4177
4178         PR c++/33839
4179         * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
4180         don't see the leading '('. Only lookup names if we get an
4181         IDENTIFIER_NODE.
4182
4183 2007-10-26  Jakub Jelinek  <jakub@redhat.com>
4184
4185         PR c++/33744
4186         * parser.c (cp_parser_parenthesized_expression_list): Set
4187         greater_than_is_operator_p to true in between the parens.
4188
4189 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
4190
4191         PR c++/31747
4192         * decl.c (grokdeclarator): In case of conflicting specifiers
4193         just return error_mark_node.
4194
4195 2007-10-26  Ollie Wild  <aaw@google.com>
4196
4197         * expr.c (cxx_expand_expr): Removed.
4198         * cp-tree.h (exx_expand_expr): Removed.
4199         * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
4200         with c_expand_expr.
4201
4202 2007-10-25  Paolo Carlini  <pcarlini@suse.de>
4203
4204         PR c++/33843
4205         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
4206
4207 2007-10-23  Jason Merrill  <jason@redhat.com>
4208
4209         PR c++/25950 (DR 391)
4210         * call.c (struct conversion): Remove check_copy_constructor_p.
4211         (reference_binding): Always bind a reference directly to a
4212         compatible class rvalue.  Pass down LOOKUP_NO_TEMP_BIND during
4213         temporary creation.
4214         (check_constructor_callable): Remove.
4215         (convert_like_real): Don't call it.
4216         (initialize_reference): Don't call check_constructor_callable.
4217         (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
4218         LOOKUP_CONSTRUCTOR_CALLABLE.  Don't require a temporary for base
4219         conversions if LOOKUP_NO_TEMP_BIND.
4220         (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
4221         (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
4222         second conversion.
4223         * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
4224
4225 2007-10-22  Jakub Jelinek  <jakub@redhat.com>
4226
4227         PR c++/33372
4228         * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
4229         before checking if its type is integral.
4230
4231 2007-10-22  Jason Merrill  <jason@redhat.com>
4232
4233         PR c++/33620
4234         * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
4235         * pt.c (apply_late_template_attributes): Splice out dependent
4236         attributes from DECL_ATTRIBUTES.
4237
4238         * decl.c (cxx_maybe_build_cleanup): Use build_address.
4239
4240 2007-10-17  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
4241
4242         * typeck.c (build_binary_op) : Use appropriate warning option
4243         instead of unnamed warning.
4244
4245 2007-10-16  Paolo Carlini  <pcarlini@suse.de>
4246
4247         PR c++/31446
4248         * pt.c (current_template_args): Do not change TREE_LIST elements
4249         with a TREE_VALUE of error_mark_node.
4250
4251 2007-10-16  Mark Mitchell  <mark@codesourcery.com>
4252
4253         * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
4254         * decl.c (start_decl): Tidy.
4255         (start_decl_1): Call cp_apply_type_quals_to_decl after completing
4256         the type.
4257         (grokdeclarator): Clarify comment.
4258
4259 2007-10-14  Andrew Pinski  <pinskia@gmail.com>
4260
4261         PR c++/30303
4262         * decl.c (grokfndecl): Return NULL after the "definition of
4263         implicitly-declared" error happened.
4264
4265 2007-10-12  Simon Martin  <simartin@users.sourceforge.net>
4266
4267         PR c++/26698
4268         * call.c (build_user_type_conversion_1): Do not consider conversion
4269         functions to convert a (possibly cv-qualified) object to the (possibly
4270         cv-qualified) same object type (or a reference to it), to a (possibly
4271         cv-qualified) base class of that type (or a reference to it).
4272
4273 2007-10-12  Paolo Carlini  <pcarlini@suse.de>
4274
4275         * pt.c (tsubst): Use template_parm_level_and_index.
4276
4277 2007-10-12  Jakub Jelinek  <jakub@redhat.com>
4278
4279         PR c++/32121
4280         * parser.c (cp_parser_compound_statement): Handle label-declarations
4281         at the beginning of the compound statement.
4282         (cp_parser_block_declaration): Issue diagnostics about __label__
4283         not at the beginning of a block.
4284
4285 2007-10-11  Paolo Carlini  <pcarlini@suse.de>
4286
4287         PR c++/33461
4288         * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
4289         to convert_template_argument.
4290         (coerce_template_parms): Return error_mark_node after fixed-length
4291         error.
4292         (tsubst_decl): Check for error_mark_node the return value of the
4293         first tsubst in 'case VAR_DECL'.
4294
4295 2007-10-08  Ollie Wild  <aaw@google.com>
4296
4297         * typeck2.c (digest_init): Call cplus_expand_constant after
4298         convert_for_initialization.
4299         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
4300         * expr.c (cplus_expand_constant): Updated function description.
4301
4302 2007-10-04  Jason Merrill  <jason@redhat.com>
4303
4304         PR c++/20416
4305         * call.c (initialize_reference): Handle local static reference
4306         temps properly.
4307
4308 2007-10-03  Jason Merrill  <jason@redhat.com>
4309
4310         PR c++/32470
4311         * name-lookup.c (push_namespace_with_attrs): Fold back into...
4312         (push_namespace): Here.
4313         (handle_namespace_attrs): New fn for the attr code.
4314         (leave_scope): Don't pop_visibility.
4315         * name-lookup.h (struct cp_binding_level): Remove has_visibility.
4316         * parser.c (cp_parser_namespace_definition): Call
4317         handle_namespace_attrs and pop_visibility as appropriate.
4318
4319         PR c++/11756
4320         * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
4321
4322 2007-10-03  Alexandre Oliva  <aoliva@redhat.com>
4323
4324         * decl.c (duplicate_decls): Preserve linkage flags for mere
4325         redeclarations of gnu_inline definitions.
4326
4327 2007-10-03  Jason Merrill  <jason@redhat.com>
4328
4329         PR c++/15764
4330         * decl.c (wrap_cleanups_r): New fn.
4331         (wrap_temporary_cleanups): New fn.
4332         (initialize_local_var): Call it.
4333
4334 2007-09-29  Jason Merrill  <jason@redhat.com>
4335
4336         PR c++/33094
4337         * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
4338         constant to not have DECL_EXTERNAL if it's file-local.
4339
4340 2007-09-28  Ollie Wild  <aaw@google.com>
4341
4342         Revert
4343         2007-09-27  Ollie Wild  <aaw@google.com>
4344
4345         * typeck2.c (digest_init): Call cplus_expand_constant after
4346         convert_for_initialization.
4347         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
4348         * expr.c (cplus_expand_constant): Updated function description.
4349
4350 2007-09-28  Jason Merrill  <jason@redhat.com>
4351
4352         PR c++/10179
4353         * class.c (layout_empty_base): Take rli parameter, update
4354         rli->record_align if empty base has user-specified alignment.
4355         (build_base_field): Pass rli to it.
4356
4357 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
4358
4359         PR c++/33213
4360         * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
4361
4362 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
4363
4364         PR c++/33118
4365         * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
4366         (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
4367         (dump_parameters): Just call dump_type for argument packs too.
4368
4369 2007-09-28  Jakub Jelinek  <jakub@redhat.com>
4370
4371         PR c++/31434
4372         * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
4373         qualification by creating qualified PACK_EXPANSION_PATTERN and
4374         then calling make_pack_expansion on it.
4375
4376 2007-09-27  Ollie Wild  <aaw@google.com>
4377
4378         * typeck2.c (digest_init): Call cplus_expand_constant after
4379         convert_for_initialization.
4380         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
4381         * expr.c (cplus_expand_constant): Updated function description.
4382
4383 2007-09-27  Jason Merrill  <jason@redhat.com>
4384
4385         PR c++/33571
4386         * decl2.c (is_late_template_attribute): Don't crash on unknown
4387         attribute.
4388
4389 2007-09-27  Paolo Carlini  <pcarlini@suse.de>
4390
4391         PR c++/33493
4392         * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
4393         * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
4394         spaces in the formatting.
4395         * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
4396
4397 2007-09-27  Jakub Jelinek  <jakub@redhat.com>
4398
4399         * error.c (cxx_print_error_function): Add third argument, pass
4400         it over to lhd_print_error_function.
4401         (cp_print_error_function): If diagnostic->abstract_origin, print
4402         virtual backtrace.
4403         * cp-tree.h (struct diagnostic_info): New forward decl.
4404         (cxx_print_error_function): Add third argument.
4405
4406 2007-09-25  Simon Martin  <simartin@users.sourceforge.net>
4407
4408         PR c++/33207
4409         * name-lookup.c (pushtag): Do not create an implicit typedef before
4410         the associated type declaration is known to be valid.
4411
4412 2007-09-25  Jakub Jelinek  <jakub@redhat.com>
4413
4414         * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
4415         rather than pointers.
4416
4417 2007-09-24  Danny Smith  <dannysmith@user.sourceforge.net>
4418
4419         PR c++/14688
4420          * search.c (check_final_overrider): Fail if
4421         targetm.comp_type_attributes returns 0.
4422
4423 2007-09-24  Jason Merrill  <jason@redhat.com>
4424
4425         PR c++/33239
4426         * pt.c (resolve_typename_type): Don't look things up in the original
4427         template if it would mean losing template arguments.
4428
4429 2007-09-24  Jakub Jelinek  <jakub@redhat.com>
4430
4431         PR c++/33506
4432         * cp-tree.h (cxx_type_hash_eq): New prototype.
4433         * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
4434         * tree.c (cxx_type_hash_eq): New function.
4435
4436 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
4437
4438         PR c++/33185
4439         * tree.c (cp_build_qualified_type_real): Build a canonical
4440         ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
4441
4442 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
4443
4444         PR c++/33112
4445         PR c++/33185
4446         * tree.c (cplus_array_compare): Compare pointers, not types.
4447         (build_cplus_array_type_1): Store new array type into the hash
4448         table before building the canonical type; build the canonical type
4449         correctly.
4450         (cp_build_qualified_type_real): Put all of the array types with
4451         cv-qualified element types into the C++ array hash table, built as
4452         variants of the unqualified versions.
4453
4454 2007-09-23  Jason Merrill  <jason@redhat.com>
4455
4456         PR c++/16370
4457         * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
4458         for deprecation warnings.
4459
4460 2007-09-22  Jason Merrill  <jason@redhat.com>
4461
4462         PR c++/15269
4463         * call.c (build_over_call): Warn about deprecated virtuals.
4464
4465         PR c++/19407
4466         * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
4467         (MAYBE_TAGGED_TYPE_P): Remove.
4468         * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
4469         instead of calling is_late_template_attribute again.
4470         (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
4471         (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
4472         Don't crash on typedefs from non-template classes.
4473         * decl2.c (grokfield): Don't sorry about attrs on template parms.
4474         (is_late_template_attribute): All attributes applied to template
4475         parms or typename types are dependent.  Static.
4476         (splice_template_attributes): Pass decl through.
4477         (save_template_attributes): Likewise.
4478
4479 2007-09-20  Jakub Jelinek  <jakub@redhat.com>
4480
4481         PR c++/33496
4482         * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
4483         returned from tsubst_pack_expansion.
4484         (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
4485         (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
4486
4487 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
4488
4489         PR c++/33460
4490         * semantics.c (finish_id_expression): Use consistently
4491         context_for_name_lookup.
4492         * decl.c (fixup_anonymous_aggr): Fix error message for
4493         anonymous struct (vs union).
4494
4495 2007-09-19  Jason Merrill  <jason@redhat.com>
4496
4497         PR c++/7586
4498         * pt.c (tsubst): Handle typedefs by looking for the specialization.
4499         (retrieve_specialization): Only tagged types use
4500         DECL_TEMPLATE_INSTANTIATIONS.
4501         (instantiate_class_template): Push nested classes too.
4502         (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
4503         tagged types.
4504         * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
4505         * init.c (is_aggr_type): Remove redundant tests.
4506         * class.c (push_nested_class): Use CLASS_TYPE_P.
4507
4508 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
4509
4510         PR c++/33459
4511         * init.c (build_zero_init): If, recursively, build_zero_init
4512         returns a NULL_TREE, do not append it to the VEC of constructors.
4513
4514 2007-09-18  Jason Merrill  <jason@redhat.com>
4515
4516         PR c++/17743
4517         * pt.c (apply_late_template_attributes): Set processing_template_decl.
4518         (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
4519         ATTR_FLAG_TYPE_IN_PLACE.
4520         (tsubst): Do unqualified lookup to find typedefs from current class.
4521         [ARRAY_TYPE]: Propagate alignment info.
4522         * decl2.c (is_late_template_attribute): Only defer handling of
4523         attribute aligned if the expression is dependent.
4524         (save_template_attributes): If we're deferring any attributes,
4525         make this a naming typedef.
4526
4527 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
4528
4529         PR c++/33462 (again)
4530         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
4531         va_arg instead of __builtin_va_arg.
4532
4533 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
4534
4535         PR c++/33462
4536         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
4537         (pp_cxx_primary_expression): Use it.
4538         * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
4539         * error.c (dump_expr): Use it.
4540
4541 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
4542
4543         PR c++/33463
4544         * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
4545         out case TYPEID_EXPR to...
4546         (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
4547         and pp_cxx_right_paren.
4548         * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
4549         * error.c (dump_expr): Use it.
4550
4551 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
4552
4553         PR c++/33464
4554         * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
4555         (pp_cxx_primary_expression): Use it.
4556         * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
4557         * error.c (dump_expr): Use it.
4558
4559 2007-09-16  Paolo Carlini  <pcarlini@suse.de>
4560
4561         PR c++/33124
4562         * init.c (build_new): Remove warning for zero-element
4563         allocations.
4564
4565 2007-09-16  Nathan Sidwell  <nathan@codesourcery.com>
4566
4567         PR c++/32756
4568         * call.c (maybe_handle_implicit_object): Set this_p, clear
4569         rvaluedness_matches_p.
4570         (compare_ics): Do not compare rvaluedness matching when one of the
4571         operands is an implicit object.
4572
4573 2007-09-14  Jason Merrill  <jason@redhat.com>
4574
4575         PR c++/17743, c++/19163
4576         * decl2.c (is_late_template_attribute): New fn.
4577         (splice_template_attributes, save_template_attributes): New fns.
4578         (cplus_decl_attributes): Call save_template_attributes.
4579         * pt.c (apply_late_template_attributes): New fn.
4580         (instantiate_class_template, tsubst_decl): Use it.
4581         * cp-tree.h: Declare is_late_template_attribute.
4582
4583 2007-09-13  Tom Tromey  <tromey@redhat.com>
4584
4585         * parser.c (cp_lexer_new_main): Don't use
4586         c_lex_return_raw_strings.
4587         (cp_lexer_get_preprocessor_token): Update.  Add special case when
4588         lexer is NULL.
4589
4590 2007-09-11  Jan Hubicka <jh@suse.cz>
4591
4592         * method.c (use_thunk): Use tree_rest_of_compilation
4593         * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
4594         (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
4595         * cp-tree.h (expand_body): Kill.
4596         (emit_associated_thunks): Declare.
4597         * semantics.c (emit_associated_thunks): Export.
4598         (expand_body): Kill.
4599
4600 2007-09-09  David Daney  <ddaney@avtrex.com>
4601
4602         PR c++/33324
4603         * init.c (build_new_1):  Use POINTER_PLUS_EXPR instead of MINUS_EXPR
4604         to calculate cookie_ptr.
4605
4606 2007-09-08  Jason Merrill  <jason@redhat.com>
4607
4608         PR c++/33342
4609         * pt.c (most_specialized_class): Set processing_template_decl
4610         while tsubsting partial spec args.
4611
4612 2007-09-06  Jason Merrill  <jason@redhat.com>
4613
4614         * decl2.c (get_guard): Copy visibility from the guarded variable.
4615
4616 2007-09-06  Jan Hubicka  <jh@suse.cz>
4617
4618         * semantics.c (expand_body): Do not mark arguments of clones used.
4619
4620 2007-09-06  Paolo Carlini  <pcarlini@suse.de>
4621
4622         PR c++/32674
4623         * decl.c (cp_finish_decl): When processing_template_decl,
4624         deal correctly with init as TREE_LIST.
4625
4626 2007-09-06  Tom Tromey  <tromey@redhat.com>
4627
4628         * decl.c (finish_function): Put return's location on line zero of
4629         file.
4630
4631 2007-09-05  Jason Merrill  <jason@redhat.com>
4632
4633         PR c++/15745
4634         * except.c (prepare_eh_type): Use type_decays_to.
4635
4636         PR c++/15097
4637         * init.c (build_delete): Use build_headof to get the address of the
4638         complete object if we aren't using the deleting destructor.
4639         * rtti.c (build_headof): No longer static.
4640         * cp-tree.h: Declare it.
4641
4642 2007-09-06  Jakub Jelinek  <jakub@redhat.com>
4643
4644         * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
4645         decl if a prototype for XX is provided with throw().
4646
4647         PR c++/33289
4648         * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
4649         on __*_chk non-__builtin_* decls.
4650
4651 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
4652
4653         PR c++/30302
4654         * semantics.c (finish_id_expression): Use context_for_name_lookup
4655         insted of DECL_CONTEXT, to see through anonymous structs and unions.
4656         * class.c (finish_struct_anon): Deal correctly with anonymous
4657         structs (vs unions, as GNU extension) in error messages.
4658
4659 2007-09-05  Jan Hubicka  <jh@suse.cz>
4660
4661         * sematics.c (expand_body): Remove unnecesary import_export_decl
4662         call, DECL_EXTERNAL checks and current_function_decl saving.
4663
4664 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
4665
4666         PR c++/29731 (again)
4667         * parser.c (cp_parser_primary_expression): Return error_mark_node
4668         when a statement-expression is found in a template-argument list.
4669
4670 2007-09-04  Jason Merrill  <jason@redhat.com>
4671
4672         * except.c (initialize_handler_parm): Use
4673         fold_build_cleanup_point_expr.
4674
4675         PR c++/31419
4676         * call.c (reference_binding): Don't look for user-defined conversions
4677         to the same type.
4678
4679         PR c++/31411
4680         * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
4681         the MUST_NOT_THROW_EXPR.
4682
4683 2007-09-04  Richard Sandiford  <richard@codesourcery.com>
4684
4685         * decl.c (cp_finish_decl): Call determine_visibility before
4686         make_rtl_for_nonlocal_decl.
4687
4688 2007-09-04  Jason Merrill  <jason@redhat.com>
4689
4690         PR c++/14032
4691         * pt.c (most_specialized_class): Substitute outer template
4692         arguments into the arguments of a member template partial
4693         specialization.
4694         (strip_innermost_template_args): New fn.
4695
4696 2007-09-03  Daniel Jacobowitz  <dan@codesourcery.com>
4697
4698         * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
4699
4700 2007-09-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4701
4702         * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
4703         * decl.c (cp_make_fname_decl): Likewise,
4704         * parser.c (cp_parser_string_literal): Likewise,
4705         * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
4706         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
4707         Likewise,
4708
4709 2007-09-02  Paolo Carlini  <pcarlini@suse.de>
4710
4711         PR c++/33208
4712         * typeck.c (build_unary_op): Fix error message for
4713         Boolean expression as operand to operator--.
4714
4715 2007-09-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4716
4717         * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
4718         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
4719         Likewise.
4720
4721 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
4722
4723         PR c++/32597
4724         * init.c (build_default_init): Make extern.
4725         * cp-tree.h (build_default_init): Declare here.
4726         * pt.c (tsubst_expr): When the instantiation of the initializer of
4727         a variable results in an empty list, default-initialize the
4728         variable.
4729         (tsubst_copy_and_build): When the instantiation of the initializer
4730         in a new expression results in an empty initializer list,
4731         default-initialize it.
4732
4733 2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>
4734
4735         * mangle.c (write_type): Change mangling of rvalue reference from
4736         `RR' to `O'.
4737
4738 2007-08-31  Jakub Jelinek  <jakub@redhat.com>
4739
4740         * decl.c (duplicate_decls): Remove duplicated line.
4741
4742 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
4743
4744         PR c++/33210
4745         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
4746         BOUND_TEMPLATE_TEMPLATE_PARM.
4747
4748 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
4749
4750         PR c++/32113
4751         * search.c (lookup_member): Check the name argument for
4752         error_mark_node.
4753
4754 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
4755
4756         PR c++/33212
4757         * parser.c (cp_parser_trait_expr): Check rerurn value of
4758         cp_parser_type_id.
4759
4760 2007-08-30  Ollie Wild  <aaw@google.com>
4761
4762         * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
4763         convert_ptrmem for pointer to member conversions.
4764         (convert_to_pointer_force): Update cp_convert_to_pointer call.
4765         (ocp_convert): Update cp_convert_to_pointer call.
4766         * typeck.c (convert_ptrmem): Add conditional for null pointers to
4767         members.
4768         (build_static_cast_1): Check can_convert for conversions in either
4769         direction.
4770         (get_delta_difference_1): New function.
4771         (get_delta_difference): Refactor to call get_delta_difference_1.
4772
4773 2007-08-30  Jakub Jelinek  <jakub@redhat.com>
4774
4775         * decl.c (start_preparsed_function): Set
4776         DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
4777
4778 2007-08-28  Paolo Carlini  <pcarlini@suse.de>
4779
4780         PR c++/33209
4781         * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
4782         BOUND_TEMPLATE_TEMPLATE_PARM.
4783
4784 2007-08-28  Jakub Jelinek  <jakub@redhat.com>
4785
4786         PR c++/32596
4787         PR c++/32400
4788         * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
4789         and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
4790
4791 2007-08-27  Jason Merrill  <jason@redhat.com>
4792
4793         PR c++/29000
4794         * pt.c (build_non_dependent_expr, type_dependent_expression_p):
4795         Look inside STMT_EXPR.
4796         * semantics.c (stmt_expr_value_expr): New fn.
4797         * cp-tree.h: Declare it.
4798
4799         PR c++/28558
4800         * decl.c (groktypename): Ignore attributes applied to class type.
4801
4802 2007-08-28  Richard Guenther  <rguenther@suse.de>
4803
4804         * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
4805
4806 2007-08-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4807
4808         * error.c (dump_expr): Handle COMPLEX_CST.
4809         * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
4810         (pp_cxx_expression): Likewise.
4811
4812 2007-08-27  Alexandre Oliva  <aoliva@redhat.com>
4813
4814         * decl.c (GNU_INLINE_P): New.
4815         (duplicate_decls): Handle gnu_inline.  Merge attributes and
4816         some flags in overriding definitions.
4817         (redeclaration_error_message): Handle gnu_inline.
4818         (start_preparsed_function): Likewise.
4819
4820 2007-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4821
4822         * call.c (sufficient_parms_p): Constify.
4823         * class.c (same_signature_p): Likewise.
4824         * cp-gimplify.c (is_invisiref_parm,
4825         cxx_omp_privatize_by_reference): Likewise.
4826         * cp-objcp-common.c (has_c_linkage): Likewise.
4827         * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
4828         sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
4829         grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
4830         num_artificial_parms_for, comp_template_parms,
4831         template_parameter_pack_p, any_dependent_template_arguments_p,
4832         any_type_dependent_arguments_p, any_value_dependent_elements_p,
4833         repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
4834         zero_init_p, member_p, cp_lvalue_kind,
4835         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
4836         varargs_function_p, is_dummy_object, special_function_kind,
4837         string_conv_p, type_unknown_p, comp_except_specs, compparms,
4838         comp_cv_qualification, is_bitfield_expr_with_lowered_type,
4839         unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
4840         cp_has_mutable_p, at_least_as_qualified_p,
4841         invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
4842         * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
4843         * except.c (nothrow_libfn_p): Likewise.
4844         * method.c (skip_artificial_parms_for, num_artificial_parms_for):
4845         Likewise.
4846         * pt.c (comp_template_parms, template_parameter_pack_p,
4847         any_type_dependent_arguments_p, any_value_dependent_elements_p,
4848         any_dependent_template_arguments_p): Likewise.
4849         * repo.c (repo_export_class_p): Likewise.
4850         * semantics.c (anon_aggr_type_p): Likewise.
4851         * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
4852         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
4853         varargs_function_p, member_p, is_dummy_object, pod_type_p,
4854         zero_init_p, special_function_p): Likewise.
4855         * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
4856         comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
4857         compparms, invalid_nonstatic_memfn_p,
4858         is_bitfield_expr_with_lowered_type, unlowered_expr_type,
4859         string_conv_p, ptr_reasonably_similar, cp_type_readonly,
4860         cp_has_mutable_p, lvalue_or_else): Likewise.
4861
4862 2007-08-25  Paolo Bonzini  <bonzini@gnu.org>
4863
4864         * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
4865         * cp-objcp-common.c (cp_tree_size): Ditto.
4866         * tree.c (cp_walk_subtrees): Ditto
4867         * cp-tree.def (TINST_LEVEL): Go away.
4868         * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
4869         move together with other non-tree structs.
4870         (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
4871         (union lang_tree_node): Eliminate tinst_level field.
4872         (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
4873         (current_instantiation, outermost_tinst_level): Return
4874         a "struct tinst_level *".
4875
4876         * error.c (print_instantiation_partial_context): Change second
4877         parameter to a "struct tinst_level *".  Replace accessor macros
4878         with field access.
4879         (print_instantiation_full_context): Likewise.
4880         * lex.c (in_main_input_context): Likewise.
4881
4882         * pt.c (struct pending_templates): New.
4883         (pending_templates, last_pending_template): Use it as a type.
4884         (current_tinst_level): Change typo to "struct tinst_level *"
4885         (reopen_tinst_level): Accept "struct tinst_level *", return decl.
4886         (add_pending_template): Construct a "struct pending_template".
4887         Replace TINST_LEVEL accessor macros with field access.
4888         (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
4889         (pop_tinst_level): Likewise.
4890         (instantiate_pending_templates): Likewise.  Factor common code used
4891         when an instantiation has been done.
4892         (outermost_tinst_level): Replace tree_last with loop.
4893         (current_instantiation): Return a "struct tinst_level *".
4894
4895 2007-08-24  Ollie Wild  <aaw@google.com>
4896
4897         * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
4898         * name-lookup.h (cp_binding_level): Remove vtables member.
4899
4900 2007-08-24  Richard Guenther  <rguenther@suse.de>
4901
4902         * tree.c (cp_cannot_inline_tree_fn): Remove.
4903         * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
4904         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
4905         Remove define.
4906
4907 2007-08-24  Jakub Jelinek  <jakub@redhat.com>
4908
4909         PR c++/32567
4910         * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
4911         error_mark_node right away if build_expr_type_conversion
4912         returned it.
4913
4914         PR c++/32898
4915         * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
4916         is error_mark_node rather than NULL_TREE.
4917         * pt.c (check_explicit_specialization): Likewise.
4918
4919         PR c++/31941
4920         * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
4921         TARGET_VTABLE_USES_DESCRIPTORS targets properly.
4922
4923 2007-08-22  Jason Merrill  <jason@redhat.com>
4924
4925         PR c++/29365
4926         * pt.c (outermost_tinst_level): New function.
4927         * lex.c (in_main_input_context): New function.
4928         * cp-tree.h: Declare it.
4929         * decl2.c (constrain_class_visibility): Use it to avoid warning
4930         about uses of the anonymous namespace in the main input file.
4931
4932 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
4933
4934         * init.c (build_new_1): Use get_target_expr instead of save_expr.
4935
4936 2007-08-20  Pawel Sikora  <pluto@pld-linux.org>
4937
4938         PR c++/7302
4939         * class.c (finish_struct_1): Warn when a class has virtual
4940         functions and accessible non-virtual destructor.
4941
4942 2007-08-20  Richard Guenther  <rguenther@suse.de>
4943
4944         PR c++/22369
4945         PR c++/22451
4946         * call.c (build_new_method_call): Convert initializer to
4947         the basetype.
4948         * init.c (build_aggr_init): Do not fiddle with types.
4949         (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
4950         * except.c (build_throw): Do not drop qualifiers for the
4951         pointer type.
4952         * typeck.c (get_member_function_from_ptrfunc): Do not
4953         fiddle with types, instead convert.
4954         (build_ptrmemfunc1): Convert to the target type for
4955         initialization.
4956         (gfc_trans_allocate): Convert result to target type.
4957         * cp-objcp-common.c (cxx_get_alias_set): Pointers to
4958         pointer-to-member structures shall have alias set zero as well.
4959
4960 2007-08-20  Richard Guenther  <rguenther@suse.de>
4961
4962         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
4963         Remove.
4964         * cp-tree.h (cp_auto_var_in_fn_p): Remove.
4965         (nonstatic_local_decl_p): Likewise.
4966         * tree.c (cp_auto_var_in_fn_p): Remove.
4967         * decl.c (nonstatic_local_decl_p): Remove.
4968
4969 2007-08-20  Richard Guenther  <rguenther@suse.de>
4970
4971         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
4972         Remove define.
4973         * tree.h (cp_walk_tree): New define to walk_tree_1 with
4974         cp_walk_subtrees lh parameter.
4975         (cp_walk_tree_without_duplicates): New define to
4976         walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
4977         * tree.c (count_trees): Call
4978         cp_walk_tree_without_duplicates.
4979         (verify_stmt_tree): Call cp_walk_tree.
4980         (break_out_target_exprs): Likewise.
4981         (WALK_SUBTREE): Likewise.
4982         * cp-gimplify.c (cp_genericize): Likewise.
4983         * cp-pt.c (find_parameter_packs_r): Likewise.
4984         (uses_parameter_packs): Likewise.
4985         (make_pack_expansion): Likewise.
4986         (check_for_bare_parameter_packs): Likewise.
4987         (for_each_template_parm): Likewise.
4988         * decl.c (check_default_argument): Call
4989         cp_walk_tree_without_duplicates.
4990         * except.c (build_throw): Likewise.
4991         * decl2.c (type_visibility): Likewise.
4992         * semantics.c (expand_or_defer_fn): Likewise.
4993         (finalize_nrv): Call cp_walk_tree.
4994
4995 2007-08-20  Jakub Jelinek  <jakub@redhat.com>
4996
4997         PR c++/33025
4998         * init.c (build_new_1): Rename placement_var variable to placement_expr.
4999         Initialize it with save_expr rather than get_temp_regvar.
5000
5001 2007-08-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5002
5003         PR c++/28989
5004         * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
5005         lvalues.
5006
5007 2007-08-17  Ollie Wild  <aaw@google.com>
5008
5009         PR c++/31749
5010         * name-lookup.c (do_nonmember_using_decl): Shift implicit type
5011         declarations into appropriate slots for comparison.  Fix type
5012         comparison.
5013
5014 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
5015
5016         PR c++/32112
5017         * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
5018         * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
5019
5020 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
5021
5022         PR c++/32870
5023         * parser.c (cp_parser_class_head): Improve error message.
5024
5025 2007-08-16  Seongbae Park  <seongbae.park@gmail.com>
5026
5027         * pt.c (instantiate_decl): Set input_location
5028         for the function end.
5029
5030 2007-08-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5031
5032         * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
5033         Constify.
5034         * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
5035         class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
5036         cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
5037         cxx_warn_unused_global_decl, cp_expr_size): Likewise.
5038         * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
5039         * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
5040         * typeck.c (cp_type_quals): Likewise.
5041         * typeck2.c (cxx_incomplete_type_diagnostic,
5042         cxx_incomplete_type_error): Likewise.
5043
5044 2007-08-16  Paolo Carlini  <pcarlini@suse.de>
5045
5046         PR c++/31132
5047         * pt.c (tsubst_friend_function): When check_classfn
5048         returns error_mark_node likewise return it.
5049
5050 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
5051
5052         PR c++/32992
5053         * typeck.c (check_return_expr): Don't NRV optimize vars in
5054         anonymous unions.
5055         * decl.c (finish_function): Comment fix.
5056
5057 2007-08-15  Paolo Carlini  <pcarlini@suse.de>
5058
5059         PR c++/33035
5060         * pt.c (push_template_decl_real): Depending on TYPE_P
5061         use either TYPE_CONTEXT or DECL_CONTEXT.
5062
5063 2007-08-14  Mark Mitchell  <mark@codesourcery.com>
5064
5065         * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
5066         constructors and destructors return this.
5067
5068 2007-08-14  Paolo Carlini  <pcarlini@suse.de>
5069
5070         PR c++/27211
5071         * decl2.c (check_classfn): Return error_mark_node in case of error;
5072         in that case, do not call add_method.
5073         * decl.c (start_decl): Deal with check_classfn returning
5074         error_mark_node.
5075         (grokfndecl): Likewise.
5076         * pt.c (tsubst_friend_function): Likewise.
5077
5078 2007-08-14  Andrew Pinski  <pinskia@gmail.com>
5079
5080         PR c++/30428
5081         * typeck.c (build_binary_op): Disallow vector float types with
5082         BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
5083
5084 2007-08-11  Ian Lance Taylor  <iant@google.com>
5085
5086         * cp-objcp-common.c (cxx_get_alias_set): Change return type to
5087         alias_set_type.
5088         * cp-tree.h (cxx_get_alias_set): Update declaration.
5089
5090 2007-08-10  Ollie Wild  <aaw@google.com>
5091
5092         * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
5093         type lookups.
5094         (ambiguous_decl): Construct tree of ambiguous types.  Remove extaneous
5095         function parameter.
5096         (unqualified_namespace_lookup): Fix ambiguous_decl call.
5097         (lookup_using_namespace): Fix ambiguous_decl call.
5098         (qualified_lookup_using_namespace): Fix ambiguous_decl call.
5099
5100 2007-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5101
5102         * call.c (name_as_c_string): Use CONST_CAST.
5103         * decl.c (build_decl): Likewise.
5104         * parser.c (cp_parser_string_literal): Likewise.
5105
5106 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
5107
5108         PR c++/17763
5109         * error.c (dump_expr): Consistently use the *_cxx_*
5110         variants of the pretty-print functions.
5111
5112 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
5113
5114         PR c++/22256
5115         * decl.c (check_special_function_return_type): Just error
5116         on return type specified for conversion operator.
5117
5118 2007-08-09  Daniel Berlin  <dberlin@dberlin.org>
5119
5120         * typeck2.c (readonly_error): Handle general expressions.
5121         * error.c (dump_expr): Handle POINTER_PLUS_EXPR
5122
5123 2007-08-06  Dan Hipschman  <dsh@google.com>
5124
5125         * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
5126         access function name.
5127
5128 2007-08-04  Alfred Minarik  <a.minarik@aon.at>
5129
5130         PR pch/13676
5131         * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
5132         * g++spec.c (lang_specific_driver): Check them.
5133
5134 2007-08-06  Paolo Carlini  <pcarlini@suse.de>
5135
5136         PR c++/19532
5137         * pt.c (inline_needs_template_parms): Fix comment; change return type
5138         to bool.
5139
5140 2007-08-05  Volker Reichelt  <v.reichelt@netcologne.de>
5141
5142         Revert:
5143         2007-03-26  Dirk Mueller  <dmueller@suse.de>
5144
5145         * parser.c (cp_parser_member_declaration): Pedwarn
5146         about stray semicolons after member declarations.
5147
5148 2007-08-02  Lee Millward  <lee.millward@gmail.com>
5149
5150         PR c++/30849
5151         PR c++/30850
5152         PR c++/30851
5153         * parser.c (cp_parser_asm_definition): Detect and discard asm
5154         statements with invalid inputs or outputs.
5155          (cp_parser_asm_operand_list): Return error mark node if any
5156          of the operands are invalid. Adjust documentation.
5157
5158 2007-08-02  Nick Clifton  <nickc@redhat.com>
5159
5160         * typeck.c: Change copyright header to refer to version 3 of the
5161         GNU General Public License and to point readers at the COPYING3
5162         file and the FSF's license web page.
5163         * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
5164         config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
5165         Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
5166         cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
5167         tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
5168         cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
5169         cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
5170         name-lookup.h, parser.c: Likewise.
5171
5172 2007-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5173
5174         PR middle-end/32668
5175         * call.c (magic_varargs_p): Honor the "type generic" attribute.
5176
5177 2007-07-30  Paolo Carlini  <pcarlini@suse.de>
5178
5179         PR c++/32108
5180         * semantics.c (finish_label_stmt): Reject the __label__
5181         extension outside function scopes.
5182
5183 2007-07-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5184
5185         * parser.c (eof_token): Un-constify.
5186         (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
5187         cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
5188         casts.
5189
5190 2007-07-28  Kazu Hirata  <kazu@codesourcery.com>
5191
5192         * pt.c, tree.c, typeck2.c: Fix comment typos.
5193
5194 2007-07-28  Simon Martin  <simartin@users.sourceforge.net>
5195             Mark Mitchell  <mark@codesourcery.com>
5196
5197         PR c++/30917
5198         * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
5199         hidden due to friend declarations in local classes.
5200
5201 2007-07-27  Douglas Gregor  <doug.gregor@gmail.com>
5202
5203         * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
5204         * cp-tree.def (DECLTYPE_TYPE): New.
5205         * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
5206         (dump_type_prefix): Ditto.
5207         (dump_type_suffix): Ditto.
5208         * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
5209         * mangle.c (write_type): Handle DECLTYPE_TYPE.
5210         * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
5211         types.
5212         (DECLTYPE_TYPE_EXPR): New.
5213         (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
5214         (finish_declared_type): Declare.
5215         * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
5216         DECLTYPE_TYPE nodes.
5217         (pp_cxx_type_id): Ditto.
5218         * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
5219         (tsubst): Substitute into a DECLTYPE_TYPE node.
5220         (tsubst_copy): Ditto.
5221         (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
5222         nodes.
5223         (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
5224         * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
5225         structural equality (because we can't hash the expressions).
5226         (finish_declared_type): New.
5227         * lex.c (reswords): Add "decltype" keyword.
5228         * parser.c cp_lexer_next_token_is_decl_specifier_keyword
5229         (cp_parser_postfix_expression): Add member_access_only_p to
5230         restrict postfix expression to member access expressions.
5231         (cp_parser_unary_expression): Update call to
5232         cp_parser_postfix_expression to reflect new parameter.
5233         (cp_parser_declared_type): New.
5234         (cp_parser_simple_type_specifier): Parse decltype types.
5235
5236 2007-07-27  Mark Mitchell  <mark@codesourcery.com>
5237
5238         PR c++/32346
5239         * call.c (convert_for_arg_passing): Only widen bitfields to their
5240         declared types if necessary.
5241
5242 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5243
5244         * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
5245         Constify.
5246
5247 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5248
5249         * decl.c (typename_hash, typename_compare): Constify.
5250         * mangle.c (hash_type, compare_type): Likewise.
5251         * pt.c (eq_local_specializations, hash_local_specialization):
5252         Likewise.
5253         * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
5254         list_hash): Likewise.
5255         * typeck2.c (pat_compare): Likewise.
5256
5257 2007-07-24  Nathan Sidwell  <nathan@codesourcery.com>
5258
5259         * method.c (implicitly_declare_fn): Increase alignment if member
5260         function pointer format requires it.
5261
5262 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
5263
5264         PR c++/29001
5265         * typeck.c (check_return_expr): Do not pass a null argument
5266         to null_ptr_cst_p.
5267
5268 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
5269
5270         PR c++/32561
5271         * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
5272         only on VAR_DECL.
5273
5274 2007-07-22  Nathan Sidwell  <nathan@codesourcery.com>
5275
5276         PR c++/32839
5277         * typeck.c (convert_arguments): Only use default args if we have
5278         a function decl.
5279
5280         PR c++/30818
5281         * typeck.c (structural_comptypes): No need to check
5282         resolve_typename_type return value here.
5283         * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
5284         * pt.c (resolve_typename_type): Follow typename typedefs.  Return
5285         original type rather than error_mark_node in case of failure.
5286         * parser.c (cp_parser_nested_name_specifier_opt): Adjust
5287         resolve_typename_type result check.
5288         (cp_parser_direct_declarator, cp_parser_head,
5289         cp_parser_constructor_declarator_p): Likewise.
5290
5291 2007-07-12  Kazu Hirata  <kazu@codesourcery.com>
5292
5293         * pt.c (template_parms_variadic_p): Remove.
5294         * cp-tree.h: Remove the prototype for template_parms_variadic_p.
5295
5296 2007-07-12  Jakub Jelinek  <jakub@redhat.com>
5297
5298         PR c++/30854
5299         * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
5300         argument to dump_aggr_init_expr_args instead of false.
5301
5302 2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>
5303
5304         * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
5305         canonical types; otherwise, fall back to structural type
5306         comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
5307         internal compiler error if the canonical types are wrong.
5308
5309 2007-07-11  Paolo Carlini  <pcarlini@suse.de>
5310
5311         PR c++/32560
5312         * parser.c (cp_parser_make_indirect_declarator): When the
5313         the code argument is ERROR_MARK return cp_error_declarator.
5314
5315 2007-07-09  Geoffrey Keating  <geoffk@apple.com>
5316
5317         PR 32617
5318         * decl.c (cxx_init_decl_processing): Don't set
5319         force_align_functions_log.
5320         (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
5321         * typeck.c (cxx_alignof_expr): When alignof is used on a plain
5322         FUNCTION_DECL, return its alignment.
5323
5324 2007-07-09  Richard Guenther  <rguenther@suse.de>
5325
5326         * decl.c (start_preparsed_function): Do not promote return type.
5327
5328 2007-07-08  Paolo Carlini  <pcarlini@suse.de>
5329
5330         PR c++/30535
5331         * pt.c (unify): Never pass error_mark_node to template_decl_level.
5332
5333 2007-07-07  Mark Mitchell  <mark@codesourcery.com>
5334
5335         PR c++/32232
5336         * pt.c (resolve_overloaded_unification): Robustify.  Return a
5337         bool, not an int.
5338         (type_unification_real): Adjust accordingly.
5339
5340 2007-07-06  Richard Guenther  <rguenther@suse.de>
5341
5342         * init.c (build_new_1): Use the correct pointer type.
5343         * typeck2.c (build_m_component_ref): Likewise.
5344
5345 2007-07-05  Mark Mitchell  <mark@codesourcery.com>
5346
5347         PR c++/32245
5348         * init.c (build_zero_init): Always build an initializer for
5349         non-static storage.
5350         * typeck2.c (build_functional_cast): Use build_zero_init.
5351
5352         PR c++/32251
5353         * init.c (build_new_1): Always pass the allocation function to
5354         build_op_delete_call.
5355         * call.c (build_op_delete_call): Handle operator delete with a
5356         variable-argument list.  Do not issue an error when no matching
5357         deallocation function is available for a new operator.
5358
5359         PR c++/31992
5360         * cp-tree.h (any_value_dependent_elements_p): Declare it.
5361         * decl.c (value_dependent_init_p): New function.
5362         (cp_finish_decl): Use it.
5363         * pt.c (value_dependent_expression_p): Use
5364         any_value_dependent_elements_p.
5365         * parser.c (cp_parser_primary_expression): Add comment about
5366         treating dependent qualified names as integral
5367         constant-expressions.
5368
5369 2007-07-04  Douglas Gregor  <doug.gregor@gmail.com>
5370
5371         * decl.c (build_ptrmemfunc_type): Always use structural equality
5372         tests when comparing pointer-to-member-function types, because the
5373         handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
5374         types.
5375
5376 2007-07-03  Mark Mitchell  <mark@codesourcery.com>
5377
5378         * init.c (build_new): Tweak comment.
5379
5380 2007-06-29  Dave Brolley  <brolley@redhat.com>
5381
5382         PR c++/31743
5383         * parser.c (cp_parser_new_type_id): Don't reduce a named array
5384         type to its base type and number of elements here.
5385         * init.c (build_new): Call complete_type_or_else to ensure that the
5386         type is complete and to issue a diagnostic if it is not.
5387         (build_new_1): Don't call complete_type_or_else here.
5388
5389 2007-07-03  Richard Guenther  <rguenther@suse.de>
5390
5391         PR c++/32609
5392         * class.c (fixed_type_or_null): Re-lookup the hashtable slot
5393         after recursing.
5394
5395 2007-07-02  Simon Baldwin  <simonb@google.com>
5396
5397         * parser.c (cp_parser_elaborated_type_specifier): Added a warning
5398         for inner-style nested forward declarations that don't declare
5399         anything useful.
5400
5401 2007-07-02  Jakub Jelinek  <jakub@redhat.com>
5402
5403         PR c++/31748
5404         * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
5405         DECL_P in not a variable and appears more than once error messages.
5406
5407 2007-07-01  Ollie Wild  <aaw@google.com>
5408
5409         * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
5410         (select_decl): Remove function.
5411         (unqualified_namespace_lookup): Populate binding by calling
5412         ambiguous_decl.  Remove select_decl call.
5413         (lookup_qualified_name): Remove select_decl call.
5414         * decl.c (lookup_and_check_tag): Check for ambiguous references.
5415         * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
5416         generation when name lookup is ambiguous.
5417
5418 2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>
5419
5420         PR c++/31724
5421         * init.c (build_new_1): Use structural equality on the copy of the
5422         array type.
5423
5424 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
5425
5426         * decl2.c (determine_visibility): Implement
5427         flag_visibility_ms_compat effect on type info.
5428         * decl.c (cxx_init_decl_processing): Implement
5429         global effect of flag_visibility_ms_compat.
5430
5431 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
5432
5433         * decl2.c (start_objects): Mark constructor-running function
5434         as artificial.
5435
5436 2007-06-26  Simon Martin  <simartin@users.sourceforge.net>
5437
5438         PR c++/32111
5439         * decl.c (grokdeclarator): Reset friendp for member functions declared
5440         friend of their own class.
5441
5442 2007-06-23  Mark Mitchell  <mark@codesourcery.com>
5443
5444         * decl2.c (determine_visibility): Don't look for dllexport here.
5445         (determine_visibility_from_class): Tidy.
5446
5447 2007-06-18  Simon Baldwin <simonb@google.com>
5448
5449         PR c++/31923
5450         * parser.c (cp_parser_single_declaration): Added check for storage
5451         class other than sc_none in parsed declaration, and a flag to indicate
5452         if the call is part of an explicit template specialization parse.
5453         * (cp_parser_explicit_specialization): Specialization check flag added
5454         to call to cp_parser_single_declaration(), set true.
5455         * (cp_parser_template_declaration_after_export): Specialization check
5456         flag added to call to cp_parser_single_declaration(), set false.
5457         * pt.c (check_explicit_specialization): Added code to copy visiblity
5458         and linkage from the templated function to the explicit specialization.
5459
5460 2007-06-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5461
5462         * typeck.c (build_binary_op): For templates build the
5463         expression in pieces to avoid the assert in build2_stat.
5464         (get_member_function_from_ptrfunc):
5465         Change over to using POINTER_PLUS_EXPR and convert
5466         the second operand to sizetype.
5467         * typeck2.c (build_m_component_ref):  Likewise.
5468         * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
5469         instead of PLUS_EXPR for pointers.
5470         (build_new_1): Likewise.
5471         (build_vec_delete_1): Likewise.
5472         (build_vec_delete): Likewise.
5473         * class.c (build_base_path): Likewise.
5474         (build_base_path): Likewise.
5475         (convert_to_base_statically): Likewise.
5476         (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
5477         (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
5478         instead of PLUS_EXPR.
5479         (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
5480         instead of PLUS_EXPR for pointers.
5481         * call.c (build_special_member_call): Likewise.
5482         * rtti.c (build_headof): Likewise.
5483         Use sizetype instead of ptrdiff_type_node.
5484         (tinfo_base_init): Create a POINTER_PLUS_EXPR
5485         instead of PLUS_EXPR for pointers.
5486         * except.c (expand_start_catch_block):  Do a
5487         NEGATIVE and then a POINTER_PLUS_EXPR instead
5488         of a MINUS_EXPR.
5489         * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
5490         PLUS_EXPR on pointer types over to use
5491         POINTER_PLUS_EXPR and remove the conversion
5492         to the pointer types.
5493         * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
5494         adding to a pointer type. Use size_int instead of
5495         ssize_int. Convert the index to sizetype before
5496         adding it to the pointer.
5497
5498 2007-06-15  Mark Mitchell  <mark@codesourcery.com>
5499
5500         * cp-tree.h (DECL_VAR_MARKED_P): Remove.
5501         (DECL_ANON_UNION_VAR_P): New macro.
5502         * class.c (fixed_type_or_null): Tidy.  Use a hash table, rather
5503         than DECL_VAR_MARKED_P, to keep track of which variables we have
5504         seen.
5505         * decl.c (redeclaration_error_message): Complain about redeclaring
5506         anonymous union members at namespace scope.
5507         * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
5508
5509 2007-06-14  Geoff Keating  <geoffk@apple.com>
5510
5511         * decl2.c (determine_visibility): Ensure that functions with
5512         hidden types as parameters are hidden.
5513
5514         PR 31093
5515         * decl2.c (determine_visibility): Remove duplicate code for
5516         handling type info.
5517
5518 2007-06-12  Ian Lance Taylor  <iant@google.com>
5519
5520         PR libstdc++/29286
5521         * init.c (avoid_placement_new_aliasing): New static function.
5522         (build_new_1): Call it.
5523
5524 2007-06-11  Rafael Ávila de Espíndola  <espindola@google.com>
5525
5526         * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
5527         (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
5528
5529 2007-06-08  Jakub Jelinek  <jakub@redhat.com>
5530
5531         PR c++/32177
5532         * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
5533         on init, the non-decl cond operand and increment value.
5534
5535 2007-06-07  Simon Martin  <simartin@users.sourceforge.net>
5536
5537         PR c++/30759
5538         * decl.c (check_initializer): Report an error when a brace enclosed
5539         initializer is used for a non-aggregate type in C++98.
5540         (redeclaration_error_message): Rewrote flag_cpp0x in terms of
5541         cxx_dialect.
5542         (grokdeclarator): Likewise.
5543         (move_fn_p): Likewise.
5544         * typeck.c (check_return_expr): Likewise.
5545         * call.c (reference_binding): Likewise.
5546         * error.c (cp_cpp_error): Likewise.
5547         * pt.c (check_default_tmpl_args): Likewise.
5548         (tsubst): Likewise.
5549         * lex.c (init_reswords): Likewise.
5550         * parser.c (p_parser_primary_expression): Likewise.
5551         (TOKEN_PRECEDENCE): Likewise.
5552         (cp_parser_init_declarator): Likewise.
5553         (cp_parser_ptr_operator): Likewise.
5554         (cp_parser_parameter_declaration): Likewise.
5555         (cp_parser_enclosed_template_argument_list): Likewise.
5556         (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
5557         (cp_parser_next_token_ends_template_argument_p): Likewise.
5558
5559 2007-06-04  Simon Baldwin  <simonb@google.com>
5560
5561         * decl.c (grokdeclarator): Readability change.  Moved case labels
5562         into direct switch statement scope.
5563
5564 2007-06-04  Paolo Carlini  <pcarlini@suse.de>
5565
5566         * call.c (convert_like_real): Remove pointless code.
5567
5568 2007-05-31  Mark Mitchell  <mark@codesourcery.com>
5569
5570         * decl.c (get_atexit_fn_ptr_type): New function.
5571         (get_atexit_node): Use it.
5572         (start_cleanup_fn): Likewise.
5573         (register_dtor_fn): Use the object's destructor, instead of a
5574         separate cleanup function, where possible.
5575         * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
5576         (atexit_fn_ptr_type_node): New macro.
5577         * decl2.c (build_cleanup): Use build_address.
5578
5579 2007-05-31  Daniel Berlin  <dberlin@dberlin.org>
5580
5581         * typeck.c (build_binary_op): Include types in error.
5582
5583 2007-05-31  Jakub Jelinek  <jakub@redhat.com>
5584
5585         PR c++/31806
5586         * decl.c (cp_finish_decl): Also clear was_readonly if a static var
5587         needs runtime initialization.
5588
5589 2007-05-31  Paolo Carlini  <pcarlini@suse.de>
5590
5591         PR c++/32158
5592         * semantics.c (finish_trait_expr): Complete the types.
5593
5594 2007-05-30  Russell Yanofsky <russ@yanofsky.org>
5595              Douglas Gregor <doug.gregor@gmail.com>
5596              Pedro Lamarao <pedro.lamarao@mndfck.org>
5597              Howard Hinnant <howard.hinnant@gmail.com>
5598
5599         PR c++/7412
5600         PR c++/29939
5601         * typeck.c (comptypes): Don't consider rvalue and lvalue
5602         reference types to be equivalent.
5603         (check_return_expr): Move from certain lvalues when returning
5604         them.
5605         * decl.c (grokdeclarator): Implement reference collapsing.
5606         (copy_fn_p): Don't consider constructors taking rvalue references
5607         to be copy constructors.
5608         (move_fn_p): New.
5609         * call.c (conversion): New "rvaluedness_matches_p" member.
5610         (convert_class_to_reference): Require reference type as first
5611         parameter instead of base type.
5612         (reference_binding): Add logic to handle rvalue references.
5613         (implicit_conversion): Update inaccurate comment.
5614         (convert_like_real): Disable creation of temporaries that are
5615         impossible to initialize for types with move constructors.
5616         (build_over_call): Elide move constructors when possible.
5617         (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
5618         (maybe_handle_ref_bind): Return conversion instead of type node.
5619         (compare_ics): Add logic to use "rvaluedness_matches_p" values to
5620         determine preferred conversion sequences.
5621         * cp-tree.h (TYPE_REF_IS_RVALUE): New.
5622         (LOOKUP_PREFER_RVALUE): New.
5623         (DECL_MOVE_CONSTRUCTOR_P): New.
5624         (struct cp_declarator): Add "reference" member for reference
5625         types, with new "rvalue_ref" flag.
5626         (cp_build_reference_type): Declare.
5627         (move_fn_p): Declare.
5628         * error.c (dump_type_prefix): Format rvalue reference types
5629         correctly in error messages.
5630         * except.c (build_throw): Move from certain lvalues when
5631         throwing.
5632         * mangle.c (write_type): Mangle rvalue references differently
5633         than regular references.
5634         * parser.c (make_reference_declarator): Add boolean parameter for
5635         rvalue references.
5636         (cp_parser_make_indirect_declarator): New.
5637         (cp_parser_new_declarator_opt): Call
5638         cp_parser_make_indirect_declarator.
5639         (cp_parser_conversion_declarator_opt): Ditto.
5640         (cp_parser_declarator): Ditto.
5641         (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
5642         declarators.
5643         * pt.c (tsubst): Implement reference collapsing.
5644         (maybe_adjust_types_for_deduction): Implement special template
5645         parameter deduction rule for rvalue references.
5646         (type_unification_real): Update calls to
5647         maybe_adjust_types_for_deduction.
5648         (try_one_overload): Ditto.
5649         (unify_pack_expansion): Ditto.
5650         * tree.c (lvalue_p_1): Handle rvalue reference types.
5651         (cp_build_reference_type): New.
5652
5653 2007-05-30  Jakub Jelinek  <jakub@redhat.com>
5654
5655         PR c++/31809
5656         * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
5657         variables that need runtime initialization.
5658
5659 2007-05-28  Andrew Pinski  <Andrew_pinski@playstation.sony.com>
5660
5661         PR c++/31339
5662         * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
5663         case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
5664         case POSTDECREMENT_EXPR>): Return the error_mark_node
5665         if either the real or imaginary parts would an
5666         error_mark_node.
5667
5668 2007-05-25  Simon Martin  <simartin@users.sourceforge.net>
5669             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
5670
5671         PR c++/31745
5672         * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
5673         token is a closing brace, false if there are no tokens left.
5674         (cp_parser_namespace_alias_definition): Only consume the next token if
5675         it is a closing brace.
5676
5677         * parser.c (cp_parser_class_specifier): Likewise.
5678
5679 2007-05-25  H.J. Lu  <hongjiu.lu@intel.com>
5680
5681         * semantics.c (finish_member_declaration): Fix a typo in the
5682         last checkin.
5683
5684 2007-05-25  Douglas Gregor <doug.gregor@gmail.com>
5685
5686         PR c++/31431
5687         PR c++/31432
5688         PR c++/31434
5689         PR c++/31435
5690         PR c++/31437
5691         PR c++/31438
5692         PR c++/31442
5693         PR c++/31443
5694         PR c++/31444
5695         PR c++/31445
5696         * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
5697         * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
5698         * pt.c (check_for_bare_parameter_packs): Return bool indicated
5699         whether everything was okay. Fix indentation.
5700         (push_template_decl_real): Check for bare parameter packs in
5701         function parameters; where errors occur, mark the parameter types
5702         with ERROR_MARK_NODEs to avert ICEs.
5703         (coerce_template_parameter_pack): New.
5704         (coerce_template_parms): Moved parameter pack coercion into
5705         coerce_template_parameter_pack, and permit it anywhere in the
5706         template parameter list (not just at the end). Parameter and
5707         argument indices can vary (somewhat) separately now, so add
5708         PARM_IDX and ARG_IDX.
5709         (fn_type_unification): Don't set an argument pack as incomplete if
5710         no argument pack was deduced.
5711         (type_unification_real): If a type parameter is a parameter pack
5712         and has not otherwise been deduced, it will be deduced to an empty
5713         parameter pack.
5714         (more_specialized_fn): Use the actual lengths of the argument
5715         lists when comparing against expansions.
5716         * semantics.c (finish_member_declaration): If a field's type has
5717         bare parameter packs, error and set its type to ERROR_MARK_NODE.
5718
5719 2007-05-24  Danny Smith  <dannysmith@users.sourceforge.net>
5720
5721         PR target/27067
5722         * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
5723
5724 2007-05-22  Ollie Wild  <aaw@google.com>
5725
5726         * name-lookup.c (ambiguous_decl): Adds check for hidden types.
5727         (unqualified_namespace_lookup): Adds check for hidden types.
5728
5729 2007-05-22  Ollie Wild  <aaw@google.com>
5730
5731         * decl.c (duplicate_decls): Verify namespace names are unique.
5732
5733 2007-05-21  Mark Mitchell  <mark@codesourcery.com>
5734
5735         * decl.c (cxx_maybe_build_cleanup): Handle
5736         __attribute__((cleanup)).
5737
5738 2007-05-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
5739
5740         * cvt.c (cp_convert_and_check): Don't check warnings if the
5741         conversion failed.
5742
5743 2007-05-18  Geoffrey Keating  <geoffk@apple.com>
5744
5745         * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
5746
5747 2007-05-14  Paolo Carlini  <pcarlini@suse.de>
5748
5749         PR c++/29928
5750         * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
5751         type only if is a class type (5.2.8/4).
5752
5753 2007-05-14  Rafael Ávila de Espíndola  <espindola@google.com>
5754
5755         * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
5756         * decl.c (grokdeclarator): Use unsigned_type_for instead of
5757         c_common_unsigned_type.
5758
5759 2007-05-11  Silvius Rus  <rus@google.com>
5760
5761         * typeck.c (build_indirect_ref): Add call to
5762         strict_aliasing_warning.
5763         (build_reinterpret_cast_1): Condition call to
5764         strict_aliasing_warning.
5765
5766 2007-05-11  Jan Hubicka  <jh@suse.cz>
5767
5768         * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
5769         * decl2.c (start_objects): ctors and dtors are no longer public.
5770         (cp_write_global_declarations): Do not call c_build_cdtor_fns.
5771
5772 2007-05-07  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5773
5774         * typeck.c (build_unary_op): Remove code that used to
5775         handle non lvalue increments/decrements.
5776
5777 2007-05-07  Mike Stump  <mrs@apple.com>
5778
5779         * parser.c (check_empty_body): Add.
5780         (cp_parser_iteration_statement): Add call to check_empty_body.
5781
5782 2007-05-05  Geoffrey Keating  <geoffk@apple.com>
5783
5784         PR 31775
5785         * mangle.c (write_mangled_name): Mangle static variable names.
5786         (write_unqualified_name): Use local-source-name for
5787         namespace-scope static variables.
5788
5789 2007-05-04  Dirk Mueller  <dmueller@suse.de>
5790
5791         * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
5792         not in effect.
5793
5794 2007-05-02  Seongbae Park  <seongbae.park@gmail.com>
5795
5796         PR c++/31663
5797         * decl2.c (constrain_class_visibility):
5798         Use strip_pointer_or_array_types instead of strip_array_types.
5799
5800 2007-04-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5801
5802         PR C++/30221
5803         * decl.c (reshape_init_r): Don't reshape the first element if it
5804         is a pointer to member function.
5805
5806 2007-04-27  Simon Baldwin  <simonb@google.com>
5807
5808         * decl.c (grokparms): Changed message format from %qD to %qE.
5809
5810 2007-04-27  Douglas Gregor  <doug.gregor@gmail.com>
5811
5812         * error.c (maybe_warn_variadic_templates): Variadic templates are
5813         now in C++0x, so only warn about them in C++98 mode.
5814
5815 2007-04-26  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5816
5817         PR C++/30016
5818         * typeck.c (build_reinterpret_cast_1): Only allow conversion to
5819         integeral types from vectors types.
5820
5821 2007-04-26  Jakub Jelinek  <jakub@redhat.com>
5822
5823         PR c++/31598
5824         * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
5825         for type dependent OMP_CLAUSE_DECLs.
5826
5827 2007-04-24  Mark Mitchell  <mark@codesourcery.com>
5828
5829         PR c++/31338
5830         * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
5831         * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
5832         COMPLEX_TYPE is now an ARITHMETIC_TYPE.
5833         * init.c (build_zero_init): Adjust, as
5834         COMPLEX_TYPE is now a SCALAR_TYPE.
5835         * typeck2.c (digest_init): Allow brace-enclosed initializers for
5836         COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
5837
5838 2007-04-25  Paolo Carlini  <pcarlini@suse.de>
5839
5840         * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
5841         per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
5842         (trait_expr_value): Adjust.
5843
5844 2007-04-23  Simon Baldwin  <simonb@google.com>
5845
5846         * decl.c (grokparms): Added new error for duplicate function
5847         parameters names in function prototypes, to match gcc behavior.
5848
5849 2007-04-23  Jan Hubicka  <jh@suse.cz>
5850
5851         * decl2.c (finish_objects): Do not call target constructor/destructor
5852         bits dirrectly.
5853
5854 2007-04-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5855
5856         * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
5857         instead of checking GIMPLE_STMT_P in chain_next.
5858
5859 2007-04-17  Mark Mitchell  <mark@codesourcery.com>
5860
5861         PR c++/31513
5862         * call.c (convert_for_arg_passing): Convert bitfields to their
5863         declared types.
5864
5865 2007-04-17  Simon Martin  <simartin@users.sourceforge.net>
5866
5867         PR c++/31517
5868         * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
5869
5870 2007-04-16  Seongbae Park <seongbae.park@gmail.com>
5871
5872         PR c++/29365
5873         * decl2.c (constrain_class_visibility):
5874         Do not warn about the use of anonymous namespace in the main input file.
5875
5876 2007-04-15  Mark Mitchell  <mark@codesourcery.com>
5877
5878         * cp-tree.h (current_template_parms): Fix typo in comment.
5879
5880 2007-04-15  Kazu Hirata  <kazu@codesourcery.com>
5881
5882         * cp-tree.h, error.c: Fix comment typos.
5883
5884 2007-04-13  Jason Merrill  <jason@redhat.com>
5885
5886         PR c++/31074
5887         * call.c (reference_binding): Add c_cast_p parm.  If true,
5888         add quals to TO as needed to make it reference-compatible.
5889
5890 2007-04-11  Jan Hubicka  <jh@suse.cz>
5891
5892         * class.c (convert_to_base_statically): Fold produced tree; verify
5893         that we are not processing template_decl.
5894
5895 2007-04-09  Mark Mitchell  <mark@codesourcery.com>
5896
5897         PR c++/31449
5898         * class.c (build_base_path): Ensure that the converted pointer has
5899         the same cv-qualification as the input.
5900
5901 2007-04-09  Paolo Carlini  <pcarlini@suse.de>
5902
5903         * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
5904
5905 2007-04-08  Steven Bosscher  <steven@gcc.gnu.org>
5906
5907         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
5908         Do not set it.
5909         (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
5910         * tree.c (cp_add_pending_fn_decls): Remove.
5911         * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
5912
5913 2007-04-07  Daniel Berlin  <dberlin@dberlin.org>
5914
5915         Revert change removing staticp.
5916
5917 2007-04-06  Daniel Berlin  <dberlin@dberlin.org>
5918
5919         * cp-objcp-common.c (cxx_staticp): Remove.
5920         * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
5921         * cp-tree.h (cxx_staticp):
5922
5923 2007-04-04  Danny Smith  <dannysmith.users.sourceforge.net>
5924
5925         * class.c (check_for_override): Don't remove dllmport attribute
5926         of virtual methods.
5927
5928 2007-04-03  Jakub Jelinek  <jakub@redhat.com>
5929
5930         PR c++/30847
5931         * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
5932         type issue error and return early.
5933
5934 2007-03-30  Jason Merrill  <jason@redhat.com>
5935
5936         PR c++/31187
5937         * typeck.c (cp_type_readonly): New fn.
5938         * cp-tree.h: Declare it.
5939         * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
5940         (cp_finish_decl): Not here.
5941
5942 2007-03-31  Richard Guenther  <rguenther@suse.de>
5943
5944         * optimize.c (maybe_clone_body): Replace splay-tree usage by
5945         pointer-map.
5946
5947 2007-03-31  Douglas Gregor  <doug.gregor@gmail.com>
5948
5949         PR c++/31138
5950         PR c++/31140
5951         PR c++/31141
5952         * parser.c (declarator_can_be_parameter_pack): New.
5953         (cp_parser_template_parameter): Only parse the `...' if the
5954         declarator can be a parameter pack.
5955         (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
5956         is NULL.
5957         * pt.c (find_parameter_packs_r): Look into the bounds on integer
5958         types (they could be used as array bounds).
5959         (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
5960         (tsubst_pack_expansion): Handle failure to expand parameter
5961         packs.
5962
5963 2007-03-30  Paolo Carlini  <pcarlini@suse.de>
5964
5965         PR c++/26099
5966         * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
5967         TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
5968         (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
5969         (CLASS_TYPE_NON_UNION_P): Add.
5970         (struct lang_type_class): Add has_complex_dflt.
5971         (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
5972         (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
5973         * cp-tree.def: Add TRAIT_EXPR.
5974         * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
5975         * lex.c (struct resword): Add __has_nothrow_assign,
5976         __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
5977         __has_trivial_constructor, __has_trivial_copy,
5978         __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
5979         __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
5980         __is_pod, __is_polymorphic, __is_union.
5981         * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
5982         (cp_parser_trait_expr): New.
5983         * semantics.c (finish_trait_expr, trait_expr_value
5984         classtype_has_nothrow_copy_or_assign_p): New.
5985         * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
5986         as static.
5987         * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
5988         * class.c (check_bases, check_field_decl, check_bases_and_members):
5989         Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
5990         * pt.c (uses_template_parms, tsubst_copy_and_build,
5991         value_dependent_expression_p, type_dependent_expression_p): Deal with
5992         TRAIT_EXPR.
5993         * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
5994
5995 2007-03-29  Richard Guenther  <rguenther@suse.de>
5996
5997         * tree.c (cp_walk_subtrees): Do not set input_location.
5998
5999 2007-03-28  Simon Martin  <simartin@users.sourceforge.net>
6000
6001         PR c++/29077
6002         * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
6003         destructor.
6004
6005 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
6006
6007         * parser.c (struct cp_parser): Update comment for
6008         greater_than_is_operator_p.
6009         (cp_parser_primary_expression): In C++0x mode, a cast operator can
6010         be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
6011         (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
6012         !GREATER_THAN_IS_OPERATOR_P.
6013         (cp_parser_binary_expression): When -Wc++0x-compat, warn about
6014         `>>' operators that will become two `>' tokens in C++0x.
6015         (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
6016         mode, allowing it to terminate default arguments.
6017         (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
6018         `>>' like two consecutive `>' tokens.
6019         (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
6020         (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
6021         ends a template argument.
6022
6023 2007-03-28  Douglas Gregor  <doug.gregor@gmail.com>
6024
6025         * decl.c (redeclaration_error_message): Complain when redeclaring
6026         a friend function with default template arguments (C++0x mode only).
6027         * cp-tree.h (check_default_tmpl_args): Declare.
6028         * pt.c (check_default_tmpl_args): In C++0x mode, permit default
6029         template arguments in function templates. Add support for checking
6030         the default template arguments of friend templates.
6031         (push_template_decl_real): Fix call to check_default_tmpl_args.
6032         (type_unification_real): If a template parameter has not been
6033         deduced but provides a default template argument, substitute into
6034         that default template argument.
6035         * parser.c (cp_parser_init_declarator): When declaring (but not
6036         defining!) a function template in C++0x mode, check for default
6037         template arguments.
6038
6039 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
6040
6041         PR c++/29993
6042         * decl.c (grokdeclarator): Deal with cv-qualified function type
6043         typedefs in the same way for member and non-member functions.
6044
6045 2007-03-26  Dirk Mueller  <dmueller@suse.de>
6046
6047         * parser.c (cp_parser_member_declaration): Pedwarn
6048         about stray semicolons after member declarations.
6049
6050 2007-03-26  Paolo Carlini  <pcarlini@suse.de>
6051
6052         PR c++/30500
6053         * pt.c (instantiate_decl): Set in_system_header.
6054
6055 2007-03-22  Mark Mitchell  <mark@codesourcery.com>
6056
6057         * cp-tree.h (current_tempalte_parms): Improve documentation.
6058         * pt.c (current_template_args): Likewise.
6059
6060         PR c++/30863
6061         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
6062         not consume tokens when failing.
6063
6064 2007-03-22  Jim Wilson  <wilson@specifix.com>
6065             Mark Mitchell  <mark@codesourcery.com>
6066
6067         PR c++/31273
6068         * call.c (standard_conversion): Use type_decays_to.  Keep FCODE
6069         consistent with FROM.
6070
6071 2007-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6072
6073         * error.c (dump_expr): Handle dependent names that designate types.
6074         * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
6075
6076 2007-03-17  Kazu Hirata  <kazu@codesourcery.com>
6077
6078         * cp-tree.def, parser.c, pt.c: Fix comment typos.
6079
6080 2007-03-16  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6081
6082         * cvt.c (cp_convert_and_check) : Define.
6083         * cp-tree.h (cp_convert_and_check): Declare.
6084         * call.c (convert_conversion_warnings): Rename to
6085         conversion_null_warnings.  The warning for floating-point to
6086         integer is handled by convert_and_check in convert_like_real.
6087         (convert_like_real): convert_conversion_warnings was renamed as
6088         conversion_null_warnings.
6089         * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
6090         overflow and changes of value during conversion.
6091
6092 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6093
6094         PR c++/30891
6095         * parser.c (cp_parser_statement): If 'namespace' is found, this
6096         only can be a namespace alias definition, so parse it now.
6097         (cp_parser_namespace_alias_definition): if we find an open brace
6098         instead of '=', then this is actually a misplaced namespace
6099         definition.
6100
6101 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6102
6103         PR c++/24924
6104         * decl.c (cxx_init_decl_processing): Move command-line options
6105         processing to c-opts.c.
6106
6107 2007-03-15  Douglas Gregor  <doug.gregor@gmail.com>
6108
6109         * ptree.c (cxx_print_type): Use formatting markup for integers
6110         when printing template parameter index/level/orig level.
6111         (cxx_print_xnode): Ditto.
6112         * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
6113         (struct template_parm_index_s): Remove the PARAMETER_PACK member.
6114         Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
6115         HOST_WIDE_INTs.
6116         (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
6117         rather than a HOST_WIDE_INT.
6118         Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
6119         NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
6120         better bit-packing.
6121         (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
6122         RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
6123         IN_BASE_INITIALIZER bool bitfields.
6124         (struct cp_declarator): Make KIND a 4-bit field. Make
6125         PARAMETER_PACK_P a bool bitfield just after KIND.
6126         * pt.c (uses_parameter_packs): Destroy the pointer set.
6127         (make_pack_expansion): Ditto.
6128         (check_for_bare_parameter_packs): Ditto.
6129         * name-lookup.c (push_to_top_level): Make need_pop a bool value.
6130
6131 2007-03-14  Andrew Pinski  <andrew_pinski@playstation.sony.com>
6132
6133         PR c++/31165
6134         * call.c  (convert_default_arg): Instead of copying the node,
6135         unshare it.
6136
6137 2007-03-15  Dirk Mueller  <dmueller@suse.de>
6138
6139         PR c++/30860
6140         * call.c (convert_conversion_warnings): New..
6141         (convert_like_real): .. factored out from here.
6142         (convert_conversion_warnings): Add warning about
6143         false being converted to NULL in argument passing.
6144
6145 2007-03-14  Dirk Mueller  <dmueller@suse.de>
6146
6147         * semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
6148         (finish_do_body): Warn about empty body in do/while statement.
6149
6150 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6151
6152         * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
6153
6154 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6155
6156         PR c/21438
6157         * typeck.c (build_binary_op): Call warn_for_div_zero instead of
6158         warning.
6159
6160 2007-03-13  Alexandre Oliva  <aoliva@redhat.com>
6161
6162         * repo.c (init_repo): Initialize random_seed saved options.
6163         (finish_repo): Adjust.
6164
6165 2007-03-13  Mark Mitchell  <mark@codesourcery.com>
6166
6167         PR bootstrap/30899
6168         * Make-lang.in (doc/g++.1): Use $< to specify the location from
6169         which to copy.
6170
6171 2007-03-12  Seongbae Park <seongbae.park@gmail.com>
6172
6173         * decl.c (compute_array_index_type): New warning flag warn_vla.
6174
6175 2007-03-12  Mark Mitchell  <mark@codesourcery.com>
6176
6177         PR c++/30108
6178         * call.c (convert_default_arg): Copy non-constant arguments.
6179
6180 2007-03-11  Mark Mitchell  <mark@codesourcery.com>
6181
6182         PR c++/31038
6183         * parser.c (cp_parser_postfix_expression): Disallow compound
6184         literals in constant expressions.
6185
6186         PR c++/30328
6187         * semantics.c (finish_typeof): Use unlowered_expr_type.
6188
6189 2007-03-10  Mark Mitchell  <mark@codesourcery.com>
6190
6191         PR c++/30274
6192         * cp-tree.h (unlowered_expr_type): New function.
6193         * typeck.c (is_bitfield_expr_with_lowered_type): Handle
6194         COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
6195         (unlowered_expr_type): New function.
6196         (build_unary_op): Disallow predecrements of bool bitfields.
6197         * call.c (build_conditional_expr): Use unlowered_expr_type.
6198         * pt.c (type_unification_real): Likewise.
6199
6200 2007-03-09  Douglas Gregor  <doug.gregor@gmail.com>
6201
6202         PR c++/20599
6203         * typeck.c (check_return_expr): Check for bare parameter packs.
6204         (comptypes): Compare template parameter packs and
6205         type pack expansions.
6206         * decl.c (grokdeclarator): Deal with the declaration of function
6207         parameter packs.
6208         (grokparms): Verify that the (optional) function parameter pack is
6209         at the end of the parameter list.
6210         (xref_basetypes): Handle pack expansions in the base class.
6211         (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
6212         * cp-tree.def (TYPE_ARGUMENT_PACK): New.
6213         (NONTYPE_ARGUMENT_PACK): New.
6214         (TYPE_PACK_EXPANSION): New.
6215         (EXPR_PACK_EXPANSION): New.
6216         (ARGUMENT_PACK_SELECT): New.
6217         * cp-objcp-common.c (cp_tree_size): Compute size of
6218         (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
6219         ARGUMENT_PACK_SELECT.
6220         * error.c (dump_template_argument): Print template argument packs.
6221         (dump_template_argument_list): Ditto.
6222         (dump_template_parameter): Dump `...' for template type parameter
6223         packs.
6224         (dump_type): Dump TYPE_PACK_EXPANSION nodes.
6225         (dump_parameters): Print function parameter packs.
6226         (dump_template_parms): Print template argument packs.
6227         (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
6228         (maybe_warn_variadic_templates): New.
6229         * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
6230         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
6231         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
6232         CAST_EXPR.
6233         * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
6234         (write_template_arg): Write argument packs as separate arguments.
6235         * cp-tree.h (struct template_parm_index_s): Add flag that
6236         indicates that the template parameter is actually a parameter
6237         pack.
6238         (struct tree_argument_pack_select): New.
6239         (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
6240         (union lang_tree_node): Add argument_pack_select.
6241         (FUNCTION_PARAMETER_PACK_P): New.
6242         (PACK_EXPANSION_P): New.
6243         (PACK_EXPANSION_PATTERN): New.
6244         (SET_PACK_EXPANSION_PATTERN): New.
6245         (PACK_EXPANSION_PARAMETER_PACKS): New.
6246         (ARGUMENT_PACK_P): New.
6247         (ARGUMENT_PACK_ARGS): New.
6248         (SET_ARGUMENT_PACK_ARGS): New.
6249         (ARGUMENT_PACK_INCOMPLETE_P): New.
6250         (ARGUMENT_PACK_EXPLICIT_ARGS): New.
6251         (TEMPLATE_PARM_PARAMETER_PACK): New.
6252         (TEMPLATE_TYPE_PARAMETER_PACK): New.
6253         (ARGUMENT_PACK_SELECT_FROM_PACK): New.
6254         (ARGUMENT_PACK_SELECT_INDEX): New.
6255         (ARGUMENT_PACK_SELECT_ARG): New.
6256         (struct cp_declarator): Add parameter_pack_p flag.
6257         (maybe_warn_variadic_templates): Declare.
6258         (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
6259         indicate a template parameter pack.
6260         (uses_parameter_packs): Declare.
6261         (template_parameter_pack_p): Declare.
6262         (template_parms_variadic_p): Declare.
6263         (make_pack_expansion): Declare.
6264         (check_for_bare_parameter_packs): Declare.
6265         * cxx-pretty-print.c (pp_cxx_unary_expression): Print
6266         sizeof... expressions.
6267         (pp_cxx_expression): Print pack expansions and non-type argument
6268         packs.
6269         (pp_cxx_exception_specification): Print pack expansions.
6270         (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
6271         (pp_cxx_ctor_initializer): Print pack expansions.
6272         (pp_cxx_type_id): Print pack expansions.
6273         (pp_cxx_template_argument_list): Print argument packs.
6274         (pp_cxx_template_parameter): Print ellipsis for template parameter
6275         packs.
6276         * pt.c (comp_template_parms): Compare template parameter packs.
6277         (template_parameter_pack_p): New.
6278         (template_parms_variadic_p): New.
6279         (template_args_variadic_p): New.
6280         (make_ith_pack_parameter_name): New.
6281         (struct find_parameter_pack_data): New.
6282         (find_parameter_packs_r): New.
6283         (uses_parameter_packs): New.
6284         (make_pack_expansion): New.
6285         (check_for_bare_parameter_packs): New.
6286         (expand_template_argument_pack): New.
6287         (reduce_template_parm_level): Propagate parameter pack flag.
6288         (process_template_parm): Add is_parameter_pack parameter to state
6289         when the parameter is actually a parameter pack. Create template
6290         parameter packs when is_parameter_pack is true.
6291         (current_template_args): The argument for a template parameter
6292         pack is an argument pack containing a single pack expansion.
6293         (process_partial_specialization): When checking that non-type
6294         argument expressions do not involve template parameters, loop over
6295         the arguments in argument packs separately.
6296         (push_template_decl_real): Check that the type of the declaration
6297         does not have any bare parameter packs. Check that primary
6298         templates have no more than one parameter pack, and that it comes
6299         at the end of the template parameter list.
6300         (convert_template_argument): Handle coercions for pack expansion
6301         expressions by coercing the pattern then rebuilding the expansion.
6302         (coerce_template_parms): When coercing the arguments for a
6303         variadic template, pack "extra" arguments into an argument pack.
6304         (coerce_template_template_parms): Cannot coerce between parameter
6305         packs and non-pack parameters.
6306         (template_args_equal): Compare PACK_EXPANSION_P expressions.
6307         (comp_template_args): Expand all template arguments packs before
6308         comparing template argument lists.
6309         (mangle_class_name_for_template): Make argument packs as separate
6310         template arguments.
6311         (for_each_template_parm_r): No need to handle BASELINK.
6312         (instantiate_class_template): Handle pack expansions in the base
6313         class list.
6314         (tsubst_pack_expansion): New.
6315         (tsubst_template_args): Handle substitutions of argument packs and
6316         pack expansion into template argument lists.
6317         (tsubst_decl): Expand function parameter packs into separate
6318         function parameters.
6319         (tsubst_arg_types): Expand a type pack expansion into separate
6320         argument types.
6321         (tsubst_exception_specification): Handle pack expansions in
6322         exception specifiers.
6323         (tsubst): See through ARGUMENT_PACK_SELECT arguments when
6324         replacing a template parameter with its argument. If we encounter
6325         a substitution for an argument pack, just return the parameter
6326         itself.
6327         (tsubst_copy): sizeof(X...) returns the number of elements in
6328         parameter pack X.  See through ARGUMENT_PACK_SELECT when the
6329         PARM_DECL is a parameter pack.
6330         (tsubst_expr): Expression pack expansions and argument packs
6331         cannot show up here; they will all be handled through function
6332         calls, sizeof, and template argument lists.
6333         (tsubst_copy_and_build): sizeof(X...) returns the number of
6334         elements in parameter pack X.  Handle pack expansions in TREE_LIST
6335         and CONSTRUCTOR nodes.
6336         (fn_type_unification): Handle "incomplete" explicit template
6337         argument lists that specify some of the arguments for a template
6338         parameter pack.
6339         (type_unification_real): Unify arguments against pack expansions.
6340         (template_parm_level_and_index): New, helper function.
6341         (unify_pack_expansion): New.
6342         (unify): Unify argument packs on an argument-by-argument basis,
6343         handling variadic argument packs as well.
6344         (more_specialized_fn): Handle unification of function parameter
6345         packs. All things being equal, prefer non-variadic function
6346         templates to variadic function templates.
6347         (more_specialized_class): Prefer the variadic class template
6348         partial specialization that binds fewer arguments to a parameter
6349         pack.
6350         (regenerate_decl_from_template): Expand function parameter packs
6351         into separate parameters.
6352         (instantiate_decl): Ditto.
6353         (tsubst_initializer_list): Handle pack expansions for base-class
6354         initializers.
6355         (dependent_type_p_r): Determine dependent types in argument packs
6356         and pack expansions.
6357         (value_dependent_expression_p): Determine value-dependence of
6358         non-type argument packs.
6359         (dependent_template_arg_p): Handle argument packs.
6360         * semantics.c (finish_cond): Check for bare parameter packs.
6361         (finish_expr_stmt): Ditto.
6362         (finish_for_expr): Ditto.
6363         (finish_switch_cond): Ditto.
6364         (finish_mem_initializers): Ditto.
6365         * name-lookup.c (arg_assoc_type): Handle pack expansions and
6366         argument packs.
6367         * decl2.c (cp_build_parm_decl): Mark function parameter packs.
6368         * parser.c (make_declarator): Declarator is not an expansion.
6369         (make_pointer_declarator): Transfer parameter pack flag to outer
6370         declarator.
6371         (make_reference_declarator): Ditto.
6372         (make_ptrmem_declarator): Ditto.
6373         (make_call_declarator): Ditto.
6374         (make_array_declarator): Ditto.
6375         (cp_parser_postfix_expression): Allow pack expansion expressions
6376         in the argument list for a call expression.
6377         (cp_parser_parenthesized_expression_list): Add new parameter
6378         ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
6379         into separate arguments."
6380         (cp_parser_new_placement): Allow pack expansion expressions.
6381         (cp_parser_new_initializer): Ditto.
6382         (cp_parser_mem_initializer_list): Allow ellipsis to create a
6383         base-class initializer expansion.
6384         (cp_parser_mem_initializer): Ditto.
6385         (cp_parser_template_parameter_list): Keep track of whether the
6386         template parameter is a template parameter pack.
6387         (cp_parser_template_parameter): Parse the ellipsis to indicate a
6388         template parameter pack.
6389         (cp_parser_type_parameter): Ditto.
6390         (cp_parser_template_argument_list): Parse the ellipsis to indicate
6391         a pack expansion.
6392         (cp_parser_direct_declarator): Parse the ellipsis to indicate that
6393         this declarator is a parameter pack.
6394         (cp_parser_parameter_declaration): The ellipsis does not end the
6395         parameter declaration, because it might be a parameter pack. Parse
6396         the ellipsis to indicate a parameter pack.
6397         (cp_parser_initializer): Allow pack expansions.
6398         (cp_parser_initializer_list): Allow ellipsis to create an
6399         initializer expansion.
6400         (cp_parser_base_clause): Allow ellipsis to create a base specifier
6401         expansion.
6402         (cp_parser_type_id_list): Allow ellipsis to create an exception
6403         specifier expansion.
6404         (cp_parser_attribute_list): Don't allow pack expansions.
6405         (cp_parser_functional_cast): Allow pack expansions.
6406         (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
6407         compute the length of a parameter pack.
6408         (cp_parser_next_token_ends_template_argument_p): An ellipsis can
6409         end a template argument.
6410         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
6411         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
6412         CAST_EXPR.
6413
6414 2007-03-09  Dirk Mueller  <dmueller@suse.de>
6415
6416         * call.c (build_new_op): Call warn_logical_operator.
6417
6418 2007-03-08  Volker Reichelt  <v.reichelt@netcologne.de>
6419
6420         PR c++/30852
6421         * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
6422
6423         PR c++/30534
6424         * pt.c (any_template_arguments_need_structural_equality_p):
6425         Robustify.
6426
6427 2007-03-08  Alexandre Oliva  <aoliva@redhat.com>
6428
6429         * decl.c (grokdeclarator): Disable warnings for anonymous
6430         bitfields.
6431
6432 2007-03-05  Volker Reichelt  <v.reichelt@netcologne.de>
6433
6434         * typeck2.c (readonly_error): Always emit a hard error.
6435         Remove last argument.
6436         * cp-tree.h (readonly_error): Adjust prototype.
6437         * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
6438         * typeck.c (build_unary_op): Likewise.
6439         (build_modify_expr): Likewise.
6440
6441 2007-03-04  Simon Martin  <simartin@users.sourceforge.net>
6442
6443         PR c++/30895
6444         * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
6445
6446 2007-03-03  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6447
6448         PR c++/15787
6449         * parser.c (struct cp_parser): New IN_IF_STMT.
6450         (cp_parser_statement_seq_opt): Handle an unexpected 'else',
6451         returning if parsing the body of an 'if' statement or issuing an
6452         error and continuing.
6453         (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
6454         body of 'if'.
6455         (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
6456
6457 2007-03-02  Simon Martin  <simartin@users.sourceforge.net>
6458
6459         PR c++/28253
6460         * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
6461         for thunks.
6462
6463 2007-03-02  Geoffrey Keating  <geoffk@apple.com>
6464
6465         * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
6466         Objective-C++.  Don't exit early if -shared-libgcc needs to be
6467         added.
6468
6469 2007-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6470
6471         * typeck.c (common_base_type): Delete unused function.
6472
6473 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
6474
6475         * Make-lang.in: Add dummy lang.install-pdf target.
6476
6477 2007-03-01  Simon Baldwin <simonb@google.com>
6478
6479         PR c++/23689
6480         * decl.c (check_tag_decl): Added new warning for typedef ignored
6481         when it precedes an otherwise valid non-typedef declaration.
6482
6483 2007-02-28  Sandra Loosemore  <sandra@codesourcery.com>
6484
6485         * typeck.c (build_function_call): Store converted arguments
6486         in a stack-allocated array instead of building a list.
6487         (convert_arguments): Store arguments in the array passed in as an
6488         argument, and return the actual number of arguments.
6489         * call.c (build_call): Delete, and replace with...
6490         (build_call_n, build_call_a): New.
6491         (build_op_delete_call): Rewrite to avoid constructing argument lists.
6492         (build_over_call): Store converted arguments in a stack-allocated
6493         array instead of building a list.
6494         (build_cxx_call): Pass arguments in an array instead of as a list.
6495         (build_java_interface_fn_ref): Rewrite to avoid constructing
6496         argument lists.
6497         * tree.h: Update declarations to reflect above changes.
6498         * method.c (use_thunk): Use a stack-allocated array to hold
6499         the arguments instead of a list.
6500         * rtti.c (throw_bad_cast): Update call to cxx_call.
6501         (throw_bad_typeid): Likewise.
6502         (build_dynamic_cast_1): Likewise.
6503         * init.c (build_builtin_delete_call): Use build_call_n.
6504         * decl.c (expand_static_init): Likewise.
6505         * except.c (cp_protect_cleanup_actions): Likewise.
6506         * cp-gimplify.c (genericize_eh_spec_block): Likewise.
6507         (gimplify_must_not_throw_expr): Likewise.
6508         (cxx_omp_apply_fn): Use build_call_a.
6509
6510 2007-02-26  Mark Mitchell  <mark@codesourcery.com>
6511
6512         * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
6513         * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
6514
6515 2007-02-25  Mark Mitchell  <mark@codesourcery.com>
6516
6517         * cp-tree.h (static_ctors): Remove.
6518         * cp-tree.h (static_dtors): Likewise.
6519         * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
6520         refactoring of tree_map hierarchy.
6521         (decl_shadowed_for_var_insert): Likewise.
6522         * semantics.c (expand_body): Use c_expand_body.
6523         (expand_or_defer_fn): Don't update static_ctors or static_dtors.
6524         * decl2.c (static_ctors): Remove.
6525         (static_dtors): Likewise.
6526         (generate_ctor_or_dtor_function): Pass NULL_TREE to
6527         objc_generate_static_init_call.  Do not call static_[cd]tors.
6528         (generate_ctor_and_dtor_functions_for_priority): Do not check for
6529         static_[cd]tors.
6530         (cp_write_global_declarations): Likewise.
6531
6532 2007-02-23  Richard Guenther  <rguenther@suse.de>
6533
6534         * class.c (note_name_declared_in_class): Make declaration
6535         changes meaning a pedwarn.
6536
6537 2007-02-22  Michael Matz  <matz@suse.de>
6538
6539         PR c++/29433
6540         * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
6541         * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
6542         dump_function_decl): Guard emitting outer scopes by new flag.
6543         * cp-lang.c (cxx_dwarf_name): New function.
6544         (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
6545         * pt.c (classtype_mangled_name, mangle_class_name_for_template):
6546         Remove functions.
6547         (push_template_decl_real, lookup_template_class): Remove calls
6548         to above functions.
6549
6550 2007-02-19  Mark Mitchell  <mark@codesourcery.com>
6551
6552         * call.c (build_new_method_call): Ensure that explicit calls of
6553         destructors have type "void".
6554
6555 2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6556
6557         * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
6558         and -Walways-true with -Waddress.
6559         * cvt.c (convert_to_void): Replace unconditional warning with
6560         -Waddress.
6561
6562 2007-02-18  Kazu Hirata  <kazu@codesourcery.com>
6563
6564         * decl.c, tree.c: Fix comment typos.
6565
6566 2007-02-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
6567
6568         PR C++/30158
6569         * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
6570         statement expression if we had an error mark node.
6571
6572 2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
6573             Brooks Moses  <brooks.moses@codesourcery.com>
6574             Lee Millward  <lee.millward@codesourcery.com>
6575
6576         * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
6577         Change class to tcc_vl_exp.
6578
6579         * call.c (build_call): Use build_call_list instead
6580         of build3.
6581         (build_over_call): Likewise.
6582         (build_new_method_call): Use build_min_non_dep_call_list
6583         instead of build_min_non_dep.
6584
6585         * error.c (dump_call_expr_args): New function.
6586         (dump_aggr_init_expr_args): New function.
6587         (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
6588         Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
6589
6590         * cvt.c (convert_to_void): Use build_call_array instead
6591         of build3; use new AGGR_INIT_EXPR accessor macros.
6592
6593         * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
6594         instead of TREE_CODE_LENGTH.
6595
6596         * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
6597         AGGR_INIT_EXPR accessor macros.
6598
6599         * cp-gimplify.c (cp_gimplify_init_expr): Use
6600         AGGR_INIT_EXPR_SLOT to set the slot operand.
6601
6602         * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
6603         (AGGR_INIT_EXPR_SLOT): New macro.
6604         (AGGR_INIT_EXPR_ARG): New macro.
6605         (aggr_init_expr_nargs): New macro.
6606         (AGGR_INIT_EXPR_ARGP): New macro.
6607         (aggr_init_expr_arg_iterator): New.
6608         (init_aggr_init_expr_arg_iterator): New.
6609         (next_aggr_init_expr_arg): New.
6610         (first_aggr_init_expr_arg): New.
6611         (more_aggr_init_expr_args_p): New.
6612         (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
6613         (stabilize_aggr_init): New declaration.
6614         (build_min_non_dep_call_list): Likewise.
6615
6616         * tree.c (process_aggr_init_operands): New function.
6617         (build_aggr_init_array) New function.
6618         (build_cplus_new): Update to use new CALL_EXPR and
6619         AGGR_INIT_EXPR accessor macros. Replace use of build3 with
6620         build_aggr_init_array.
6621         (build_min_non_dep_call_list) New function.
6622         (build_min_nt): Assert input code parameter is not a variable
6623         length expression class.
6624         (build_min, build_min_non_dep): Likewise.
6625         (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
6626         to check for equality instead of recursing. Handle tcc_vl_exp
6627         tree code classes.
6628         (stabilize_call): Update to only handle CALL_EXPRs, not
6629         AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
6630         (stabilize_aggr_init): New function.
6631         (stabilize_init): Use it.
6632
6633         * cxx-pretty-print.c (pp_cxx_postfix_expression)
6634         <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
6635         AGGR_INIT_EXPR accessor macros and argument iterators.
6636
6637         * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
6638         build_vl_exp. Iterate through the operands, recursively
6639         processing each one.
6640         (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
6641         CALL_EXPR accessor macros.
6642         (value_dependent_expression_p) <default>: Handle tcc_vl_exp
6643         tree code classes. Use TREE_OPERAND_LENGTH instead of
6644         TREE_CODE_LENGTH.
6645
6646         * semantics.c (finish_call_expr): Use build_nt_call_list
6647         instead of build_nt.
6648         (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
6649         accessor macros. Use build_call_array to construct the
6650         CALL_EXPR node instead of build3
6651
6652         * decl2.c (build_offset_ref_call_from_tree): Use
6653         build_nt_call_list and build_min_non_dep_call_list instead
6654         of build_min_nt and build_min_non_dep.
6655
6656         * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
6657         Use build_nt_call_list instead of build_min_nt.
6658
6659 2007-02-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6660
6661         PR c++/28943
6662         * call.c (build_conditional_expr): Improve error message.
6663
6664 2007-02-13  Dirk Mueller  <dmueller@suse.de>
6665
6666         * friend.c (do_friend): Annotate warning about friend
6667         declarations in templates with OPT_Wnon_template_friend.
6668         Convert informal message from warning() to inform().
6669
6670 2007-02-12  Simon Martin  <simartin@users.sourceforge.net>
6671             Mark Mitchell  <mark@codesourcery.com>
6672
6673         PR c++/14622
6674         * pt.c (do_decl_instantiation): Detect type mismatches in explicit
6675         instantiations for variables.
6676
6677 2007-02-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6678
6679         PR middle-end/7651
6680         * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
6681         Check warn_unused_value just once.
6682
6683 2007-02-11  Mark Mitchell  <mark@codesourcery.com>
6684
6685         PR c++/26988
6686         * pt.c (determine_specialization): Use skip_artificial_parms_for.
6687         (fn_type_unificiation): Likewise.
6688         (get_bindings): Likewise.
6689
6690 o2007-02-06  Mark Mitchell  <mark@codesourcery.com>
6691
6692         PR target/29487
6693         * decl.c (finish_function): Use DECL_REPLACEABLE.
6694         * tree.c (cp_cannot_inline_tree_fn): Likewise.
6695
6696 2007-02-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6697
6698         * parser.c (cp_parser_primary_expression): Reformat overly long lines.
6699
6700 2007-02-10  Richard Henderson  <rth@redhat.com>, Jakub Jelinek  <jakub@redhat.com>
6701
6702         * decl.c (grokvardecl): Don't error if !have_tls.
6703         (grokdeclarator): Likewise.
6704         * parser.c (cp_parser_omp_threadprivate): Likewise.
6705
6706 2007-02-07  Jakub Jelinek  <jakub@redhat.com>
6707
6708         PR c++/30703
6709         * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
6710         parameters and result decls in omp clauses.
6711         (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
6712         by reference.
6713
6714 2007-02-05  Dirk Mueller  <dmueller@suse.de>
6715
6716         PR bootstrap/30510
6717         * parser.c (cp_parser_class_specifier): Always initialize bases.
6718
6719 2007-02-05  Paolo Bonzini  <bonzini@gnu.org>
6720
6721         * cp-tree.h (OMP_ATOMIC_CODE): Delete.
6722         (OMP_ATOMIC_DEPENDENT_P): Rewrite.
6723         * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
6724         expressions.
6725         * semantics.c (finish_omp_atomic): Store a whole expression node
6726         in operand 1, and integer_zero_node in operand 0, for dependent
6727         OMP_ATOMIC.  Rewrite to make flow easier to understand.
6728
6729 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6730
6731         * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
6732
6733 2007-02-04  Kazu Hirata  <kazu@codesourcery.com>
6734
6735         * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
6736         parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
6737
6738 2007-02-03  Douglas Gregor  <doug.gregor@gmail.com>
6739
6740         * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
6741         keyword warning to -Wc++0x-compat.
6742
6743 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6744
6745         * decl.c (grokdeclarator): Update documentation.
6746
6747 2007-02-02  Jakub Jelinek  <jakub@redhat.com>
6748
6749         PR c++/30536
6750         * decl.c (grokdeclarator): If __thread is used together with
6751         a storage class other than extern and static, clear thread_p
6752         after issuing diagnostics and fall through to checking the
6753         storage class.
6754
6755 2007-01-30  Roger Sayle  <roger@eyesopen.com>
6756
6757         * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
6758         calculating the size of an array (to avoid recursive errors).
6759
6760 2007-01-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6761
6762         PR c++/24745
6763         * typeck.c (build_binary_op): Fix logic for warning. Move warning
6764         to -Wpointer-arith.
6765         * call.c (convert_like_real): Don't warn when converting to
6766         boolean type.
6767
6768 2007-01-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6769
6770         * decl.c (pop_label): Replace warning with call to
6771         warn_for_unused_label.
6772
6773 2007-01-28  Andrew Pinski  <pinskia@gmail.com>
6774
6775         PR C++/28988
6776         * semantics.c (finish_pseudo_destructor_expr): Check the
6777         destrutor name by calling check_dtor_name.
6778
6779 2007-01-24  Douglas Gregor  <dgregor@osl.iu.edu>
6780
6781         * lex.c (D_CPP0X): Rename.
6782         (D_CXX0X): To this.
6783         (reswords): D_CPP0X -> D_CXX0X.
6784         (init_reswords): Ditto.
6785         * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
6786         of C++0x keywords as identifiers.
6787
6788 2007-01-23  Simon Martin  <simartin@users.sourceforge.net>
6789
6790         PR c++/27492
6791         * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
6792         function decls.
6793
6794 2007-01-23  Ian Lance Taylor  <iant@google.com>
6795
6796         * typeck.c (convert_for_assignment): Only warn about a = b = c
6797         when converting to bool.
6798
6799 2007-01-23  Roger Sayle  <roger@eyesopen.com>
6800
6801         * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
6802         TREE_OVERFLOW.
6803         * typeck.c (ignore_overflows): Remove the remaining uses of
6804         TREE_CONSTANT_OVERFLOW.
6805
6806 2007-01-20  Jan Hubicka  <jh@suse.cz>
6807
6808         * decl2.c (start_objects, start_static_storage_duration_function):
6809         Do not make the functions uninlinable.
6810
6811 2007-01-17  Ian Lance Taylor  <iant@google.com>
6812
6813         * class.c (add_method): Call VEC_reserve_exact rather than passing
6814         a negative size to VEC_reserve.
6815
6816 2007-01-11  Simon Martin  <simartin@users.sourceforge.net>
6817
6818         PR c++/29573
6819         * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
6820
6821 2007-01-10  Mark Mitchell  <mark@codesourcery.com>
6822
6823         PR c++/28999
6824         * decl.c (make_typename_type): If the qualified name is not a
6825         type, issue an error.
6826         * parser.c (cp_parser_elaborated_type_specifier): Fix comment
6827         formatting.
6828
6829 2007-01-08  Geoffrey Keating  <geoffk@apple.com>
6830
6831         * rtti.c: Include target.h.
6832         (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
6833         don't emit typeinfo for fundamental types as weak.
6834         * Make-lang.in (cp/rtti.o): Update and correct dependencies.
6835
6836 2007-01-08  Richard Guenther  <rguenther@suse.de>
6837
6838         * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
6839
6840 2007-01-08  Mark Shinwell  <shinwell@codesourcery.com>
6841
6842         * call.c (standard_conversion): Pass flag to
6843         vector_types_convertible_p to disallow emission of note.
6844         * typeck.c (convert_for_assignment): Pass flag to
6845         vector_types_convertible_p to allow emission of note.
6846         (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
6847         to disallow emission of note.
6848
6849 2007-01-07  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6850
6851         PR c++/28986
6852         * typeck.c (build_binary_op): Call overflow_warning if
6853         TREE_OVERFLOW_P is true for the result and not for any of the
6854         operands.
6855
6856 2007-01-06  Lee Millward  <lee.millward@codesourcery.com>
6857
6858         PR c++/19439
6859         * class.c (add_method): Don't wait until template
6860         instantiation time to complain about duplicate methods.
6861
6862 2007-01-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6863
6864         PR c/19978
6865         * semantics.c (finish_unary_op_expr): Warn only if result
6866         overflowed and operands did not.
6867
6868 2007-01-05  Ian Lance Taylor  <iant@google.com>
6869
6870         * typeck.c (build_binary_op): Warn about comparing a non-weak
6871         address to NULL.
6872
6873 2007-01-05  Douglas Gregor  <doug.gregor@gmail.com>
6874
6875         * pt.c (tsubst): Propagate the need for structural equality checks
6876         when reducing the level of template parameters.
6877
6878 2007-01-03  Kazu Hirata  <kazu@codesourcery.com>
6879
6880         * pt.c: Fix a comment typo.
6881
6882 2007-01-02  Ian Lance Taylor  <iant@google.com>
6883
6884         * semantics.c (maybe_convert_cond): Optionally warn when using an
6885         assignment as a condition.
6886         * typeck.c (convert_for_assignment): Optionally warn about
6887         assigning the result of an assignment to a bool.
6888
6889 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
6890
6891         * pt.c (canonical_template_parms): Correct typo in comment.
6892
6893 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
6894
6895         * typeck.c (structural_comptypes): Renamed from "comptypes".
6896         (comptypes): Use canonical type information to perform fast type
6897         comparison. When VERIFY_CANONICAL_TYPES, verify that the
6898         canonical type comparison returns the same results as we would see
6899         from the current, structural check. Support COMPARE_STRUCTURAL
6900         when we need structural checks.
6901         * decl.c (typename_compare): Fix comment.
6902         (build_typename_type): TYPENAME_TYPE nodes require structural
6903         equality checks, because they resolve different based on the
6904         current class type.
6905         (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
6906         require structural equality checks (for now).
6907         (build_ptrmemfunc_type): Build the canonical pointer to member
6908         function type.
6909         (compute_array_index_type): Whenever we build a new index type
6910         to represent the size of an array in a template, we need to mark
6911         this index type as requiring structural equality. This goes for
6912         arrays with value-dependent sizes with the current ABI, or all
6913         arrays with ABI-1.
6914         * tree.c (cplus_array_hash): New.
6915         (struct cplus_array_info): New.
6916         (cplus_array_compare): New.
6917         (cplus_array_htab): New.
6918         (build_cplus_array_type_1): Use a hash table to cache the array
6919         types we build. Build the canonical array type for each array
6920         type.
6921         (cp_build_qualified_type_real): When building a cv-qualified array
6922         type, use the hash table of array types and build canonical array
6923         types as necessary.
6924         (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
6925         use structural equality (for now).
6926         * cp-tree.h (COMPARE_STRUCTURAL): New.
6927         * pt.c (canonical_template_parms): New.
6928         (canonical_type_parameter): New.
6929         (process_template_parm): Find the canonical type parameter.
6930         (lookup_template_class): When we have named the primary template
6931         type, set the canonical type for our template class to the primary
6932         template type. If any of the template arguments need structural
6933         equality checks, the template class needs structural equality
6934         checks.
6935         (tsubst): When reducing the level of a template template
6936         parameter, we require structural equality tests for the resulting
6937         parameter because its template parameters have not had their types
6938         canonicalized. When reducing a template type parameter, find the
6939         canonical reduced type parameter.
6940         (any_template_arguments_need_structural_equality_p): New.
6941