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