OSDN Git Service

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