tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
[gcc.git] / gcc / cp / ChangeLog
1 2010-09-28 Jason Merrill <jason@redhat.com>
2
3 * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
4 (real_lvalue_p): Take const_tree.
5 * cp-tree.h: Adjust.
6 * typeck.c (lvalue_or_else): Make temporary arg a permerror.
7 (cp_build_addr_expr_1): Likewise.
8
9 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
10
11 Partially merged from apple/trunk branch on FSF servers:
12 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
13 Radar 3803157 (method attributes)
14
15 * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
16 (cp_parser_objc_method_tail_params_opt): Likewise.
17 (cp_parser_objc_method_signature): Likewise.
18 (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
19 (cp_parser_objc_method_prototype_list): Handle attributes.
20 (cp_parser_objc_method_definition_list): Likewise.
21
22 2010-09-28 Richard Henderson <rth@redhat.com>
23
24 * cp-lang.c: Include "target.h".
25 (cp_eh_personality): Use targetm.except_unwind_info.
26 * Make-lang.in (cp-lang.o): Update deps.
27
28 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
29
30 * parser.c (cp_parser_objc_valid_prefix_attributes): New.
31 (cp_parser_declaration): Parse prefix attributes for ObjC++.
32 (cp_parser_objc_protocol_declaration): Handle attributes.
33 (cp_parser_objc_class_interface): Likewise.
34 (cp_parser_objc_declaration): Likewise.
35
36 2010-09-27 Jason Merrill <jason@redhat.com>
37
38 Require lvalues as specified by the standard.
39 * typeck.c (lvalue_or_else): Use real_lvalue_p.
40 (cp_build_addr_expr_1): Split out of cp_build_unary_op.
41 (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
42 (decay_conversion, get_member_function_from_ptrfunc): Adjust.
43 (build_x_unary_op, build_reinterpret_cast_1): Adjust.
44 (build_const_cast_1): Adjust.
45 * cp-tree.h: Declare new fns.
46 * call.c (build_this, convert_like_real, build_over_call): Adjust.
47 (initialize_reference): Adjust.
48 * class.c (build_base_path, convert_to_base_statically): Adjust.
49 (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
50 * cvt.c (build_up_reference, convert_to_reference): Adjust.
51 * decl.c (register_dtor_fn): Adjust.
52 * decl2.c (build_offset_ref_call_from_tree): Adjust.
53 * except.c (initialize_handler_parm): Adjust.
54 * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
55 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
56 * tree.c (stabilize_expr): Adjust.
57
58 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
59
60 Merge from apple/trunk branch on FSF servers:
61
62 2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
63
64 Radar 4229905
65 * typeck.c (composite_pointer_type): Call objc_have_common_type
66 when comparing two objective-c pointer types.
67
68 2005-07-18 Ziemowit Laski <zlaski@apple.com>
69
70 Radar 4175534
71 * call.c (standard_conversion): Do not issue warnings when
72 comparing ObjC pointer types.
73
74 2005-06-22 Ziemowit Laski <zlaski@apple.com>
75
76 Radar 4154928
77 * call.c (standard_conversion): Allow for a pointer conversion
78 between any two ObjC pointer types.
79 * typeck.c (composite_pointer_type): Determine common type
80 for two ObjC pointer types.
81
82 2010-09-24 Jan Hubicka <jh@suse.cz>
83
84 * decl.c (finish_function): Use decl_replaceable_p
85 * method.c (make_alias_for_thunk): Update call of cgraph_same_body_alias.
86
87 2010-09-24 Jason Merrill <jason@redhat.com>
88
89 * decl.c (compute_array_index_type): Remember type dependence of
90 array bound.
91 * pt.c (dependent_type_p_r): Don't recompute it here.
92
93 * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
94 reference and pointer to the same type as "*" or "&".
95
96 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
97
98 * typeck.c (warn_args_num): Use warning 'too many arguments to
99 method [methodname]' for an Objective-C method instead of the less
100 satisfactory 'too many arguments to function' (with no method
101 name).
102
103 2010-09-21 Jason Merrill <jason@redhat.com>
104
105 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
106 special handling if we know the member.
107
108 2010-09-18 Jason Merrill <jason@redhat.com>
109
110 * call.c (compare_ics): Do lvalue/rvalue reference binding
111 comparison for ck_list, too.
112
113 2010-09-15 Jason Merrill <jason@redhat.com>
114
115 * semantics.c (finish_id_expression): Diagnose use of function
116 parms in evaluated context outside function body.
117
118 * decl2.c (grokbitfield): Diagnose non-integral width.
119
120 * call.c (convert_like_real): Use the underlying type of the
121 reference for the temporary.
122
123 2010-09-15 Jakub Jelinek <jakub@redhat.com>
124
125 PR c++/45635
126 * class.c (build_vtbl_initializer): Use fn instead of init's operand
127 as first argument to FDESC_EXPR.
128
129 2010-09-15 Paolo Carlini <paolo.carlini@oracle.com>
130
131 PR c++/45665
132 * decl.c (grokdeclarator): Check build_memfn_type return value
133 for error_mark_node.
134
135 2010-09-13 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
136
137 * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
138 (begin_range_for_stmt): Likewise.
139
140 2010-09-11 Rodrigo Rivas <rodrigorivascosta@gmail.com>
141
142 Implement range-based for-statements.
143 * cp-tree.def (RANGE_FOR_STMT): New.
144 * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
145 (cp_convert_range_for): Declare.
146 * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
147 (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
148 * semantics.c (begin_range_for_stmt): New.
149 (finish_range_for_decl): New.
150 (finish_for_stmt): Accept also RANGE_FOR_STMT.
151 (perform_koenig_lookup): Add extra argument include_std.
152 * parser.c (cp_parser_c_for): New with code from
153 cp_parser_iteration_statement().
154 (cp_parser_range_for): New.
155 (cp_convert_range_for): New.
156 (cp_parser_iteration_statement): Add range-for support.
157 (cp_parser_condition): Adjust comment.
158 (cp_parser_postfix_expression): perform_koenig_lookup takes extra
159 argument.
160 * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
161 * cxx-pretty-print.c: Likewise.
162 * lex.c (cxx_init): Likewise.
163 * name-lookup.c (lookup_function_nonclass): Add extra argument
164 include_std.
165 (lookup_arg_dependent): Likewise.
166 * name-lookup.h: Likewise.
167
168 2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
169
170 PR c++/43824
171 * error.c (maybe_warn_cpp0x): Add new warning
172 CPP0X_INLINE_NAMESPACES.
173 * parser.c (cp_parser_namespace_definition): Likewise.
174 * cp-tree.h (cpp0x_warn_str): Likewise.
175
176 2010-09-10 Richard Guenther <rguenther@suse.de>
177
178 * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
179 TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
180
181 2010-09-10 Jan Hubicka <jh@suse.cz>
182
183 PR tree-optimization/45605
184 * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
185 ADDR_EXPR.
186
187 2010-09-08 Jakub Jelinek <jakub@redhat.com>
188
189 PR c++/45588
190 * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
191 before calling fold_decl_constant_value.
192
193 2010-09-07 Arnaud Charlet <charlet@adacore.com>
194
195 * cp-tree.h (build_enumerator): Add new location_t parameter.
196 (build_lang_decl_loc): New function.
197 * decl.c (build_enumerator): New parameter loc. Use it when calling
198 build_decl. Replace build_lang_decl with build_lang_decl_loc.
199 * pt.c (tsubst_enum): Adjust call to build_enumerator.
200 * parser.c (cp_parser_enumerator_definition): Ditto.
201 * lex.c (build_lang_decl_loc): New function.
202
203 2010-09-06 Dodji Seketeli <dodji@redhat.com>
204
205 PR c++/45200
206 PR c++/45293
207 PR c++/45558
208 * tree.c (strip_typedefs): Strip typedefs from the context of
209 TYPENAME_TYPEs.
210
211 2010-09-06 Mark Mitchell <mark@codesourcery.com>
212
213 * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
214 * call.c (build_conditional_expr): Likewise.
215 (convert_arg_to_ellipsis): Likewise.
216
217 2010-09-06 Arnaud Charlet <charlet@adacore.com>
218
219 * parser.c (make_pointer_declarator, make_reference_declarator,
220 make_call_declarator, make_array_declarator): Set declarator->id_loc.
221 (cp_parser_init_declarator): Adjust location of decl if appropriate.
222
223 2010-09-06 Jason Merrill <jason@redhat.com>
224
225 * call.c (implicit_conversion): Fix value-init of enums.
226 (convert_like_real): Likewise.
227
228 * decl.c (cp_finish_decl): Don't change init for auto deduction.
229
230 * pt.c (fold_non_dependent_expr_sfinae): Split out from...
231 (fold_non_dependent_expr): ...here.
232 (convert_nontype_argument): Use it. Take complain parm.
233 Use perform_implicit_conversion instead of ocp_convert.
234 Allow cv-qual changes.
235 (convert_template_argument): Pass complain down.
236 (tsubst_template_arg): Suppress constant expression warnings.
237 Don't fold here.
238
239 * method.c (synthesized_method_walk): In constructors, also check
240 subobject destructors.
241
242 * semantics.c (finish_compound_literal): Always build a
243 TARGET_EXPR.
244
245 2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
246
247 PR c++/45043
248 * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
249
250 2010-08-30 Jakub Jelinek <jakub@redhat.com>
251
252 PR middle-end/45423
253 * parser.c (cp_parser_omp_atomic): Handle boolean
254 {PRE,POST}_INCREMENT.
255
256 2010-08-29 Jason Merrill <jason@redhat.com>
257
258 PR c++/44991
259 * parser.c (cp_parser_parameter_declaration): Pop parameter decls
260 after tentative parsing.
261
262 2010-08-22 Joseph Myers <joseph@codesourcery.com>
263
264 * Make-lang.in (g++spec.o): Update dependencies.
265 * g++spec.c: Include opts.h
266 (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
267 (lang_specific_driver): Use cl_decoded_option structures.
268
269 2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
270
271 * call.c: Use FOR_EACH_VEC_ELT.
272 * class.c: Likewise.
273 * decl.c: Likewise.
274 * decl2.c: Likewise.
275 * error.c: Likewise.
276 * except.c: Likewise.
277 * mangle.c: Likewise.
278 * method.c: Likewise.
279 * name-lookup.c: Likewise.
280 * parser.c: Likewise.
281 * pt.c: Likewise.
282 * repo.c: Likewise.
283 * semantics.c: Likewise.
284 * typeck2.c: Likewise.
285
286 2010-08-19 Jason Merrill <jason@redhat.com>
287
288 * call.c (reference_related_p): Check for error_mark_node.
289 (add_function_candidate): Check it instead of
290 same_type_ignoring_top_level_qualifiers_p.
291
292 PR c++/45315
293 * init.c (build_new_1): Don't use build_value_init in a template.
294 (build_value_init): Make sure we don't.
295
296 PR c++/45307
297 * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
298 of empty class CONSTRUCTOR.
299
300 * except.c (pending_noexcept, pending_noexcept_checks): New.
301 (perform_deferred_noexcept_checks): New.
302 (maybe_noexcept_warning): Split from...
303 (finish_noexcept_expr): ...here. Adjust.
304 * decl2.c (cp_write_global_declarations): Call
305 perform_deferred_noexcept_checks.
306 * cp-tree.h: And declare it.
307
308 2010-08-18 Nathan Froyd <froydnj@codesourcery.com>
309
310 PR c++/45049
311 * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
312 TREE_CHAIN.
313
314 2010-08-17 Kai Tietz <kai.tietz@onevision.com>
315
316 * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
317 or if -fms-extensions is enabled check, check permissive.
318
319 2010-08-09 Jason Merrill <jason@redhat.com>
320
321 PR c++/45236
322 * pt.c (lookup_template_class): Don't re-coerce outer parms.
323
324 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
325
326 * call.c (add_builtin_candidates): Use VECs for local variable
327 `types'. Adjust remainder of function accordingly.
328
329 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
330
331 * name-lookup.c (is_associated_namespace): Convert local variables
332 to be VECs instead of TREE_LISTs.
333
334 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
335
336 * tree.c (varargs_function_p): Use stdarg_p.
337
338 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
339
340 * parser.c (cp_default_arg_entry): Declare. Declare a VEC of it.
341 (cp_unparsed_functions_entry): Declare. Declare a VEC of it.
342 (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
343 Change type to a VEC.
344 (unparsed_funs_with_default_args): Define.
345 (unparsed_funs_with_definitions): Define.
346 (push_unparsed_function_queues): New function.
347 (cp_parser_new): Call it.
348 (pop_unparsed_function_queues): New function.
349 (cp_parser_class_specifier): Adjust processing of unparsed functions.
350 (cp_parser_template_declaration_after_export): Use VEC_safe_push.
351 (cp_parser_save_member_function_body): Likewise.
352 (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
353 and pop_unparsed_function_queues.
354 (cp_parser_late_parsing_default_args): Likewise.
355 (cp_parser_save_default_args): Use VEC_safe_push.
356
357 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
358
359 * name-lookup.h (cp_label_binding): Declare. Declare a VEC type
360 containing it.
361 (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
362 fields to VECs.
363 * decl.c (poplevel): Adjust for type changes.
364 (declare_local_label): Likewise.
365
366 2010-08-06 Jason Merrill <jason@redhat.com>
367
368 * typeck.c (complete_type_or_maybe_complain): Split out from...
369 (complete_type_or_else): Here.
370 (build_class_member_access_expr): Call it.
371 (finish_class_member_access_expr): Likewise.
372 * call.c (build_special_member_call): Likewise.
373 * cvt.c (build_expr_type_conversion): Likewise.
374 * init.c (build_new): Likewise.
375 * typeck2.c (build_functional_cast): Likewise.
376 * cp-tree.h: Declare it.
377
378 * init.c (build_value_init): Add complain parm.
379 (build_value_init_noctor): Likewise.
380 (perform_member_init): Pass it.
381 (expand_aggr_init_1): Likewise.
382 (build_new_1): Likewise.
383 (build_vec_init): Likewise.
384 * pt.c (tsubst_expr): Likewise.
385 * typeck2.c (build_functional_cast): Likewise.
386 * cp-tree.h: Adjust.
387 * tree.c (build_target_expr_with_type): Handle error_mark_node.
388
389 * typeck.c (decay_conversion): Any expression with type nullptr_t
390 decays to nullptr.
391
392 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
393
394 PR c++/45112
395 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
396
397 2010-07-27 Jason Merrill <jason@redhat.com>
398
399 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
400 from build_value_init.
401 * init.c (build_value_init_noctor): Give error for unknown array
402 bound.
403
404 2010-07-27 Joseph Myers <joseph@codesourcery.com>
405
406 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
407
408 2010-07-27 Joseph Myers <joseph@codesourcery.com>
409
410 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
411 c_common_initialize_diagnostics.
412 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
413 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
414
415 2010-07-21 Jason Merrill <jason@redhat.com>
416
417 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
418
419 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
420 to cp_finish_decl.
421
422 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
423
424 PR c++/44641
425 * pt.c (instantiate_class_template): Propagate the template's
426 location to its instance.
427
428 2010-07-20 Jason Merrill <jason@redhat.com>
429
430 PR c++/44967
431 * pt.c (tsubst_copy_and_build): Rework last change.
432
433 PR c++/44967
434 * pt.c (tsubst_copy_and_build): Handle partial substitution of
435 CALL_EXPR.
436
437 2010-07-19 Jason Merrill <jason@redhat.com>
438
439 PR c++/44996
440 * semantics.c (finish_decltype_type): Correct decltype
441 of parenthesized rvalue reference variable.
442
443 PR c++/44969
444 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
445 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
446
447 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
448
449 PR c++/44969
450 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
451 parameter.
452 * cp-tree.h: Adjust declaration.
453 * init.c (perform_member_init): Adjust caller.
454 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
455 * typeck2.c (store_init_value): Likewise.
456 (build_functional_cast): Pass complain argument to
457 build_x_compound_expr_from_list.
458
459 2010-07-16 Jason Merrill <jason@redhat.com>
460
461 PR c++/32505
462 * pt.c (process_partial_specialization): Diagnose partial
463 specialization after instantiation.
464 (most_specialized_class): Add complain parm.
465
466 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
467
468 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
469
470 * init.c (build_new_1): Use cp_build_function_call_nary instead of
471 cp_build_function_call.
472
473 2010-07-15 Jason Merrill <jason@redhat.com>
474
475 PR c++/44909
476 * call.c (add_function_candidate): If we're working on an implicit
477 declaration, don't consider candidates that won't match.
478 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
479 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
480
481 Revert:
482 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
483 (TYPE_HAS_USER_OPEQ): New.
484 * decl.c (grok_special_member_properties): Set it.
485 * class.c (add_implicitly_declared_members): Don't lazily declare
486 constructors/operator= if a base or member has a user-declared one.
487 (check_bases_and_members, check_bases): Adjust.
488 (check_field_decls, check_field_decl): Adjust.
489
490 2010-07-15 Anatoly Sokolov <aesok@post.ru>
491
492 * decl.c (integer_three_node): Remove.
493 (cxx_init_decl_processing): Do not initialize the integer_three_node.
494 * cp-tree.h (integer_three_node): Remove.
495
496 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
497
498 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
499 * call.c: Likewise.
500 * class.c: Likewise.
501 * cp-gimplify.c: Likewise.
502 * decl.c: Likewise.
503 * decl2.c: Likewise.
504 * init.c: Likewise.
505 * mangle.c: Likewise.
506 * name-lookup.c: Likewise.
507 * optimize.c: Likewise.
508 * parser.c: Likewise.
509 * pt.c: Likewise.
510 * rtti.c: Likewise.
511 * search.c: Likewise.
512 * semantics.c: Likewise.
513 * typeck.c: Likewise.
514 * typeck2.c: Likewise.
515
516 2010-07-14 Jason Merrill <jason@redhat.com>
517
518 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
519 (build_field_list): Cache field type.
520
521 Implement C++0x unrestricted unions (N2544)
522 * class.c (check_field_decl): Loosen union handling in C++0x.
523 * method.c (walk_field_subobs): Split out from...
524 (synthesized_method_walk): ...here. Set msg before loops.
525 (process_subob_fn): Check for triviality in union members.
526 * init.c (sort_mem_initializers): Splice out uninitialized
527 anonymous unions and union members.
528 (push_base_cleanups): Don't automatically destroy anonymous unions
529 and union members.
530
531 2010-07-13 Jason Merrill <jason@redhat.com>
532
533 PR c++/44909
534 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
535 (TYPE_HAS_USER_OPEQ): New.
536 * decl.c (grok_special_member_properties): Set it.
537 * class.c (add_implicitly_declared_members): Don't lazily declare
538 constructors/operator= if a base or member has a user-declared one.
539 (check_bases_and_members, check_bases): Adjust.
540 (check_field_decls, check_field_decl): Adjust.
541 * method.c (synthesized_method_walk): Initialize check_vdtor.
542
543 PR c++/44540
544 * mangle.c (write_type): Canonicalize.
545 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
546 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
547
548 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
549
550 PR c++/44908
551 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
552 complain argument.
553 * typeck.c (get_delta_difference): Update prototype, add a
554 tsubst_flags_t parameter; update get_delta_difference_1 calls and
555 add checks for error_mark_node.
556 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
557 parameter; update lookup_base call.
558 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
559 parameter; update get_delta_difference call and add check for
560 error_mark_node.
561 (convert_ptrmem): Update prototype, add a tsubst_flags_t
562 parameter; update get_delta_difference call and add check for
563 error_mark_node; update build_ptrmemfunc call.
564 (build_static_cast_1): Adjust convert_ptrmem call.
565 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
566 (cp_build_unary_op): Adjust build_ptrmemfunc call.
567 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
568 and build_ptrmemfunc calls.
569 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
570
571 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
572
573 PR c++/44907
574 * call.c (build_temp): Add tsubst_flags_t complain parameter;
575 adjust build_special_member_call call, pass complain.
576 (convert_like_real): Adjust build_temp call, pass complain.
577
578 2010-07-09 Jason Merrill <jason@redhat.com>
579
580 PR c++/43120
581 * cp-tree.h (BV_LOST_PRIMARY): New macro.
582 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
583 Set BV_LOST_PRIMARY.
584 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
585
586 2010-07-08 Jason Merrill <jason@redhat.com>
587
588 PR c++/43120
589 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
590 virtual bases for covariant thunks.
591
592 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
593
594 * cp-tree.h: Do not include toplev.h.
595
596 2010-07-06 Jason Merrill <jason@redhat.com>
597
598 PR c++/44703
599 * call.c (is_std_init_list): Look through typedefs.
600
601 PR c++/44778
602 * init.c (build_offset_ref): If scope isn't dependent,
603 don't exit early. Look at TYPE_MAIN_VARIANT.
604 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
605
606 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
607
608 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
609
610 * cp-tree.h (impl_conv_void): New type.
611 (convert_to_void): Adjust prototype.
612 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
613 diagnostic for easy translation. Change caller.
614 * typeck.c: Update call to convert_to_void.
615 * semantics.c: Likewise.
616 * init.c: Likewise.
617
618 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
619
620 * decl.c (cp_finish_decl): Call add_local_decl.
621 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
622
623 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
624
625 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
626 throughout.
627
628 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
629
630 PR c++/22138
631 * parser.c (cp_parser_primary_expression): Error if local template is
632 declared.
633
634 2010-07-02 Le-Chun Wu <lcwu@google.com>
635
636 PR/44128
637 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
638 (variable or type) shadows another type.
639
640 2010-07-02 Jakub Jelinek <jakub@redhat.com>
641
642 PR c++/44780
643 * typeck.c (convert_for_assignment): When converting a convertible
644 vector type or objc++ types, call mark_rvalue_use.
645 * typeck2.c (build_m_component_ref): Use return values from
646 mark_rvalue_use or mark_lvalue_use.
647 * class.c (build_base_path): Likewise.
648 * call.c (build_conditional_expr): Likewise.
649
650 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
651
652 PR c++/44039
653 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
654 returns NULL_TREE.
655
656 2010-07-01 Richard Guenther <rguenther@suse.de>
657
658 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
659 predicate we are looking for, allow non-gimplified
660 INDIRECT_REFs.
661
662 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
663
664 PR c++/44628
665 * typeck.c (cp_build_unary_op): Early return error_mark_node when
666 arg is NULL_TREE too.
667 * call.c (convert_class_to_reference): Return error_mark_node when
668 expr is NULL_TREE.
669
670 2010-06-30 Michael Matz <matz@suse.de>
671
672 * repo.c (finish_repo): Fix typo.
673
674 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
675
676 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
677
678 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
679
680 * repo.c (pending_repo): Change type to a VEC.
681 (finish_repo): Adjust for new type of pending_repo.
682 (repo_emit_p): Likewise.
683
684 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
685
686 * tree.c: Include gimple.h. Do not include tree-flow.h
687 * decl.c: Do not include tree-flow.h
688 * Make-lang.in: Adjust dependencies.
689
690 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
691
692 * decl.c (incomplete_var): Declare. Declare VECs containing them.
693 (incomplete_vars): Adjust comment. Change type to a VEC.
694 (maybe_register_incomplete_var): Adjust for new type.
695 (complete_vars): Adjust iteration over incomplete_vars.
696
697 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
698
699 * decl.c (struct named_label_entry): Change type of bad_decls field
700 to a VEC.
701 (poplevel_named_label_1): Adjust for new type of bad_decls.
702 (check_goto): Likewise.
703
704 2010-06-29 Jason Merrill <jason@redhat.com>
705
706 Enable implicitly declared move constructor/operator= (N3053).
707 * class.c (add_implicitly_declared_members): A class with no
708 explicitly declared copy or move constructor gets both declared
709 implicitly, and similarly for operator=.
710 (check_bases): A type with no copy ctor does not inhibit
711 a const copy ctor in a derived class. It does mean the derived
712 one is non-trivial.
713 (check_field_decl): Likewise.
714 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
715 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
716 (trivially_copyable_p): Likewise.
717 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
718 * class.c (finish_struct_bits): Likewise.
719 * tree.c (build_target_expr_with_type): Likewise.
720 * typeck2.c (store_init_value): Likewise.
721
722 Enable implicitly deleted functions (N2346)
723 * class.c (check_bases_and_members): Adjust lambda flags.
724 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
725
726 * decl2.c (mark_used): Adjust error for use of deleted function.
727
728 Machinery to support implicit delete/move.
729 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
730 has_complex_move_ctor, has_complex_move_assign bitfields.
731 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
732 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
733 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
734 (enum special_function_kind): Add sfk_move_assignment.
735 (LOOKUP_SPECULATIVE): New.
736 * call.c (build_over_call): Return early if it's set.
737 (build_over_call): Use trivial_fn_p.
738 * class.c (check_bases): If the base has no default constructor,
739 the derived one is non-trivial. Handle move ctor/op=.
740 (check_field_decl): Likewise.
741 (check_bases_and_members): Handle move ctor/op=.
742 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
743 (type_has_move_constructor, type_has_move_assign): New.
744 * decl.c (grok_special_member_properties): Handle move ctor/op=.
745 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
746 (trivial_fn_p): New.
747 (do_build_copy_constructor): Use it.
748 (do_build_assign_ref): Likewise. Handle move assignment.
749 (build_stub_type, build_stub_object, locate_fn_flags): New.
750 (locate_ctor): Use locate_fn_flags.
751 (locate_copy, locate_dtor): Remove.
752 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
753 (process_subob_fn, synthesized_method_walk): New.
754 (maybe_explain_implicit_delete): New.
755 (implicitly_declare_fn): Use synthesized_method_walk,
756 type_has_trivial_fn, and type_set_nontrivial_flag.
757 (defaulted_late_check): Set DECL_DELETED_FN.
758 (defaultable_fn_check): Handle sfk_move_assignment.
759 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
760 implicitly deleted move ctor/op=.
761 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
762 (lookup_fnfields_slot): New.
763 * semantics.c (omp_clause_info_fndecl): Remove.
764 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
765 get_copy_assign, trivial_fn_p.
766 (trait_expr_value): Adjust call to locate_ctor.
767 * tree.c (special_function_p): Handle sfk_move_assignment.
768
769 * class.c (type_has_virtual_destructor): New.
770 * cp-tree.h: Declare it.
771 * semantics.c (trait_expr_value): Use it.
772
773 * call.c (build_over_call): Only give warnings with tf_warning.
774
775 * name-lookup.c (pop_scope): Handle NULL_TREE.
776
777 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
778 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
779 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
780 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
781 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
782 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
783 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
784 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
785 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
786 (sfk_assignment_operator): Rename to sfk_copy_assignment.
787 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
788 * search.c, semantics.c, tree.c: Adjust.
789
790 * pt.c (dependent_scope_ref_p): Remove.
791 (value_dependent_expression_p): Don't call it.
792 (type_dependent_expression_p): Here either.
793 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
794 if the scope isn't dependent.
795
796 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
797 a reference.
798
799 PR c++/44587
800 * pt.c (has_value_dependent_address): New.
801 (value_dependent_expression_p): Check it.
802 (convert_nontype_argument): Likewise. Call decay_conversion before
803 folding if we want a pointer.
804 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
805 scope is the current instantiation.
806
807 2010-06-28 Jakub Jelinek <jakub@redhat.com>
808
809 PR c++/44682
810 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
811 on expr.
812
813 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
814
815 * init.c: Do not include except.h.
816 * decl.c: Likewise.
817 * expr.c: Likewise.
818 * cp-lang.c: Likewise.
819 * pt.c: Likewise.
820 * semantics.c: Likewise.
821 * decl2.c: Likewise.
822 * except.c: Likewise.
823 (init_exception_processing): Do not set the removed
824 lang_protect_cleanup_actions here.
825 (cp_protect_cleanup_actions): Make non-static and remove prototype.
826 (doing_eh): New, moved from except.c but removed the do_warning flag.
827 (expand_start_catch_block): Update doing_eh call.
828 (expand_end_catch_block): Likewise.
829 (build_throw): Likewise.
830 * cp-tree.h: Prototype cp_protect_cleanup_actions.
831 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
832 cp_protect_cleanup_actions.
833 * Make-lang.in: Update dependencies.
834
835 2010-06-26 Jason Merrill <jason@redhat.com>
836
837 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
838 constructor called with a single argument that takes a reference
839 to the constructor's class.
840 (BAD_CONVERSION_RANK): New.
841 (compare_ics): Use it to compare bad ICSes.
842
843 2010-06-25 Joseph Myers <joseph@codesourcery.com>
844
845 * lang-specs.h: Remove +e handling.
846
847 2010-06-24 Andi Kleen <ak@linux.intel.com>
848
849 * parser.c: (cp_parser_question_colon_clause):
850 Switch to use cp_lexer_peek_token.
851 Call warn_for_omitted_condop. Call pedwarn for omitted
852 middle operand.
853
854 2010-06-22 Jakub Jelinek <jakub@redhat.com>
855
856 PR c++/44619
857 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
858 datum and mark_rvalue_use on component.
859
860 PR c++/44627
861 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
862 the CALL_EXPR has no arguments.
863
864 2010-06-21 Jason Merrill <jason@redhat.com>
865
866 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
867
868 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
869 element type.
870
871 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
872
873 * name-lookup.c (struct arg_lookup): Convert namespaces and
874 classes fields to VEC.
875 (arg_assoc_namespace): Adjust for new type of namespaces.
876 (arg_assoc_class): Adjust for new type of classes.
877 (lookup_arg_dependent): Use make_tree_vector and
878 release_tree_vector.
879 * typeck2.c (build_x_arrow): Use vec_member.
880
881 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
882
883 PR c++/44486
884 * error.c (dump_decl): Better wording for anonymous namespace.
885
886 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
887
888 * class.c (build_vtbl_initializer): Adjust computation of new_position
889 and which entry to add padding for.
890
891 2010-06-16 Jason Merrill <jason@redhat.com>
892
893 * except.c (check_noexcept_r): Return the problematic function.
894 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
895 * pt.c (tsubst_copy_and_build): Pass it.
896 * parser.c (cp_parser_unary_expression): Likewise.
897 * cp-tree.h: Adjust prototype.
898
899 * method.c (defaulted_late_check): Give the defaulted method
900 the same exception specification as the implicit declaration.
901
902 2010-06-15 Jason Merrill <jason@redhat.com>
903
904 * class.c (add_implicitly_declared_members): Implicit assignment
905 operators can also be virtual overriders.
906 * method.c (lazily_declare_fn): Likewise.
907
908 * call.c (convert_like_real): Give "initializing argument of"
909 information for ambiguous conversion. Give source position
910 of function.
911
912 * call.c (print_z_candidates): Do print viable deleted candidates.
913 (joust): Don't choose a deleted function just because its worst
914 conversion is better than another candidate's worst.
915
916 * call.c (convert_like_real): Don't complain about
917 list-value-initialization from an explicit constructor.
918
919 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
920 DECL_SOURCE_LOCATION directly.
921
922 * class.c (type_has_user_provided_default_constructor): Use
923 sufficient_parms_p.
924
925 * call.c (is_subseq): Handle ck_aggr, ck_list.
926 (compare_ics): Treat an aggregate or ambiguous conversion to the
927 same type as involving the same function.
928
929 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
930
931 * typeck.c (convert_for_assignment): Fix comment. Change message
932 format from %d to %qP.
933 (convert_for_initialization): Fix comment.
934
935 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
936
937 * cp-tree.h (expr_list_kind): New type.
938 (impl_conv_rhs): New type.
939 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
940 prototype.
941 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
942 diagnostics for easy translation. Change caller.
943 (convert_for_initialization): Use impl_conv_rhs and change caller.
944 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
945 diagnostics for easy translation. Change caller.
946 * decl.c (bad_spec_place): New enum.
947 (bad_specifiers): Use it and emit the diagnostics for easy
948 translation. Change caller.
949 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
950
951 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
952
953 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
954 to a VEC.
955 * decl2.c (cp_write_global_declarations): Adjust for new type of
956 decl_namespace_list.
957 * name-lookup.c (current_decl_namespace): Likewise.
958 (push_decl_namespace): Likewise.
959 (pop_decl_namespace): Likewise.
960
961 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
962
963 * call.c (build_java_interface_fn_ref): Call build_function_type_list
964 instead of build_function_type.
965 * decl.c (cxx_init_decl_processing): Likewise.
966 (declare_global_var): Likewise.
967 (get_atexit_node): Likewise.
968 (expand_static_init): Likewise.
969 * decl2.c (start_objects): Likewise.
970 (start_static_storage_duration_function): Likewise.
971 * except.c (init_exception_processing): Likewise.
972 (build_exc_ptr): Likewise.
973 (build_throw): Likewise.
974 * rtti.c (throw_bad_cast): Likewise.
975 (throw_bad_typeid): Likewise.
976 (build_dynamic_cast_1): Likewise.
977
978 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
979
980 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
981 (build_op_delete_call): Likewise.
982 (build_over_call): Likewise.
983 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
984 * pt.c (process_partial_specialization): Likewise.
985 (tsubst_template_args): Likewise.
986 * semantics.c (finish_asm_stmt): Likewise.
987
988 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
989
990 * decl.c (record_key_method_defined): New, broken out of ...
991 (finish_function): ... here. Call it.
992 (start_decl): Treat aliases as definitions.
993
994 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
995
996 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
997
998 * pt.c (maybe_process_partial_specialization): Likewise.
999 (register_specialization): Likewise.
1000 (add_pending_template): Likewise.
1001 (lookup_template_class): Likewise.
1002 (push_tinst_level): Likewise.
1003
1004 * parser.c (cp_lexer_new_main): Likewise.
1005 (cp_lexer_new_from_tokens): Likewise.
1006 (cp_token_cache_new): Likewise.
1007 (cp_parser_context_new): Likewise.
1008 (cp_parser_new): Likewise.
1009 (cp_parser_nested_name_specifier_opt): Likewise.
1010 (cp_parser_template_id): Likewise.
1011
1012 * name-lookup.c (binding_entry_make): Likewise.
1013 (binding_table_construct): Likewise.
1014 (binding_table_new): Likewise.
1015 (cxx_binding_make): Likewise.
1016 (pushdecl_maybe_friend): Likewise.
1017 (begin_scope): Likewise.
1018 (push_to_top_level): Likewise.
1019
1020 * lex.c (init_reswords): Likewise.
1021 (retrofit_lang_decl): Likewise.
1022 (cxx_dup_lang_specific_decl): Likewise.
1023 (copy_lang_type): Likewise.
1024 (cxx_make_type): Likewise.
1025
1026 * decl.c (make_label_decl): Likewise.
1027 (check_goto): Likewise.
1028 (start_preparsed_function): Likewise.
1029 (save_function_data): Likewise.
1030
1031 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
1032
1033 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1034
1035 * class.c (finish_struct_1): Likewise.
1036
1037 * cp-tree.h (struct lang_type): Add variable_size GTY option.
1038 (struct lang_decl): Likewise.
1039
1040 * parser.c (cp_parser_new): Update comment to not reference
1041 ggc_alloc.
1042
1043 2010-06-07 Jason Merrill <jason@redhat.com>
1044
1045 PR c++/44366
1046 * error.c (dump_parameters): Mask out TFF_SCOPE.
1047 (dump_simple_decl): Don't print the scope of a PARM_DECL.
1048 (dump_scope): Remove no-op mask.
1049
1050 PR c++/44401
1051 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
1052
1053 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
1054 * init.c (build_offset_ref): Use it.
1055 * pt.c (maybe_process_partial_specialization): Use it.
1056 (instantiate_class_template): Use it.
1057 * search.c (lookup_base): Use it.
1058
1059 2010-06-07 Jakub Jelinek <jakub@redhat.com>
1060
1061 PR c++/44444
1062 * expr.c (mark_exp_read): Handle INDIRECT_REF.
1063 * cvt.c (convert_to_void): Handle INDIRECT_REF like
1064 handled_component_p.
1065
1066 PR c++/44443
1067 * decl.c (initialize_local_var): If TREE_USED is set on the type,
1068 set also DECL_READ_P on the decl.
1069
1070 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1071
1072 PR c++/44188
1073 * cp-tree.h (typedef_variant_p): Move this declaration to
1074 gcc/tree.h.
1075 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1076 * decl.c (grokdeclarator): Do not rename debug info of an
1077 anonymous tagged type named by a typedef.
1078
1079 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
1080
1081 PR c++/44086
1082 * class.c (check_field_decls): Move the call to
1083 check_bitfield_decl before trying to set the
1084 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
1085
1086 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
1087
1088 * typeck.c: Update include path for moved files.
1089 * decl.c: Likewise.
1090 * rtti.c: Likewise.
1091 * cp-gimplify.c: Likewise.
1092 * cp-lang.c: Likewise.
1093 * pt.c: Likewise.
1094 * semantics.c: Likewise.
1095 * cxx-pretty-print.h: Likewise.
1096 * decl2.c: Likewise.
1097 * parser.c: Likewise.
1098 * cp-objcp-common.c: Likewise.
1099 * cp-tree.h: Likewise.
1100 * name-lookup.c: Likewise.
1101 * lex.c: Likewise.
1102 * name-lookup.h: Likewise.
1103 * config-lang.in: Update paths in gtfiles for files in c-family/.
1104 * Make-lang.in: Likewise.
1105
1106 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
1107
1108 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
1109 * typeck.c (build_ptrmemfunc): Likewise.
1110
1111 2010-06-04 Jason Merrill <jason@redhat.com>
1112
1113 * typeck2.c (merge_exception_specifiers): Adjust merging of
1114 throw() and noexcept(true).
1115
1116 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
1117 using an uninitialized variable.
1118
1119 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
1120 (pp_cxx_expression): Likewise.
1121
1122 Implement noexcept-specification (15.4)
1123 * parser.c (cp_parser_exception_specification_opt): Parse it.
1124 Give -Wdeprecated warning about throw() specs.
1125 * pt.c (tsubst_exception_specification): Handle it.
1126 * error.c (dump_exception_spec): Handle it.
1127 (dump_expr): Handle NOEXCEPT_EXPR.
1128 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
1129 * typeck.c (comp_except_specs): Handle compatibility rules.
1130 Change exact parm to take an enum.
1131 * typeck2.c (merge_exception_specifiers): Handle noexcept.
1132 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
1133 (type_throw_all_p, build_noexcept_spec): New fns.
1134 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
1135 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
1136 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
1137 (noexcept_true_spec, noexcept_false_spec): New macros.
1138 * name-lookup.c (pushdecl_maybe_friend): Adjust.
1139 * search.c (check_final_overrider): Adjust.
1140 * decl.c (check_redeclaration_exception_specification): Adjust.
1141 (use_eh_spec_block): Use type_throw_all_p.
1142 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
1143 Give operator new a noexcept-specification in C++0x mode.
1144 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
1145 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
1146
1147 Implement noexcept operator (5.3.7)
1148 * cp-tree.def (NOEXCEPT_EXPR): New.
1149 * except.c (check_noexcept_r, finish_noexcept_expr): New.
1150 * cp-tree.h: Declare finish_noexcept_expr.
1151 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
1152 * pt.c (tsubst_copy_and_build): And tsubst it.
1153 (type_dependent_expression_p): Handle it.
1154 (value_dependent_expression_p): Handle it.
1155
1156 * call.c (build_conditional_expr): Never fold in unevaluated context.
1157 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
1158 * semantics.c (simplify_aggr_init_expr): Likewise.
1159 * typeck.c (merge_types): Call merge_exception_specifiers.
1160 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
1161 DECL_ANTICIPATED for preferring new type.
1162
1163 2010-06-04 Joseph Myers <joseph@codesourcery.com>
1164
1165 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
1166 diagnostics.
1167
1168 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1169
1170 PR c++/44412
1171 * typeck.c (build_class_member_access_expr): Call mark_exp_read
1172 on object for static data members.
1173
1174 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1175 Jason Merrill <jason@redhat.com>
1176
1177 PR c++/44362
1178 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
1179 with the same type, call mark_lvalue_use on both.
1180
1181 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
1182
1183 * class.c (struct vtbl_init_data_s): Remove last_init field.
1184 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
1185 to a VEC.
1186 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
1187 initializers.
1188 (build_vtt): Likewise.
1189 (initialize_vtable): Take a VEC instead of a tree.
1190 (build_vtt_inits): Change return type to void. Take a VEC **
1191 instead of a tree *; accumulate results into said VEC.
1192 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
1193 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
1194 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
1195 instead of a tree.
1196 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
1197 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
1198 into it.
1199 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
1200 rather than tree_cons.
1201 (build_vbase_offset_vtbl_entries): Likewise.
1202 (add_vcall_offset): Likewise.
1203 (build_rtti_vtbl_entries): Likewise.
1204 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
1205 * decl.c (initialize_artificial_var): Use build_constructor instead
1206 of build_constructor_from_list.
1207
1208 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
1209
1210 PR c++/44294
1211 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
1212 bit-field.
1213
1214 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
1215
1216 * parser.c (cp_parser_mem_initializer_list): Change error text.
1217
1218 2010-06-02 Jakub Jelinek <jakub@redhat.com>
1219
1220 * cp-objcp-common.c (shadowed_var_for_decl): Change into
1221 tree_decl_map hashtab from tree_map.
1222 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
1223 (init_shadowed_var_for_decl): Adjust initialization.
1224
1225 PR c++/44361
1226 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
1227 instead of calling mark_exp_read only when not an assignment.
1228
1229 PR debug/44367
1230 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
1231 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
1232 Set DECL_VALUE_EXPR on var.
1233
1234 2010-06-02 Jason Merrill <jason@redhat.com>
1235
1236 * error.c (dump_type): Improve typedef handling.
1237
1238 PR c++/9726
1239 PR c++/23594
1240 PR c++/44333
1241 * name-lookup.c (same_entity_p): New.
1242 (ambiguous_decl): Multiple declarations of the same entity
1243 are not ambiguous.
1244
1245 2010-06-01 Jason Merrill <jason@redhat.com>
1246
1247 DR 990
1248 * call.c (add_list_candidates): Prefer the default constructor.
1249 (build_aggr_conv): Treat missing initializers like { }.
1250 * typeck2.c (process_init_constructor_record): Likewise.
1251 * init.c (expand_default_init): Use digest_init for
1252 direct aggregate initialization, too.
1253
1254 * call.c (add_list_candidates): Split out...
1255 (build_user_type_conversion_1): ...from here.
1256 (build_new_method_call): And here.
1257 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
1258
1259 PR c++/44358
1260 * call.c (build_list_conv): Set list-initialization flags properly.
1261
1262 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
1263
1264 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
1265
1266 2010-06-01 Arnaud Charlet <charlet@adacore.com>
1267 Matthew Gingell <gingell@adacore.com>
1268
1269 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
1270 * decl2.c: Include langhooks.h and c-ada-spec.h.
1271 (cpp_check, collect_source_refs, collect_ada_namespace,
1272 collect_all_refs): New functions.
1273 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
1274 * lang-specs.h: Ditto.
1275
1276 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
1277
1278 * cp-tree.h (cp_build_function_call_nary): Declare.
1279 * typeck.c (cp_build_function_call_nary): Define.
1280 * decl.c (register_dtor_fn): Use it instead of
1281 cp_build_function_call.
1282 (cxx_maybe_build_cleanup): Likewise.
1283 * decl2.c (generate_ctor_or_dtor_function): Likewise.
1284 * except.c (do_get_exception_ptr): Likewise.
1285 (do_begin_catch): Likewise.
1286 (do_allocate_exception): Likewise.
1287 (do_free_exception): Likewise.
1288 (build_throw): Likewise. Use cp_build_function_call_vec instead
1289 of cp_build_function_call.
1290 (do_end_catch): Likewise.
1291
1292 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
1293
1294 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
1295 (struct cp_declarator): Move id_loc field up.
1296
1297 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
1298
1299 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
1300 this file is included before c-common.h. Define GCC_DIAG_STYLE
1301 before including diagnostic-core.h and toplev.h.
1302 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
1303 * pt.c: Include cp-tree.h before c-common.h.
1304
1305 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
1306
1307 * tree.c (c_register_addr_space): Add stub.
1308
1309 2010-05-28 Joseph Myers <joseph@codesourcery.com>
1310
1311 * g++spec.c (lang_specific_driver): Use fatal_error instead of
1312 fatal.
1313
1314 2010-05-28 Dodji Seketeli <dodji@redhat.com>
1315
1316 Revert fix of PR c++/44188
1317 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
1318 gcc/tree.h.
1319 * tree.c (typedef_variant_p): Revert moving this definition to
1320 gcc/tree.c.
1321 * decl.c (grokdeclarator): Revert naming typedef handling.
1322
1323 2010-05-27 Joseph Myers <joseph@codesourcery.com>
1324
1325 * call.c: Include diagnostic-core.h instead of diagnostic.h.
1326 * cp-lang.c: Don't include diagnostic.h
1327 * name-lookup.c: Include diagnostic-core.h instead of
1328 diagnostic.h.
1329 (cp_emit_debug_info_for_using): Use seen_error.
1330 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
1331 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
1332 * pt.c (iterative_hash_template_arg): Use seen_error.
1333 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
1334 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
1335 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
1336 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
1337 dependencies.
1338
1339 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1340
1341 PR c++/44188
1342 * cp-tree.h (typedef_variant_p): Move this declaration to
1343 gcc/tree.h.
1344 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1345 * decl.c (grokdeclarator): Do not rename debug info of an
1346 anonymous tagged type named by a typedef.
1347
1348 2010-05-27 Jason Merrill <jason@redhat.com>
1349
1350 PR c++/43555
1351 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
1352 anonymous VLA size.
1353
1354 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
1355
1356 PR bootstrap/44287
1357 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
1358 * class.c (layout_class_type): Likewise.
1359 * decl.c (finish_enum): Likewise.
1360 * mangle.c (write_builitin_type): Likewise.
1361
1362 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
1363
1364 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
1365 explicit_int128_p.
1366 * decl.c (grokdeclarator): Handle __int128.
1367 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
1368 (cp_parser_simple_type_specifier): Likewise.
1369 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
1370 * typeck.c (cp_common_type): Handle __int128.
1371 * mangle.c (integer_type_codes): Add itk_int128 and
1372 itk_unsigned_int128.
1373
1374 2010-05-26 Jason Merrill <jason@redhat.com>
1375
1376 PR c++/43382
1377 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
1378 unification.
1379
1380 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
1381
1382 * cp-lang.c: Do not include expr.h.
1383
1384 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
1385
1386 * decl.c: Do not include rtl.h
1387 * semantics.c: Likewise.
1388
1389 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
1390
1391 * cp-tree.h: Do not include splay-tree.h.
1392 (struct prtmem_cst): Remove unused field and false comment.
1393 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
1394 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
1395 * init.c: Do not include rtl.h and expr.h.
1396 * class.c: Do not include rtl.h. Include splay-tree.h.
1397 (build_clone): Use plain NULL instead of NULL_RTX.
1398 * decl.c: Do not include expr.h. Explain why rtl.h has to be
1399 included. Include splay-tree.h.
1400 * method.c: Do not include rtl.h and expr.h.
1401 (use_thunk): Use plain NULL instead of NULL_RTX.
1402 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
1403 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
1404 and target.h. Include splay-tree.h.
1405 * expr.c: Do not include rtl.h and expr.h.
1406 * pt.c: Do not include obstack.h and rtl.h.
1407 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
1408 (tsubst_decl): Likewise.
1409 (instantiate_decl): Likewise.
1410 * semantics.c: Do not include exprt.h and debug.h. Explain why
1411 rtl.h has to be included.
1412 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
1413 * call.c: Do not include rtl.h and expr.h.
1414 * search.c: Do not include obstack.h and rtl.h.
1415 * friend.c: Do not include rtl.h and expr.h.
1416 * Make-lang.in: Update dependencies.
1417
1418 2010-05-25 Jakub Jelinek <jakub@redhat.com>
1419
1420 PR c++/18249
1421 * parser.c (non_integral_constant): Add NIC_NONE.
1422 (required_token): Add RT_NONE.
1423 (cp_parser_unary_expression): Initialize non_constant_p
1424 to NIC_NONE.
1425 (cp_parser_asm_definition): Initialize missing to RT_NONE.
1426 (cp_parser_primary_expression, cp_parser_postfix_expression,
1427 cp_parser_cast_expression, cp_parser_binary_expression,
1428 cp_parser_functional_cast): Fix formatting.
1429
1430 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
1431
1432 PR c++/18249
1433 * parser.c: Remove inclusion of dyn-string.h.
1434 (non_integral_constant): New enum.
1435 (name_lookup_error): New enum.
1436 (required_token): New enum.
1437 (cp_parser_required_error): New function.
1438 (cp_parser_require): Change the type of variable token_desc to
1439 required_token and use cp_parser_required_error.
1440 (cp_parser_require_keyword): Likewise.
1441 (cp_parser_error): Use gmsgid as parameter.
1442 (cp_parser_name_lookup_error): Change the type of variable desired to
1443 name_lookup_error and put the diagnostic in the full sentences. Change
1444 caller.
1445 (cp_parser_non_integral_constant_expression): Change the type of the
1446 variable thing to non_integral_constant and put the diagnostics in
1447 full sentences. Change caller.
1448
1449 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
1450
1451 PR middle-end/44100
1452 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
1453
1454 2010-05-24 Joseph Myers <joseph@codesourcery.com>
1455
1456 * error.c (cp_diagnostic_starter): Update call to
1457 diagnostic_build_prefix.
1458 (cp_print_error_function,
1459 print_instantiation_partial_context_line): Check show_column flag
1460 in context.
1461
1462 2010-05-24 Jason Merrill <jason@redhat.com>
1463
1464 PR c++/41510
1465 * decl.c (check_initializer): Don't wrap an init-list in a
1466 TREE_LIST.
1467 * init.c (build_aggr_init): Don't assume copy-initialization if
1468 init has CONSTRUCTOR_IS_DIRECT_INIT.
1469 * call.c (build_new_method_call): Sanity check.
1470
1471 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
1472
1473 * rtti.c (tinfo_base_init): Use build_constructor instead of
1474 build_constructor_from_list. Don't cons a tree node for
1475 returning.
1476 (generic_initializer): Use build_constructor_single instead of
1477 build_constructor_from_list.
1478 (ptr_initializer): Use build_constructor instead of
1479 build_constructor_from_list
1480 (ptm_initializer): Likewise.
1481 (class_initializer): Likewise. Take varargs instead of TRAIL.
1482 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
1483 build_constructor instead of build_constructor_from_list.
1484
1485 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
1486
1487 * semantics.c: Include bitmap.h.
1488 * Make-lang.in: Update dependencies.
1489
1490 2010-05-22 Jan Hubicka <jh@suse.cz>
1491
1492 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
1493 comdat vtables.
1494 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
1495
1496 2010-05-21 Joseph Myers <joseph@codesourcery.com>
1497
1498 * cxx-pretty-print.c: Correct merge error.
1499
1500 2010-05-21 Joseph Myers <joseph@codesourcery.com>
1501
1502 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
1503 (cp_print_error_function): Use diagnostic_abstract_origin macro.
1504 (cp_printer): Handle %K here using percent_K_format.
1505 * cxx-pretty-print.c: Include tree-pretty-print.h.
1506 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
1507 dependencies.
1508
1509 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
1510
1511 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
1512 Clean up redundant includes.
1513
1514 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1515
1516 PR c++/30298
1517 * decl.c (xref_basetypes): Return false in case of ill-formed
1518 redefinition.
1519
1520 2010-05-19 Jason Merrill <jason@redhat.com>
1521
1522 * call.c (reference_binding): Use cp_build_qualified_type_real
1523 and cp_type_quals consistently.
1524 (add_function_candidate): Likewise.
1525 (build_conditional_expr): Likewise.
1526 (convert_like_real): Likewise.
1527 (type_passed_as): Likewise.
1528 * class.c (add_method): Likewise.
1529 (same_signature_p): Likewise.
1530 (layout_class_type): Likewise.
1531 * decl.c (cxx_init_decl_processing): Likewise.
1532 (cp_fname_init): Likewise.
1533 (grokdeclarator): Likewise.
1534 * decl2.c (cp_reconstruct_complex_type): Likewise.
1535 * init.c (build_new_1): Likewise.
1536 * method.c (do_build_copy_constructor): Likewise.
1537 (implicitly_declare_fn): Likewise.
1538 * pt.c (tsubst_aggr_type): Likewise.
1539 (tsubst): Likewise.
1540 * rtti.c (init_rtti_processing): Likewise.
1541 (build_headof): Likewise.
1542 (build_dynamic_cast_1): Likewise.
1543 (tinfo_base_init): Likewise.
1544 (emit_support_tinfos): Likewise.
1545 * semantics.c (capture_decltype): Likewise.
1546 * tree.c (cv_unqualified): Likewise.
1547 * typeck.c (composite_pointer_type): Likewise.
1548 (string_conv_p): Likewise.
1549
1550 * mangle.c (write_CV_qualifiers_for_type): Tweak.
1551
1552 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
1553 * decl.c (start_decl): Likewise.
1554 * semantics.c (finish_compound_literal): Likewise.
1555 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
1556 (cp_type_readonly): Remove.
1557 * cp-tree.h: Remove declaration.
1558
1559 * typeck.c (merge_types): Preserve memfn quals.
1560
1561 * decl.c (grokdeclarator): Don't check quals on fn type.
1562 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
1563 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
1564
1565 PR c++/44193
1566 * typeck.c (type_memfn_quals): New fn.
1567 (apply_memfn_quals): New fn.
1568 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
1569 (cp_type_readonly): Use cp_type_quals.
1570 * cp-tree.h: Add declarations.
1571 * tree.c (cp_build_qualified_type_real): Don't set, but do
1572 preserve, quals on FUNCTION_TYPE.
1573 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
1574 * decl.c (build_ptrmem_type): Likewise.
1575 (grokdeclarator): Likewise.
1576 (static_fn_type): Likewise.
1577 * decl2.c (change_return_type): Likewise.
1578 (cp_reconstruct_complex_type): Likewise.
1579 * pt.c (tsubst_function_type): Likewise.
1580 (unify): Likewise.
1581 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
1582
1583 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
1584
1585 * tree.c (build_min_non_dep_call_vec): Update comment.
1586
1587 2010-05-17 Jason Merrill <jason@redhat.com>
1588
1589 * call.c (struct z_candidate): Add explicit_targs field.
1590 (add_template_candidate_real): Set it.
1591 (build_over_call): Use it to control init-list warning.
1592
1593 PR c++/44157
1594 * call.c (build_over_call): Limit init-list deduction warning to
1595 cases where the argument is actually an init-list.
1596
1597 PR c++/44158
1598 * call.c (build_over_call): Don't do bitwise copy for move ctor.
1599
1600 2010-05-17 Dodji Seketeli <dodji@redhat.com>
1601 Jason Merrill <jason@redhat.com>
1602
1603 PR c++/44108
1604 * decl.c (compute_array_index_type): Call mark_rvalue_use.
1605
1606 2010-05-15 Jason Merrill <jason@redhat.com>
1607
1608 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
1609 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
1610 TYPE_NOEXCEPT_P.
1611 (finish_eh_spec_block): Adjust.
1612
1613 2010-05-15 Jakub Jelinek <jakub@redhat.com>
1614
1615 PR c++/44148
1616 * pt.c (tsubst): Unshare template argument.
1617
1618 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
1619
1620 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
1621 * Make-lang.in: Fix dependencies accordingly.
1622
1623 2010-05-14 Jason Merrill <jason@redhat.com>
1624
1625 C++ DR 475
1626 * except.c (build_throw): Simplify, adjust for DR 475.
1627
1628 PR c++/44127
1629 * except.c (dtor_nothrow): Return nonzero for type with
1630 trivial destructor.
1631
1632 PR c++/44127
1633 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
1634 gimple_build_eh_must_not_throw.
1635
1636 2010-05-14 Martin Jambor <mjambor@suse.cz>
1637
1638 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
1639 and define.
1640
1641 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
1642
1643 * call.c (build_new_method_call): Change warning text.
1644 * typeck2.c (build_functional_cast): Change error text.
1645
1646 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
1647
1648 PR c++/30566
1649 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
1650 shadowing the outer parameter or variables by the declaration of
1651 nested function in nested structure or class. Warn the shadowing by
1652 the declaration of nested lambda expression.
1653
1654 2010-05-13 Jason Merrill <jason@redhat.com>
1655
1656 * typeck.c (cp_build_array_ref): Factor out from...
1657 (build_array_ref): ...here. Drop complain parm.
1658 (build_new_op): Adjust.
1659 * class.c (build_vtbl_ref_1): Adjust.
1660 * decl2.c (grok_array_decl): Adjust.
1661 * cp-tree.h: Adjust prototypes.
1662
1663 2010-05-13 Jan Hubicka <jh@suse.cz>
1664
1665 * decl.c (cp_finish_decl): Do not worry about used attribute.
1666
1667 2010-05-12 Jason Merrill <jason@redhat.com>
1668
1669 * typeck.c (build_array_ref): Take complain parm.
1670 * cp-tree.h: Add it to prototype.
1671 * call.c (build_new_op): Pass it.
1672 * class.c (build_vtbl_ref): Pass it.
1673 * decl2.c (grok_array_decl): Pass it.
1674
1675 PR bootstrap/44048
1676 PR target/44099
1677 * cp-tree.def (NULLPTR_TYPE): Remove.
1678 * cp-tree.h (NULLPTR_TYPE_P): New.
1679 (SCALAR_TYPE_P): Use it.
1680 (nullptr_type_node): New.
1681 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
1682 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
1683 nullptr_type_node.
1684 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
1685 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
1686 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
1687 * mangle.c (write_type): Likewise.
1688 * name-lookup.c (arg_assoc_type): Likewise.
1689 * typeck.c (build_reinterpret_cast_1): Likewise.
1690 * rtti.c (typeinfo_in_lib_p): Likewise.
1691 (emit_support_tinfos): Remove local nullptr_type_node.
1692
1693 * cp-tree.h (UNKNOWN_TYPE): Remove.
1694 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
1695 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
1696 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
1697 * class.c (instantiate_type): Check unknown_type_node rather than
1698 UNKNOWN_TYPE.
1699 * name-lookup.c (maybe_push_decl): Likewise.
1700 * rtti.c (get_tinfo_decl_dynamic): Likewise.
1701 (get_typeid): Likewise.
1702 * semantics.c (finish_offsetof): Likewise.
1703
1704 PR c++/20669
1705 * call.c (add_template_candidate_real): If deduction fails, still
1706 add the template as a non-viable candidate.
1707 (equal_functions): Handle template candidates.
1708 (print_z_candidate): Likewise.
1709 (print_z_candidates): Likewise.
1710 (build_new_function_call): Likewise.
1711
1712 * cp-tree.h (LOOKUP_LIST_ONLY): New.
1713 * call.c (add_candidates): Enforce it.
1714 (build_new_method_call): Try non-list ctor if no viable list ctor.
1715 (build_user_type_conversion_1): Likewise.
1716
1717 * call.c (add_candidates): Distinguish between type(x) and
1718 x.operator type().
1719 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
1720 (build_new_method_call): Give better error for conversion op.
1721
1722 * call.c (add_candidates): Add first_arg and return_type parms.
1723 Add special constructor/conversion op handling.
1724 (convert_class_to_reference): Use it.
1725 (build_user_type_conversion_1): Likewise.
1726 (build_op_call): Likewise.
1727 (build_new_method_call): Likewise.
1728 (build_new_op): Adjust.
1729 (perform_overload_resolution): Adjust.
1730
1731 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
1732
1733 PR c++/34272
1734 PR c++/43630
1735 PR c++/34491
1736 * pt.c (process_partial_specialization): Return error_mark_node
1737 in case of unused template parameters in partial specialization.
1738
1739 2010-05-11 Jakub Jelinek <jakub@redhat.com>
1740
1741 PR c++/44062
1742 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
1743 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
1744 look at its second operand.
1745
1746 2010-05-10 Jason Merrill <jason@redhat.com>
1747
1748 PR c++/44017
1749 * semantics.c (baselink_for_fns): Revert earlier change.
1750
1751 PR c++/44045
1752 * typeck.c (cp_build_modify_expr): Complain about assignment to
1753 array from init list.
1754
1755 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
1756
1757 PR c++/43719
1758 * decl.c (check_initializer): strip array type before checking for
1759 uninitialized const or ref members.
1760
1761 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
1762
1763 PR c++/43951
1764 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
1765 error count. Emit errors only if compain is true.
1766 (build_new_1): Do not return error_mark_node if
1767 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
1768 errors. Delay the check for user-provided constructor.
1769 (perform_member_init): Adjust.
1770 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
1771 prototype.
1772
1773 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
1774 Jason Merrill <jason@redhat.com>
1775
1776 Add support for C++0x nullptr.
1777 * cp-tree.def: Add NULLPTR_TYPE.
1778 * cp-tree.h: Add nullptr_node.
1779 (cp_tree_index): Add CPTI_NULLPTR.
1780 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
1781 * call.c (null_ptr_cst_p): Handle nullptr.
1782 (standard_conversion): Likewise.
1783 (convert_arg_to_ellipsis): Likewise.
1784 * mangle.c (write_type): Likewise.
1785 * name-lookup.c (arg_assoc_type): Likewise.
1786 * parser.c (cp_parser_primary_expression): Likewise.
1787 * typeck.c (cp_build_binary_op): Likewise.
1788 (build_reinterpret_cast_1): Likewise.
1789 * error.c (dump_type): Likewise.
1790 (dump_type_prefix, dump_type_suffix): Likewise.
1791 * decl.c (cxx_init_decl_processing): Likewise.
1792 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
1793 * cvt.c (ocp_convert): Likewise.
1794 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
1795 nullptr_t tinfo in libsupc++.
1796
1797 2010-05-06 Jason Merrill <jason@redhat.com>
1798
1799 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
1800
1801 2010-04-22 Jakub Jelinek <jakub@redhat.com>
1802 Dodji Seketeli <dodji@redhat.com>
1803
1804 PR c/18624
1805 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
1806 Declare ...
1807 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
1808 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
1809 (decay_conversion, perform_integral_promotions): Call rvalue_use.
1810 (cp_build_unary_op): Call lvalue_use.
1811 * decl.c (unused_but_set_errorcount): New variable.
1812 (poplevel): Issue -Wunused-but-set-variable diagnostics.
1813 (duplicate_decls): Merge DECL_READ_P flags.
1814 (start_cleanup_fn): Set DECL_READ_P flag.
1815 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
1816 * tree.c (rvalue): Call rvalue_use.
1817 * pt.c (convert_nontype_argument): Likewise.
1818 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
1819 finish_decltype_type): Likewise.
1820 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
1821 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
1822 or rvalue_use depending on the expr.
1823 * init.c (build_new, build_delete): Likewise.
1824 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
1825
1826 2010-05-05 Jason Merrill <jason@redhat.com>
1827
1828 PR c++/43787
1829 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
1830 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
1831
1832 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1833
1834 PR c++/43028
1835 * pt.c (unify): Check each elt for error_mark_node.
1836
1837 2010-05-04 Jason Merrill <jason@redhat.com>
1838
1839 PR c++/38064
1840 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
1841
1842 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1843
1844 PR c++/43705
1845 * call.c (build_new_method_call): Return error_mark_node if fns is
1846 NULL_TREE.
1847
1848 2010-05-03 Dodji Seketeli <dodji@redhat.com>
1849
1850 PR c++/43953
1851 * pt.c (most_specialized_class): Pretend we are processing
1852 a template decl during the call to coerce_template_parms.
1853
1854 2010-05-03 Jason Merrill <jason@redhat.com>
1855
1856 PR c++/42810
1857 PR c++/43680
1858 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
1859 from the selected underlying type unless -fstrict-enums. Set
1860 ENUM_UNDERLYING_TYPE to have the restricted range.
1861 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
1862 * class.c (check_bitfield_decl): Likewise.
1863
1864 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
1865
1866 PR c++/43951
1867 * init.c (build_new_1): Revert the accidental checkin in
1868 revision 158918.
1869
1870 2010-04-30 Jason Merrill <jason@redhat.com>
1871
1872 PR c++/43868
1873 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
1874 (pp_cxx_type_specifier_seq): ...here.
1875
1876 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
1877
1878 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
1879 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
1880
1881 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
1882
1883 PR c++/43779
1884 * typeck.c (warn_args_num): New function.
1885 (convert_arguments): Use warn_args_num to print the diagnostic
1886 messages.
1887
1888 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
1889
1890 PR c++/43890
1891 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
1892 user-provided constructor while recursing.
1893
1894 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
1895
1896 PR c++/9335
1897 * error.c (print_instantiation_partial_context_line): Handle
1898 recursive instantiation.
1899 (print_instantiation_partial_context): Likewise.
1900
1901 2010-04-27 Jason Merrill <jason@redhat.com>
1902
1903 * init.c (perform_member_init): Check CLASS_TYPE_P.
1904
1905 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
1906
1907 PR c++/29043
1908 * init.c (perform_member_init): check for uninitialized const or
1909 reference members, including array types.
1910
1911 2010-04-24 Jason Merrill <jason@redhat.com>
1912
1913 * tree.c (get_fns): Split out from get_first_fn.
1914 * cp-tree.h: Declare it.
1915 * search.c (shared_member_p): Use it.
1916 * semantics.c (finish_qualified_id_expr): Simplify.
1917 (finish_id_expression): Simplify.
1918
1919 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
1920 whenever object is NULL_TREE. Don't do 'this' capture here.
1921 (finish_qualified_id_expr): Pass NULL_TREE.
1922 (finish_id_expression): Likewise.
1923 (lambda_expr_this_capture): Likewise.
1924
1925 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
1926 rather than checking current_class_ref directly.
1927 (finish_call_expr): Likewise.
1928
1929 PR c++/43856
1930 * name-lookup.c (qualify_lookup): Disqualify lambda op().
1931 * class.c (current_nonlambda_class_type): New fn.
1932 * semantics.c (nonlambda_method_basetype): New.
1933 * cp-tree.h: Declare them.
1934 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
1935
1936 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
1937
1938 PR c++/43875
1939 * semantics.c (lambda_return_type): Complain about
1940 braced-init-list.
1941
1942 PR c++/43790
1943 * tree.c (cv_unqualified): Handle error_mark_node.
1944
1945 PR c++/41468
1946 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
1947 if we don't want errors.
1948
1949 PR c++/41468
1950 * class.c (convert_to_base): Add complain parameter. Pass
1951 ba_quiet to lookup_base if we don't want errors.
1952 (build_vfield_ref): Pass complain to convert_to_base.
1953 * call.c (convert_like_real): Likewise.
1954 (initialize_reference): Likewise.
1955 (perform_direct_initialization_if_possible): Pass complain to
1956 convert_like_real.
1957 * cp-tree.h: Adjust.
1958
1959 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
1960 Jason Merrill <jason@redhat.com>
1961
1962 PR c++/42844
1963 * decl.c (check_for_uninitialized_const_var): Handle classes that need
1964 constructing, too.
1965 (check_initializer): Call it for classes that need constructing, too.
1966 * class.c (in_class_defaulted_default_constructor): New.
1967 * cp-tree.h: Declare it.
1968
1969 2010-04-20 Jason Merrill <jason@redhat.com>
1970
1971 PR c++/9335
1972 * init.c (constant_value_1): Treat error_mark_node as a constant
1973 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
1974 * cvt.c (ocp_convert): Handle getting error_mark_node from
1975 integral_constant_value.
1976 * decl.c (compute_array_index_type): Likewise.
1977
1978 2010-04-20 Dodji Seketeli <dodji@redhat.com>
1979
1980 PR c++/43800
1981 PR c++/43704
1982 * typeck.c (incompatible_dependent_types_p): If one of the
1983 compared types if not a typedef then honour their main variant
1984 equivalence.
1985
1986 2010-04-20 Jakub Jelinek <jakub@redhat.com>
1987
1988 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
1989
1990 2010-04-19 Dodji Seketeli <dodji@redhat.com>
1991
1992 PR c++/43704
1993 * typeck.c (structural_comptypes): Test dependent typedefs
1994 incompatibility before testing for their main variant based
1995 equivalence.
1996
1997 2010-04-19 Jakub Jelinek <jakub@redhat.com>
1998
1999 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
2000 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
2001
2002 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
2003
2004 * decl.c (cxx_init_decl_processing): Remove second argument in call to
2005 build_common_tree_nodes.
2006
2007 2010-04-14 Jason Merrill <jason@redhat.com>
2008
2009 PR c++/36625
2010 * parser.c (cp_parser_parenthesized_expression_list): Change
2011 is_attribute_list parm to int to indicate whether or not to
2012 handle initial identifier specially.
2013 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
2014
2015 2010-04-13 Jason Merrill <jason@redhat.com>
2016
2017 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
2018 CLASS_TYPE_P.
2019 * parser.c (cp_parser_lambda_expression): Complain about lambda in
2020 unevaluated context.
2021 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
2022
2023 2010-04-12 Jason Merrill <jason@redhat.com>
2024
2025 PR c++/43641
2026 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
2027 return value directly.
2028
2029 * call.c (type_decays_to): Call cv_unqualified for non-class type.
2030
2031 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
2032
2033 PR c++/25811
2034 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2035 * init.c (build_new_1): Check for uninitialized const members and
2036 uninitialized reference members, when using new without
2037 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
2038 (diagnose_uninitialized_cst_or_ref_member): Define, call
2039 diagnose_uninitialized_cst_or_ref_member_1.
2040 (diagnose_uninitialized_cst_or_ref_member_1): New function.
2041
2042 2010-04-12 Richard Guenther <rguenther@suse.de>
2043
2044 PR c++/43611
2045 * semantics.c (expand_or_defer_fn_1): Do not keep extern
2046 template inline functions.
2047
2048 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2049
2050 PR c++/28584
2051 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
2052 pointer type.
2053
2054 2010-04-07 Jason Merrill <jason@redhat.com>
2055
2056 PR c++/43016
2057 * decl.c (start_preparsed_function): Do defer nested functions.
2058
2059 PR c++/11094, DR 408
2060 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
2061 * decl2.c (finish_static_data_member_decl): Set it.
2062 * decl.c (duplicate_decls): Propagate it.
2063 * pt.c (tsubst_decl): Don't substitute the domain of an array
2064 VAR_DECL if it's set.
2065 (regenerate_decl_from_template): Substitute it here.
2066 (type_dependent_expression_p): Return true if it's set.
2067 * semantics.c (finish_decltype_type): Instantiate such a variable.
2068 * typeck.c (cxx_sizeof_expr): Likewise.
2069 (strip_array_domain): New.
2070
2071 PR c++/43145
2072 * name-lookup.c (current_decl_namespace): Non-static.
2073 (pop_nested_namespace): Sanity check.
2074 * cp-tree.h: Declare current_decl_namespace.
2075 * decl.c (grokvardecl): Use it instead of current_namespace.
2076 (grokfndecl): Likewise.
2077
2078 PR c++/38392
2079 * pt.c (tsubst_friend_function): Instatiate a friend that has already
2080 been used.
2081
2082 * pt.c (print_template_statistics): New.
2083 * cp-tree.h: Declare it.
2084 * tree.c (cxx_print_statistics): Call it.
2085
2086 PR c++/41970
2087 * decl.c (grokvardecl): Tweak warning message.
2088 (grokfndecl): Likewise.
2089
2090 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2091
2092 PR c++/42697
2093 *pt.c (tsubst_decl): Get the arguments of a specialization from
2094 the specialization template, not from the most general template.
2095
2096 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2097
2098 PR c++/40239
2099 * typeck2.c (process_init_constructor_record):
2100 value-initialize members that are are not explicitely
2101 initialized.
2102
2103 2010-04-07 Jie Zhang <jie@codesourcery.com>
2104
2105 PR c++/42556
2106 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
2107 when all of its elements are non-constant and have been split out.
2108
2109 2010-04-06 Taras Glek <taras@mozilla.com>
2110 Jason Merrill <jason@redhat.com>
2111
2112 * parser.c (cp_parser_class_specifier): Set class location to that
2113 of IDENTIFIER_NODE instead of '{' when possible.
2114 * semantics.c (begin_class_definition): Do not overide locations
2115 with less precise ones.
2116
2117 2010-04-06 Jason Merrill <jason@redhat.com>
2118
2119 PR c++/43648
2120 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
2121
2122 PR c++/43621
2123 * pt.c (maybe_update_decl_type): Check the return value from
2124 push_scope.
2125
2126 2010-04-01 Jason Merrill <jason@redhat.com>
2127
2128 * decl.c (next_initializable_field): No longer static.
2129 * cp-tree.h: Declare it.
2130 * call.c (build_aggr_conv): Fail if there are more initializers
2131 than initializable fields.
2132
2133 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
2134 instead of void_zero_node.
2135
2136 2010-03-31 Dodji Seketeli <dodji@redhat.com>
2137
2138 PR c++/43558
2139 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
2140 * pt.c (end_template_parm_list): Store sibling template parms of
2141 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2142 (push_template_decl_real): Don't store the containing template decl
2143 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
2144 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
2145 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2146 Simplify the logic.
2147
2148 2010-03-30 Jason Merrill <jason@redhat.com>
2149
2150 PR c++/43076
2151 * pt.c (push_template_decl_real): Deal better with running out of
2152 scopes before running out of template parms.
2153
2154 PR c++/41185
2155 PR c++/41786
2156 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
2157 function parameter context. Don't print an error if parsing
2158 tentatively.
2159
2160 PR c++/43559
2161 * pt.c (more_specialized_fn): Don't control cv-qualifier check
2162 with same_type_p.
2163
2164 2010-03-26 Jason Merrill <jason@redhat.com>
2165
2166 PR c++/43509
2167 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
2168 c++0x mode, but not other type-names.
2169
2170 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2171
2172 PR c++/43327
2173 * pt.c (add_to_template_args): Support NULL ARGS;
2174 (most_specialized_class): call coerce_template_parms on
2175 template arguments passed to get_class_bindings. Use
2176 add_to_template_args.
2177 (unify): Handle VAR_DECLs.
2178
2179 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2180
2181 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
2182 into int.
2183 * pt.c (get_template_parms_at_level): Adjust.
2184
2185 2010-03-25 Dodji Seketeli <dodji@redhat.com>
2186
2187 PR c++/43206
2188 * cp-tree.h (get_template_parms_at_level): Declare ...
2189 * pt.c (get_template_parms_at_level): ... new function.
2190 * typeck.c (get_template_parms_of_dependent_type): If a template
2191 type parm's DECL_CONTEXT isn't yet set, get its siblings from
2192 current_template_parms. Use get_template_parms_at_level. Remove
2193 useless test.
2194 (incompatible_dependent_types_p): If we get empty parms from just one
2195 of the template type parms we are comparing then the template parms are
2196 incompatible.
2197
2198 2010-03-24 Jason Merrill <jason@redhat.com>
2199
2200 PR c++/43502
2201 * parser.c (make_declarator): Initialize id_loc.
2202 (cp_parser_lambda_declarator_opt): And set it.
2203
2204 2010-03-23 Jason Merrill <jason@redhat.com>
2205
2206 Make lambda conversion op and op() non-static.
2207 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
2208 Also add the thunk function returned by the conversion op.
2209 Mark the conversion deleted if the op() is variadic.
2210 * decl2.c (mark_used): Give helpful message about deleted conversion.
2211 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
2212 * semantics.c (finish_this_expr): Adjust.
2213 * mangle.c (write_closure_type_name): Adjust.
2214 * decl.c (grok_op_properties): Don't allow it.
2215 * call.c (build_user_type_conversion_1): No static conversion ops.
2216 (build_op_call): Or op().
2217
2218 * decl2.c (change_return_type): Fix 'this' quals.
2219
2220 2010-03-22 Jason Merrill <jason@redhat.com>
2221
2222 PR c++/43333
2223 * tree.c (pod_type_p): Use old meaning in C++98 mode.
2224
2225 PR c++/43281
2226 * pt.c (contains_auto_r): New fn.
2227 (do_auto_deduction): Use it.
2228 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
2229
2230 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
2231
2232 PR c++/43081:
2233 * decl2.c (grokfield): Handle invalid initializers for member
2234 functions.
2235
2236 2010-03-20 Dodji Seketeli <dodji@redhat.com>
2237
2238 PR c++/43375
2239 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
2240 is NULL.
2241 * decl2.c (vague_linkage_p): Likewise.
2242
2243 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
2244
2245 PR c++/43418
2246 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
2247 false, in the cp_parser_expression_statement call.
2248
2249 2010-03-05 Jason Merrill <jason@redhat.com>
2250
2251 * mangle.c (mangle_decl): Give name collision error even without
2252 ASM_OUTPUT_DEF.
2253
2254 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
2255
2256 * pt.c (process_partial_specialization): Use error_n instead of
2257 error.
2258
2259 2010-03-03 Jason Merrill <jason@redhat.com>
2260
2261 PR c++/12909
2262 * mangle.c (mangle_decl): Handle VAR_DECL, too.
2263
2264 2010-03-03 Jason Merrill <jason@redhat.com>
2265
2266 PR c++/12909
2267 * mangle.c: Include cgraph.h.
2268 (mangle_decl): If the mangled name will change in a later
2269 ABI version, make the later mangled name an alias.
2270 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
2271 * Make-lang.in (mangle.o): Depend on cgraph.h.
2272 * method.c (make_alias_for): Handle VAR_DECL, too.
2273 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
2274 * tree.c (no_linkage_check): Adjust.
2275 * decl.c (maybe_commonize_var): Adjust.
2276 * cp-tree.h: Adjust.
2277
2278 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
2279
2280 * pt.c (redeclare_class_template): Use error_n and inform_n.
2281
2282 2010-02-27 Mark Mitchell <mark@codesourcery.com>
2283
2284 PR c++/42748
2285 * cp-tree.h (push_tinst_level): Declare.
2286 (pop_tinst_level): Likewise.
2287 * pt.c (push_tinst_level): Give it external linkage.
2288 (pop_tinst_level): Likewise.
2289 * mangle.c (mangle_decl_string): Set the source location to that
2290 of the decl while mangling.
2291
2292 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
2293
2294 PR c++/42054
2295 * pt.c (redeclare_class_template): Return false if there are erroneous
2296 template parameters.
2297
2298 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
2299
2300 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
2301 -ftemplate-depth=.
2302
2303 2010-02-24 Jason Merrill <jason@redhat.com>
2304
2305 PR c++/12909
2306 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
2307
2308 * class.c (layout_class_type): Don't give -Wabi warning for a bug
2309 in a previous ABI version.
2310
2311 2010-02-23 Jason Merrill <jason@redhat.com>
2312
2313 PR c++/43143
2314 * typeck2.c (digest_init_r): Accept value init of array.
2315
2316 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
2317
2318 PR c++/43126
2319 * typeck.c (convert_arguments): Update error message.
2320
2321 2010-02-22 Mike Stump <mikestump@comcast.net>
2322
2323 PR c++/43125
2324 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
2325
2326 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
2327
2328 PR c++/23510
2329 * error.c (print_instantiation_partial_context_line): New.
2330 (print_instantiation_partial_context): Print at most 12 contexts,
2331 skip the rest with a message.
2332
2333 2010-02-21 Dodji Seketeli <dodji@redhat.com>
2334
2335 PR c++/42824
2336 * pt.c (lookup_template_class): Better support of specialization
2337 of member of class template implicit instantiation.
2338
2339 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
2340
2341 PR c++/35669
2342 * call.c (conversion_null_warnings): Replace -Wconversion with
2343 -Wconversion-null.
2344 * cvt.c (build_expr_type_conversion): Likewise.
2345
2346 2010-02-18 Jason Merrill <jason@redhat.com>
2347
2348 PR c++/42837
2349 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
2350
2351 PR c++/43108
2352 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
2353 C build_binary_op.
2354 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
2355 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
2356
2357 PR c++/43070
2358 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
2359
2360 PR c++/26261
2361 PR c++/43101
2362 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
2363 (maybe_update_decl_type): New fn.
2364 * parser.c (cp_parser_init_declarator): Use it.
2365
2366 PR c++/43109
2367 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
2368
2369 2010-02-17 Jason Merrill <jason@redhat.com>
2370
2371 PR c++/43075
2372 * call.c (build_over_call): Don't create zero-sized assignments.
2373 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
2374 * cp-objcp-common.c (cp_expr_size): Remove.
2375 * cp-tree.h: Remove prototype.
2376
2377 PR c++/43069
2378 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
2379 decl we looked up doesn't match.
2380
2381 PR c++/43093
2382 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
2383 have an INIT_EXPR anymore.
2384
2385 PR c++/43079
2386 * pt.c (convert_nontype_argument): Change assert to test.
2387
2388 2010-02-16 Jason Merrill <jason@redhat.com>
2389
2390 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
2391
2392 PR c++/43031
2393 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
2394 VIEW_CONVERT_EXPR for conversions between structural equality types
2395 that the back end can't tell are the same.
2396
2397 PR c++/43036
2398 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
2399 cv-quals from element here.
2400 (cp_build_qualified_type_real): Not here. Preserve typedef name.
2401
2402 2010-02-14 Jason Merrill <jason@redhat.com>
2403
2404 PR c++/41997
2405 * semantics.c (finish_compound_literal): Use
2406 cp_apply_type_quals_to_decl when creating a static variable.
2407
2408 2010-02-12 Jason Merrill <jason@redhat.com>
2409
2410 PR c++/43024
2411 * name-lookup.h (current_binding_level): Check for null
2412 cp_function_chain.
2413
2414 2010-02-12 Jason Merrill <jason@redhat.com>
2415
2416 PR c++/43054
2417 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
2418
2419 2010-02-12 Jakub Jelinek <jakub@redhat.com>
2420
2421 PR c++/43033
2422 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
2423 instead of x.
2424
2425 2010-02-10 Jason Merrill <jason@redhat.com>
2426
2427 PR c++/41896
2428 * semantics.c (outer_lambda_capture_p): Revert.
2429 (add_capture): Only finish_member_declaration if
2430 we're in the lambda class.
2431 (register_capture_members): New.
2432 * cp-tree.h: Declare it.
2433 * parser.c (cp_parser_lambda_expression): Call it.
2434
2435 2010-02-10 Jason Merrill <jason@redhat.com>
2436
2437 PR c++/41896
2438 * semantics.c (outer_lambda_capture_p): Use current_function_decl
2439 instead of current_class_type.
2440
2441 2010-02-10 Jason Merrill <jason@redhat.com>
2442
2443 PR c++/42983, core issue 906
2444 * method.c (defaultable_fn_check): Check virtualness.
2445
2446 2010-02-10 Jason Merrill <jason@redhat.com>
2447
2448 PR c++/43016
2449 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
2450
2451 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
2452
2453 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
2454 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
2455 translation.
2456 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
2457 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
2458 (cp_parser_parameter_declaration)
2459 (cp_parser_exception_specification_opt)
2460 (cp_parser_exception_declaration): Likewise.
2461 * pt.c (check_default_tmpl_args): Likewise.
2462 * search.c (lookup_field_r): Likewise.
2463
2464 2010-02-09 Jason Merrill <jason@redhat.com>
2465
2466 PR c++/42399
2467 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
2468
2469 2010-02-09 Jason Merrill <jason@redhat.com>
2470
2471 PR c++/42370
2472 * decl2.c (change_return_type): New fn.
2473 * semantics.c (apply_lambda_return_type): Use it.
2474 * cp-tree.h: Declare it.
2475
2476 2010-02-05 Richard Guenther <rguenther@suse.de>
2477
2478 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
2479 * cp-lang.c: Include gt-cp-cp-lang.h.
2480 * config-lang.in (gtfiles): Add cp/cp-lang.c.
2481
2482 2010-02-05 Dodji Seketeli <dodji@redhat.com>
2483
2484 PR c++/42915
2485 * typeck.c (get_template_parms_of_dependent_type): Try getting
2486 the template parameters fromt the type itself first.
2487
2488 2010-02-03 Jason Merrill <jason@redhat.com>
2489
2490 PR c++/4926
2491 PR c++/38600
2492 * mangle.c (write_unqualified_id): Split out from write_expression.
2493 (write_unqualified_name): Call it.
2494 (write_member_name): Likewise.
2495 (write_expression): Support TEMPLATE_ID_EXPR.
2496 Disambiguate operator names.
2497
2498 PR c++/12909
2499 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
2500 -fabi-version=4.
2501
2502 2010-02-02 Jason Merrill <jason@redhat.com>
2503
2504 PR c++/41090
2505 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
2506 * optimize.c (clone_body): Remap their initializers when making base
2507 variants.
2508 (maybe_clone_body): Complain if multiple clones aren't safe.
2509
2510 2010-01-29 Dodji Seketeli <dodji@redhat.com>
2511
2512 PR c++/42758
2513 PR c++/42634
2514 PR c++/42336
2515 PR c++/42797
2516 PR c++/42880
2517 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
2518 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
2519 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
2520 * pt.c (coerce_template_parms, type_unification_real,
2521 expand_template_argument_pack, coerce_template_parameter_pack):
2522 Set the non default template args count.
2523 (current_template_args): Always set non defaulted
2524 template args count when compiled with --enable-checking
2525 (tsubst_template_args, type_unification_real): Propagate the non
2526 defaulted template args count.
2527 * error.c (get_non_default_template_args_count): Renamed
2528 count_non_default_template_args into this. Don't calculate the
2529 non default template argument count anymore. Use the new
2530 accessor macros above to get it.
2531 (dump_template_argument_list, dump_type, dump_decl,
2532 dump_template_parms): Adjust.
2533 * parser.c (cp_parser_template_argument_list): Always set defaulted
2534 template args count when compiled with --enable-checking.
2535
2536 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
2537
2538 * decl.c (redeclaration_error_message): Wrap the return messages into
2539 G_() for easy translation.
2540
2541 2010-01-28 Jason Merrill <jason@redhat.com>
2542
2543 PR c++/42880
2544 * semantics.c (begin_class_definition): Don't use type_as_string.
2545
2546 2010-01-28 Dodji Seketeli <dodji@redhat.com>
2547
2548 PR c++/42713
2549 PR c++/42820
2550 * typeck.c (get_template_parms_of_dependent_type): Factorized
2551 this out of incompatible_template_type_parms_p
2552 (incompatible_dependent_types_p): Renamed
2553 incompatible_template_type_parms_p into this. Make it detect
2554 two incompatible dependent typedefs too.
2555 (structural_comptypes): Use incompatible_dependent_types_p.
2556 * pt.c (get_template_info):
2557 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
2558
2559 2010-01-20 Janis Johnson <janis187@us.ibm.com>
2560 Jason Merrill <jason@redhat.com>
2561
2562 * mangle.c (write_type): Mangle transparent record as member type.
2563 * semantics.c (begin_class_definition): Recognize decimal classes
2564 and set TYPE_TRANSPARENT_AGGR.
2565
2566 2010-01-20 Jason Merrill <jason@redhat.com>
2567
2568 PR c++/42338
2569 * mangle.c (write_expression): Handle tree codes that have extra
2570 arguments in the middle-end.
2571
2572 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
2573
2574 PR c++/42038
2575 * except.c (expand_start_catch_block): Deal correctly with
2576 do_begin_catch returning error_mark_node.
2577
2578 2010-01-20 Jason Merrill <jason@redhat.com>
2579
2580 PR c++/41788
2581 * class.c (layout_class_type): Set packed_maybe_necessary for packed
2582 non-PODs.
2583
2584 PR c++/41920
2585 * semantics.c (build_lambda_object): Call mark_used on captured
2586 variables.
2587
2588 PR c++/40750
2589 * decl.c (grokdeclarator): Clear type_quals for a member function
2590 declared using a typedef. Don't complain about adding cv-quals
2591 to a function typedef in C++0x mode.
2592
2593 2010-01-20 Jakub Jelinek <jakub@redhat.com>
2594
2595 * decl.c (create_array_type_for_decl): Remove set but not used
2596 variable error_msg. Remove break stmts after return stmts.
2597
2598 2010-01-19 Dodji Seketeli <dodji@redhat.com>
2599
2600 * error.c (dump_template_parms, count_non_default_template_args):
2601 Revert fix of PR c++/42634.
2602
2603 2010-01-18 Dodji Seketeli <dodji@redhat.com>
2604
2605 PR c++/42634
2606 * error.c (dump_template_parms): Use innermost template
2607 arguments before calling count_non_default_template_args.
2608 (count_non_default_template_args): We are being called with
2609 template innermost arguments now. There is no need to ensure
2610 that again.
2611
2612 2010-01-18 Dodji Seketeli <dodji@redhat.com>
2613
2614 PR c++/42766
2615 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
2616
2617 2010-01-17 Dodji Seketeli <dodji@redhat.com>
2618
2619 PR c++/42697
2620 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
2621
2622 2010-01-17 Dodji Seketeli <dodji@redhat.com>
2623
2624 PR c++/42697
2625 *pt.c (tsubst_decl): Get the arguments of a specialization from
2626 the specialization template, not from the most general template.
2627
2628 2010-01-16 Jason Merrill <jason@redhat.com>
2629
2630 PR c++/42761
2631 * semantics.c (finish_decltype_type): Within a template, treat
2632 unresolved CALL_EXPR as dependent.
2633
2634 2010-01-15 Dodji Seketeli <dodji@redhat.com>
2635
2636 * error.c (dump_template_parms,count_non_default_template_args):
2637 Revert changes of PR c++/42634.
2638
2639 2010-01-14 Jakub Jelinek <jakub@redhat.com>
2640
2641 PR middle-end/42674
2642 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
2643 functions with noreturn attribute.
2644
2645 2010-01-14 Jason Merrill <jason@redhat.com>
2646
2647 PR c++/42701
2648 * call.c (build_new_method_call): Don't free the vec here.
2649
2650 PR c++/42655
2651 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
2652
2653 2010-01-13 Dodji Seketeli <dodji@redhat.com>
2654
2655 PR c++/42634
2656 * error.c (dump_template_parms): Use innermost template
2657 arguments before calling count_non_default_template_args.
2658 (count_non_default_template_args): We are being called with
2659 template innermost arguments now. There is no need to ensure
2660 that again.
2661
2662 2010-01-07 Dodji Seketeli <dodji@redhat.com>
2663
2664 c++/40155
2665 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
2666 arguments that were previously deduced.
2667
2668 2010-01-05 Jason Merrill <jason@redhat.com>
2669
2670 * pt.c (unify_pack_expansion): Handle deduction from init-list.
2671 * call.c (build_over_call): Don't complain about it.
2672
2673 2010-01-04 Jason Merrill <jason@redhat.com>
2674
2675 PR c++/42555
2676 * pt.c (tsubst_decl): Don't apply type attributes in place.
2677
2678 PR c++/42567
2679 * semantics.c (describable_type): Remove decltype comment and
2680 semantics.
2681
2682
2683 \f
2684 Copyright (C) 2010 Free Software Foundation, Inc.
2685
2686 Copying and distribution of this file, with or without modification,
2687 are permitted in any medium without royalty provided the copyright
2688 notice and this notice are preserved.
2689