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