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