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