OSDN Git Service

PR c++/34196
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2008-01-21  Jason Merrill  <jason@redhat.com>
2
3         PR c++/34196
4         * decl.c (wrap_cleanups_r): Set TRY_CATCH_IS_CLEANUP.
5
6 2008-01-21  Richard Guenther  <rguenther@suse.de>
7
8         PR c++/34850
9         * error.c (cp_print_error_function): Deal with recursive
10         BLOCK trees.
11
12 2008-01-20  Paolo Carlini  <pcarlini@suse.de>
13
14         PR c++/34891
15         * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR.
16
17 2008-01-20  Paolo Carlini  <pcarlini@suse.de>
18
19         PR c++/34776
20         PR c++/34486
21         * name-lookup.c (do_class_using_decl): Do not call constructor_name_p
22         on non-IS_AGGR_TYPE scope.
23         (constructor_name_p): Assert IS_AGGR_TYPE.
24
25 2008-01-18  Ian Lance Taylor  <iant@google.com>
26
27         PR c++/33407
28         * decl.c (duplicate_decls): Copy DECL_IS_OPERATOR_NEW flag.
29         (grok_op_properties): For NEW_EXPR and VEC_NEW_EXPR set
30         DECL_IS_OPERATOR_NEW flag.
31
32 2008-01-16  Richard Guenther  <rguenther@suse.de>
33
34         PR c++/33819
35         * typeck.c (is_bitfield_expr_with_lowered_type): Recurse
36         for conversions to type variants.
37
38 2008-01-15  Andreas Tobler  <a.tobler@schweiz.org>
39
40         * parser.c (cp_parser_template_parameter): Fix C90 issue with mixing
41         declaration and code.  Update copyright year.
42
43 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
44
45         PR c++/34399
46         * friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we
47         know we have a class type.
48
49 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
50
51         PR c++/34751
52         * pt.c (coerce_template_parameter_pack): When substituting into
53         the type of a non-type template parameter pack. use the
54         deduced/substituted arguments.
55         * parser.c (declarator_can_be_parameter_pack): A pointer-to-member
56         can be a parameter pack with the ellipsis following it.  When we
57         have an erroneous declaration, allow it to be a parameter pack.
58         (cp_parser_template_parameter): Complain about default
59         arguments on non-type template parameter packs, and parse them
60         using the new cp_parser_default_argument.
61         (cp_parser_parameter_declaration): Complain about parameter packs
62         with default arguments. Move parsing of default arguments into a
63         new function, cp_parser_default_argument.
64         (cp_parser_default_argument): New; extracted from
65         cp_parser_parameter_declaration.
66
67 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
68
69         PR c++/34051
70         PR c++/34055
71         PR c++/34102
72         PR c++/34103
73         * typeck.c (check_return_expr): If there are bare parameter packs
74         in the return value, set it to error_mark_node.
75         * tree.c (cp_walk_subtrees): Walk USING_DECL nodes.
76         * pt.c (find_parameter_packs_r): Look at the type of
77         IDENTIFIER_NODEs (e.g., for user-defined conversions).
78         (check_for_bare_parameter_packs): Flip the result: now returns
79         TRUE when there were bare parameter packs, FALSE otherwise.
80         (push_template_decl_real): Deal with flipped result of
81         check_for_bare_parameter_packs.
82         * semantics.c (finish_cond): If there are bare parameter packs in
83         the conditional, set it to error_mark_node.
84         (finish_expr_stmt): If there are bare parameter packs in the
85         expression, set it to error_mark_node.
86         (finish_for_expr): Ditto.
87         (finish_switch_cond): If there are bare parameter packs in
88         the conditional, set it to error_mark_node.
89         (finish_mem_initializers): If there are bare parameter packs in
90         the member initializer, set it to error_mark_node.
91         (finish_member_declaration): Check the attributes of the
92         declaration for bare parameter packs, and remove the attributes if
93         any have bare parameter packs.
94         * parser.c (cp_parser_using_declaration): Check the using
95         declaration for bare parameter packs.
96         (cp_parser_base_clause): If there are bare parameter packs in a
97         base specifier, don't add it to the chain.
98
99 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
100
101        PR c++/34314
102        * error.c (dump_simple_decl): Display ellipsis for template
103        non-type parameter packs.
104        (dump_decl): Display ellipsis for template type parameter packs.
105        (dump_template_decl): Display ellipsis for template template
106        parameter packs.
107        * pt.c (redeclare_class_template): When redeclaring a class
108        template, check for collisions between template parameters and
109        template parameter packs.
110
111 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
112
113        PR c++/33964
114        * pt.c (process_partial_specialization): Don't mark template
115        parameters that occur in non-deduced contexts.
116        (struct pair_fn_data): Add include_nondeduced_p.
117        (for_each_template_parm_r): Only visit non-deduced contexts if
118        include_nondeduced_p is set.
119        (for_each_template_parm): Added parameter include_nondeduced_p,
120        which states whether template parameters found in non-deduced
121        contexts should be visited.
122        (uses_template_parms): Visit all template parameters, even those
123        in non-deduced contexts.
124
125 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
126
127        PR c++/34052
128        * pt.c (check_default_tmpl_args): Check for parameter packs that
129        aren't at the end of a primary template.
130        (push_template_decl_real): Remove check for parameter packs that
131        aren't at the end of a primary template; that now happens in
132        check_default_tmpl_args.
133        * semantics.c (finish_template_template_parm): Use
134        check_default_tmpl_args to check for errors in the template
135        parameter list.
136         
137 2008-01-12  Doug Kwan  <dougkwan@google.com>
138
139         * decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers
140         instead of OPT_Wreturn_type in warning due to ignored return type
141         qualifiers.
142         * pt.c: (tsubst_function_type): Use OPT_Wignored_qualifiers
143         instead of OPT_Wreturn_type in warning due to ignored return type
144         qualifiers.
145
146 2008-01-08  Jakub Jelinek  <jakub@redhat.com>
147
148         PR c++/33890
149         * semantics.c (finish_omp_for): Don't call
150         fold_build_cleanup_point_expr if processing_template_decl.
151
152 2008-01-04  Paolo Carlini  <pcarlini@suse.de>
153             Jakub Jelinek  <jakub@redhat.com>
154
155         PR c++/34611
156         * error.c (dump_template_argument): Deal with TREE_LIST.
157
158 2008-01-01  Douglas Gregor  <doug.gregor@gmail.com>
159
160        * parser.c (cp_parser_check_decl_spec): Don't warn about "long
161        long" in C++0x mode; change the warning to note that "long long"
162        is only unsupported in C++98 mode.
163
164 2007-12-20  Jason Merrill  <jason@redhat.com>
165
166         PR c++/34111
167         * call.c (standard_conversion): Derived-to-base is considered a
168         standard conversion.
169
170 2007-12-19  Jakub Jelinek  <jakub@redhat.com>
171
172         PR c++/34513
173         * parser.c (cp_parser_omp_parallel): For non-combined parallel
174         call cp_parser_statement rather than
175         cp_parser_already_scoped_statement.
176
177 2007-12-18  Jason Merrill  <jason@redhat.com>
178
179         PR c++/34206
180         * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't 
181         use template parms.
182         (dependent_type_p_r): Handle the domain of an array.
183
184 2007-12-18  Douglas Gregor  <doug.gregor@gmail.com>
185             Jakub Jelinek  <jakub@redhat.com>
186         
187         PR c++/32565
188         PR c++/33943
189         PR c++/33965
190         * pt.c (template_template_parm_bindings_ok_p): New; verifies
191         bindings of template template parameters after all template
192         arguments have been deduced.
193         (coerce_template_parms): Don't complain when COMPLAIN doesn't
194         include tf_error.
195         (fn_type_unification): Use template_template_parm_bindings_ok_p. 
196         (unify): Deal with variadic, bound template template parameters. 
197         (get_class_bindings): Use template_template_parm_bindings_ok_p. 
198
199 2007-12-18  Jakub Jelinek  <jakub@redhat.com>
200
201         PR c++/34488
202         * decl.c (grokdeclarator): Reject friend sfk_constructor
203         FUNCTION_TYPE.
204
205 2007-12-17  Jakub Jelinek  <jakub@redhat.com>
206
207         PR c/34506
208         * parser.c (cp_parser_omp_all_clauses): Accept optional comma
209         in between clauses.
210
211 2007-12-15  Alexandre Oliva  <aoliva@redhat.com>
212
213         PR debug/7081
214         * cp-lang.c (cp_classify_record): New.
215         (LANG_HOOKS_CLASSIFY_RECORD): Override.
216
217 2007-12-11  Jakub Jelinek  <jakub@redhat.com>
218
219         PR c++/34238
220         * decl2.c (cp_write_global_declarations): Revert 2007-11-22 change.
221
222         PR c++/34364
223         * rtti.c (build_dynamic_cast): Call convert_from_reference even for
224         dynamic_cast in a template.
225
226 2007-12-10  Simon Martin  <simartin@users.sourceforge.net>
227
228         PR c++/34059
229         * typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from
230         MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO.
231
232 2007-12-10  Jakub Jelinek  <jakub@redhat.com>
233
234         PR c++/34395
235         * error.c (dump_type_prefix, dump_type_suffix): Handle
236         TYPE_PACK_EXPANSION.
237
238         PR c++/34394
239         * error.c (dump_expr): Handle ABS_EXPR.
240
241 2007-12-09  Jakub Jelinek  <jakub@redhat.com>
242
243         PR c++/34178
244         PR c++/34340
245         * repo.c (repo_emit_p): Return 2 for DECL_INTEGRAL_CONSTANT_VAR_P
246         in class scope rather than DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
247         Return 2 also if DECL_EXPLICIT_INSTANTIATION.
248         * decl2.c (import_export_decl): Don't make VAR_DECLs import_p when
249         flag_use_repository and repo_emit_p returned 2.
250
251 2007-12-06  Jakub Jelinek  <jakub@redhat.com>
252
253         PR c++/34336
254         * tree.c (stabilize_call, stabilize_init): Do nothing if
255         processing_template_decl.
256
257 2007-12-05  Jakub Jelinek  <jakub@redhat.com>
258
259         PR c++/34271
260         * semantics.c (finish_decltype_type): For SCOPE_REF issue an
261         error instead of assertion failure.
262         * parser.c (cp_parser_decltype): If closing paren is not found,
263         return error_mark_node.
264
265 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
266
267        PR c++/34101
268        * name-lookup.c (arg_assoc_template_arg): Recurse on argument
269        packs.
270        (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
271        since arg_assoc_template_arg will deal with them (better).
272
273 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
274
275        PR c++/33509
276        * pt.c (tsubst_exception_specification): Handle substitutions into
277        member templates, where tsubst_pack_expansion returns a
278        TYPE_PACK_EXPANSION.
279
280 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
281
282        PR c++/33091
283        * pt.c (unify_pack_expansion): If we didn't deduce any actual
284        bindings for the template parameter pack, don't try to keep the
285        empty deduced arguments.
286        (unify): If a parameter is a template-id whose template argument
287        list contains a pack expansion that is not at the end, then we
288        cannot unify against that template-id.
289
290 2007-12-02  Paolo Carlini  <pcarlini@suse.de>
291
292         PR c++/34061
293         * pt.c (current_template_args): Use error_operand_p.
294
295 2007-12-02  Paolo Carlini  <pcarlini@suse.de>
296
297         PR c++/34273
298         * error.c (dump_decl): Handle TREE_BINFO.
299
300 2007-12-01  Ollie Wild  <aaw@google.com>
301
302         PR c++/8171
303         * typeck.c (build_binary_op): Add conversion of pointers to function
304         members appearing as operands to the equality operators.
305
306 2007-11-30  Jakub Jelinek  <jakub@redhat.com>
307
308         PR c++/34275
309         * error.c (dump_expr): Handle OBJ_TYPE_REF.
310
311 2007-11-29  Jakub Jelinek  <jakub@redhat.com>
312
313         PR c++/34270
314         * tree.c (lvalue_p_1) <case COND_EXPR>: Handle x ?: y
315         in templates.
316         * typeck.c (is_bitfield_expr_with_lowered_type) <case COND_EXPR>:
317         Likewise.
318
319         PR c++/34267
320         PR c++/34268
321         * parser.c (cp_parser_decltype): Don't call finish_id_expression
322         on ~type.
323         * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs
324         and ~type early.
325
326 2007-11-27  Jakub Jelinek  <jakub@redhat.com>
327
328         PR tree-optimization/34181
329         * method.c (use_thunk): Don't inline the call in the thunk.
330
331         PR c++/34213
332         * tree.c (decl_linkage): Static data members and static member
333         functions in anonymous ns classes are lk_external.
334
335 2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>
336
337         PR c++/34081
338         * decl.c (start_preparsed_function): Pass 
339         processing_template_decl for the new allocate_struct_function
340         parameter.
341
342 2007-11-25  Richard Guenther  <rguenther@suse.de>
343
344         * decl.c (poplevel): Use BLOCK_CHAIN.
345
346 2007-11-24  Ollie Wild  <aaw@google.com>
347
348         * typeck.c (delta_from_ptrmemfunc): New function.
349         (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc.
350         (build_binary_op): Call delta_from_ptrmemfunc.
351
352 2007-11-23  Jakub Jelinek  <jakub@redhat.com>
353
354         PR c++/30293
355         PR c++/30294
356         * decl.c (cp_finish_decl): Disallow variable or field
357         definitions if extern "Java" aggregates.
358         (grokparms): Disallow parameters with extern "Java"
359         aggregates.
360         (check_function_type): Disallow function return values
361         with extern "Java" aggregates.
362         * init.c (build_new_1): Disallow placement new with
363         extern "Java" aggregates.
364
365 2007-11-23  Mark Mitchell  <mark@codesourcery.com>
366             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
367         
368         PR c++/5310
369         * call.c (convert_like_real): Build a zero constant when __null is
370         converted to an integer type.
371         
372 2007-11-22  Jakub Jelinek  <jakub@redhat.com>
373
374         PR c++/34094
375         * decl2.c (cp_write_global_declarations): Issue error about static
376         data members in anonymous namespace which are declared and used,
377         but not defined.
378
379 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
380
381         PR c++/34089
382         * parser.c (cp_parser_class_head): Reject function template ids.
383
384         PR c++/28879
385         * tree.c (build_cplus_array_type_1): Don't pass any VLA types
386         when processing_template_decl to build_array_type.
387
388         PR c++/33962
389         * pt.c (more_specialized_fn): Don't segfault if one or
390         both argument list end with ellipsis.
391
392 2007-11-18  Jakub Jelinek  <jakub@redhat.com>
393
394         PR c++/30988
395         * semantics.c (finish_call_expr): Set
396         current_function_returns_abnormally if fn is noreturn FUNCTION_DECL
397         or OVERLOAD with all noreturn functions.
398
399 2007-11-16  Jakub Jelinek  <jakub@redhat.com>
400
401         PR c++/34100
402         * pt.c (apply_late_template_attributes): Do nothing if decl's type is
403         error_mark_node.
404
405 2007-11-13  Jakub Jelinek  <jakub@redhat.com>
406
407         PR c++/34054
408         PR c++/34056
409         PR c++/34057
410         PR c++/34058
411         PR c++/34060
412         * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error,
413         set to error_mark_node the outermost POINTER_TYPE to the pack if
414         it is seen in a POINTER_TYPE.
415         (push_template_decl_real): If check_for_bare_parameter_packs
416         fails for function return type, set the return type to
417         integer_type_node.  If check_for_bare_parameter_packs failed
418         for non-function, return error_mark_node.
419
420         PR c++/29225
421         * call.c (build_new_op): Call resolve_args before calling
422         build_over_call.
423
424 2007-11-11  Tom Tromey  <tromey@redhat.com>
425
426         PR c++/17577:
427         * lex.c (handle_pragma_implementation): Use cpp_included_before.
428
429 2007-11-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
430
431         PR c++/8570
432         * pt.c (redeclare_class_template): Update error message. Use a
433         note to show the previous declaration.
434         (tsubst_friend_class): Use the location of the friend template as
435         the input location before calling redeclare_class_template.
436
437 2007-11-11  Jakub Jelinek  <jakub@redhat.com>
438
439         PR c++/34068
440         * semantics.c (finish_pseudo_destructor_expr): Handle
441         object == error_mark_node.
442
443 2007-11-10  Jakub Jelinek  <jakub@redhat.com>
444
445         PR c++/32241
446         * pt.c (tsubst_copy_and_build) <case COMPONENT_REF>: If object_type
447         is not scalar type, let finish_class_member_access_expr handle
448         diagnostics.  Pass BIT_NOT_EXPR argument to
449         finish_pseudo_destructor_expr.  Handle SCOPE_REF properly.
450
451 2007-11-09  Douglas Gregor  <doug.gregor@gmail.com>
452
453         PR c++/33510
454         * decl.c (cp_complete_array_type): If any of the initializer
455         elements are pack expansions, don't compute the array size yet.
456
457 2007-11-08  Andrew Pinski  <pinskia@gmail.com>
458
459         PR c++/30297:
460         * tree.c (decl_linkage): Fields have no linkage.
461
462 2007-11-08  Daniel Jacobowitz  <dan@codesourcery.com>
463
464         * class.c (build_ctor_vtbl_group): Lay out the new type and decl.
465
466 2007-11-07  Douglas Gregor  <doug.gregor@gmail.com>
467
468         PR c++/33045
469         PR c++/33837
470         PR c++/33838
471         * semantics.c (finish_decltype_type): See through INDIRECT_REFs.
472         Be careful with ERROR_MARK_NODEs.
473         * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL
474         argument.
475
476 2007-11-07  Jakub Jelinek  <jakub@redhat.com>
477
478         PR c++/33501
479         * call.c (build_over_call): Don't check TREE_ADDRESSABLE
480         on incomplete type.
481
482 2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>
483
484         PR c++/33977
485         PR c++/33886
486         * tree.c (c_build_qualified_type): Define bridge to
487         cp_build_qualified_type.
488
489 2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>
490
491         PR c++/31439
492         PR c++/32114
493         PR c++/32115
494         PR c++/32125
495         PR c++/32126
496         PR c++/32127
497         PR c++/32128
498         PR c++/32253
499         PR c++/32566
500         * typeck.c (check_return_expr): Pass address of retval to
501         check_for_bare_parameter_packs.
502         * class.c (build_base_field): Tolerate bases that have no layout
503         due to errors.
504         (end_of_base): Ditto.
505         * tree.c (canonical_type_variant): Be careful with
506         ERROR_MARK_NODE.
507         * cp-tree.h (check_for_bare_parameter_packs): Now accepts a
508         tree*.
509         * pt.c (find_parameter_pack_data): Add set_packs_to_error field,
510         which states whether parameter packs should be replaced with
511         ERROR_MARK_NODE.
512         (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever
513         possible. If set_packs_to_error is set true, replace the parameter
514         pack with ERROR_MARK_NODE. Manage our own pointer sets.
515         (uses_parameter_packs): Don't set parameter packs to
516         ERROR_MARK_NODE.
517         (check_for_bare_parameter_packs): Now takes a pointer to a tree,
518         which may be modified (if it is a parameter pack). Instructs
519         find_parameter_packs_r to replace parameter packs with
520         ERROR_MARK_NODE (so that they won't cause errors later on).
521         (process_template_parm): Pass pointer to
522         check_for_bare_parameter_packs.
523         (process_partial_specialization): Replace pack expansions before
524         the end of the template argument list with ERROR_MARK_NODE.
525         (push_template_decl_real): Pass pointer to
526         check_for_bare_parameter_packs. Replace parameter packs not at the
527         end of the template parameter list with ERROR_MARK_NODE.
528         (convert_template_argument): Be more careful about using DECL_NAME
529         on only declarations.
530         (unify): Can't unify against ERROR_MARK_NODE.
531         * semantics.c (finish_cond): Pass pointer to
532         check_for_bare_parameter_packs.
533         (finish_expr_stmt): Ditto.
534         (finish_for_expr): Ditto.
535         (finish_switch_cond): Pass pointer to
536         check_for_bare_parameter_packs, and call it before we put the
537         condition into the statement.
538         (finish_mem_initializers): Pass pointer to
539         check_for_bare_parameter_packs.
540         (finish_member_declaration): Ditto.
541         * parser.c (cp_parser_base_clause): Ditto.
542         
543 2007-11-06  Jakub Jelinek  <jakub@redhat.com>
544
545         PR target/33168
546         * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already
547         with the final TREE_READONLY flag in place.  processing_template_decl
548         is known to be 0 in this part of function.
549
550         PR c++/33894
551         * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not
552         OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC.
553         * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P.
554         * semantics.c (finish_omp_atomic): Revert most of the
555         2007-02-05 changes, just keep the new representation of
556         OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC.
557
558 2007-11-05  H.J. Lu  <hongjiu.lu@intel.com>
559
560         PR c++/33871
561         * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked
562         local.
563
564 2007-11-05  Douglas Gregor  <doug.gregor@gmail.com>
565
566         PR c++/33996
567         PR c++/33235
568         PR c++/33930
569         * typeck.c (merge_types): Don't lose rvalue references when
570         merging types.
571         * call.c (build_over_call): Don't elide move constructors just
572         because the copy constructor is trivial (!).
573         (compare_ics): If comparing cv-qualifiers fails, we can still order
574         based on binding lvalues vs. rvalues.
575
576 2007-11-05  Douglas Gregor  <doug.gregor@gmail.com>
577
578         PR c++/33939
579         * pt.c (unify_pack_expansion): bring handling of function call
580         arguments into line with type_unification_real. 
581
582 2007-11-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
583
584         * typeck.c (build_binary_op): Use pedwarn instead of error for
585         consistency.
586
587 2007-11-05  Jakub Jelinek  <jakub@redhat.com>
588
589         PR c++/33836
590         * parser.c (cp_parser_unary_expression): For &&label call
591         cp_parser_non_integral_constant_expression and return error_mark_node
592         if it returned true.
593
594         PR c++/33969
595         * decl.c (grokdeclarator): Don't call build_memfn_type if type
596         is neither FUNCTION_TYPE nor METHOD_TYPE.
597
598 2007-11-02  Jakub Jelinek  <jakub@redhat.com>
599
600         PR c++/33516
601         * parser.c (cp_parser_nested_name_specifier_opt): Use
602         TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete
603         typedef of currently open class.
604
605 2007-11-02  Paolo Carlini  <pcarlini@suse.de>
606
607         PR c++/33495
608         * error.c (dump_expr): Deal specially with statements.
609
610 2007-11-01  Jason Merrill  <jason@redhat.com>
611
612         PR c++/30897
613         * pt.c (push_template_decl_real): Set DECL_CONTEXT on template
614         template parms.
615         (lookup_template_class): Use it to get the outer template args
616         for instantiating one.
617
618         PR c++/29236
619         * pt.c (reduce_template_parm_level): tsubst the parameters
620         of a template template parm.
621
622 2007-11-01  Douglas Gregor  <doug.gregor@gmail.com>
623
624         PR c++/33955
625         * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
626
627 2007-11-01  Jakub Jelinek  <jakub@redhat.com>
628
629         PR c++/32384
630         * parser.c (cp_parser_postfix_dot_deref_expression): If
631         POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor
632         first and if that succeeds and type is SCALAR_TYPE_P, create
633         PSEUDO_DTOR_EXPR.
634
635         PR c++/32260
636         * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment.
637         (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo
638         as for std::type_info.
639
640 2007-10-31  Paolo Carlini  <pcarlini@suse.de>
641
642         PR c++/33494
643         * cxx-pretty-print.c (pp_cxx_typeid_expression,
644         pp_cxx_delete_expression): Change to static linkage.
645         * cxx-pretty-print.h: Adjust declarations.
646         * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
647         MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
648         MODOP_EXPR): Forward to pp_expression.
649
650         * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
651         Fix typo.
652
653 2007-10-31 Christian Bruel  <christian.bruel@st.com>
654            Mark Mitchell  <mark@codesourcery.com>
655
656         PR c++/19531
657         * typeck.c (check_return_expr): Don't set named_return_value_okay_p
658         if retval is volatile. 
659         
660 2007-10-30  Jakub Jelinek  <jakub@redhat.com>
661
662         PR c++/33616
663         * decl2.c (build_offset_ref_call_from_tree): Call
664         build_non_dependent_expr on object prior to building ADDR_EXPR from it
665         if FN is DOTSTAR_EXPR.
666
667 2007-10-30  Douglas Gregor  <doug.gregor@gmail.com>
668
669         PR c++/31993
670         PR c++/32252
671         * pt.c (find_parameter_packs_r): Fix typo in comment.
672         (convert_template_argument): Look at the pattern of a pack
673         expansion to determine what kind of entity we're converting.
674         (coerce_template_parameter_pack): When we have coerced a non-type
675         template parameter pack, substitute into the type of that pack.
676         (tsubst_pack_expansion): When our substitution of a parameter pack
677         is a "trivial" substitution of itself, just substitute into the
678         pack expansion rather than actually expanding.
679
680 2007-10-29  Jakub Jelinek  <jakub@redhat.com>
681
682         PR c++/33841
683         * class.c (check_bitfield_decl): Don't set field's type to error_mark_node
684         for non-integral type bitfields.  Return true if bitfield is correct, false
685         error has been diagnosed.
686         (check_field_decls): If check_bitfield_decl returned false, call also
687         check_field_decl.
688
689 2007-10-28  Paolo Carlini  <pcarlini@suse.de>
690             Mark Mitchell  <mark@codesourcery.com>
691
692         PR c++/30659
693         * pt.c (do_decl_instantiation): If the VAR_DECL is not a
694         class member error out and return.
695
696 2007-10-27  Jakub Jelinek  <jakub@redhat.com>
697
698         * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
699         to current_function_decl rather than 0.
700
701         PR c++/33844
702         * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
703         ->* rather than .*.
704         * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
705
706 2007-10-27  Jason Merrill  <jason@redhat.com>
707
708         PR c++/5247
709         * call.c (convert_default_arg): Detect recursion.
710
711 2007-10-27  Jakub Jelinek  <jakub@redhat.com>
712
713         PR c++/33842
714         * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
715         * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
716         OFFSETOF_EXPR.
717         (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
718         functions.
719         * error.c (dump_expr): Handle OFFSETOF_EXPR.
720
721 2007-10-26  Jason Merrill  <jason@redhat.com>
722
723         PR c++/24791
724         * pt.c (get_template_info): New fn.
725         (template_class_depth): Use it.
726         (push_template_decl_real): Check that the template args of the 
727         definition match the args of the previous declaration.
728
729 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
730
731         PR c++/31988
732         * decl2.c (coerce_new_type): Do not allow a default argument for
733         the first parameter.
734
735 2007-10-26  Douglas Gregor  <doug.gregor@gmail.com>
736
737         PR c++/33839
738         * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
739         don't see the leading '('. Only lookup names if we get an
740         IDENTIFIER_NODE.
741
742 2007-10-26  Jakub Jelinek  <jakub@redhat.com>
743
744         PR c++/33744
745         * parser.c (cp_parser_parenthesized_expression_list): Set
746         greater_than_is_operator_p to true in between the parens.
747
748 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
749
750         PR c++/31747
751         * decl.c (grokdeclarator): In case of conflicting specifiers
752         just return error_mark_node.
753
754 2007-10-26  Ollie Wild  <aaw@google.com>
755
756         * expr.c (cxx_expand_expr): Removed.
757         * cp-tree.h (exx_expand_expr): Removed.
758         * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
759         with c_expand_expr.
760
761 2007-10-25  Paolo Carlini  <pcarlini@suse.de>
762
763         PR c++/33843
764         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
765
766 2007-10-23  Jason Merrill  <jason@redhat.com>
767
768         PR c++/25950 (DR 391)
769         * call.c (struct conversion): Remove check_copy_constructor_p.
770         (reference_binding): Always bind a reference directly to a 
771         compatible class rvalue.  Pass down LOOKUP_NO_TEMP_BIND during 
772         temporary creation.
773         (check_constructor_callable): Remove.
774         (convert_like_real): Don't call it.
775         (initialize_reference): Don't call check_constructor_callable.
776         (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
777         LOOKUP_CONSTRUCTOR_CALLABLE.  Don't require a temporary for base
778         conversions if LOOKUP_NO_TEMP_BIND.
779         (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
780         (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
781         second conversion.
782         * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
783
784 2007-10-22  Jakub Jelinek  <jakub@redhat.com>
785
786         PR c++/33372
787         * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
788         before checking if its type is integral.
789
790 2007-10-22  Jason Merrill  <jason@redhat.com>
791
792         PR c++/33620
793         * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
794         * pt.c (apply_late_template_attributes): Splice out dependent
795         attributes from DECL_ATTRIBUTES.
796
797         * decl.c (cxx_maybe_build_cleanup): Use build_address.
798
799 2007-10-17  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
800
801         * typeck.c (build_binary_op) : Use appropriate warning option
802         instead of unnamed warning.
803
804 2007-10-16  Paolo Carlini  <pcarlini@suse.de>
805
806         PR c++/31446
807         * pt.c (current_template_args): Do not change TREE_LIST elements
808         with a TREE_VALUE of error_mark_node.
809
810 2007-10-16  Mark Mitchell  <mark@codesourcery.com>
811
812         * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
813         * decl.c (start_decl): Tidy.
814         (start_decl_1): Call cp_apply_type_quals_to_decl after completing
815         the type.
816         (grokdeclarator): Clarify comment.
817
818 2007-10-14  Andrew Pinski  <pinskia@gmail.com>
819
820         PR c++/30303
821         * decl.c (grokfndecl): Return NULL after the "definition of
822         implicitly-declared" error happened.
823
824 2007-10-12  Simon Martin  <simartin@users.sourceforge.net>
825
826         PR c++/26698
827         * call.c (build_user_type_conversion_1): Do not consider conversion
828         functions to convert a (possibly cv-qualified) object to the (possibly
829         cv-qualified) same object type (or a reference to it), to a (possibly
830         cv-qualified) base class of that type (or a reference to it).
831
832 2007-10-12  Paolo Carlini  <pcarlini@suse.de>
833
834         * pt.c (tsubst): Use template_parm_level_and_index.
835
836 2007-10-12  Jakub Jelinek  <jakub@redhat.com>
837
838         PR c++/32121
839         * parser.c (cp_parser_compound_statement): Handle label-declarations
840         at the beginning of the compound statement.
841         (cp_parser_block_declaration): Issue diagnostics about __label__
842         not at the beginning of a block.
843
844 2007-10-11  Paolo Carlini  <pcarlini@suse.de>
845
846         PR c++/33461
847         * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
848         to convert_template_argument.
849         (coerce_template_parms): Return error_mark_node after fixed-length
850         error.
851         (tsubst_decl): Check for error_mark_node the return value of the
852         first tsubst in 'case VAR_DECL'.
853
854 2007-10-08  Ollie Wild  <aaw@google.com>
855
856         * typeck2.c (digest_init): Call cplus_expand_constant after
857         convert_for_initialization.
858         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
859         * expr.c (cplus_expand_constant): Updated function description.
860
861 2007-10-04  Jason Merrill  <jason@redhat.com>
862
863         PR c++/20416
864         * call.c (initialize_reference): Handle local static reference
865         temps properly.
866
867 2007-10-03  Jason Merrill  <jason@redhat.com>
868
869         PR c++/32470
870         * name-lookup.c (push_namespace_with_attrs): Fold back into...
871         (push_namespace): Here.
872         (handle_namespace_attrs): New fn for the attr code.
873         (leave_scope): Don't pop_visibility.
874         * name-lookup.h (struct cp_binding_level): Remove has_visibility.
875         * parser.c (cp_parser_namespace_definition): Call
876         handle_namespace_attrs and pop_visibility as appropriate. 
877
878         PR c++/11756
879         * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
880
881 2007-10-03  Alexandre Oliva  <aoliva@redhat.com>
882
883         * decl.c (duplicate_decls): Preserve linkage flags for mere
884         redeclarations of gnu_inline definitions.
885
886 2007-10-03  Jason Merrill  <jason@redhat.com>
887
888         PR c++/15764
889         * decl.c (wrap_cleanups_r): New fn.
890         (wrap_temporary_cleanups): New fn.
891         (initialize_local_var): Call it.
892
893 2007-09-29  Jason Merrill  <jason@redhat.com>
894
895         PR c++/33094
896         * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member 
897         constant to not have DECL_EXTERNAL if it's file-local.
898
899 2007-09-28  Ollie Wild  <aaw@google.com>
900
901         Revert
902         2007-09-27  Ollie Wild  <aaw@google.com>
903
904         * typeck2.c (digest_init): Call cplus_expand_constant after
905         convert_for_initialization.
906         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
907         * expr.c (cplus_expand_constant): Updated function description.
908
909 2007-09-28  Jason Merrill  <jason@redhat.com>
910
911         PR c++/10179
912         * class.c (layout_empty_base): Take rli parameter, update
913         rli->record_align if empty base has user-specified alignment.
914         (build_base_field): Pass rli to it.
915
916 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
917
918         PR c++/33213
919         * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
920
921 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
922
923         PR c++/33118
924         * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
925         (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
926         (dump_parameters): Just call dump_type for argument packs too.
927
928 2007-09-28  Jakub Jelinek  <jakub@redhat.com>
929
930         PR c++/31434
931         * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
932         qualification by creating qualified PACK_EXPANSION_PATTERN and
933         then calling make_pack_expansion on it.
934
935 2007-09-27  Ollie Wild  <aaw@google.com>
936
937         * typeck2.c (digest_init): Call cplus_expand_constant after
938         convert_for_initialization.
939         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
940         * expr.c (cplus_expand_constant): Updated function description.
941
942 2007-09-27  Jason Merrill  <jason@redhat.com>
943
944         PR c++/33571
945         * decl2.c (is_late_template_attribute): Don't crash on unknown
946         attribute.
947
948 2007-09-27  Paolo Carlini  <pcarlini@suse.de>
949
950         PR c++/33493
951         * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
952         * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
953         spaces in the formatting.
954         * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
955
956 2007-09-27  Jakub Jelinek  <jakub@redhat.com>
957
958         * error.c (cxx_print_error_function): Add third argument, pass
959         it over to lhd_print_error_function.
960         (cp_print_error_function): If diagnostic->abstract_origin, print
961         virtual backtrace.
962         * cp-tree.h (struct diagnostic_info): New forward decl.
963         (cxx_print_error_function): Add third argument.
964
965 2007-09-25  Simon Martin  <simartin@users.sourceforge.net>
966
967         PR c++/33207
968         * name-lookup.c (pushtag): Do not create an implicit typedef before
969         the associated type declaration is known to be valid.
970
971 2007-09-25  Jakub Jelinek  <jakub@redhat.com>
972
973         * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
974         rather than pointers.
975
976 2007-09-24  Danny Smith  <dannysmith@user.sourceforge.net>
977
978         PR c++/14688
979         * search.c (check_final_overrider): Fail if
980         targetm.comp_type_attributes returns 0.
981
982 2007-09-24  Jason Merrill  <jason@redhat.com>
983
984         PR c++/33239
985         * pt.c (resolve_typename_type): Don't look things up in the original
986         template if it would mean losing template arguments.    
987
988 2007-09-24  Jakub Jelinek  <jakub@redhat.com>
989
990         PR c++/33506
991         * cp-tree.h (cxx_type_hash_eq): New prototype.
992         * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
993         * tree.c (cxx_type_hash_eq): New function.
994
995 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
996
997         PR c++/33185    
998         * tree.c (cp_build_qualified_type_real): Build a canonical
999         ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
1000         
1001 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
1002
1003         PR c++/33112
1004         PR c++/33185    
1005         * tree.c (cplus_array_compare): Compare pointers, not types.
1006         (build_cplus_array_type_1): Store new array type into the hash
1007         table before building the canonical type; build the canonical type
1008         correctly.
1009         (cp_build_qualified_type_real): Put all of the array types with
1010         cv-qualified element types into the C++ array hash table, built as 
1011         variants of the unqualified versions.
1012         
1013 2007-09-23  Jason Merrill  <jason@redhat.com>
1014
1015         PR c++/16370
1016         * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
1017         for deprecation warnings.
1018
1019 2007-09-22  Jason Merrill  <jason@redhat.com>
1020
1021         PR c++/15269
1022         * call.c (build_over_call): Warn about deprecated virtuals.
1023
1024         PR c++/19407
1025         * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
1026         (MAYBE_TAGGED_TYPE_P): Remove.
1027         * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
1028         instead of calling is_late_template_attribute again.
1029         (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
1030         (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
1031         Don't crash on typedefs from non-template classes.
1032         * decl2.c (grokfield): Don't sorry about attrs on template parms.
1033         (is_late_template_attribute): All attributes applied to template
1034         parms or typename types are dependent.  Static.
1035         (splice_template_attributes): Pass decl through.
1036         (save_template_attributes): Likewise.
1037
1038 2007-09-20  Jakub Jelinek  <jakub@redhat.com>
1039
1040         PR c++/33496
1041         * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
1042         returned from tsubst_pack_expansion.
1043         (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
1044         (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
1045
1046 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
1047
1048         PR c++/33460
1049         * semantics.c (finish_id_expression): Use consistently
1050         context_for_name_lookup.
1051         * decl.c (fixup_anonymous_aggr): Fix error message for
1052         anonymous struct (vs union).
1053
1054 2007-09-19  Jason Merrill  <jason@redhat.com>
1055
1056         PR c++/7586
1057         * pt.c (tsubst): Handle typedefs by looking for the specialization.
1058         (retrieve_specialization): Only tagged types use 
1059         DECL_TEMPLATE_INSTANTIATIONS.
1060         (instantiate_class_template): Push nested classes too.
1061         (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
1062         tagged types.
1063         * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
1064         * init.c (is_aggr_type): Remove redundant tests.
1065         * class.c (push_nested_class): Use CLASS_TYPE_P.
1066
1067 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
1068
1069         PR c++/33459
1070         * init.c (build_zero_init): If, recursively, build_zero_init
1071         returns a NULL_TREE, do not append it to the VEC of constructors.
1072
1073 2007-09-18  Jason Merrill  <jason@redhat.com>
1074
1075         PR c++/17743
1076         * pt.c (apply_late_template_attributes): Set processing_template_decl.
1077         (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
1078         ATTR_FLAG_TYPE_IN_PLACE.
1079         (tsubst): Do unqualified lookup to find typedefs from current class.
1080         [ARRAY_TYPE]: Propagate alignment info.
1081         * decl2.c (is_late_template_attribute): Only defer handling of
1082         attribute aligned if the expression is dependent.
1083         (save_template_attributes): If we're deferring any attributes,
1084         make this a naming typedef.
1085
1086 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
1087
1088         PR c++/33462 (again)
1089         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
1090         va_arg instead of __builtin_va_arg.
1091
1092 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
1093
1094         PR c++/33462
1095         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
1096         (pp_cxx_primary_expression): Use it.
1097         * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
1098         * error.c (dump_expr): Use it.
1099
1100 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
1101
1102         PR c++/33463
1103         * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
1104         out case TYPEID_EXPR to...
1105         (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
1106         and pp_cxx_right_paren.
1107         * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
1108         * error.c (dump_expr): Use it.
1109
1110 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
1111
1112         PR c++/33464
1113         * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
1114         (pp_cxx_primary_expression): Use it.
1115         * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
1116         * error.c (dump_expr): Use it.
1117
1118 2007-09-16  Paolo Carlini  <pcarlini@suse.de>
1119
1120         PR c++/33124
1121         * init.c (build_new): Remove warning for zero-element
1122         allocations.
1123
1124 2007-09-16  Nathan Sidwell  <nathan@codesourcery.com>
1125
1126         PR c++/32756
1127         * call.c (maybe_handle_implicit_object): Set this_p, clear
1128         rvaluedness_matches_p.
1129         (compare_ics): Do not compare rvaluedness matching when one of the
1130         operands is an implicit object.
1131
1132 2007-09-14  Jason Merrill  <jason@redhat.com>
1133
1134         PR c++/17743, c++/19163
1135         * decl2.c (is_late_template_attribute): New fn.
1136         (splice_template_attributes, save_template_attributes): New fns.
1137         (cplus_decl_attributes): Call save_template_attributes.
1138         * pt.c (apply_late_template_attributes): New fn.
1139         (instantiate_class_template, tsubst_decl): Use it.
1140         * cp-tree.h: Declare is_late_template_attribute.
1141
1142 2007-09-13  Tom Tromey  <tromey@redhat.com>
1143
1144         * parser.c (cp_lexer_new_main): Don't use
1145         c_lex_return_raw_strings.
1146         (cp_lexer_get_preprocessor_token): Update.  Add special case when
1147         lexer is NULL.
1148
1149 2007-09-11  Jan Hubicka <jh@suse.cz>
1150
1151         * method.c (use_thunk): Use tree_rest_of_compilation
1152         * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
1153         (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
1154         * cp-tree.h (expand_body): Kill.
1155         (emit_associated_thunks): Declare.
1156         * semantics.c (emit_associated_thunks): Export.
1157         (expand_body): Kill.
1158
1159 2007-09-09  David Daney  <ddaney@avtrex.com>
1160
1161         PR c++/33324
1162         * init.c (build_new_1):  Use POINTER_PLUS_EXPR instead of MINUS_EXPR
1163         to calculate cookie_ptr.
1164
1165 2007-09-08  Jason Merrill  <jason@redhat.com>
1166
1167         PR c++/33342
1168         * pt.c (most_specialized_class): Set processing_template_decl
1169         while tsubsting partial spec args.
1170
1171 2007-09-06  Jason Merrill  <jason@redhat.com>
1172
1173         * decl2.c (get_guard): Copy visibility from the guarded variable.
1174
1175 2007-09-06  Jan Hubicka  <jh@suse.cz>
1176
1177         * semantics.c (expand_body): Do not mark arguments of clones used.
1178
1179 2007-09-06  Paolo Carlini  <pcarlini@suse.de>
1180
1181         PR c++/32674
1182         * decl.c (cp_finish_decl): When processing_template_decl,
1183         deal correctly with init as TREE_LIST.
1184
1185 2007-09-06  Tom Tromey  <tromey@redhat.com>
1186
1187         * decl.c (finish_function): Put return's location on line zero of
1188         file.
1189
1190 2007-09-05  Jason Merrill  <jason@redhat.com>
1191
1192         PR c++/15745
1193         * except.c (prepare_eh_type): Use type_decays_to.
1194
1195         PR c++/15097
1196         * init.c (build_delete): Use build_headof to get the address of the
1197         complete object if we aren't using the deleting destructor.
1198         * rtti.c (build_headof): No longer static.
1199         * cp-tree.h: Declare it.
1200
1201 2007-09-06  Jakub Jelinek  <jakub@redhat.com>
1202
1203         * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
1204         decl if a prototype for XX is provided with throw().
1205
1206         PR c++/33289
1207         * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
1208         on __*_chk non-__builtin_* decls.
1209
1210 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
1211
1212         PR c++/30302
1213         * semantics.c (finish_id_expression): Use context_for_name_lookup
1214         insted of DECL_CONTEXT, to see through anonymous structs and unions.
1215         * class.c (finish_struct_anon): Deal correctly with anonymous
1216         structs (vs unions, as GNU extension) in error messages.
1217
1218 2007-09-05  Jan Hubicka  <jh@suse.cz>
1219
1220         * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
1221         call, DECL_EXTERNAL checks and current_function_decl saving.
1222
1223 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
1224
1225         PR c++/29731 (again)
1226         * parser.c (cp_parser_primary_expression): Return error_mark_node
1227         when a statement-expression is found in a template-argument list.
1228
1229 2007-09-04  Jason Merrill  <jason@redhat.com>
1230
1231         * except.c (initialize_handler_parm): Use
1232         fold_build_cleanup_point_expr.
1233
1234         PR c++/31419
1235         * call.c (reference_binding): Don't look for user-defined conversions
1236         to the same type.
1237
1238         PR c++/31411
1239         * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
1240         the MUST_NOT_THROW_EXPR.
1241
1242 2007-09-04  Richard Sandiford  <richard@codesourcery.com>
1243
1244         * decl.c (cp_finish_decl): Call determine_visibility before
1245         make_rtl_for_nonlocal_decl.
1246
1247 2007-09-04  Jason Merrill  <jason@redhat.com>
1248
1249         PR c++/14032
1250         * pt.c (most_specialized_class): Substitute outer template
1251         arguments into the arguments of a member template partial
1252         specialization.
1253         (strip_innermost_template_args): New fn.
1254
1255 2007-09-03  Daniel Jacobowitz  <dan@codesourcery.com>
1256
1257         * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
1258
1259 2007-09-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1260
1261         * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
1262         * decl.c (cp_make_fname_decl): Likewise,
1263         * parser.c (cp_parser_string_literal): Likewise,
1264         * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
1265         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
1266         Likewise,
1267
1268 2007-09-02  Paolo Carlini  <pcarlini@suse.de>
1269
1270         PR c++/33208
1271         * typeck.c (build_unary_op): Fix error message for
1272         Boolean expression as operand to operator--.
1273
1274 2007-09-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1275
1276         * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
1277         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
1278         Likewise.
1279
1280 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
1281
1282         PR c++/32597
1283         * init.c (build_default_init): Make extern.
1284         * cp-tree.h (build_default_init): Declare here.
1285         * pt.c (tsubst_expr): When the instantiation of the initializer of
1286         a variable results in an empty list, default-initialize the
1287         variable.
1288         (tsubst_copy_and_build): When the instantiation of the initializer
1289         in a new expression results in an empty initializer list,
1290         default-initialize it.
1291
1292 2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>
1293
1294         * mangle.c (write_type): Change mangling of rvalue reference from
1295         `RR' to `O'. 
1296
1297 2007-08-31  Jakub Jelinek  <jakub@redhat.com>
1298
1299         * decl.c (duplicate_decls): Remove duplicated line.
1300
1301 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
1302
1303         PR c++/33210
1304         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
1305         BOUND_TEMPLATE_TEMPLATE_PARM.
1306
1307 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
1308
1309         PR c++/32113
1310         * search.c (lookup_member): Check the name argument for
1311         error_mark_node.
1312
1313 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
1314
1315         PR c++/33212
1316         * parser.c (cp_parser_trait_expr): Check rerurn value of
1317         cp_parser_type_id.
1318
1319 2007-08-30  Ollie Wild  <aaw@google.com>
1320
1321         * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
1322         convert_ptrmem for pointer to member conversions.
1323         (convert_to_pointer_force): Update cp_convert_to_pointer call.
1324         (ocp_convert): Update cp_convert_to_pointer call.
1325         * typeck.c (convert_ptrmem): Add conditional for null pointers to
1326         members.
1327         (build_static_cast_1): Check can_convert for conversions in either
1328         direction.
1329         (get_delta_difference_1): New function.
1330         (get_delta_difference): Refactor to call get_delta_difference_1.
1331
1332 2007-08-30  Jakub Jelinek  <jakub@redhat.com>
1333
1334         * decl.c (start_preparsed_function): Set
1335         DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
1336
1337 2007-08-28  Paolo Carlini  <pcarlini@suse.de>
1338
1339         PR c++/33209
1340         * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
1341         BOUND_TEMPLATE_TEMPLATE_PARM.
1342
1343 2007-08-28  Jakub Jelinek  <jakub@redhat.com>
1344
1345         PR c++/32596
1346         PR c++/32400
1347         * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
1348         and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
1349
1350 2007-08-27  Jason Merrill  <jason@redhat.com>
1351
1352         PR c++/29000
1353         * pt.c (build_non_dependent_expr, type_dependent_expression_p): 
1354         Look inside STMT_EXPR.
1355         * semantics.c (stmt_expr_value_expr): New fn.
1356         * cp-tree.h: Declare it.
1357
1358         PR c++/28558
1359         * decl.c (groktypename): Ignore attributes applied to class type.
1360
1361 2007-08-28  Richard Guenther  <rguenther@suse.de>
1362
1363         * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
1364
1365 2007-08-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1366         
1367         * error.c (dump_expr): Handle COMPLEX_CST.
1368         * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
1369         (pp_cxx_expression): Likewise.
1370
1371 2007-08-27  Alexandre Oliva  <aoliva@redhat.com>
1372
1373         * decl.c (GNU_INLINE_P): New.
1374         (duplicate_decls): Handle gnu_inline.  Merge attributes and
1375         some flags in overriding definitions.
1376         (redeclaration_error_message): Handle gnu_inline.
1377         (start_preparsed_function): Likewise.
1378
1379 2007-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1380
1381         * call.c (sufficient_parms_p): Constify.
1382         * class.c (same_signature_p): Likewise.
1383         * cp-gimplify.c (is_invisiref_parm,
1384         cxx_omp_privatize_by_reference): Likewise.
1385         * cp-objcp-common.c (has_c_linkage): Likewise.
1386         * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
1387         sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
1388         grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
1389         num_artificial_parms_for, comp_template_parms,
1390         template_parameter_pack_p, any_dependent_template_arguments_p,
1391         any_type_dependent_arguments_p, any_value_dependent_elements_p,
1392         repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
1393         zero_init_p, member_p, cp_lvalue_kind,
1394         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
1395         varargs_function_p, is_dummy_object, special_function_kind,
1396         string_conv_p, type_unknown_p, comp_except_specs, compparms,
1397         comp_cv_qualification, is_bitfield_expr_with_lowered_type,
1398         unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
1399         cp_has_mutable_p, at_least_as_qualified_p,
1400         invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
1401         * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
1402         * except.c (nothrow_libfn_p): Likewise.
1403         * method.c (skip_artificial_parms_for, num_artificial_parms_for):
1404         Likewise.
1405         * pt.c (comp_template_parms, template_parameter_pack_p,
1406         any_type_dependent_arguments_p, any_value_dependent_elements_p,
1407         any_dependent_template_arguments_p): Likewise.
1408         * repo.c (repo_export_class_p): Likewise.
1409         * semantics.c (anon_aggr_type_p): Likewise.
1410         * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
1411         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
1412         varargs_function_p, member_p, is_dummy_object, pod_type_p,
1413         zero_init_p, special_function_p): Likewise.
1414         * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
1415         comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
1416         compparms, invalid_nonstatic_memfn_p,
1417         is_bitfield_expr_with_lowered_type, unlowered_expr_type,
1418         string_conv_p, ptr_reasonably_similar, cp_type_readonly,
1419         cp_has_mutable_p, lvalue_or_else): Likewise.
1420
1421 2007-08-25  Paolo Bonzini  <bonzini@gnu.org>
1422
1423         * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
1424         * cp-objcp-common.c (cp_tree_size): Ditto.
1425         * tree.c (cp_walk_subtrees): Ditto
1426         * cp-tree.def (TINST_LEVEL): Go away.
1427         * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
1428         move together with other non-tree structs.
1429         (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
1430         (union lang_tree_node): Eliminate tinst_level field.
1431         (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
1432         (current_instantiation, outermost_tinst_level): Return
1433         a "struct tinst_level *".
1434
1435         * error.c (print_instantiation_partial_context): Change second
1436         parameter to a "struct tinst_level *".  Replace accessor macros
1437         with field access.
1438         (print_instantiation_full_context): Likewise.
1439         * lex.c (in_main_input_context): Likewise.
1440
1441         * pt.c (struct pending_templates): New.
1442         (pending_templates, last_pending_template): Use it as a type.
1443         (current_tinst_level): Change typo to "struct tinst_level *"
1444         (reopen_tinst_level): Accept "struct tinst_level *", return decl.
1445         (add_pending_template): Construct a "struct pending_template".
1446         Replace TINST_LEVEL accessor macros with field access.
1447         (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
1448         (pop_tinst_level): Likewise.
1449         (instantiate_pending_templates): Likewise.  Factor common code used
1450         when an instantiation has been done.
1451         (outermost_tinst_level): Replace tree_last with loop.
1452         (current_instantiation): Return a "struct tinst_level *".
1453
1454 2007-08-24  Ollie Wild  <aaw@google.com>
1455
1456         * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
1457         * name-lookup.h (cp_binding_level): Remove vtables member.
1458
1459 2007-08-24  Richard Guenther  <rguenther@suse.de>
1460
1461         * tree.c (cp_cannot_inline_tree_fn): Remove.
1462         * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
1463         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
1464         Remove define.
1465
1466 2007-08-24  Jakub Jelinek  <jakub@redhat.com>
1467
1468         PR c++/32567
1469         * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
1470         error_mark_node right away if build_expr_type_conversion
1471         returned it.
1472
1473         PR c++/32898
1474         * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
1475         is error_mark_node rather than NULL_TREE.
1476         * pt.c (check_explicit_specialization): Likewise.
1477
1478         PR c++/31941
1479         * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
1480         TARGET_VTABLE_USES_DESCRIPTORS targets properly.
1481
1482 2007-08-22  Jason Merrill  <jason@redhat.com>
1483
1484         PR c++/29365
1485         * pt.c (outermost_tinst_level): New function.
1486         * lex.c (in_main_input_context): New function.
1487         * cp-tree.h: Declare it.
1488         * decl2.c (constrain_class_visibility): Use it to avoid warning
1489         about uses of the anonymous namespace in the main input file.
1490
1491 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
1492
1493         * init.c (build_new_1): Use get_target_expr instead of save_expr.
1494
1495 2007-08-20  Pawel Sikora  <pluto@pld-linux.org>
1496
1497         PR c++/7302
1498         * class.c (finish_struct_1): Warn when a class has virtual
1499         functions and accessible non-virtual destructor.
1500
1501 2007-08-20  Richard Guenther  <rguenther@suse.de>
1502
1503         PR c++/22369
1504         PR c++/22451
1505         * call.c (build_new_method_call): Convert initializer to
1506         the basetype.
1507         * init.c (build_aggr_init): Do not fiddle with types.
1508         (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
1509         * except.c (build_throw): Do not drop qualifiers for the
1510         pointer type.
1511         * typeck.c (get_member_function_from_ptrfunc): Do not
1512         fiddle with types, instead convert.
1513         (build_ptrmemfunc1): Convert to the target type for
1514         initialization.
1515         (gfc_trans_allocate): Convert result to target type.
1516         * cp-objcp-common.c (cxx_get_alias_set): Pointers to
1517         pointer-to-member structures shall have alias set zero as well.
1518
1519 2007-08-20  Richard Guenther  <rguenther@suse.de>
1520
1521         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
1522         Remove.
1523         * cp-tree.h (cp_auto_var_in_fn_p): Remove.
1524         (nonstatic_local_decl_p): Likewise.
1525         * tree.c (cp_auto_var_in_fn_p): Remove.
1526         * decl.c (nonstatic_local_decl_p): Remove.
1527
1528 2007-08-20  Richard Guenther  <rguenther@suse.de>
1529
1530         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
1531         Remove define.
1532         * tree.h (cp_walk_tree): New define to walk_tree_1 with
1533         cp_walk_subtrees lh parameter.
1534         (cp_walk_tree_without_duplicates): New define to
1535         walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
1536         * tree.c (count_trees): Call
1537         cp_walk_tree_without_duplicates.
1538         (verify_stmt_tree): Call cp_walk_tree.
1539         (break_out_target_exprs): Likewise.
1540         (WALK_SUBTREE): Likewise.
1541         * cp-gimplify.c (cp_genericize): Likewise.
1542         * cp-pt.c (find_parameter_packs_r): Likewise.
1543         (uses_parameter_packs): Likewise.
1544         (make_pack_expansion): Likewise.
1545         (check_for_bare_parameter_packs): Likewise.
1546         (for_each_template_parm): Likewise.
1547         * decl.c (check_default_argument): Call
1548         cp_walk_tree_without_duplicates.
1549         * except.c (build_throw): Likewise.
1550         * decl2.c (type_visibility): Likewise.
1551         * semantics.c (expand_or_defer_fn): Likewise.
1552         (finalize_nrv): Call cp_walk_tree.
1553
1554 2007-08-20  Jakub Jelinek  <jakub@redhat.com>
1555
1556         PR c++/33025
1557         * init.c (build_new_1): Rename placement_var variable to placement_expr.
1558         Initialize it with save_expr rather than get_temp_regvar.
1559
1560 2007-08-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1561
1562         PR c++/28989
1563         * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
1564         lvalues.
1565
1566 2007-08-17  Ollie Wild  <aaw@google.com>
1567
1568         PR c++/31749
1569         * name-lookup.c (do_nonmember_using_decl): Shift implicit type
1570         declarations into appropriate slots for comparison.  Fix type
1571         comparison.
1572
1573 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
1574
1575         PR c++/32112
1576         * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
1577         * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
1578
1579 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
1580
1581         PR c++/32870
1582         * parser.c (cp_parser_class_head): Improve error message.
1583
1584 2007-08-16  Seongbae Park  <seongbae.park@gmail.com>
1585
1586         * pt.c (instantiate_decl): Set input_location
1587         for the function end.
1588
1589 2007-08-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1590
1591         * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
1592         Constify.
1593         * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
1594         class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
1595         cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
1596         cxx_warn_unused_global_decl, cp_expr_size): Likewise.
1597         * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
1598         * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
1599         * typeck.c (cp_type_quals): Likewise.
1600         * typeck2.c (cxx_incomplete_type_diagnostic,
1601         cxx_incomplete_type_error): Likewise.
1602
1603 2007-08-16  Paolo Carlini  <pcarlini@suse.de>
1604
1605         PR c++/31132
1606         * pt.c (tsubst_friend_function): When check_classfn
1607         returns error_mark_node likewise return it.
1608
1609 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
1610
1611         PR c++/32992
1612         * typeck.c (check_return_expr): Don't NRV optimize vars in
1613         anonymous unions.
1614         * decl.c (finish_function): Comment fix.
1615
1616 2007-08-15  Paolo Carlini  <pcarlini@suse.de>
1617
1618         PR c++/33035
1619         * pt.c (push_template_decl_real): Depending on TYPE_P
1620         use either TYPE_CONTEXT or DECL_CONTEXT.
1621
1622 2007-08-14  Mark Mitchell  <mark@codesourcery.com>
1623
1624         * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
1625         constructors and destructors return this.
1626
1627 2007-08-14  Paolo Carlini  <pcarlini@suse.de>
1628
1629         PR c++/27211
1630         * decl2.c (check_classfn): Return error_mark_node in case of error;
1631         in that case, do not call add_method.
1632         * decl.c (start_decl): Deal with check_classfn returning
1633         error_mark_node.
1634         (grokfndecl): Likewise.
1635         * pt.c (tsubst_friend_function): Likewise.
1636
1637 2007-08-14  Andrew Pinski  <pinskia@gmail.com>
1638
1639         PR c++/30428
1640         * typeck.c (build_binary_op): Disallow vector float types with
1641         BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
1642
1643 2007-08-11  Ian Lance Taylor  <iant@google.com>
1644
1645         * cp-objcp-common.c (cxx_get_alias_set): Change return type to
1646         alias_set_type.
1647         * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
1648
1649 2007-08-10  Ollie Wild  <aaw@google.com>
1650
1651         * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
1652         type lookups.
1653         (ambiguous_decl): Construct tree of ambiguous types.  Remove extaneous
1654         function parameter.
1655         (unqualified_namespace_lookup): Fix ambiguous_decl call.
1656         (lookup_using_namespace): Fix ambiguous_decl call.
1657         (qualified_lookup_using_namespace): Fix ambiguous_decl call.
1658
1659 2007-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1660
1661         * call.c (name_as_c_string): Use CONST_CAST.
1662         * decl.c (build_decl): Likewise.
1663         * parser.c (cp_parser_string_literal): Likewise.
1664
1665 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
1666
1667         PR c++/17763
1668         * error.c (dump_expr): Consistently use the *_cxx_*
1669         variants of the pretty-print functions.
1670
1671 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
1672
1673         PR c++/22256
1674         * decl.c (check_special_function_return_type): Just error
1675         on return type specified for conversion operator.
1676
1677 2007-08-09  Daniel Berlin  <dberlin@dberlin.org>
1678
1679         * typeck2.c (readonly_error): Handle general expressions.
1680         * error.c (dump_expr): Handle POINTER_PLUS_EXPR
1681
1682 2007-08-06  Dan Hipschman  <dsh@google.com>
1683
1684         * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
1685         access function name.
1686
1687 2007-08-04  Alfred Minarik  <a.minarik@aon.at>
1688
1689         PR pch/13676
1690         * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
1691         * g++spec.c (lang_specific_driver): Check them.
1692
1693 2007-08-06  Paolo Carlini  <pcarlini@suse.de>
1694
1695         PR c++/19532
1696         * pt.c (inline_needs_template_parms): Fix comment; change return type
1697         to bool.
1698
1699 2007-08-05  Volker Reichelt  <v.reichelt@netcologne.de>
1700
1701         Revert:
1702         2007-03-26  Dirk Mueller  <dmueller@suse.de>
1703
1704         * parser.c (cp_parser_member_declaration): Pedwarn
1705         about stray semicolons after member declarations.
1706
1707 2007-08-02  Lee Millward  <lee.millward@gmail.com>
1708
1709         PR c++/30849
1710         PR c++/30850
1711         PR c++/30851
1712         * parser.c (cp_parser_asm_definition): Detect and discard asm
1713         statements with invalid inputs or outputs.
1714         (cp_parser_asm_operand_list): Return error mark node if any
1715         of the operands are invalid. Adjust documentation.
1716         
1717 2007-08-02  Nick Clifton  <nickc@redhat.com>
1718
1719         * typeck.c: Change copyright header to refer to version 3 of the
1720         GNU General Public License and to point readers at the COPYING3
1721         file and the FSF's license web page.
1722         * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
1723         config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
1724         Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
1725         cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
1726         tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
1727         cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
1728         cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
1729         name-lookup.h, parser.c: Likewise.
1730
1731 2007-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1732
1733         PR middle-end/32668
1734         * call.c (magic_varargs_p): Honor the "type generic" attribute.
1735
1736 2007-07-30  Paolo Carlini  <pcarlini@suse.de>
1737
1738         PR c++/32108
1739         * semantics.c (finish_label_stmt): Reject the __label__
1740         extension outside function scopes.
1741
1742 2007-07-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1743
1744         * parser.c (eof_token): Un-constify.
1745         (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
1746         cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
1747         casts.
1748
1749 2007-07-28  Kazu Hirata  <kazu@codesourcery.com>
1750
1751         * pt.c, tree.c, typeck2.c: Fix comment typos.
1752
1753 2007-07-28  Simon Martin  <simartin@users.sourceforge.net>
1754             Mark Mitchell  <mark@codesourcery.com>
1755
1756         PR c++/30917
1757         * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
1758         hidden due to friend declarations in local classes.
1759
1760 2007-07-27  Douglas Gregor  <doug.gregor@gmail.com>
1761
1762         * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
1763         * cp-tree.def (DECLTYPE_TYPE): New.
1764         * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
1765         (dump_type_prefix): Ditto.
1766         (dump_type_suffix): Ditto.
1767         * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
1768         * mangle.c (write_type): Handle DECLTYPE_TYPE.
1769         * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
1770         types.
1771         (DECLTYPE_TYPE_EXPR): New.
1772         (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
1773         (finish_declared_type): Declare.
1774         * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
1775         DECLTYPE_TYPE nodes.
1776         (pp_cxx_type_id): Ditto.
1777         * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
1778         (tsubst): Substitute into a DECLTYPE_TYPE node.
1779         (tsubst_copy): Ditto.
1780         (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
1781         nodes.
1782         (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
1783         * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
1784         structural equality (because we can't hash the expressions).
1785         (finish_declared_type): New.
1786         * lex.c (reswords): Add "decltype" keyword.
1787         * parser.c cp_lexer_next_token_is_decl_specifier_keyword
1788         (cp_parser_postfix_expression): Add member_access_only_p to
1789         restrict postfix expression to member access expressions.
1790         (cp_parser_unary_expression): Update call to
1791         cp_parser_postfix_expression to reflect new parameter.
1792         (cp_parser_declared_type): New.
1793         (cp_parser_simple_type_specifier): Parse decltype types.
1794
1795 2007-07-27  Mark Mitchell  <mark@codesourcery.com>
1796
1797         PR c++/32346
1798         * call.c (convert_for_arg_passing): Only widen bitfields to their
1799         declared types if necessary.
1800
1801 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1802
1803         * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
1804         Constify.
1805
1806 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1807
1808         * decl.c (typename_hash, typename_compare): Constify.
1809         * mangle.c (hash_type, compare_type): Likewise.
1810         * pt.c (eq_local_specializations, hash_local_specialization):
1811         Likewise.
1812         * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
1813         list_hash): Likewise.
1814         * typeck2.c (pat_compare): Likewise.
1815
1816 2007-07-24  Nathan Sidwell  <nathan@codesourcery.com>
1817
1818         * method.c (implicitly_declare_fn): Increase alignment if member
1819         function pointer format requires it.
1820
1821 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
1822
1823         PR c++/29001
1824         * typeck.c (check_return_expr): Do not pass a null argument
1825         to null_ptr_cst_p.
1826
1827 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
1828
1829         PR c++/32561
1830         * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
1831         only on VAR_DECL.
1832
1833 2007-07-22  Nathan Sidwell  <nathan@codesourcery.com>
1834
1835         PR c++/32839
1836         * typeck.c (convert_arguments): Only use default args if we have
1837         a function decl.
1838
1839         PR c++/30818
1840         * typeck.c (structural_comptypes): No need to check
1841         resolve_typename_type return value here.
1842         * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
1843         * pt.c (resolve_typename_type): Follow typename typedefs.  Return
1844         original type rather than error_mark_node in case of failure.
1845         * parser.c (cp_parser_nested_name_specifier_opt): Adjust
1846         resolve_typename_type result check.
1847         (cp_parser_direct_declarator, cp_parser_head,
1848         cp_parser_constructor_declarator_p): Likewise.
1849
1850 2007-07-12  Kazu Hirata  <kazu@codesourcery.com>
1851
1852         * pt.c (template_parms_variadic_p): Remove.
1853         * cp-tree.h: Remove the prototype for template_parms_variadic_p.
1854
1855 2007-07-12  Jakub Jelinek  <jakub@redhat.com>
1856
1857         PR c++/30854
1858         * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
1859         argument to dump_aggr_init_expr_args instead of false.
1860
1861 2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>
1862
1863         * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
1864         canonical types; otherwise, fall back to structural type
1865         comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
1866         internal compiler error if the canonical types are wrong.
1867         
1868 2007-07-11  Paolo Carlini  <pcarlini@suse.de>
1869
1870         PR c++/32560
1871         * parser.c (cp_parser_make_indirect_declarator): When the
1872         the code argument is ERROR_MARK return cp_error_declarator.
1873
1874 2007-07-09  Geoffrey Keating  <geoffk@apple.com>
1875
1876         PR 32617
1877         * decl.c (cxx_init_decl_processing): Don't set
1878         force_align_functions_log.
1879         (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
1880         * typeck.c (cxx_alignof_expr): When alignof is used on a plain
1881         FUNCTION_DECL, return its alignment.
1882
1883 2007-07-09  Richard Guenther  <rguenther@suse.de>
1884
1885         * decl.c (start_preparsed_function): Do not promote return type.
1886
1887 2007-07-08  Paolo Carlini  <pcarlini@suse.de>
1888
1889         PR c++/30535
1890         * pt.c (unify): Never pass error_mark_node to template_decl_level.
1891
1892 2007-07-07  Mark Mitchell  <mark@codesourcery.com>
1893
1894         PR c++/32232
1895         * pt.c (resolve_overloaded_unification): Robustify.  Return a
1896         bool, not an int.
1897         (type_unification_real): Adjust accordingly.
1898
1899 2007-07-06  Richard Guenther  <rguenther@suse.de>
1900
1901         * init.c (build_new_1): Use the correct pointer type.
1902         * typeck2.c (build_m_component_ref): Likewise.
1903
1904 2007-07-05  Mark Mitchell  <mark@codesourcery.com>
1905
1906         PR c++/32245
1907         * init.c (build_zero_init): Always build an initializer for
1908         non-static storage.
1909         * typeck2.c (build_functional_cast): Use build_zero_init.
1910
1911         PR c++/32251
1912         * init.c (build_new_1): Always pass the allocation function to
1913         build_op_delete_call.
1914         * call.c (build_op_delete_call): Handle operator delete with a
1915         variable-argument list.  Do not issue an error when no matching
1916         deallocation function is available for a new operator.
1917
1918         PR c++/31992
1919         * cp-tree.h (any_value_dependent_elements_p): Declare it.
1920         * decl.c (value_dependent_init_p): New function.
1921         (cp_finish_decl): Use it.
1922         * pt.c (value_dependent_expression_p): Use
1923         any_value_dependent_elements_p.
1924         * parser.c (cp_parser_primary_expression): Add comment about
1925         treating dependent qualified names as integral
1926         constant-expressions.
1927
1928 2007-07-04  Douglas Gregor  <doug.gregor@gmail.com>
1929
1930         * decl.c (build_ptrmemfunc_type): Always use structural equality
1931         tests when comparing pointer-to-member-function types, because the
1932         handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
1933         types.
1934         
1935 2007-07-03  Mark Mitchell  <mark@codesourcery.com>
1936
1937         * init.c (build_new): Tweak comment.
1938
1939 2007-06-29  Dave Brolley  <brolley@redhat.com>
1940
1941         PR c++/31743
1942         * parser.c (cp_parser_new_type_id): Don't reduce a named array
1943         type to its base type and number of elements here.
1944         * init.c (build_new): Call complete_type_or_else to ensure that the
1945         type is complete and to issue a diagnostic if it is not.
1946         (build_new_1): Don't call complete_type_or_else here.
1947
1948 2007-07-03  Richard Guenther  <rguenther@suse.de>
1949
1950         PR c++/32609
1951         * class.c (fixed_type_or_null): Re-lookup the hashtable slot
1952         after recursing.
1953
1954 2007-07-02  Simon Baldwin  <simonb@google.com>
1955
1956         * parser.c (cp_parser_elaborated_type_specifier): Added a warning
1957         for inner-style nested forward declarations that don't declare
1958         anything useful.
1959
1960 2007-07-02  Jakub Jelinek  <jakub@redhat.com>
1961
1962         PR c++/31748
1963         * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
1964         DECL_P in not a variable and appears more than once error messages.
1965
1966 2007-07-01  Ollie Wild  <aaw@google.com>
1967
1968         * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
1969         (select_decl): Remove function.
1970         (unqualified_namespace_lookup): Populate binding by calling
1971         ambiguous_decl.  Remove select_decl call.
1972         (lookup_qualified_name): Remove select_decl call.
1973         * decl.c (lookup_and_check_tag): Check for ambiguous references.
1974         * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
1975         generation when name lookup is ambiguous.
1976
1977 2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>
1978
1979         PR c++/31724
1980         * init.c (build_new_1): Use structural equality on the copy of the
1981         array type.
1982
1983 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
1984
1985         * decl2.c (determine_visibility): Implement
1986         flag_visibility_ms_compat effect on type info.
1987         * decl.c (cxx_init_decl_processing): Implement
1988         global effect of flag_visibility_ms_compat.
1989
1990 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
1991
1992         * decl2.c (start_objects): Mark constructor-running function
1993         as artificial.
1994
1995 2007-06-26  Simon Martin  <simartin@users.sourceforge.net>
1996
1997         PR c++/32111
1998         * decl.c (grokdeclarator): Reset friendp for member functions declared
1999         friend of their own class.
2000
2001 2007-06-23  Mark Mitchell  <mark@codesourcery.com>
2002
2003         * decl2.c (determine_visibility): Don't look for dllexport here.
2004         (determine_visibility_from_class): Tidy.
2005
2006 2007-06-18  Simon Baldwin <simonb@google.com>
2007
2008         PR c++/31923
2009         * parser.c (cp_parser_single_declaration): Added check for storage
2010         class other than sc_none in parsed declaration, and a flag to indicate
2011         if the call is part of an explicit template specialization parse.
2012         * (cp_parser_explicit_specialization): Specialization check flag added
2013         to call to cp_parser_single_declaration(), set true.
2014         * (cp_parser_template_declaration_after_export): Specialization check
2015         flag added to call to cp_parser_single_declaration(), set false.
2016         * pt.c (check_explicit_specialization): Added code to copy visiblity
2017         and linkage from the templated function to the explicit specialization.
2018
2019 2007-06-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2020
2021         * typeck.c (build_binary_op): For templates build the
2022         expression in pieces to avoid the assert in build2_stat.
2023         (get_member_function_from_ptrfunc):
2024         Change over to using POINTER_PLUS_EXPR and convert
2025         the second operand to sizetype.
2026         * typeck2.c (build_m_component_ref):  Likewise.
2027         * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
2028         instead of PLUS_EXPR for pointers.
2029         (build_new_1): Likewise.
2030         (build_vec_delete_1): Likewise.
2031         (build_vec_delete): Likewise.
2032         * class.c (build_base_path): Likewise.
2033         (build_base_path): Likewise.
2034         (convert_to_base_statically): Likewise.
2035         (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
2036         (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
2037         instead of PLUS_EXPR.
2038         (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
2039         instead of PLUS_EXPR for pointers.
2040         * call.c (build_special_member_call): Likewise.
2041         * rtti.c (build_headof): Likewise.
2042         Use sizetype instead of ptrdiff_type_node.
2043         (tinfo_base_init): Create a POINTER_PLUS_EXPR
2044         instead of PLUS_EXPR for pointers.
2045         * except.c (expand_start_catch_block):  Do a
2046         NEGATIVE and then a POINTER_PLUS_EXPR instead
2047         of a MINUS_EXPR.
2048         * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
2049         PLUS_EXPR on pointer types over to use
2050         POINTER_PLUS_EXPR and remove the conversion
2051         to the pointer types.
2052         * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
2053         adding to a pointer type. Use size_int instead of
2054         ssize_int. Convert the index to sizetype before
2055         adding it to the pointer.
2056
2057 2007-06-15  Mark Mitchell  <mark@codesourcery.com>
2058
2059         * cp-tree.h (DECL_VAR_MARKED_P): Remove.
2060         (DECL_ANON_UNION_VAR_P): New macro.
2061         * class.c (fixed_type_or_null): Tidy.  Use a hash table, rather
2062         than DECL_VAR_MARKED_P, to keep track of which variables we have
2063         seen.
2064         * decl.c (redeclaration_error_message): Complain about redeclaring
2065         anonymous union members at namespace scope.
2066         * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
2067
2068 2007-06-14  Geoff Keating  <geoffk@apple.com>
2069
2070         * decl2.c (determine_visibility): Ensure that functions with
2071         hidden types as parameters are hidden.
2072
2073         PR 31093
2074         * decl2.c (determine_visibility): Remove duplicate code for
2075         handling type info.
2076
2077 2007-06-12  Ian Lance Taylor  <iant@google.com>
2078
2079         PR libstdc++/29286
2080         * init.c (avoid_placement_new_aliasing): New static function.
2081         (build_new_1): Call it.
2082
2083 2007-06-11  Rafael Avila de Espindola  <espindola@google.com>
2084
2085         * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
2086         (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
2087
2088 2007-06-08  Jakub Jelinek  <jakub@redhat.com>
2089
2090         PR c++/32177
2091         * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
2092         on init, the non-decl cond operand and increment value.
2093
2094 2007-06-07  Simon Martin  <simartin@users.sourceforge.net>
2095
2096         PR c++/30759
2097         * decl.c (check_initializer): Report an error when a brace enclosed
2098         initializer is used for a non-aggregate type in C++98.
2099         (redeclaration_error_message): Rewrote flag_cpp0x in terms of
2100         cxx_dialect.
2101         (grokdeclarator): Likewise.
2102         (move_fn_p): Likewise.
2103         * typeck.c (check_return_expr): Likewise.
2104         * call.c (reference_binding): Likewise.
2105         * error.c (cp_cpp_error): Likewise.
2106         * pt.c (check_default_tmpl_args): Likewise.
2107         (tsubst): Likewise.
2108         * lex.c (init_reswords): Likewise.
2109         * parser.c (p_parser_primary_expression): Likewise.
2110         (TOKEN_PRECEDENCE): Likewise.
2111         (cp_parser_init_declarator): Likewise.
2112         (cp_parser_ptr_operator): Likewise.
2113         (cp_parser_parameter_declaration): Likewise.
2114         (cp_parser_enclosed_template_argument_list): Likewise.
2115         (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
2116         (cp_parser_next_token_ends_template_argument_p): Likewise.
2117
2118 2007-06-04  Simon Baldwin  <simonb@google.com>
2119
2120         * decl.c (grokdeclarator): Readability change.  Moved case labels
2121         into direct switch statement scope.
2122
2123 2007-06-04  Paolo Carlini  <pcarlini@suse.de>
2124
2125         * call.c (convert_like_real): Remove pointless code.
2126
2127 2007-05-31  Mark Mitchell  <mark@codesourcery.com>
2128
2129         * decl.c (get_atexit_fn_ptr_type): New function.
2130         (get_atexit_node): Use it.
2131         (start_cleanup_fn): Likewise.
2132         (register_dtor_fn): Use the object's destructor, instead of a
2133         separate cleanup function, where possible.
2134         * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
2135         (atexit_fn_ptr_type_node): New macro.
2136         * decl2.c (build_cleanup): Use build_address.
2137
2138 2007-05-31  Daniel Berlin  <dberlin@dberlin.org>
2139
2140         * typeck.c (build_binary_op): Include types in error.
2141
2142 2007-05-31  Jakub Jelinek  <jakub@redhat.com>
2143
2144         PR c++/31806
2145         * decl.c (cp_finish_decl): Also clear was_readonly if a static var
2146         needs runtime initialization.
2147
2148 2007-05-31  Paolo Carlini  <pcarlini@suse.de>
2149
2150         PR c++/32158
2151         * semantics.c (finish_trait_expr): Complete the types.
2152
2153 2007-05-30  Russell Yanofsky <russ@yanofsky.org>
2154             Douglas Gregor <doug.gregor@gmail.com>
2155             Pedro Lamarao <pedro.lamarao@mndfck.org>
2156             Howard Hinnant <howard.hinnant@gmail.com>
2157
2158         PR c++/7412
2159         PR c++/29939
2160         * typeck.c (comptypes): Don't consider rvalue and lvalue
2161         reference types to be equivalent.
2162         (check_return_expr): Move from certain lvalues when returning
2163         them.
2164         * decl.c (grokdeclarator): Implement reference collapsing.
2165         (copy_fn_p): Don't consider constructors taking rvalue references
2166         to be copy constructors.
2167         (move_fn_p): New.
2168         * call.c (conversion): New "rvaluedness_matches_p" member.
2169         (convert_class_to_reference): Require reference type as first
2170         parameter instead of base type.
2171         (reference_binding): Add logic to handle rvalue references.
2172         (implicit_conversion): Update inaccurate comment.
2173         (convert_like_real): Disable creation of temporaries that are
2174         impossible to initialize for types with move constructors.
2175         (build_over_call): Elide move constructors when possible.
2176         (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
2177         (maybe_handle_ref_bind): Return conversion instead of type node.
2178         (compare_ics): Add logic to use "rvaluedness_matches_p" values to
2179         determine preferred conversion sequences.
2180         * cp-tree.h (TYPE_REF_IS_RVALUE): New.
2181         (LOOKUP_PREFER_RVALUE): New.
2182         (DECL_MOVE_CONSTRUCTOR_P): New.
2183         (struct cp_declarator): Add "reference" member for reference
2184         types, with new "rvalue_ref" flag.
2185         (cp_build_reference_type): Declare.
2186         (move_fn_p): Declare.
2187         * error.c (dump_type_prefix): Format rvalue reference types
2188         correctly in error messages.
2189         * except.c (build_throw): Move from certain lvalues when
2190         throwing.
2191         * mangle.c (write_type): Mangle rvalue references differently
2192         than regular references.
2193         * parser.c (make_reference_declarator): Add boolean parameter for
2194         rvalue references.
2195         (cp_parser_make_indirect_declarator): New.
2196         (cp_parser_new_declarator_opt): Call
2197         cp_parser_make_indirect_declarator. 
2198         (cp_parser_conversion_declarator_opt): Ditto.
2199         (cp_parser_declarator): Ditto.
2200         (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
2201         declarators.
2202         * pt.c (tsubst): Implement reference collapsing.
2203         (maybe_adjust_types_for_deduction): Implement special template
2204         parameter deduction rule for rvalue references.
2205         (type_unification_real): Update calls to
2206         maybe_adjust_types_for_deduction.
2207         (try_one_overload): Ditto.
2208         (unify_pack_expansion): Ditto.
2209         * tree.c (lvalue_p_1): Handle rvalue reference types.
2210         (cp_build_reference_type): New.
2211
2212 2007-05-30  Jakub Jelinek  <jakub@redhat.com>
2213
2214         PR c++/31809
2215         * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
2216         variables that need runtime initialization.
2217
2218 2007-05-28  Andrew Pinski  <Andrew_pinski@playstation.sony.com>
2219
2220         PR c++/31339
2221         * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
2222         case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
2223         case POSTDECREMENT_EXPR>): Return the error_mark_node
2224         if either the real or imaginary parts would an
2225         error_mark_node.
2226         
2227 2007-05-25  Simon Martin  <simartin@users.sourceforge.net>
2228             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2229
2230         PR c++/31745
2231         * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
2232         token is a closing brace, false if there are no tokens left.
2233         (cp_parser_namespace_alias_definition): Only consume the next token if
2234         it is a closing brace.
2235
2236         * parser.c (cp_parser_class_specifier): Likewise.
2237
2238 2007-05-25  H.J. Lu  <hongjiu.lu@intel.com>
2239
2240         * semantics.c (finish_member_declaration): Fix a typo in the
2241         last checkin.
2242
2243 2007-05-25  Douglas Gregor <doug.gregor@gmail.com>
2244
2245         PR c++/31431
2246         PR c++/31432
2247         PR c++/31434
2248         PR c++/31435
2249         PR c++/31437
2250         PR c++/31438
2251         PR c++/31442
2252         PR c++/31443
2253         PR c++/31444
2254         PR c++/31445
2255         * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
2256         * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
2257         * pt.c (check_for_bare_parameter_packs): Return bool indicated
2258         whether everything was okay. Fix indentation.
2259         (push_template_decl_real): Check for bare parameter packs in
2260         function parameters; where errors occur, mark the parameter types
2261         with ERROR_MARK_NODEs to avert ICEs.
2262         (coerce_template_parameter_pack): New.
2263         (coerce_template_parms): Moved parameter pack coercion into
2264         coerce_template_parameter_pack, and permit it anywhere in the
2265         template parameter list (not just at the end). Parameter and
2266         argument indices can vary (somewhat) separately now, so add
2267         PARM_IDX and ARG_IDX.
2268         (fn_type_unification): Don't set an argument pack as incomplete if
2269         no argument pack was deduced.
2270         (type_unification_real): If a type parameter is a parameter pack
2271         and has not otherwise been deduced, it will be deduced to an empty
2272         parameter pack.
2273         (more_specialized_fn): Use the actual lengths of the argument
2274         lists when comparing against expansions.
2275         * semantics.c (finish_member_declaration): If a field's type has
2276         bare parameter packs, error and set its type to ERROR_MARK_NODE.
2277
2278 2007-05-24  Danny Smith  <dannysmith@users.sourceforge.net>
2279
2280         PR target/27067
2281         * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
2282
2283 2007-05-22  Ollie Wild  <aaw@google.com>
2284
2285         * name-lookup.c (ambiguous_decl): Adds check for hidden types.
2286         (unqualified_namespace_lookup): Adds check for hidden types.
2287
2288 2007-05-22  Ollie Wild  <aaw@google.com>
2289
2290         * decl.c (duplicate_decls): Verify namespace names are unique.
2291
2292 2007-05-21  Mark Mitchell  <mark@codesourcery.com>
2293
2294         * decl.c (cxx_maybe_build_cleanup): Handle
2295         __attribute__((cleanup)).
2296
2297 2007-05-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2298
2299         * cvt.c (cp_convert_and_check): Don't check warnings if the
2300         conversion failed.
2301
2302 2007-05-18  Geoffrey Keating  <geoffk@apple.com>
2303
2304         * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
2305
2306 2007-05-14  Paolo Carlini  <pcarlini@suse.de>
2307
2308         PR c++/29928
2309         * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
2310         type only if is a class type (5.2.8/4).
2311
2312 2007-05-14  Rafael Avila de Espindola  <espindola@google.com>
2313
2314         * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
2315         * decl.c (grokdeclarator): Use unsigned_type_for instead of
2316         c_common_unsigned_type.
2317
2318 2007-05-11  Silvius Rus  <rus@google.com>
2319
2320         * cp/typeck.c (build_indirect_ref): Add call to
2321         strict_aliasing_warning.
2322         (build_reinterpret_cast_1): Condition call to
2323         strict_aliasing_warning. 
2324
2325 2007-05-11  Jan Hubicka  <jh@suse.cz>
2326
2327         * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
2328         * decl2.c (start_objects): ctors and dtors are no longer public.
2329         (cp_write_global_declarations): Do not call c_build_cdtor_fns.
2330         
2331 2007-05-07  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2332
2333         * typeck.c (build_unary_op): Remove code that used to
2334         handle non lvalue increments/decrements.
2335
2336 2007-05-07  Mike Stump  <mrs@apple.com>
2337
2338         * parser.c (check_empty_body): Add.
2339         (cp_parser_iteration_statement): Add call to check_empty_body.
2340
2341 2007-05-05  Geoffrey Keating  <geoffk@apple.com>
2342
2343         PR 31775
2344         * mangle.c (write_mangled_name): Mangle static variable names.
2345         (write_unqualified_name): Use local-source-name for
2346         namespace-scope static variables.
2347
2348 2007-05-04  Dirk Mueller  <dmueller@suse.de>
2349
2350         * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
2351         not in effect.
2352
2353 2007-05-02  Seongbae Park  <seongbae.park@gmail.com>
2354
2355         PR c++/31663
2356         * decl2.c (constrain_class_visibility): 
2357         Use strip_pointer_or_array_types instead of strip_array_types.
2358
2359 2007-04-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2360
2361         PR C++/30221
2362         * decl.c (reshape_init_r): Don't reshape the first element if it
2363         is a pointer to member function.
2364
2365 2007-04-27  Simon Baldwin  <simonb@google.com>
2366
2367         * decl.c (grokparms): Changed message format from %qD to %qE.
2368
2369 2007-04-27  Douglas Gregor  <doug.gregor@gmail.com>
2370
2371         * error.c (maybe_warn_variadic_templates): Variadic templates are
2372        now in C++0x, so only warn about them in C++98 mode.
2373         
2374 2007-04-26  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2375
2376         PR C++/30016
2377         * typeck.c (build_reinterpret_cast_1): Only allow conversion to
2378         integeral types from vectors types.
2379
2380 2007-04-26  Jakub Jelinek  <jakub@redhat.com>
2381
2382         PR c++/31598
2383         * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
2384         for type dependent OMP_CLAUSE_DECLs.
2385
2386 2007-04-24  Mark Mitchell  <mark@codesourcery.com>
2387
2388         PR c++/31338
2389         * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
2390         * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
2391         COMPLEX_TYPE is now an ARITHMETIC_TYPE.
2392         * init.c (build_zero_init): Adjust, as
2393         COMPLEX_TYPE is now a SCALAR_TYPE.
2394         * typeck2.c (digest_init): Allow brace-enclosed initializers for
2395         COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
2396
2397 2007-04-25  Paolo Carlini  <pcarlini@suse.de>
2398
2399         * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
2400         per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
2401         (trait_expr_value): Adjust.
2402
2403 2007-04-23  Simon Baldwin  <simonb@google.com>
2404
2405         * decl.c (grokparms): Added new error for duplicate function
2406         parameters names in function prototypes, to match gcc behavior.
2407
2408 2007-04-23  Jan Hubicka  <jh@suse.cz>
2409
2410         * cp/decl2.c (finish_objects): Do not call target constructor/destructor
2411         bits dirrectly.
2412
2413 2007-04-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2414
2415         * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
2416         instead of checking GIMPLE_STMT_P in chain_next.
2417
2418 2007-04-17  Mark Mitchell  <mark@codesourcery.com>
2419
2420         PR c++/31513
2421         * call.c (convert_for_arg_passing): Convert bitfields to their
2422         declared types.
2423
2424 2007-04-17  Simon Martin  <simartin@users.sourceforge.net>
2425
2426         PR c++/31517
2427         * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
2428
2429 2007-04-16  Seongbae Park <seongbae.park@gmail.com>
2430
2431         PR c++/29365
2432         * cp/decl2.c (constrain_class_visibility):
2433         Do not warn about the use of anonymous namespace in the main input file.
2434
2435 2007-04-15  Mark Mitchell  <mark@codesourcery.com>
2436
2437         * cp-tree.h (current_template_parms): Fix typo in comment.
2438
2439 2007-04-15  Kazu Hirata  <kazu@codesourcery.com>
2440
2441         * cp-tree.h, error.c: Fix comment typos.
2442
2443 2007-04-13  Jason Merrill  <jason@redhat.com>
2444
2445         PR c++/31074
2446         * call.c (reference_binding): Add c_cast_p parm.  If true,
2447         add quals to TO as needed to make it reference-compatible.
2448
2449 2007-04-11  Jan Hubicka  <jh@suse.cz>
2450
2451         * cp/class.c (convert_to_base_statically): Fold produced tree; verify
2452         that we are not processing template_decl.
2453
2454 2007-04-09  Mark Mitchell  <mark@codesourcery.com>
2455
2456         PR c++/31449
2457         * class.c (build_base_path): Ensure that the converted pointer has
2458         the same cv-qualification as the input.
2459
2460 2007-04-09  Paolo Carlini  <pcarlini@suse.de>
2461
2462         * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
2463
2464 2007-04-08  Steven Bosscher  <steven@gcc.gnu.org>
2465
2466         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
2467         Do not set it.
2468         (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
2469         * tree.c (cp_add_pending_fn_decls): Remove.
2470         * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
2471
2472 2007-04-07  Daniel Berlin  <dberlin@dberlin.org>
2473
2474         Revert change removing staticp.
2475
2476 2007-04-06  Daniel Berlin  <dberlin@dberlin.org>
2477
2478         * cp-objcp-common.c (cxx_staticp): Remove.
2479         * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
2480         * cp-tree.h (cxx_staticp):      
2481
2482 2007-04-04  Danny Smith  <dannysmith.users.sourceforge.net>
2483
2484         * class.c (check_for_override): Don't remove dllmport attribute
2485         of virtual methods.
2486
2487 2007-04-03  Jakub Jelinek  <jakub@redhat.com>
2488
2489         PR c++/30847
2490         * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
2491         type issue error and return early.
2492
2493 2007-03-30  Jason Merrill  <jason@redhat.com>
2494
2495         PR c++/31187
2496         * typeck.c (cp_type_readonly): New fn.
2497         * cp-tree.h: Declare it.
2498         * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
2499         (cp_finish_decl): Not here.
2500
2501 2007-03-31  Richard Guenther  <rguenther@suse.de>
2502
2503         * optimize.c (maybe_clone_body): Replace splay-tree usage by
2504         pointer-map.
2505
2506 2007-03-31  Douglas Gregor  <doug.gregor@gmail.com>
2507
2508         PR c++/31138
2509         PR c++/31140
2510         PR c++/31141
2511         * parser.c (declarator_can_be_parameter_pack): New.
2512         (cp_parser_template_parameter): Only parse the `...' if the
2513         declarator can be a parameter pack.
2514         (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
2515         is NULL.
2516         * pt.c (find_parameter_packs_r): Look into the bounds on integer
2517         types (they could be used as array bounds). 
2518         (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
2519         (tsubst_pack_expansion): Handle failure to expand parameter
2520         packs.
2521         
2522 2007-03-30  Paolo Carlini  <pcarlini@suse.de>
2523
2524         PR c++/26099
2525         * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
2526         TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
2527         (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
2528         (CLASS_TYPE_NON_UNION_P): Add.
2529         (struct lang_type_class): Add has_complex_dflt.
2530         (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
2531         (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
2532         * cp-tree.def: Add TRAIT_EXPR.
2533         * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
2534         * lex.c (struct resword): Add __has_nothrow_assign,
2535         __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
2536         __has_trivial_constructor, __has_trivial_copy,
2537         __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
2538         __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
2539         __is_pod, __is_polymorphic, __is_union.
2540         * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
2541         (cp_parser_trait_expr): New.
2542         * semantics.c (finish_trait_expr, trait_expr_value
2543         classtype_has_nothrow_copy_or_assign_p): New.
2544         * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
2545         as static.
2546         * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
2547         * class.c (check_bases, check_field_decl, check_bases_and_members):
2548         Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
2549         * pt.c (uses_template_parms, tsubst_copy_and_build,
2550         value_dependent_expression_p, type_dependent_expression_p): Deal with
2551         TRAIT_EXPR.
2552         * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
2553
2554 2007-03-29  Richard Guenther  <rguenther@suse.de>
2555
2556         * tree.c (cp_walk_subtrees): Do not set input_location.
2557
2558 2007-03-28  Simon Martin  <simartin@users.sourceforge.net>
2559
2560         PR c++/29077
2561         * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
2562         destructor.
2563
2564 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
2565
2566         * parser.c (struct cp_parser): Update comment for
2567         greater_than_is_operator_p.
2568         (cp_parser_primary_expression): In C++0x mode, a cast operator can
2569         be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
2570         (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
2571         !GREATER_THAN_IS_OPERATOR_P.
2572         (cp_parser_binary_expression): When -Wc++0x-compat, warn about
2573         `>>' operators that will become two `>' tokens in C++0x.
2574         (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
2575         mode, allowing it to terminate default arguments.
2576         (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
2577         `>>' like two consecutive `>' tokens.
2578         (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
2579         (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
2580         ends a template argument.
2581
2582 2007-03-28  Douglas Gregor  <doug.gregor@gmail.com>
2583
2584         * decl.c (redeclaration_error_message): Complain when redeclaring
2585         a friend function with default template arguments (C++0x mode only).
2586         * cp-tree.h (check_default_tmpl_args): Declare.
2587         * pt.c (check_default_tmpl_args): In C++0x mode, permit default
2588         template arguments in function templates. Add support for checking
2589         the default template arguments of friend templates.
2590         (push_template_decl_real): Fix call to check_default_tmpl_args.
2591         (type_unification_real): If a template parameter has not been
2592         deduced but provides a default template argument, substitute into
2593         that default template argument.
2594         * parser.c (cp_parser_init_declarator): When declaring (but not
2595         defining!) a function template in C++0x mode, check for default
2596         template arguments.
2597
2598 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
2599
2600         PR c++/29993
2601         * decl.c (grokdeclarator): Deal with cv-qualified function type
2602         typedefs in the same way for member and non-member functions.
2603
2604 2007-03-26  Dirk Mueller  <dmueller@suse.de>
2605
2606         * parser.c (cp_parser_member_declaration): Pedwarn
2607         about stray semicolons after member declarations.
2608
2609 2007-03-26  Paolo Carlini  <pcarlini@suse.de>
2610
2611         PR c++/30500
2612         * pt.c (instantiate_decl): Set in_system_header.
2613
2614 2007-03-22  Mark Mitchell  <mark@codesourcery.com>
2615
2616         * cp-tree.h (current_tempalte_parms): Improve documentation.
2617         * pt.c (current_template_args): Likewise.
2618
2619         PR c++/30863
2620         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
2621         not consume tokens when failing.
2622
2623 2007-03-22  Jim Wilson  <wilson@specifix.com>
2624             Mark Mitchell  <mark@codesourcery.com>
2625
2626         PR c++/31273
2627         * call.c (standard_conversion): Use type_decays_to.  Keep FCODE
2628         consistent with FROM.
2629
2630 2007-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2631
2632         * error.c (dump_expr): Handle dependent names that designate types.
2633         * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
2634
2635 2007-03-17  Kazu Hirata  <kazu@codesourcery.com>
2636
2637         * cp-tree.def, parser.c, pt.c: Fix comment typos.
2638
2639 2007-03-16  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2640
2641         * cvt.c (cp_convert_and_check) : Define.
2642         * cp-tree.h (cp_convert_and_check): Declare.
2643         * call.c (convert_conversion_warnings): Rename to
2644         conversion_null_warnings.  The warning for floating-point to
2645         integer is handled by convert_and_check in convert_like_real.
2646         (convert_like_real): convert_conversion_warnings was renamed as
2647         conversion_null_warnings.
2648         * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
2649         overflow and changes of value during conversion.
2650
2651 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2652
2653         PR c++/30891
2654         * parser.c (cp_parser_statement): If 'namespace' is found, this
2655         only can be a namespace alias definition, so parse it now.
2656         (cp_parser_namespace_alias_definition): if we find an open brace
2657         instead of '=', then this is actually a misplaced namespace
2658         definition.
2659         
2660 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2661
2662         PR c++/24924
2663         * decl.c (cxx_init_decl_processing): Move command-line options
2664         processing to c-opts.c.
2665         
2666 2007-03-15  Douglas Gregor  <doug.gregor@gmail.com>
2667
2668         * ptree.c (cxx_print_type): Use formatting markup for integers
2669         when printing template parameter index/level/orig level.
2670         (cxx_print_xnode): Ditto.
2671         * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
2672         (struct template_parm_index_s): Remove the PARAMETER_PACK member.
2673         Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
2674         HOST_WIDE_INTs.
2675         (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
2676         rather than a HOST_WIDE_INT.
2677         Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
2678         NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
2679         better bit-packing.
2680         (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
2681         RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
2682         IN_BASE_INITIALIZER bool bitfields.
2683         (struct cp_declarator): Make KIND a 4-bit field. Make
2684         PARAMETER_PACK_P a bool bitfield just after KIND.
2685         * pt.c (uses_parameter_packs): Destroy the pointer set.
2686         (make_pack_expansion): Ditto.
2687         (check_for_bare_parameter_packs): Ditto.
2688         * name-lookup.c (push_to_top_level): Make need_pop a bool value.
2689         
2690 2007-03-14  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2691
2692         PR c++/31165
2693         * call.c  (convert_default_arg): Instead of copying the node,
2694         unshare it.
2695
2696 2007-03-15  Dirk Mueller  <dmueller@suse.de>
2697
2698         PR c++/30860
2699         * call.c (convert_conversion_warnings): New..
2700         (convert_like_real): .. factored out from here.
2701         (convert_conversion_warnings): Add warning about
2702         false being converted to NULL in argument passing.
2703
2704 2007-03-14  Dirk Mueller  <dmueller@suse.de>
2705
2706         * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
2707         (finish_do_body): Warn about empty body in do/while statement.
2708
2709 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2710
2711         * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
2712         
2713 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2714
2715         PR c/21438
2716         * typeck.c (build_binary_op): Call warn_for_div_zero instead of
2717         warning.
2718         
2719 2007-03-13  Alexandre Oliva  <aoliva@redhat.com>
2720
2721         * cp/repo.c (init_repo): Initialize random_seed saved options.
2722         (finish_repo): Adjust.
2723
2724 2007-03-13  Mark Mitchell  <mark@codesourcery.com>
2725
2726         PR bootstrap/30899
2727         * Make-lang.in (doc/g++.1): Use $< to specify the location from
2728         which to copy.
2729
2730 2007-03-12  Seongbae Park <seongbae.park@gmail.com>
2731
2732         * decl.c (compute_array_index_type): New warning flag warn_vla.
2733
2734 2007-03-12  Mark Mitchell  <mark@codesourcery.com>
2735
2736         PR c++/30108
2737         * call.c (convert_default_arg): Copy non-constant arguments.
2738
2739 2007-03-11  Mark Mitchell  <mark@codesourcery.com>
2740
2741         PR c++/31038
2742         * parser.c (cp_parser_postfix_expression): Disallow compound
2743         literals in constant expressions.
2744
2745         PR c++/30328
2746         * semantics.c (finish_typeof): Use unlowered_expr_type.
2747         
2748 2007-03-10  Mark Mitchell  <mark@codesourcery.com>
2749
2750         PR c++/30274
2751         * cp-tree.h (unlowered_expr_type): New function.
2752         * typeck.c (is_bitfield_expr_with_lowered_type): Handle
2753         COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
2754         (unlowered_expr_type): New function.
2755         (build_unary_op): Disallow predecrements of bool bitfields.
2756         * call.c (build_conditional_expr): Use unlowered_expr_type.
2757         * pt.c (type_unification_real): Likewise.
2758
2759 2007-03-09  Douglas Gregor  <doug.gregor@gmail.com>
2760
2761         PR c++/20599
2762         * typeck.c (check_return_expr): Check for bare parameter packs.
2763         (comptypes): Compare template parameter packs and
2764         type pack expansions.
2765         * decl.c (grokdeclarator): Deal with the declaration of function
2766         parameter packs.
2767         (grokparms): Verify that the (optional) function parameter pack is
2768         at the end of the parameter list.
2769         (xref_basetypes): Handle pack expansions in the base class.
2770         (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
2771         * cp-tree.def (TYPE_ARGUMENT_PACK): New.
2772         (NONTYPE_ARGUMENT_PACK): New.
2773         (TYPE_PACK_EXPANSION): New.
2774         (EXPR_PACK_EXPANSION): New.
2775         (ARGUMENT_PACK_SELECT): New.
2776         * cp-objcp-common.c (cp_tree_size): Compute size of
2777         (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
2778         ARGUMENT_PACK_SELECT.
2779         * error.c (dump_template_argument): Print template argument packs.
2780         (dump_template_argument_list): Ditto.
2781         (dump_template_parameter): Dump `...' for template type parameter
2782         packs.
2783         (dump_type): Dump TYPE_PACK_EXPANSION nodes.
2784         (dump_parameters): Print function parameter packs.
2785         (dump_template_parms): Print template argument packs.
2786         (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
2787         (maybe_warn_variadic_templates): New.
2788         * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
2789         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2790         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2791         CAST_EXPR. 
2792         * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
2793         (write_template_arg): Write argument packs as separate arguments.
2794         * cp-tree.h (struct template_parm_index_s): Add flag that
2795         indicates that the template parameter is actually a parameter
2796         pack.
2797         (struct tree_argument_pack_select): New.
2798         (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
2799         (union lang_tree_node): Add argument_pack_select.
2800         (FUNCTION_PARAMETER_PACK_P): New.
2801         (PACK_EXPANSION_P): New.
2802         (PACK_EXPANSION_PATTERN): New.
2803         (SET_PACK_EXPANSION_PATTERN): New.
2804         (PACK_EXPANSION_PARAMETER_PACKS): New.
2805         (ARGUMENT_PACK_P): New.
2806         (ARGUMENT_PACK_ARGS): New.
2807         (SET_ARGUMENT_PACK_ARGS): New.
2808         (ARGUMENT_PACK_INCOMPLETE_P): New.
2809         (ARGUMENT_PACK_EXPLICIT_ARGS): New.
2810         (TEMPLATE_PARM_PARAMETER_PACK): New.
2811         (TEMPLATE_TYPE_PARAMETER_PACK): New.
2812         (ARGUMENT_PACK_SELECT_FROM_PACK): New.
2813         (ARGUMENT_PACK_SELECT_INDEX): New.
2814         (ARGUMENT_PACK_SELECT_ARG): New.
2815         (struct cp_declarator): Add parameter_pack_p flag.
2816         (maybe_warn_variadic_templates): Declare.
2817         (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
2818         indicate a template parameter pack. 
2819         (uses_parameter_packs): Declare.
2820         (template_parameter_pack_p): Declare.
2821         (template_parms_variadic_p): Declare.
2822         (make_pack_expansion): Declare.
2823         (check_for_bare_parameter_packs): Declare.
2824         * cxx-pretty-print.c (pp_cxx_unary_expression): Print
2825         sizeof... expressions. 
2826         (pp_cxx_expression): Print pack expansions and non-type argument
2827         packs.
2828         (pp_cxx_exception_specification): Print pack expansions. 
2829         (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
2830         (pp_cxx_ctor_initializer): Print pack expansions.
2831         (pp_cxx_type_id): Print pack expansions.
2832         (pp_cxx_template_argument_list): Print argument packs.
2833         (pp_cxx_template_parameter): Print ellipsis for template parameter
2834         packs.
2835         * pt.c (comp_template_parms): Compare template parameter packs.
2836         (template_parameter_pack_p): New.
2837         (template_parms_variadic_p): New.
2838         (template_args_variadic_p): New.
2839         (make_ith_pack_parameter_name): New.
2840         (struct find_parameter_pack_data): New.
2841         (find_parameter_packs_r): New.
2842         (uses_parameter_packs): New.
2843         (make_pack_expansion): New.
2844         (check_for_bare_parameter_packs): New.
2845         (expand_template_argument_pack): New.
2846         (reduce_template_parm_level): Propagate parameter pack flag.
2847         (process_template_parm): Add is_parameter_pack parameter to state
2848         when the parameter is actually a parameter pack. Create template
2849         parameter packs when is_parameter_pack is true.
2850         (current_template_args): The argument for a template parameter
2851         pack is an argument pack containing a single pack expansion.
2852         (process_partial_specialization): When checking that non-type
2853         argument expressions do not involve template parameters, loop over
2854         the arguments in argument packs separately.
2855         (push_template_decl_real): Check that the type of the declaration
2856         does not have any bare parameter packs. Check that primary
2857         templates have no more than one parameter pack, and that it comes
2858         at the end of the template parameter list.
2859         (convert_template_argument): Handle coercions for pack expansion
2860         expressions by coercing the pattern then rebuilding the expansion.
2861         (coerce_template_parms): When coercing the arguments for a
2862         variadic template, pack "extra" arguments into an argument pack.
2863         (coerce_template_template_parms): Cannot coerce between parameter
2864         packs and non-pack parameters.
2865         (template_args_equal): Compare PACK_EXPANSION_P expressions.
2866         (comp_template_args): Expand all template arguments packs before
2867         comparing template argument lists.
2868         (mangle_class_name_for_template): Make argument packs as separate
2869         template arguments.
2870         (for_each_template_parm_r): No need to handle BASELINK. 
2871         (instantiate_class_template): Handle pack expansions in the base
2872         class list.
2873         (tsubst_pack_expansion): New.
2874         (tsubst_template_args): Handle substitutions of argument packs and
2875         pack expansion into template argument lists.
2876         (tsubst_decl): Expand function parameter packs into separate
2877         function parameters.
2878         (tsubst_arg_types): Expand a type pack expansion into separate
2879         argument types.
2880         (tsubst_exception_specification): Handle pack expansions in
2881         exception specifiers.
2882         (tsubst): See through ARGUMENT_PACK_SELECT arguments when 
2883         replacing a template parameter with its argument. If we encounter
2884         a substitution for an argument pack, just return the parameter
2885         itself. 
2886         (tsubst_copy): sizeof(X...) returns the number of elements in
2887         parameter pack X.  See through ARGUMENT_PACK_SELECT when the
2888         PARM_DECL is a parameter pack.
2889         (tsubst_expr): Expression pack expansions and argument packs
2890         cannot show up here; they will all be handled through function
2891         calls, sizeof, and template argument lists.
2892         (tsubst_copy_and_build): sizeof(X...) returns the number of
2893         elements in parameter pack X.  Handle pack expansions in TREE_LIST
2894         and CONSTRUCTOR nodes.
2895         (fn_type_unification): Handle "incomplete" explicit template
2896         argument lists that specify some of the arguments for a template
2897         parameter pack.
2898         (type_unification_real): Unify arguments against pack expansions.
2899         (template_parm_level_and_index): New, helper function.
2900         (unify_pack_expansion): New.
2901         (unify): Unify argument packs on an argument-by-argument basis,
2902         handling variadic argument packs as well.
2903         (more_specialized_fn): Handle unification of function parameter
2904         packs. All things being equal, prefer non-variadic function
2905         templates to variadic function templates.
2906         (more_specialized_class): Prefer the variadic class template
2907         partial specialization that binds fewer arguments to a parameter
2908         pack.
2909         (regenerate_decl_from_template): Expand function parameter packs
2910         into separate parameters.
2911         (instantiate_decl): Ditto.
2912         (tsubst_initializer_list): Handle pack expansions for base-class
2913         initializers.
2914         (dependent_type_p_r): Determine dependent types in argument packs
2915         and pack expansions.
2916         (value_dependent_expression_p): Determine value-dependence of
2917         non-type argument packs.
2918         (dependent_template_arg_p): Handle argument packs.
2919         * semantics.c (finish_cond): Check for bare parameter packs.
2920         (finish_expr_stmt): Ditto.
2921         (finish_for_expr): Ditto.
2922         (finish_switch_cond): Ditto.
2923         (finish_mem_initializers): Ditto.
2924         * name-lookup.c (arg_assoc_type): Handle pack expansions and
2925         argument packs.
2926         * decl2.c (cp_build_parm_decl): Mark function parameter packs.
2927         * parser.c (make_declarator): Declarator is not an expansion.
2928         (make_pointer_declarator): Transfer parameter pack flag to outer
2929         declarator.
2930         (make_reference_declarator): Ditto.
2931         (make_ptrmem_declarator): Ditto.
2932         (make_call_declarator): Ditto.
2933         (make_array_declarator): Ditto.
2934         (cp_parser_postfix_expression): Allow pack expansion expressions
2935         in the argument list for a call expression.
2936         (cp_parser_parenthesized_expression_list): Add new parameter
2937         ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
2938         into separate arguments."
2939         (cp_parser_new_placement): Allow pack expansion expressions.
2940         (cp_parser_new_initializer): Ditto.
2941         (cp_parser_mem_initializer_list): Allow ellipsis to create a
2942         base-class initializer expansion.
2943         (cp_parser_mem_initializer): Ditto.
2944         (cp_parser_template_parameter_list): Keep track of whether the
2945         template parameter is a template parameter pack.
2946         (cp_parser_template_parameter): Parse the ellipsis to indicate a
2947         template parameter pack.
2948         (cp_parser_type_parameter): Ditto.
2949         (cp_parser_template_argument_list): Parse the ellipsis to indicate
2950         a pack expansion.
2951         (cp_parser_direct_declarator): Parse the ellipsis to indicate that
2952         this declarator is a parameter pack.
2953         (cp_parser_parameter_declaration): The ellipsis does not end the
2954         parameter declaration, because it might be a parameter pack. Parse
2955         the ellipsis to indicate a parameter pack.
2956         (cp_parser_initializer): Allow pack expansions.
2957         (cp_parser_initializer_list): Allow ellipsis to create an
2958         initializer expansion.
2959         (cp_parser_base_clause): Allow ellipsis to create a base specifier
2960         expansion.
2961         (cp_parser_type_id_list): Allow ellipsis to create an exception
2962         specifier expansion.
2963         (cp_parser_attribute_list): Don't allow pack expansions.
2964         (cp_parser_functional_cast): Allow pack expansions.
2965         (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
2966         compute the length of a parameter pack.
2967         (cp_parser_next_token_ends_template_argument_p): An ellipsis can
2968         end a template argument.
2969         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2970         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2971         CAST_EXPR. 
2972
2973 2007-03-09  Dirk Mueller  <dmueller@suse.de>
2974
2975         * cp/call.c (build_new_op): Call warn_logical_operator.
2976
2977 2007-03-08  Volker Reichelt  <reichelt@netcologne.de>
2978
2979         PR c++/30852
2980         * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
2981
2982         PR c++/30534
2983         * pt.c (any_template_arguments_need_structural_equality_p):
2984         Robustify.
2985
2986 2007-03-08  Alexandre Oliva  <aoliva@redhat.com>
2987
2988         * decl.c (grokdeclarator): Disable warnings for anonymous
2989         bitfields.
2990
2991 2007-03-05  Volker Reichelt  <reichelt@netcologne.de>
2992
2993         * typeck2.c (readonly_error): Always emit a hard error.
2994         Remove last argument.
2995         * cp-tree.h (readonly_error): Adjust prototype.
2996         * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
2997         * typeck.c (build_unary_op): Likewise.
2998         (build_modify_expr): Likewise.
2999
3000 2007-03-04  Simon Martin  <simartin@users.sourceforge.net>
3001
3002         PR c++/30895
3003         * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
3004
3005 2007-03-03  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3006
3007         PR c++/15787
3008         * parser.c (struct cp_parser): New IN_IF_STMT.
3009         (cp_parser_statement_seq_opt): Handle an unexpected 'else',
3010         returning if parsing the body of an 'if' statement or issuing an
3011         error and continuing.
3012         (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
3013         body of 'if'.
3014         (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
3015         
3016 2007-03-02  Simon Martin  <simartin@users.sourceforge.net>
3017
3018         PR c++/28253
3019         * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
3020         for thunks.
3021
3022 2007-03-02  Geoffrey Keating  <geoffk@apple.com>
3023
3024         * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
3025         Objective-C++.  Don't exit early if -shared-libgcc needs to be
3026         added.
3027
3028 2007-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3029
3030         * typeck.c (common_base_type): Delete unused function.
3031         
3032 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
3033
3034         * Make-lang.in: Add dummy lang.install-pdf target.
3035
3036 2007-03-01  Simon Baldwin <simonb@google.com>
3037
3038         PR c++/23689
3039         * decl.c (check_tag_decl): Added new warning for typedef ignored
3040         when it precedes an otherwise valid non-typedef declaration.
3041
3042 2007-02-28  Sandra Loosemore  <sandra@codesourcery.com>
3043
3044         * typeck.c (build_function_call): Store converted arguments
3045         in a stack-allocated array instead of building a list.
3046         (convert_arguments): Store arguments in the array passed in as an
3047         argument, and return the actual number of arguments.
3048         * call.c (build_call): Delete, and replace with...
3049         (build_call_n, build_call_a): New.
3050         (build_op_delete_call): Rewrite to avoid constructing argument lists.
3051         (build_over_call): Store converted arguments in a stack-allocated
3052         array instead of building a list.
3053         (build_cxx_call): Pass arguments in an array instead of as a list.
3054         (build_java_interface_fn_ref): Rewrite to avoid constructing
3055         argument lists.
3056         * tree.h: Update declarations to reflect above changes.
3057         * method.c (use_thunk): Use a stack-allocated array to hold
3058         the arguments instead of a list.
3059         * rtti.c (throw_bad_cast): Update call to cxx_call.
3060         (throw_bad_typeid): Likewise.
3061         (build_dynamic_cast_1): Likewise.
3062         * init.c (build_builtin_delete_call): Use build_call_n.
3063         * decl.c (expand_static_init): Likewise.
3064         * except.c (cp_protect_cleanup_actions): Likewise.
3065         * cp-gimplify.c (genericize_eh_spec_block): Likewise.
3066         (gimplify_must_not_throw_expr): Likewise.
3067         (cxx_omp_apply_fn): Use build_call_a.
3068
3069 2007-02-26  Mark Mitchell  <mark@codesourcery.com>
3070
3071         * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
3072         * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
3073
3074 2007-02-25  Mark Mitchell  <mark@codesourcery.com>
3075
3076         * cp-tree.h (static_ctors): Remove.
3077         * cp-tree.h (static_dtors): Likewise.
3078         * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
3079         refactoring of tree_map hierarchy.
3080         (decl_shadowed_for_var_insert): Likewise.
3081         * semantics.c (expand_body): Use c_expand_body.
3082         (expand_or_defer_fn): Don't update static_ctors or static_dtors.
3083         * decl2.c (static_ctors): Remove.
3084         (static_dtors): Likewise.
3085         (generate_ctor_or_dtor_function): Pass NULL_TREE to
3086         objc_generate_static_init_call.  Do not call static_[cd]tors.
3087         (generate_ctor_and_dtor_functions_for_priority): Do not check for
3088         static_[cd]tors.
3089         (cp_write_global_declarations): Likewise.
3090
3091 2007-02-23  Richard Guenther  <rguenther@suse.de>
3092
3093         * class.c (note_name_declared_in_class): Make declaration
3094         changes meaning a pedwarn.
3095
3096 2007-02-22  Michael Matz  <matz@suse.de>
3097
3098         PR c++/29433
3099         * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
3100         * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
3101         dump_function_decl): Guard emitting outer scopes by new flag.
3102         * cp-lang.c (cxx_dwarf_name): New function.
3103         (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
3104         * pt.c (classtype_mangled_name, mangle_class_name_for_template):
3105         Remove functions.
3106         (push_template_decl_real, lookup_template_class): Remove calls
3107         to above functions.
3108
3109 2007-02-19  Mark Mitchell  <mark@codesourcery.com>
3110
3111         * call.c (build_new_method_call): Ensure that explicit calls of
3112         destructors have type "void".
3113
3114 2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3115
3116         * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
3117         and -Walways-true with -Waddress.
3118         * cvt.c (convert_to_void): Replace unconditional warning with
3119         -Waddress.
3120
3121 2007-02-18  Kazu Hirata  <kazu@codesourcery.com>
3122
3123         * decl.c, tree.c: Fix comment typos.
3124
3125 2007-02-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
3126
3127         PR C++/30158
3128         * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the 
3129         statement expression if we had an error mark node.
3130
3131 2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
3132             Brooks Moses  <brooks.moses@codesourcery.com>
3133             Lee Millward  <lee.millward@codesourcery.com>
3134
3135         * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
3136         Change class to tcc_vl_exp.
3137
3138         * call.c (build_call): Use build_call_list instead 
3139         of build3. 
3140         (build_over_call): Likewise.
3141         (build_new_method_call): Use build_min_non_dep_call_list 
3142         instead of build_min_non_dep.
3143
3144         * error.c (dump_call_expr_args): New function.
3145         (dump_aggr_init_expr_args): New function.
3146         (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. 
3147         Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
3148
3149         * cvt.c (convert_to_void): Use build_call_array instead
3150         of build3; use new AGGR_INIT_EXPR accessor macros.
3151
3152         * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
3153         instead of TREE_CODE_LENGTH.
3154
3155         * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
3156         AGGR_INIT_EXPR accessor macros.
3157
3158         * cp-gimplify.c (cp_gimplify_init_expr): Use 
3159         AGGR_INIT_EXPR_SLOT to set the slot operand.
3160
3161         * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
3162         (AGGR_INIT_EXPR_SLOT): New macro.
3163         (AGGR_INIT_EXPR_ARG): New macro.
3164         (aggr_init_expr_nargs): New macro.
3165         (AGGR_INIT_EXPR_ARGP): New macro.
3166         (aggr_init_expr_arg_iterator): New.
3167         (init_aggr_init_expr_arg_iterator): New.
3168         (next_aggr_init_expr_arg): New.
3169         (first_aggr_init_expr_arg): New.
3170         (more_aggr_init_expr_args_p): New.
3171         (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
3172         (stabilize_aggr_init): New declaration.
3173         (build_min_non_dep_call_list): Likewise.
3174
3175         * tree.c (process_aggr_init_operands): New function.
3176         (build_aggr_init_array) New function.
3177         (build_cplus_new): Update to use new CALL_EXPR and
3178         AGGR_INIT_EXPR accessor macros. Replace use of build3 with
3179         build_aggr_init_array.
3180         (build_min_non_dep_call_list) New function.
3181         (build_min_nt): Assert input code parameter is not a variable
3182         length expression class.
3183         (build_min, build_min_non_dep): Likewise.
3184         (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
3185         to check for equality instead of recursing. Handle tcc_vl_exp
3186         tree code classes.
3187         (stabilize_call): Update to only handle CALL_EXPRs, not 
3188         AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
3189         (stabilize_aggr_init): New function.
3190         (stabilize_init): Use it.
3191
3192         * cxx-pretty-print.c (pp_cxx_postfix_expression)
3193         <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
3194         AGGR_INIT_EXPR accessor macros and argument iterators.
3195         
3196         * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
3197         build_vl_exp. Iterate through the operands, recursively 
3198         processing each one.
3199         (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
3200         CALL_EXPR accessor macros.
3201         (value_dependent_expression_p) <default>: Handle tcc_vl_exp
3202         tree code classes. Use TREE_OPERAND_LENGTH instead of 
3203         TREE_CODE_LENGTH.
3204
3205         * semantics.c (finish_call_expr): Use build_nt_call_list
3206         instead of build_nt.
3207         (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR 
3208         accessor macros. Use build_call_array to construct the 
3209         CALL_EXPR node instead of build3
3210         
3211         * decl2.c (build_offset_ref_call_from_tree): Use 
3212         build_nt_call_list and build_min_non_dep_call_list instead
3213         of build_min_nt and build_min_non_dep.
3214
3215         * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
3216         Use build_nt_call_list instead of build_min_nt.
3217
3218 2007-02-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3219
3220         PR c++/28943
3221         * call.c (build_conditional_expr): Improve error message.
3222         
3223 2007-02-13  Dirk Mueller  <dmueller@suse.de>
3224
3225         * friend.c (do_friend): Annotate warning about friend
3226         declarations in templates with OPT_Wnon_template_friend.
3227         Convert informal message from warning() to inform().
3228
3229 2007-02-12  Simon Martin  <simartin@users.sourceforge.net>
3230             Mark Mitchell  <mark@codesourcery.com>
3231
3232         PR c++/14622
3233         * pt.c (do_decl_instantiation): Detect type mismatches in explicit
3234         instantiations for variables.
3235
3236 2007-02-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3237
3238         PR middle-end/7651
3239         * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
3240         Check warn_unused_value just once.
3241
3242 2007-02-11  Mark Mitchell  <mark@codesourcery.com>
3243
3244         PR c++/26988
3245         * pt.c (determine_specialization): Use skip_artificial_parms_for.
3246         (fn_type_unificiation): Likewise.
3247         (get_bindings): Likewise.
3248
3249 o2007-02-06  Mark Mitchell  <mark@codesourcery.com>
3250
3251         PR target/29487
3252         * decl.c (finish_function): Use DECL_REPLACEABLE.
3253         * tree.c (cp_cannot_inline_tree_fn): Likewise.
3254
3255 2007-02-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3256
3257         * parser.c (cp_parser_primary_expression): Reformat overly long lines.
3258
3259 2007-02-10  Richard Henderson  <rth@redhat.com>, Jakub Jelinek  <jakub@redhat.com>
3260
3261         * decl.c (grokvardecl): Don't error if !have_tls.
3262         (grokdeclarator): Likewise.
3263         * parser.c (cp_parser_omp_threadprivate): Likewise.
3264
3265 2007-02-07  Jakub Jelinek  <jakub@redhat.com>
3266
3267         PR c++/30703
3268         * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
3269         parameters and result decls in omp clauses.
3270         (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
3271         by reference.
3272
3273 2007-02-05  Dirk Mueller  <dmueller@suse.de>
3274
3275         PR bootstrap/30510
3276         * parser.c (cp_parser_class_specifier): Always initialize bases.
3277
3278 2007-02-05  Paolo Bonzini  <bonzini@gnu.org>
3279
3280         * cp-tree.h (OMP_ATOMIC_CODE): Delete.
3281         (OMP_ATOMIC_DEPENDENT_P): Rewrite.
3282         * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
3283         expressions.
3284         * semantics.c (finish_omp_atomic): Store a whole expression node
3285         in operand 1, and integer_zero_node in operand 0, for dependent
3286         OMP_ATOMIC.  Rewrite to make flow easier to understand.
3287
3288 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3289
3290         * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
3291
3292 2007-02-04  Kazu Hirata  <kazu@codesourcery.com>
3293
3294         * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
3295         parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
3296
3297 2007-02-03  Douglas Gregor  <doug.gregor@gmail.com>
3298
3299        * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
3300        keyword warning to -Wc++0x-compat.
3301         
3302 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3303
3304         * decl.c (grokdeclarator): Update documentation.
3305
3306 2007-02-02  Jakub Jelinek  <jakub@redhat.com>
3307
3308         PR c++/30536
3309         * decl.c (grokdeclarator): If __thread is used together with
3310         a storage class other than extern and static, clear thread_p
3311         after issuing diagnostics and fall through to checking the
3312         storage class.
3313
3314 2007-01-30  Roger Sayle  <roger@eyesopen.com>
3315
3316         * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
3317         calculating the size of an array (to avoid recursive errors).
3318
3319 2007-01-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3320
3321         PR c++/24745
3322         * typeck.c (build_binary_op): Fix logic for warning. Move warning
3323         to -Wpointer-arith.
3324         * call.c (convert_like_real): Don't warn when converting to
3325         boolean type.
3326         
3327 2007-01-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3328
3329         * decl.c (pop_label): Replace warning with call to
3330         warn_for_unused_label.
3331
3332 2007-01-28  Andrew Pinski  <pinskia@gmail.com>
3333
3334         PR C++/28988
3335         * semantics.c (finish_pseudo_destructor_expr): Check the
3336         destrutor name by calling check_dtor_name.
3337
3338 2007-01-24  Douglas Gregor  <dgregor@osl.iu.edu>
3339
3340         * lex.c (D_CPP0X): Rename.
3341         (D_CXX0X): To this.
3342         (reswords): D_CPP0X -> D_CXX0X.
3343         (init_reswords): Ditto.
3344         * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
3345         of C++0x keywords as identifiers.
3346
3347 2007-01-23  Simon Martin  <simartin@users.sourceforge.net>
3348
3349         PR c++/27492
3350         * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
3351         function decls.
3352
3353 2007-01-23  Ian Lance Taylor  <iant@google.com>
3354
3355         * typeck.c (convert_for_assignment): Only warn about a = b = c
3356         when converting to bool.
3357
3358 2007-01-23  Roger Sayle  <roger@eyesopen.com>
3359
3360         * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
3361         TREE_OVERFLOW.
3362         * typeck.c (ignore_overflows): Remove the remaining uses of
3363         TREE_CONSTANT_OVERFLOW.
3364
3365 2007-01-20  Jan Hubicka  <jh@suse.cz>
3366
3367         * decl2.c (start_objects, start_static_storage_duration_function):
3368         Do not make the functions uninlinable.
3369
3370 2007-01-17  Ian Lance Taylor  <iant@google.com>
3371
3372         * class.c (add_method): Call VEC_reserve_exact rather than passing
3373         a negative size to VEC_reserve.
3374
3375 2007-01-11  Simon Martin  <simartin@users.sourceforge.net>
3376
3377         PR c++/29573
3378         * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
3379
3380 2007-01-10  Mark Mitchell  <mark@codesourcery.com>
3381
3382         PR c++/28999
3383         * decl.c (make_typename_type): If the qualified name is not a
3384         type, issue an error.
3385         * parser.c (cp_parser_elaborated_type_specifier): Fix comment
3386         formatting.
3387
3388 2007-01-08  Geoffrey Keating  <geoffk@apple.com>
3389
3390         * rtti.c: Include target.h.
3391         (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
3392         don't emit typeinfo for fundamental types as weak.
3393         * Make-lang.in (cp/rtti.o): Update and correct dependencies.
3394
3395 2007-01-08  Richard Guenther  <rguenther@suse.de>
3396
3397         * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
3398
3399 2007-01-08  Mark Shinwell  <shinwell@codesourcery.com>
3400
3401         * call.c (standard_conversion): Pass flag to
3402         vector_types_convertible_p to disallow emission of note.
3403         * typeck.c (convert_for_assignment): Pass flag to
3404         vector_types_convertible_p to allow emission of note.
3405         (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
3406         to disallow emission of note.
3407
3408 2007-01-07  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3409
3410         PR c++/28986
3411         * typeck.c (build_binary_op): Call overflow_warning if
3412         TREE_OVERFLOW_P is true for the result and not for any of the
3413         operands.
3414         
3415 2007-01-06  Lee Millward  <lee.millward@codesourcery.com>
3416
3417        PR c++/19439
3418        * class.c (add_method): Don't wait until template
3419        instantiation time to complain about duplicate methods.
3420         
3421 2007-01-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3422
3423         PR c/19978
3424         * semantics.c (finish_unary_op_expr): Warn only if result
3425         overflowed and operands did not.
3426
3427 2007-01-05  Ian Lance Taylor  <iant@google.com>
3428
3429         * typeck.c (build_binary_op): Warn about comparing a non-weak
3430         address to NULL.
3431
3432 2007-01-05  Douglas Gregor  <doug.gregor@gmail.com>
3433
3434         * pt.c (tsubst): Propagate the need for structural equality checks
3435         when reducing the level of template parameters.
3436
3437 2007-01-03  Kazu Hirata  <kazu@codesourcery.com>
3438
3439         * pt.c: Fix a comment typo.
3440
3441 2007-01-02  Ian Lance Taylor  <iant@google.com>
3442
3443         * semantics.c (maybe_convert_cond): Optionally warn when using an
3444         assignment as a condition.
3445         * typeck.c (convert_for_assignment): Optionally warn about
3446         assigning the result of an assignment to a bool.
3447
3448 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
3449
3450         * pt.c (canonical_template_parms): Correct typo in comment.
3451         
3452 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
3453
3454         * typeck.c (structural_comptypes): Renamed from "comptypes".
3455         (comptypes): Use canonical type information to perform fast type
3456         comparison. When VERIFY_CANONICAL_TYPES, verify that the
3457         canonical type comparison returns the same results as we would see
3458         from the current, structural check. Support COMPARE_STRUCTURAL
3459         when we need structural checks.
3460         * decl.c (typename_compare): Fix comment.
3461         (build_typename_type): TYPENAME_TYPE nodes require structural
3462         equality checks, because they resolve different based on the
3463         current class type.
3464         (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
3465         require structural equality checks (for now).
3466         (build_ptrmemfunc_type): Build the canonical pointer to member
3467         function type.
3468         (compute_array_index_type): Whenever we build a new index type
3469         to represent the size of an array in a template, we need to mark
3470         this index type as requiring structural equality. This goes for
3471         arrays with value-dependent sizes with the current ABI, or all
3472         arrays with ABI-1.
3473         * tree.c (cplus_array_hash): New.
3474         (struct cplus_array_info): New.
3475         (cplus_array_compare): New.
3476         (cplus_array_htab): New.
3477         (build_cplus_array_type_1): Use a hash table to cache the array
3478         types we build. Build the canonical array type for each array
3479         type.
3480         (cp_build_qualified_type_real): When building a cv-qualified array
3481         type, use the hash table of array types and build canonical array
3482         types as necessary.
3483         (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
3484         use structural equality (for now).
3485         * cp-tree.h (COMPARE_STRUCTURAL): New.
3486         * pt.c (canonical_template_parms): New.
3487         (canonical_type_parameter): New.
3488         (process_template_parm): Find the canonical type parameter.
3489         (lookup_template_class): When we have named the primary template
3490         type, set the canonical type for our template class to the primary
3491         template type. If any of the template arguments need structural
3492         equality checks, the template class needs structural equality
3493         checks.
3494         (tsubst): When reducing the level of a template template
3495         parameter, we require structural equality tests for the resulting
3496         parameter because its template parameters have not had their types
3497         canonicalized. When reducing a template type parameter, find the
3498         canonical reduced type parameter.
3499         (any_template_arguments_need_structural_equality_p): New.
3500