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