OSDN Git Service

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