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