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