1 2009-11-03 Jason Merrill <jason@redhat.com>
4 * call.c (build_call_a): Strip cv-quals from rvalue result.
7 * call.c (initialize_reference): Add complain parm.
8 * typeck.c (convert_for_initialization): Pass it.
9 * decl.c (grok_reference_init): Likewise.
10 * cp-tree.h: Declare it.
13 * pt.c (do_auto_deduction): Diagnose inconsistent deduction.
15 2009-11-02 Dodji Seketeli <dodji@redhat.com>
18 * pt.c (check_valid_ptrmem_cst_expr): New function.
19 (convert_nontype_argument): Use it to output an error for
20 illegal pointer to member expressions used as template arguments.
22 2009-11-02 Jason Merrill <jason@redhat.com>
24 Restrict DR 757 change to C++0x mode.
25 * decl2.c (mark_used): Check cxx_dialect.
26 * decl.c (grokfndecl): Do check type linkage in C++98 mode.
27 (grokvardecl): Likewise.
28 * pt.c (check_instantiated_arg): Likewise.
30 2009-11-02 Jakub Jelinek <jakub@redhat.com>
33 * name-lookup.c (handle_namespace_attrs): Pass 1 as last argument to
35 * parser.c (cp_parser_namespace_definition): Pass 1 as argument to
37 * rtti.c (push_abi_namespace): Pass 2 as last argument to
39 (pop_abi_namespace): Pass 2 as argument to pop_visibility.
41 2009-10-31 Jason Merrill <jason@redhat.com>
43 * tree.c (cv_unqualified): New fn.
44 * cp-tree.h: Declare it.
45 * typeck.c (decay_conversion): Use it instead of TYPE_MAIN_VARIANT.
47 * rtti.c (tinfo_name): Fix lengths for private case.
49 2009-10-31 Jason Merrill <jason@redhat.com>
52 * call.c (compare_ics): Avoid bad union use when
53 comparing two ck_lists.
55 2009-10-30 Jerry Quinn <jlquinn@optonline.net>
57 * mangle.c (mangle_type_string_for_rtti): Reapply 153734.
58 (needs_fake_anon): Likewise.
59 (write_name): Likewise.
60 (write_nested_name): Likewise.
61 * cp-tree.h (mangle_type_string_for_rtti): Likewise.
62 (get_anonymous_namespace): Likewise.
63 * name-lookup.c (get_anonymous_namespace_name): Likewise.
64 * rtti.c (tinfo_name): Likewise, with +1 in the second
65 build_string call fixed.
66 (tinfo_base_init): Likewise.
68 2009-10-30 Jason Merrill <jason@redhat.com>
71 * decl.c (cp_fname_init): Correct build_string argument.
73 2009-10-30 Jerry Quinn <jlquinn@optonline.net>
75 * mangle.c (mangle_type_string_for_rtti): Revert 153734.
76 (needs_fake_anon): Likewise.
77 (write_name): Likewise.
78 (write_nested_name): Likewise.
79 * cp-tree.h (mangle_type_string_for_rtti): Likewise.
80 (get_anonymous_namespace): Likewise.
81 * name-lookup.c (get_anonymous_namespace_name): Likewise.
82 * rtti.c (tinfo_name): Likewise.
83 (tinfo_base_init): Likewise.
85 2009-10-30 Dodji Seketeli <dodji@redhat.com>
88 * pt.c (iterative_hash_template_arg): articifial parms
89 don't have DECL_PARM_INDEX set. Do not hash it.
91 2009-10-28 Jerry Quinn <jlquinn@optonline.net>
93 * mangle.c (mangle_type_string_for_rtti): Revert r149964.
94 (needs_fake_anon): Likewise.
95 (write_name): Likewise.
96 (write_nested_name): Likewise.
97 * cp-tree.h (mangle_type_string_for_rtti): Likewise.
98 (get_anonymous_namespace): Likewise.
99 * name-lookup.c (get_anonymous_namespace_name): Likewise.
100 * rtti.c (tinfo_name): Insert '*' in front of private names.
101 (tinfo_base_init): Use it.
103 2009-10-28 Jason Merrill <jason@redhat.com>
106 * name-lookup.c (set_decl_namespace): Deal properly with inline
108 (qualified_lookup_using_namespace): Overhaul.
109 * pt.c (print_candidates): Handle getting an OVERLOAD.
111 2009-10-28 Jason Merrill <jason@redhat.com>
113 * decl.c (cp_fname_init): Correct build_string argument.
115 2009-10-27 Jason Merrill <jason@redhat.com>
117 Allow no-capture lambdas to convert to function pointer.
118 * semantics.c (maybe_add_lambda_conv_op): New.
119 * parser.c (cp_parser_lambda_expression): Call it.
120 (cp_parser_lambda_declarator_opt): Make op() static if
122 * mangle.c (write_closure_type_name): Adjust.
123 * semantics.c (finish_this_expr): Adjust.
124 * decl.c (grok_op_properties): Allow it.
125 * call.c (build_user_type_conversion_1): Handle static conversion op.
126 (build_op_call): And op().
128 2009-10-26 Jakub Jelinek <jakub@redhat.com>
131 * cp-lang.c (cxx_dwarf_name): Return NULL instead of
132 <anonymous ...> for anonymous aggregate names.
134 2009-10-26 Jason Merrill <jason@redhat.com>
136 PR c++/38796, Core issue 906
137 * cp-tree.h (DECL_DEFAULTED_OUTSIDE_CLASS_P): New.
138 (DECL_DEFAULTED_IN_CLASS_P): New.
139 * class.c (user_provided_p): Non-static.
140 (check_methods): Use it.
141 (check_bases_and_members): Check defaulted fns.
142 (defaultable_fn_p): Move and rename to...
143 * method.c (defaultable_fn_check): ...this.
144 (defaulted_late_check): New.
145 * pt.c (tsubst_decl): Call it.
146 * decl2.c (grokfield): Adjust.
147 * decl.c (cp_finish_decl): Adjust.
148 (grok_special_member_properties): Use user_provided_p.
150 2009-10-26 Dodji Seketeli <dodji@redhat.com>
153 * pt.c (template_args_equal): Handle comparison of
154 an ARGUMENT_PACK_SELECT node with the arguments node it selects into.
155 * cp-tree.def: Fix a typo in the description of TYPE_PACK_EXPANSION.
157 2009-10-26 Dodji Seketeli <dodji@redhat.com>
160 * decl.c (decls_match): Use DECL_IS_BUILTIN instead of
163 2009-10-23 Dodji Seketeli <dodji@redhat.com>
166 * mangle.c (write_template_args): Allow mangling of empty template
167 argument list. Updated function comments.
169 2009-10-23 Jason Merrill <jason@redhat.com>
171 * semantics.c (lambda_expr_this_capture): Use thisify_lambda_field.
173 * semantics.c (outer_lambda_capture_p): New fn.
174 (thisify_lambda_field): Factor out...
175 (add_default_capture): ...from here.
176 (finish_id_expression): Use them.
179 * call.c (add_function_candidate): Only permit explicit conversion
180 ops if copy ctor was called with a single argument.
182 * call.c (initialize_reference): Tweak error message.
184 2009-10-21 Jakub Jelinek <jakub@redhat.com>
186 * mangle.c (finish_mangling_get_identifier): Use
187 obstack_base (mangle_obstack) instead of name_base.
189 2009-10-19 Jakub Jelinek <jakub@redhat.com>
191 * parser.c (cp_lexer_print_token, cp_parser_is_string_literal,
192 cp_parser_string_literal, cp_parser_primary_expression): Likewise.
193 (cp_lexer_get_preprocessor_token): Use C_LEX_STRING_JOIN instead
194 of C_LEX_RAW_STRINGS.
196 2009-10-15 Jason Merrill <jason@redhat.com>
199 * error.c (dump_template_bindings): Wrap argument packs in {}.
202 * parser.c (CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS): New.
203 (cp_parser_type_specifier): Don't try to parse a class-specifier
204 or enum-specifier in that case.
205 (cp_parser_trailing_type_id): New.
206 (cp_parser_late_return_type_opt): Call it.
207 (cp_parser_type_id_1): Add is_trailing_return parm.
208 (cp_parser_type_specifier_seq): Likewise.
210 2009-10-14 Jason Merrill <jason@redhat.com>
213 * call.c (print_z_candidates): Don't print deleted candidates.
214 (print_z_candidate): Note deleted candidates.
216 2009-10-14 Larry Evans <cppljevans@suddenlink.net>
219 * tree.c (cp_tree_equal): Add test for TEMPLATE_PARM_PARAMETER_PACK
222 2009-10-12 Jason Merrill <jason@redhat.com>
225 * parser.c (cp_parser_decltype): Set greater_than_is_operator_p.
228 * pt.c (type_unification_real): Call convert_template_argument
229 for function default template arguments.
230 (check_default_tmpl_args): Suggest -std=c++0x when function default
231 template args seen in C++98 mode.
233 2009-10-11 Jason Merrill <jason@redhat.com>
236 * typeck.c (build_reinterpret_cast_1): Handle rvalue refs
239 2009-10-11 Richard Guenther <rguenther@suse.de>
241 * tree.c (cp_free_lang_data): Drop anonymous aggregate names.
243 2009-10-08 Jason Merrill <jason@redhat.com>
246 * pt.c (maybe_adjust_types_for_deduction): Do rvalue ref adjustment
247 even when DEDUCE_EXACT.
250 * pt.c (resolve_nondeduced_context): New.
251 * cvt.c (convert_to_void): Call it.
252 * semantics.c (finish_decltype_type): Likewise.
253 * typeck.c (decay_conversion): Here too.
254 * pt.c (tsubst_decl): Don't clobber input_location.
255 Don't register a bad specialization.
257 2009-10-07 Gabriel Dos Reis <gdr@cs.tamu.edu>
259 * cp-tree.h: Fix location of documentation for DECL_LANG_FLAG_7.
261 2009-10-07 Jason Merrill <jason@redhat.com>
264 * pt.c (tsubst_pack_expansion): Don't do anything now if we
265 have incomplete packs of different lengths.
268 * tree.c (build_qualified_name): Call convert_from_reference.
270 2009-10-06 Jason Merrill <jason@redhat.com>
272 Fix lookup of initialized captures in unevaluated context.
273 * cp-tree.h (DECL_NORMAL_CAPTURE_P): New.
274 * name-lookup.c (qualify_lookup): Check it.
275 * parser.c (cp_parser_lambda_introducer): Pass explicit_init_p
277 * semantics.c (add_capture): Set DECL_NORMAL_CAPTURE_P
278 on captures without explicit init.
279 (add_default_capture): Pass explicit_init_p.
281 Fix capture by copy of types with explicit copy constructor.
282 * cp-tree.h (TARGET_EXPR_DIRECT_INIT_P): New.
283 (DIRECT_INIT_EXPR_P): New.
284 * typeck.c (convert_for_initialization): Just return if
286 * semantics.c (build_lambda_object): Use
287 TARGET_EXPR_DIRECT_INIT_P for normal captures.
289 2009-10-05 Jason Merrill <jason@redhat.com>
291 * parser.c: Mark lambda_scope and lambda_count for PCH.
293 2009-10-03 Jason Merrill <jason@redhat.com>
296 * parser.c (cp_parser_lambda_introducer): Avoid infinite loop on
299 2009-10-02 Jason Merrill <jason@redhat.com>
301 * mangle.c (write_unnamed_type_name): Implement.
302 (local_class_index): Split out from...
303 (discriminator_for_local_entity): ...here.
304 (nested_anon_class_index): New.
305 * cp-tree.h (TYPE_FUNCTION_SCOPE_P): New.
307 2009-10-02 Janis Johnson <janis187@us.ibm.com>
309 * call.c (convert_arg_to_ellipsis): Avoid promoting decimal32
312 2009-10-01 Jason Merrill <jason@redhat.com>
314 * parser.c (cp_parser_lambda_expression): Compute visibility.
315 (no_linkage_lambda_type_p): Remove.
316 * cp-tree.h: Remove declaration.
317 * tree.c (no_linkage_check): Don't call it. Don't check template
318 args. Don't check TREE_PUBLIC Types.
320 2009-10-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
321 Jason Merrill <jason@redhat.com>
323 * decl.c (grokdeclarator): Set constexprness before announcing
326 2009-10-01 Gabriel Dos Reis <gdr@cs.tamu.edu>
328 * decl.c (record_builtin_java_type): Undo unintended change.
329 (cxx_init_decl_processing): Likewise.
331 2009-10-01 Jason Merrill <jason@redhat.com>
333 * pt.c (register_specialization): Push DECL_SOURCE_LOCATION to the
336 * decl.c (grok_special_member_properties): Only adjust
337 TYPE_HAS_COMPLEX_* if the function is defaulted in the class body.
338 (cp_finish_decl): Push DECL_DELETED_FN/DECL_DEFAULTED_FN to the
341 2009-09-30 Gabriel Dos Reis <gdr@cs.tamu.edu>
343 * decl.c (check_for_uninitialized_const_var): Check constexpr
345 (grokdeclarator): Handle `constexpr'.
346 (check_tag_decl): Reject `constexpr'.
347 (check_function_type): Check constexpr functions.
348 * cp-tree.h (ds_constexpr): New cp_decl_spec enumerator.
349 (CLASSTYPE_LITERAL_P): New.
350 (lang_type_class::is_literal): New.
351 (lang_type_class::dummy): Adjust width.
352 (literal_type_p): Declare.
353 * parser.c (cp_parser_check_decl_spec): Print it.
354 (cp_parser_decl_specifier_seq): Accept "constexpr".
355 * semantics.c (validate_constexpr_fundecl): Define.
356 (literal_type_p): Define.
358 2009-09-30 Jason Merrill <jason@redhat.com>
360 * semantics.c (lambda_expr_this_capture): Fix default capture
361 of explicit capture of 'this'.
363 2009-09-30 Jason Merrill <jason@redhat.com>
365 * parser.c (cp_parser_lambda_expression): Don't add __ to __this.
367 2009-09-30 Jason Merrill <jason@redhat.com>
369 * cp-tree.h (LANG_DECL_U2_CHECK): Check LANG_DECL_HAS_MIN.
371 2009-09-29 John Freeman <jfreeman08@gmail.com>
372 Jason Merrill <jason@redhat.com>
374 Add support for lambda-expressions as per N2927.
375 * cp-tree.def (VEC_INIT_EXPR, LAMBDA_EXPR): New.
376 * cp-tree.h (LAMBDA_TYPE_P, LAMBDA_FUNCTION_P): New.
377 (LAMBDA_EXPR_DEFAULT_CAPTURE_MODE): New.
378 (LAMBDA_EXPR_DEFAULT_CAPTURE_LIST): New.
379 (LAMBDA_EXPR_THIS_CAPTURE, LAMBDA_EXPR_CAPTURES_THIS_P): New.
380 (LAMBDA_EXPR_MUTABLE_P, LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): New.
381 (LAMBDA_EXPR_RETURN_TYPE, LAMBDA_EXPR_LOCATION): New.
382 (LAMBDA_EXPR_EXTRA_SCOPE, LAMBDA_EXPR_DISCRIMINATOR): New.
383 (struct tree_lambda_expr): New.
384 (union lang_tree_node): Add lambda_expression.
385 (struct lang_type_class): Add lazy_move_ctor flag, lambda_expr field.
386 (CLASSTYPE_LAZY_MOVE_CTOR, CLASSTYPE_LAMBDA_EXPR): New.
387 (LAMBDA_TYPE_EXTRA_SCOPE, VEC_INIT_EXPR_SLOT): New.
388 (VEC_INIT_EXPR_INIT, DECLTYPE_FOR_LAMBDA_CAPTURE): New.
389 (DECLTYPE_FOR_LAMBDA_RETURN): New.
390 (enum special_function_kind): Add sfk_move_constructor.
391 (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT, LAMBDANAME_P): New.
392 * parser.c (cp_parser_lambda_expression, cp_parser_lambda_introducer)
393 (cp_parser_lambda_declarator_opt, cp_parser_lambda_body): New.
394 (start_lambda_scope, record_lambda_scope, finish_lambda_scope): New.
395 (no_linkage_lambda_type_p): New.
396 (cp_parser_primary_expression): Recognize lambda expression.
397 (cp_parser_init_declarator): Note lambda scope.
398 (cp_parser_function_definition_after_declarator): Likewise.
399 (cp_parser_late_parsing_default_args): Likewise.
400 (cp_parser_skip_to_closing_parenthesis): Skip to end of lambda capture
402 (cp_parser_parameter_declaration): Don't defer lambda default args.
403 * semantics.c (finish_non_static_data_member, finish_id_expression):
404 Handle default capture for lambda expressions.
405 (finish_this_expr): Handle 'this' keyword inside of lambda expressions.
406 (outer_automatic_var_p): New.
407 (finish_decltype_type): Handle decltypes within lambda expressions.
408 (classtype_has_nothrow_assign_or_copy_p): Synthesized move constructor.
409 (build_lambda_expr, build_lambda_object, begin_lambda_type)
410 (lambda_return_type, lambda_capture_field_type, apply_lambda_return_type)
411 (capture_decltype, add_capture, add_default_capture)
412 (lambda_expr_this_capture): New.
413 * mangle.c (write_unnamed_type_name): New. Incomplete.
414 (write_closure_type_name): New.
415 (write_unqualified_name): Recognize unnamed, closure types.
416 (write_type): Do not write decltypes from lambda expressions.
417 (decl_mangling_context): New.
418 (write_name): Use it. Handle PARM_DECL scope.
419 (write_prefix): Likewise. Handle VAR_DECL/FIELD_DECL scope.
420 (write_compact_number): Factor out from...
421 (write_expression, write_template_param): ...here.
422 (discriminator_for_local_entity): Recognize lambdas.
423 (write_local_name): Handle PARM_DECL scope.
424 * typeck.c (structural_comptypes): Compare decltypes from lambda
426 (check_return_expr): Deduce lambda return type from multiple return
428 * class.c (add_implicitly_declared_members): Add lazy move constructor
430 (check_bases_and_members): Delete default constructor and assignment
431 operator for lambda types.
432 (maybe_note_name_used_in_class): Do not confuse lambda expression with
434 * decl.c (reshape_init_r): Array copy.
435 (grokfndecl): Synthesized move constructor.
436 (cp_tree_node_structure): Lambda expression.
437 * method.c (use_thunk): Synthesized move constructor.
438 (do_build_copy_constructor): Likewise.
439 (locate_copy): Likewise.
440 (implicitly_declare_fn): Likewise.
441 * cp-objcp-common.c (cp_tree_size): Handle LAMBDA_EXPR.
442 * error.c (dump_aggr_type): Recognize lambda type.
443 (dump_function_decl): Recognize lambda function.
444 (function_category): Likewise.
445 (dump_function_name): Hide lambda name.
446 * tree.c (build_array_copy, move): New.
447 (special_function_p): Synthesized move constructor.
448 (no_linkage_check): Handle lambdas.
449 * search.c (lookup_fnfields_1): Synthesized move constructor.
450 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr):
451 Handle VEC_INIT_EXPR.
452 * typeck2.c (digest_init_r): Array copy.
453 * pt.c (get_template_info): Don't touch typedefs.
454 (instantiate_decl): Don't resubstitute artificial decls.
455 (tsubst_decl, tsubst, tsubst_copy_and_build): Handle lambdas.
456 (lookup_template_class): Don't fall back on name lookup.
457 * name-lookup.c (make_lambda_name): New.
458 (pushdecl_class_level): Handle default capture for lambda expressions.
459 (qualify_lookup): Handle decltypes within lambda expressions.
460 (pushtag): Handle ts_within_enclosing_non_class in function scope.
462 2009-09-28 Janis Johnson <janis187@us.ibm.com>
464 * mangle.c (write_builtin_type): Support decimal float types.
466 2009-09-28 Richard Henderson <rth@redhat.com>
468 * cp-objcp-common.h (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New.
470 2009-09-24 Jakub Jelinek <jakub@redhat.com>
472 * method.c (make_thunk, make_alias_for): Don't set
473 DECL_NO_STATIC_CHAIN.
474 * decl.c (builtin_function_1, grokfndecl): Likewise.
475 * lex.c (build_lang_decl): Likewise.
477 2009-09-23 Dodji Seketeli <dodji@redhat.com>
480 * decl.c (cp_finish_decl): Record the types used by the global
481 variable declaration we've just parsed.
483 2009-09-22 Dodji Seketeli <dodji@redhat.com>
485 * cp-lang.c (LANG_HOOKS_FUNCTION_PARAMETER_PACK_P,
486 LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P,
487 LANG_HOOKS_GET_GENERIC_FUNCTION_DECL): Initialize these
488 hooks for the c++ FE.
489 * cp-tree.h (function_parameter_pack_p, get_function_template_decl,
490 function_parameter_expanded_from_pack_p): Declare ...
491 * pt.c (function_parameter_pack_p, get_function_template_decl,
492 function_parameter_expanded_from_pack_p): ... new hooks.
493 (get_template_info): Make this more robust.
494 (template_args_variadic_p, make_ith_pack_parameter_name): Add a new
495 line between comment and function.
496 (get_template_argument_pack_elems): Fix comment.
497 (tsubst_decl): Arguments of function parameter packs are not
498 parameter packs themselves.
500 2009-09-21 Jason Merrill <jason@redhat.com>
503 * tree.c (trivial_type_p): Fix logic.
505 2009-09-21 Jason Merrill <jason@redhat.com>
507 * name-lookup.c (push_class_level_binding): Sanity check.
509 2009-09-18 Jason Merrill <jason@redhat.com>
511 * decl2.c (determine_visibility): Make anonymous types internal.
512 (mark_used): Complain about types without linkage used in
513 decls with internal linkage.
514 (vague_linkage_fn_p): Split out from...
515 * decl.c (maybe_commonize_var): ...here.
516 (grokdeclarator): Adjust linkage when a typedef gives linkage name.
517 * tree.c (no_linkage_check): Check the enclosing class and template
520 * cp-tree.h (TYPE_NAMESPACE_SCOPE_P): New.
522 * pt.c (get_pattern_parm): New.
523 (listify): Split out from...
524 (listify_autos): ...here.
525 (unify): Deduce std::initializer_list for T.
526 * call.c (build_over_call): Warn about it.
528 2009-09-17 Andrew Pinski <pinskia@gcc.gnu.org>
531 * typeck.c (cp_build_unary_op): Check TREE_CODE for bools instead of
533 (convert_for_assignment): Likewise.
534 * cvt.c (type_promotes_to): Likewise.
536 2009-09-14 Richard Henderson <rth@redhat.com>
537 Jakub Jelinek <jakub@redhat.com>
539 * cp-tree.h (finish_asm_stmt): Update decl.
540 * parser.c (cp_parser_asm_definition): Parse asm goto.
541 (cp_parser_asm_label_list): New.
542 * pt.c (tsubst_copy_asm_operands): Don't recurse on labels.
543 (tsubst_expr): Handle asm labels.
544 * semantics.c (finish_asm_stmt): Add and use labels parameter.
546 2009-09-14 Richard Henderson <rth@redhat.com>
548 * except.c (init_exception_processing): Don't call
549 default_init_unwind_resume_libfunc.
550 (cp_protect_cleanup_actions): Return the decl to call.
551 (build_exc_ptr): Use __builtin_eh_pointer.
552 * optimize.c (clone_body): Set eh_lp_nr, not eh_region.
554 2009-09-13 Richard Guenther <rguenther@suse.de>
555 Rafael Avila de Espindola <espindola@google.com>
557 * except.c (init_exception_processing): Do not set
558 lang_eh_runtime_type.
559 (choose_personality_routine): Do not set eh_personality_decl,
560 set pragma_java_exceptions.
561 * cp-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
562 (LANG_HOOKS_EH_PERSONALITY): Likewise.
563 (cp_eh_personality_decl): New.
564 (cp_eh_personality): Likewise.
565 * Make-lang.in (cp-lang.o): Add $(EXPR_H) and $(EXCEPT_H)
568 2009-09-13 Wei Guozhi <carrot@google.com>
571 * cp/optimize.c (build_delete_destructor_body): New function.
572 (maybe_clone_body): Call build_delete_destructor_body for
575 2009-09-10 Jason Merrill <jason@redhat.com>
577 * repo.c (extract_string, get_base_filename, init_repo): constify.
579 2009-09-09 Jason Merrill <jason@redhat.com>
581 * error.c (find_typenames_r): Also add decltypes.
583 2009-09-09 Paolo Carlini <paolo.carlini@oracle.com>
586 * decl2.c (grokfield): Check for explicit template argument lists.
588 2009-09-09 Jack Howarth <howarth@bromo.med.uc.edu>
591 * Make-lang.in: Remove redundant code from linkage for darwin10.
593 2009-09-08 Paolo Carlini <paolo.carlini@oracle.com>
596 * decl.c (build_init_list_var_init): Check return value of
597 perform_implicit_conversion.
599 2009-09-08 Jason Merrill <jason@redhat.com>
601 * class.c (currently_open_class): Make sure we're dealing with the
604 * cp-tree.h (enum overload_flags): Remove OP_FLAG.
605 * method.c (lazily_declare_fn): Check for dtorness in ABI warning.
607 * name-lookup.c (is_class_level): Remove.
608 (push_binding_level, leave_scope, resume_scope): Adjust.
609 (pushlevel_class): Adjust.
610 (poplevel_class): Make sure we're on class_binding_level.
612 * decl.c (grokmethod): Rename from start_method.
613 (finish_method): Remove.
615 * parser.c (cp_parser_save_member_function_body): Adjust.
617 2009-09-03 Doug Kwan <dougkwan@google.com>
619 * tree.c (cp_fix_function_decl_p): New.
620 (cp_free_lang_data): New.
622 2009-09-03 Diego Novillo <dnovillo@google.com>
624 * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H).
625 * decl2.c: Include pointer-set.h.
626 (collect_candidates_for_java_method_aliases): New.
627 (cp_write_global_declarations): Call it.
628 Add local variable CANDIDATES. If set, call
629 build_java_method_aliases.
630 (build_java_method_aliases): Add argument CANDIDATES.
631 Use it to determine if FNDECL should get a hidden alias.
632 * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define.
633 * cp-tree.h (cp_free_lang_data): Declare.
635 2009-09-03 Richard Guenther <rguenther@suse.de>
637 * method.c (use_thunk): Use cgraph_finalize_function to hand
638 off thunks to the cgraph.
639 * semantics.c (emit_associated_thunks): Do not emit thunks
640 for really extern functions.
642 2009-09-03 Diego Novillo <dnovillo@google.com>
644 * cp-lang.c (lang_hooks): Remove const qualifier.
646 2009-09-02 Jason Merrill <jason@redhat.com>
648 * semantics.c (describable_type): Don't pretend to be in a template.
650 * ptree.c (cxx_print_type) [DECLTYPE_TYPE]: Print the expression.
652 2009-09-01 Alexandre Oliva <aoliva@redhat.com>
654 * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New.
655 * cp-lang.c (cxx_dwarf_name): Pass it.
656 * error.c (count_non_default_template_args): Take flags as
657 argument. Adjust all callers. Skip counting of default
658 arguments if the new flag is given.
660 2009-09-01 Dodji Seketeli <dodji@redhat.com>
663 * pt.c (make_ith_pack_parameter_name): Don't use strnlen that is a
666 2009-09-01 Richard Guenther <rguenther@suse.de>
668 * cp-objcp-common.c (cp_expr_size): Use tree_expr_size.
669 * cp-objcp-common.h (LANG_HOOKS_EXPR_SIZE): Do not define.
671 2009-09-01 Richard Guenther <rguenther@suse.de>
673 * cp-objcp-common.h (LANG_HOOKS_MARK_ADDRESSABLE): Remove.
675 2009-08-31 Dodji Seketeli <dodji@redhat.com>
678 * cp-tree.h (get_template_info): Parameter should be const.
679 (CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): Fix typo.
680 (get_template_argument_pack_elems,
681 get_primary_template_innermost_parameters,
682 get_template_innermost_arguments, template_template_parameter_p):
684 * pt.c (get_template_argument_pack_elems,
685 get_template_innermost_parameters, get_template_innermost_arguments,
686 template_template_parameter_p):
687 ... New C++ front end implementation of new language hooks.
688 (primary_template_instantiation_p): New private helper.
689 (make_ith_pack_parameter_name): Use snprintf and strnlen instead of
691 (get_template_info): Const-ify parameter.
692 * cp-lang.c (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
693 LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
694 LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
695 LANG_HOOKS_GENERIC_TYPE_PARAMETER_DECL_P): Initialize these
696 interfaces for the C++ front-end.
698 2009-08-31 Jason Merrill <jason@redhat.com>
701 * parser.c (cp_parser_enum_specifier): Make sure the : is followed by a
702 type-specifier-seq before we commit.
704 2009-08-28 Richard Guenther <rguenther@suse.de>
707 * cp-gimplify.c (cp_genericize_r): Do not leak zero-sized stores
710 2009-08-27 Richard Guenther <rguenther@suse.de>
712 * class.c (build_vtbl_ref_1): Remove excess vertical space.
713 * Make-lang.in (CXX_TREE_H): Remove c-common.def dependency
714 tracked by $(TREE_H).
715 * semantics.c (expand_or_defer_fn): Zero DECL_SAVED_TREE.
717 2009-08-26 Jason Merrill <jason@redhat.com>
719 * call.c (build_builtin_candidate): Don't set LOOKUP_ONLYCONVERTING
720 if we're contextually converting to bool.
721 (build_conditional_expr): Likewise.
722 * typeck.c (condition_conversion): Likewise.
724 * call.c (build_conditional_expr): Fix logic errors.
725 (build_new_op): Remove dead COND_EXPR handling.
727 2009-08-24 Jason Merrill <jason@redhat.com>
729 * cp-tree.h (DECL_DEFERRED_FN): Remove.
730 (struct lang_decl_fn): Remove deferred flag.
731 * class.c (build_clone): Don't set it.
732 * decl2.c (note_vague_linkage_fn): Don't check or set it.
733 (mark_used): Don't check it.
734 * method.c (make_thunk, make_alias_for): Don't set it.
736 * decl2.c (mark_used): Streamline logic.
741 * cp-tree.h (DECL_ODR_USED): New macro.
742 (struct lang_decl_base): Add odr_used flag.
743 * decl.c (duplicate_decls): Propagate it. Use it for error.
744 * pt.c (register_specialization): Use it for error.
745 * decl2.c (mark_used): Use it as gating flag rather than TREE_USED.
746 (cp_write_global_declarations): Use it for error.
747 (tree_used_ok): Remove.
748 * cp-tree.h: Remove tree_used_ok.
749 * call.c (build_call_a): Don't call it.
750 * init.c (build_offset_ref): Likewise.
752 2009-08-21 Jakub Jelinek <jakub@redhat.com>
755 * tree.c (lvalue_p_1) <case CONST_DECL>: Return clk_none if
758 2009-08-19 Jason Merrill <jason@redhat.com>
762 * decl2.c (mark_used): Increment function_depth during synthesis.
763 * parser.c (cp_parser_default_argument): Not here.
765 2009-08-19 Jakub Jelinek <jakub@redhat.com>
767 * method.c (use_thunk): Call free_after_compilation after
768 assemble_end_function.
770 2009-08-17 Richard Guenther <rguenther@suse.de>
772 * decl.c (build_ptrmemfunc_type): Keep variant chain intact.
774 (finish_enum): Keep variant chain intact.
775 * tree.c (cp_build_reference_type): Likewise.
777 2009-08-16 Jason Merrill <jason@redhat.com>
779 Make TREE_USED match the [basic.def.odr] concept for FUNCTION_DECL
780 and VAR_DECL, so mark_used only has effect the first time.
781 * decl2.c (mark_used): Just return if TREE_USED is already set.
782 Don't set TREE_USED if cp_unevaluated_operand is set.
783 (tree_used_ok): New fn.
784 * init.c (build_offset_ref): Check it instead of TREE_USED.
785 * call.c (build_call_a): Likewise.
786 * cp-tree.h: Declare it.
787 (DECL_NO_LINKAGE_CHECKED): No longer needed.
788 (struct lang_decl_base): Remove no_linkage_checked bitfield.
790 * decl2.c (finish_static_data_member_decl): Don't set TREE_USED.
792 * decl2.c (mark_used): It's ok to synthesize for default args now.
794 2009-08-10 Jason Merrill <jason@redhat.com>
796 Implement DR 757: It's OK for a decl to use a type without linkage
797 so long as the decl is defined in the current translation unit.
798 * decl2.c (no_linkage_decls): New vector.
799 (mark_used): Add decls that use types with no linkage.
800 (cp_write_global_declarations): Check that they are defined.
801 (decl_defined_p, no_linkage_error): New fns.
802 * cp-tree.h (DECL_NO_LINKAGE_CHECKED): New macro.
803 (struct lang_decl_base): Add flag.
804 * decl.c (grokfndecl): Don't check type linkage.
805 (grokvardecl): If the type has no linkage, just make sure
806 DECL_LANG_SPECIFIC is set.
807 * pt.c (check_instantiated_arg): Don't check type linkage.
808 * name-lookup.c (is_local_extern): New fn.
809 * name-lookup.h: Declare it.
811 2009-08-05 Jason Merrill <jason@redhat.com>
814 * init.c (build_vec_init): Evaluate the initializer before
815 starting the initialization try block.
817 2009-08-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
820 * typeck.c (convert_for_assignment): Do not warn for any boolean
821 variant. Use explicit location.
823 2009-08-04 Dodji Seketeli <dodji@redhat.com>
826 * pt.c (tsubst_default_argument): Let access checks of the
827 default argument happen in the context of the current function.
829 2009-08-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
832 * call.c (build_new_op): Only try prefix operator if -fpermissive,
833 otherwise just error.
835 2009-08-04 Dodji Seketeli <dodji@redhat.com>
838 * error.c (lang_decl_name): Print qualified names for decls
841 2009-08-03 Jason Merrill <jason@redhat.com>
842 Jakub Jelinek <jakub@redhat.com>
845 * init.c (build_vec_init): Look through a TARGET_EXPR around a
848 2009-07-31 Jason Merrill <jason@redhat.com>
849 Douglas Gregor <doug.gregor@gmail.com>
851 Remove implicit binding of lvalues to rvalue references (N2831)
852 * call.c (convert_class_to_reference): Binding an lvalue to an
853 rvalue reference is bad. If the user-defined conversion is bad,
854 set bad_p before merging conversions.
855 (maybe_handle_ref_bind): Don't push down bad_p.
856 (reference_binding): Binding an lvalue to an rvalue reference is bad.
857 (convert_like_real): Give a helpful error about binding lvalue
859 (reference_related_p): No longer static.
860 * typeck.c (build_typed_address): New.
861 (build_static_cast_1): Add static_cast from lvalue to &&.
864 2009-07-31 Jason Merrill <jason@redhat.com>
866 * call.c (reference_binding): Rename lvalue_p to is_lvalue.
867 Do direct binding of "rvalues" in memory to rvalue references.
868 * tree.c (lvalue_p_1): Can't be both non-addressable lvalue and
870 * typeck.c (build_static_cast_1): Do direct binding of memory
871 "rvalues" to rvalue references.
872 * cvt.c (cp_fold_convert): New.
873 * cp-tree.h: Declare it.
875 2009-07-31 Jason Merrill <jason@redhat.com>
877 * typeck.c (build_address): Do fold away ADDR_EXPR of INDIRECT_REF.
878 * tree.c (rvalue): Use cp_build_qualified_type, not TYPE_MAIN_VARIANT.
880 2009-07-29 Jason Merrill <jason@redhat.com>
883 * cp-tree.h (enum tsubst_flags): Add tf_no_class_instantiations.
884 * error.c (count_non_default_template_args): Pass it.
885 * pt.c (tsubst) [TYPENAME_TYPE]: Don't complete type if it's set.
887 2009-07-29 Richard Guenther <rguenther@suse.de>
890 * cp-gimplify.c (cp_genericize_r): Properly walk the BIND_EXPR
893 2009-07-26 Simon Martin <simartin@users.sourceforge.net>
896 * decl.c (grokdeclarator): Do not set TREE_NO_WARNING for functions
897 with a qualified return type.
899 2009-07-24 Jason Merrill <jason@redhat.com>
902 * call.c (build_op_delete_call): If this is for a new-expression
903 and the op delete is deleted, do nothing.
906 * call.c (compare_ics): Give list-initialization of std::init_list
907 priority over conversion to scalar, too.
909 2009-07-22 Jason Merrill <jason@redhat.com>
911 * mangle.c (mangle_type_string_for_rtti): Rename to be clearer.
912 (needs_fake_anon): New.
913 (write_name): Check it.
914 (write_nested_name): Add a fake anonymous namespace scope if true.
915 * name-lookup.c (get_anonymous_namespace_name): No longer static.
916 * rtti.c, cp-tree.h: Adjust.
918 2009-07-22 Richard Guenther <rguenther@suse.de>
921 * cp-gimplify.c (cp_gimplify_expr): Move handling of using
923 (cp_genericize_r): ... genericization stage.
924 (cp_genericize): Adjust.
926 2009-07-21 Jason Merrill <jason@redhat.com>
929 * call.c (reference_binding): Implement binding to { }.
930 (initialize_reference): Binding temporary to non-const && is fine.
931 * decl.c (grok_reference_init): Remove error for CONSTRUCTOR.
933 * decl.c (reshape_init_r): { T } is not an aggregate initializer
936 2009-07-17 Richard Guenther <rguenther@suse.de>
939 * decl.c (finish_function): Do not emit unused result warnings
941 * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use
942 c_warn_unused_result_pass.
943 * semantics.c (expand_or_defer_fn): Adjust assertion about IL status.
944 * optimize.c (clone_body): Clone in GENERIC.
945 (maybe_clone_body): Do not clear DECL_SAVED_TREE.
946 * decl2.c (cp_write_global_declarations): Fix body test.
947 Do not call cgraph_optimize.
948 * Make-lang.in (optimize.o): Add tree-iterator.h dependency.
949 * method.c (use_thunk): Register thunk with
950 cgraph_finalize_function.
951 * error.c (function_category): Guard access of DECL_LANG_SPECIFIC.
953 2009-07-17 Richard Guenther <rguenther@suse.de>
955 * init.c (build_vec_delete_1): Do not set DECL_REGISTER on the
958 2009-07-17 Aldy Hernandez <aldyh@redhat.com>
959 Manuel López-Ibáñez <manu@gcc.gnu.org>
962 * typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c,
963 tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c,
964 call.c, cvt.c, mangle.c: Add location argument to
965 fold_{unary,binary,ternary}, fold_build[123], build_call_expr,
966 build_size_arg, build_fold_addr_expr, build_call_array,
967 non_lvalue, size_diffop, fold_build1_initializer,
968 fold_build2_initializer, fold_build3_initializer,
969 fold_build_call_array, fold_build_call_array_initializer,
970 fold_single_bit_test, omit_one_operand, omit_two_operands,
971 invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref,
972 fold_indirect_ref, combine_comparisons, fold_builtin_*,
973 fold_call_expr, build_range_check, maybe_fold_offset_to_address,
974 round_up, round_down.
976 2009-07-16 Jason Merrill <jason@redhat.com>
979 Split POD into "standard-layout" and "trivial" as per N2230,
980 Support std::is_standard_layout and std::is_trivial traits.
981 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_STD_LAYOUT,
983 (struct lang_type_class): Add non_std_layout.
984 (CLASSTYPE_NON_STD_LAYOUT): New.
985 * class.c (check_bases): Set it.
986 (check_field_decls): Likewise.
987 (check_bases_and_members): Likewise.
988 * parser.c (cp_parser_primary_expression): Handle RID_IS_STD_LAYOUT,
990 (cp_parser_trait_expr): Likewise.
991 * semantics.c (trait_expr_value): Handle CPTK_IS_STD_LAYOUT,
993 (finish_trait_expr): Likewise.
994 * tree.c (scalarish_type_p, trivial_type_p, std_layout_type_p): New.
995 (pod_type_p): Use them.
996 (type_has_nontrivial_copy_init, type_has_nontrivial_default_init): New.
998 Adjust bits of the language that no longer refer to POD types.
999 * call.c (convert_arg_to_ellipsis): Use type_has_nontrivial_copy_init
1000 and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
1001 (build_x_va_arg): Likewise.
1002 (call_builtin_trap): Remove.
1003 * decl.c (declare_local_label): Use type_has_nontrivial_default_init
1004 and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
1005 (cp_finish_decl): Likewise.
1006 (check_previous_goto_1, check_goto): Adjust error.
1007 * typeck.c (build_class_member_access_expr): Check
1008 CLASSTYPE_NON_STD_LAYOUT rather than CLASSTYPE_NON_POD_P.
1010 2009-07-14 Taras Glek <tglek@mozilla.com>
1011 Rafael Espindola <espindola@google.com>
1013 * Make-lang.in: Added CP_PLUGIN_HEADERS and
1014 c.install-target to export cp-tree.h cxx-pretty-print.h
1015 name-lookup.h headers for plugins.
1017 2009-07-14 Jason Merrill <jason@redhat.com>
1020 * decl.c (decls_match): A non-extern-C declaration doesn't match
1021 a builtin extern-C declaration.
1024 * name-lookup.c (qualified_lookup_using_namespace): Don't stop
1025 looking in used namespaces just because we found something on
1029 * semantics.c (perform_koenig_lookup): Handle empty template args.
1031 * call.c (build_over_call): Use can_trust_pointer_alignment.
1033 2009-07-14 Dodji Seketeli <dodji@redhat.com>
1037 * decl2.c (grokfield): Don't call set_underlying_type on typedef
1038 decls that are type names.
1040 2009-07-13 Andrew Pinski <andrew_pinski@playstation.sony.com>
1043 * parser.c (cp_parser_elaborated_type_specifier): Accept typename in
1044 front of qualified names.
1046 2009-07-12 Jason Merrill <jason@redhat.com>
1049 * tree.c (rvalue): Use lvalue_or_rvalue_with_address_p.
1052 * cp-tree.h (enum cp_lvalue_kind_flags): Add clk_rvalueref.
1053 * tree.c (lvalue_p_1): Return it. Remove
1054 treat_class_rvalues_as_lvalues parm.
1055 (real_lvalue_p): Disallow pseudo-lvalues here.
1056 (lvalue_or_rvalue_with_address_p): New fn.
1057 * call.c (initialize_reference): Use it instead of real_lvalue_p.
1060 * init.c (build_new_1): Handle initializer list as array initializer.
1061 (build_vec_init): Likewise.
1062 * typeck.c (cp_build_modify_expr): Likewise.
1063 * typeck2.c (process_init_constructor_array): Error rather than abort
1064 if too many initializers.
1066 2009-07-10 Jakub Jelinek <jakub@redhat.com>
1069 * error.c (cp_print_error_function): Check for NULL block.
1071 2008-07-09 Simon Martin <simartin@users.sourceforge.net>
1072 Jason Merrill <jason@redhat.com>
1074 * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
1075 append_type_to_template_for_access_check_1): Use CLASS_TYPE_P.
1077 2009-07-09 Dodji Seketeli <dodji@redhat.com>
1080 * pt.c (type_unification_real): Use tsubst_template_arg instead
1081 of tsubst to substitute default template arguments.
1083 2009-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
1086 * init.c (build_new_1): Set TREE_NO_WARNING for compiler-generated
1088 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1091 2009-07-07 Jason Merrill <jason@redhat.com>
1094 * pt.c (tsubst_decl): Don't abort if we didn't change anything
1095 in a TEMPLATE_DECL's args.
1097 2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
1099 * semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by
1102 2009-07-07 Jason Merrill <jason@redhat.com>
1105 * decl.c (build_enumerator): Don't add enumerators for a
1106 scoped enum to the enclosing class.
1109 * decl.c (start_enum): Allow dependent underlying type.
1112 * decl.c (finish_enum): Finish scope even in a template.
1114 2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
1116 * init.c: Replace %J by an explicit location. Update all calls.
1118 * typeck2.c: Likewise.
1120 * name-lookup.c: Likewise.
1122 2009-07-06 Manuel López-Ibáñez <manu@gcc.gnu.org>
1124 * decl.c: Replace %H by an explicit location. Update all calls.
1125 * except.c: Likewise.
1126 * semantics.c: Likewise.
1127 * parser.c: Likewise.
1129 2009-07-06 Simon Martin <simartin@users.sourceforge.net>
1132 * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
1133 append_type_to_template_for_access_check_1): Use
1134 RECORD_OR_UNION_CODE_P.
1136 2009-07-04 Jason Merrill <jason@redhat.com>
1138 * pt.c (retrieve_specialization): Don't get confused by a
1139 using-declaration that brings in another instance of this template
1142 * ptree.c (cxx_print_type): Fix logic.
1144 * cp-tree.h (LANG_DECL_FN_CHECK): Fix non-checking version.
1147 * cp-tree.h (struct lang_decl_parm): New.
1148 (struct lang_decl): Add it.
1149 (LANG_DECL_PARM_CHECK): New.
1150 (DECL_PARM_INDEX): New.
1151 * decl2.c (parm_index): Remove.
1152 * lex.c (retrofit_lang_decl): Handle parms.
1153 (cxx_dup_lang_specific_decl): Likewise.
1154 * mangle.c (write_expression): Adjust.
1155 * tree.c (cp_tree_equal): Adjust.
1156 (decl_linkage): Only check DECL_COMDAT for functions and variables.
1157 * parser.c (cp_parser_parameter_declaration_list): Set
1159 * pt.c (iterative_hash_template_arg): Hash it.
1161 2009-07-03 Jason Merrill <jason@redhat.com>
1163 * cp-tree.h (struct lang_decl): Overhaul.
1164 (struct lang_decl_flags): Remove.
1165 (struct lang_decl_base): New.
1166 (struct lang_decl_min): New.
1167 (struct lang_decl_fn): New.
1168 (struct lang_decl_ns): New.
1169 (CAN_HAVE_FULL_LANG_DECL_P): Replace with LANG_DECL_HAS_MIN.
1170 (LANG_DECL_MIN_CHECK): New.
1171 (LANG_DECL_FN_CHECK): New.
1172 (LANG_DECL_NS_CHECK): New.
1173 (STRIP_TEMPLATE): New.
1174 (NON_THUNK_FUNCTION_CHECK): Remove.
1175 (DECL_DECLARES_FUNCTION_P): New.
1177 * lex.c (retrofit_lang_decl, cxx_dup_lang_specific_decl): Adjust.
1178 * decl.c (push_local_name, duplicate_decls): Adjust.
1179 * decl2.c (start_objects): Don't set u2sel.
1180 * semantics.c (finish_omp_threadprivate): Adjust.
1181 * class.c (build_clone): Don't do much on TEMPLATE_DECLs.
1182 (decl_cloned_function_p): Out-of-line implementation of macros.
1183 (clone_function_decl, adjust_clone_args): Use DECL_CLONED_FUNCTION_P.
1184 * mangle.c (write_unqualified_name): Don't check function flags
1186 * method.c (make_alias_for): Don't set DECL_CLONED_FUNCTION.
1187 * pt.c (build_template_decl): Don't set function flags.
1188 (check_default_tmpl_args): Check that it's a function.
1189 (instantiate_template): Use DECL_ABSTRACT_ORIGIN to find the
1192 * pt.c (tsubst_decl) [FUNCTION_DECL]: Don't tsubst
1193 DECL_CLONED_FUNCTION.
1195 * cp-tree.h (struct lang_type_class): Move sorted_fields here.
1196 * class.c (finish_struct_1): Adjust.
1197 * ptree.c (cxx_print_decl, cxx_print_type): Adjust.
1198 * search.c (lookup_field_1): Adjust.
1200 * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Remove.
1201 * decl.c (finish_method): Don't add to it.
1202 * class.c (fixup_pending_inline): Remove.
1203 (fixup_inline_methods): Remove.
1204 (finish_struct_1): Don't call it.
1206 * error.c (dump_function_name): Handle null name.
1208 2009-07-02 Mark Mitchell <mark@codesourcery.com>
1210 * typeck.c (cp_build_binary_op): Move warnings about use of NULL
1211 in arithmetic earlier and allow comparisions of NULL with
1212 pointers-to-members.
1214 2009-07-02 Jason Merrill <jason@redhat.com>
1216 Use hash tables for template specialization lookup.
1217 * pt.c (struct spec_entry): New type.
1218 (decl_specializations, type_specializations): New hash tables.
1219 (register_specialization, retrieve_specialization): Use them.
1220 (reregister_specialization, lookup_template_class): Use them.
1221 (eq_specializations, hash_tmpl_and_args, hash_specialization): New.
1222 (iterative_hash_template_arg): New.
1223 (init_template_processing): New
1224 (process_partial_specialization): Don't look to see if we already
1225 have this partial specialization.
1226 (maybe_process_partial_specialization): Handle reassigning
1227 full specializations when we get an explicit specialization
1228 of the partial instantiation.
1229 (tsubst_friend_function): Adjust specialization reassignment code.
1230 (instantiate_template): Only do one lookup.
1231 (instantiate_decl): Don't do any lookup.
1232 * cp-tree.h: Declare init_template_processing.
1233 * decl.c (duplicate_decls): Pass args to reregister_specialization.
1235 2009-07-01 Jason Merrill <jason@redhat.com>
1237 * cp-tree.h (DECL_CLASS_TEMPLATE_P): Use DECL_IMPLICIT_TYPEDEF_P.
1239 * pt.c (register_specialization): Use duplicate_decls to merge
1240 the argument with a previous specialization.
1241 (check_explicit_specialization): Call register_specialization to
1242 merge the TEMPLATE_DECL with a previous version.
1243 (determine_specialization): Return the args even if fn is a template.
1245 2009-07-01 Ian Lance Taylor <iant@google.com>
1247 * g++spec.c (lang_specific_driver): Bump num_args by 1.
1249 2009-06-30 Jason Merrill <jason@redhat.com>
1252 * pt.c (tsubst_pack_expansion): Handle unexpanded packs in an
1253 EXPR_PACK_EXPANSION.
1255 2009-06-29 Jason Merrill <jason@redhat.com>
1258 * error.c (dump_template_parms): Pass all args to
1259 count_non_default_template_args.
1260 (count_non_default_template_args): Pull out the inner ones.
1262 2009-06-26 H.J. Lu <hongjiu.lu@intel.com>
1264 * decl.c (duplicate_decls): Re-indent.
1266 2009-06-25 Ian Lance Taylor <iant@google.com>
1268 * call.c (avoid_sign_compare_warnings): New static function.
1269 (build_new_op): Call it.
1270 * typeck.c (cp_build_binary_op): Don't call warn_sign_compare if
1271 TREE_NO_WARNING is set on either operand.
1273 2009-06-25 Ian Lance Taylor <iant@google.com>
1275 * g++spec.c (SKIPOPT): define.
1276 (lang_specific_driver): Handle -static-libstdc++. Only add
1277 LIBSTDCXX_STATIC if we add LIBSTDCXX.
1279 2009-06-25 Ian Lance Taylor <iant@google.com>
1281 * cvt.c (convert_to_void): Only warn about COND_EXPR if neither
1282 the second nor third operand has side effects.
1284 2009-06-25 Ian Lance Taylor <iant@google.com>
1286 * parser.c (cp_parser_binary_expression): Increment
1287 c_inhibit_evaluation_warnings while parsing the right hand side of
1288 "true || x" or "false && x".
1289 * typeck.c (cp_build_binary_op): Only call warn_for_sign_compare
1290 if c_inhibit_evaluation_warnings is zero.
1292 2009-06-24 Jason Merrill <jason@redhat.com>
1294 * error.c (dump_decl): Do say "typedef" for the injected class name.
1296 * pt.c (lookup_template_class): Use currently_open_class,
1297 compare template args later.
1300 * decl.c (decls_match): Check DECL_TI_TEMPLATE too.
1301 * class.c (resolve_address_of_overloaded_function): Fix typo.
1303 2009-06-18 Aldy Hernandez <aldyh@redhat.com>
1305 * class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.
1306 * decl.c (finish_decl): Remove.
1307 (declare_global_var): Replace finish_decl with cp_finish_decl.
1308 (start_method): Same.
1309 * rtti.c (emit_tinfo_decl): Same.
1310 * pt.c (tsubst_expr): Same.
1311 (instantiate_decl): Same.
1312 * decl2.c (grokbitfield): Same.
1313 * name-lookup.c (pushdecl_top_level_1): Same.
1314 * cp-tree.h: Remove finish_decl.
1316 2009-06-16 David Edelsohn <edelsohn@gnu.org>
1318 * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL.
1319 (lang_specific_driver): Always allocate extra argument.
1320 Add LIBSTDCXX_STATIC to arglist if defined and linking
1323 2009-06-16 Ian Lance Taylor <iant@google.com>
1325 * Make-lang.in (cp/class.o): Depend upon gt-cp-class.h.
1326 (cp/semantics.o): Depend upon gt-cp-semantics.h.
1328 2009-06-16 Ian Lance Taylor <iant@google.com>
1330 * parser.c (cp_unevaluated_operand): Define global variable.
1331 (cp_parser_question_colon_clause): Increment
1332 c_inhibit_evaluation_warnings when evaluating an expression which
1333 will never be executed.
1334 (cp_parser_decltype): Increment cp_unevaluated_operand and
1335 c_inhibit_evaluation_warnings, not skip_evaluation.
1336 (cp_parser_sizeof_operand): Likewise.
1337 (cp_parser_enclosed_template_argument_list): Save
1338 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
1340 * cp-tree.h (struct saved_scope): Remove skip_evaluation field.
1341 Add unevaluated_operand and inhibit_evaluation_warnings fields.
1342 (cp_unevaluated_operand): Declare.
1343 * name-lookup.c (push_to_top_level): Save cp_unevaluated_operand
1344 and c_inhibit_evaluation_warnings rather than skip_evaluation.
1345 (pop_from_top_level): Restore cp_unevaluated_operand and
1346 c_inhibit_evaluation_warnings rather than skip_evaluation.
1347 * class.c (build_base_path): Check cp_unevaluated_operand rather
1348 than skip_evaluation.
1349 * typeck.c (build_class_member_access_expr): Likewise.
1350 (cp_build_binary_op): Don't warn about bad shift counts if
1351 c_inhibit_evaluation_warnings is non-zero.
1352 * pt.c (coerce_template_parms): Save state of
1353 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
1355 (tsubst_aggr_type): Likewise.
1356 (tsubst_pack_expansion): Check cp_unevaluated_operand rather than
1358 (tsubst_copy): Likewise.
1359 (tsubst): Set cp_unevaluated_operand and
1360 c_inhibit_evaluation_warnings, not skip_evaluation.
1361 (tsubst_copy_and_build): Likewise.
1362 * call.c (convert_arg_to_ellipsis): Check cp_unevaluated_operand
1363 rather than skip_evaluation.
1364 * decl2.c (mark_used): Likewise.
1365 * semantics.c (finish_non_static_data_member): Likewise.
1366 * cvt.c (cp_convert_and_check): Check
1367 c_inhibit_evaluation_warnings rather than skip_evaluation.
1368 * mangle.c (write_type): Set cp_unevaluated_operand rather than
1371 2009-06-15 Ian Lance Taylor <iant@google.com>
1373 * parser.c (cp_parser_direct_declarator): Add braces around
1374 variables declared before label.
1376 2009-06-15 Rafael Avila de Espindola <espindola@google.com>
1378 * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove.
1379 * cp-tree.h (cxx_comdat_group): Change signature.
1380 * decl.c (duplicate_decls): Use DECL_COMDAT_GROUP.
1381 (cxx_comdat_group): Change signature.
1382 * decl2.c (comdat_linkage, maybe_make_one_only): Update call to
1384 (constrain_visibility, get_guard): Use DECL_COMDAT_GROUP.
1385 * method.c (use_thunk): Update call to make_decl_one_only.
1386 * optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP
1388 2009-06-12 Aldy Hernandez <aldyh@redhat.com>
1390 * typeck.c (cp_build_binary_op): Pass location to overflow_warning.
1391 (build_modify_expr): New arg.
1392 * semantics.c (finish_unary_op_expr): Pass location to
1394 (handle_omp_for_class_iterator): Pass location to build_modify_expr.
1395 * typeck.c (cxx_sizeof_or_alignof_type): Pass location to
1396 c_sizeof_or_alignof_type.
1397 (build_array_ref): New argument.
1398 (build_compound_expr): Same.
1399 (build_const_cast): Same.
1400 (build_ptrmemfunc): Pass location to build_c_cast.
1401 * init.c (avoid_placement_new_aliasing): Pass location to
1403 (build_vec_delete_1): Pass location to cp_build_modify_expr,
1404 build_compound_expr.
1405 * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
1406 * decl.c (poplevel): Pass location to c_build_bind_expr.
1407 (finish_case_label): Pass location to build_case_label.
1408 (finish_constructor_body): Same.
1409 (finish_destructor_body): Pass location to build_stmt.
1410 (cxx_maybe_build_cleanup): Same, but to build_compound_expr.
1411 * call.c (build_new_op): Pass location to build_array_ref.
1412 (build_x_va_arg): Pass location to build_va_arg.
1413 * except.c (expand_end_catch_block): Pass location to
1415 * cp-tree.h (build_array_ref): New argument.
1416 (build_compound_expr): Same.
1417 (build_c_cast): Same.
1418 * cp-gimplify.c (gimplify_if_stmt): Pass location on down.
1419 (gimplify_switch_stmt): Same.
1420 * typeck2.c (split_nonconstant_init_1): Same.
1421 * pt.c (tsubst_copy): Same.
1422 * semantics.c (add_decl_expr): Same.
1423 (do_poplevel): Same.
1424 (push_cleanup): Same.
1425 (finish_goto_stmt): Same.
1426 (finish_expr_stmt): Same.
1427 (begin_if_stmt): Same.
1428 (begin_while_stmt): Same.
1429 (begin_do_stmt): Same.
1430 (finish_return_stmt): Same.
1431 (begin_for_stmt): Same.
1432 (finish_break_stmt): Same.
1433 (finish_continue_stmt): Same.
1434 (begin_switch_stmt): Same.
1435 (begin_try_block): Same.
1436 (begin_handler): Same.
1437 (finish_asm_stmt): Same.
1438 (finish_label_stmt): Same.
1439 (finish_stmt_expr_expr): Same.
1440 (finalize_nrv_r): Same.
1441 (finish_omp_atomic): Same.
1442 * name-lookup.c (do_using_directive): Same.
1443 * decl2.c (grok_array_decl): Same.
1444 * parser.c (cp_parser_cast_expression): Same.
1445 (cp_parser_selection_statement): Same.
1446 (cp_parser_implicitly_scoped_statement): Same.
1447 (cp_parser_objc_selector_expression): Same.
1448 (cp_parser_objc_synchronized_statement): Same.
1449 (cp_parser_objc_throw_statement): Same.
1450 (cp_parser_omp_critical): Same.
1451 (cp_parser_omp_master): Same.
1452 * typeck.c (build_function_call): Add location argument.
1453 * init.c: Add location argument to all build_decl calls.
1459 * semantics.c: Same.
1462 * cp-gimplify.c: Same.
1464 (cp_make_fname_decl): Add location argument. Pass location ot
1466 (finish_case_label): Same.
1467 * cp-tree.h (finish_case_label): Add location argument.
1468 * parser.c (cp_parser_label_for_labeled_statement): Pass location to
1471 2009-06-09 Jason Merrill <jason@redhat.com>
1474 * decl2.c (mark_used): Return after complaining about deleted fn.
1476 2009-06-08 Jason Merrill <jason@redhat.com>
1478 * parser.c (cp_parser_type_id_1): 'auto' type is ok with a
1479 late-specified return type.
1481 2009-06-08 Jakub Jelinek <jakub@redhat.com>
1484 * call.c (check_dtor_name): Return false even if
1485 get_type_value (name) is error_mark_node.
1489 * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
1490 on error_mark_node. Check for VLAs outside of function context
1491 before check whether to wrap bounds into a NOP_EXPR with
1494 2009-06-08 Alexandre Oliva <aoliva@redhat.com>
1496 * repo.c (get_base_filename): Use aux_base_name rather than
1497 alternate temporary file during second compare debug compilation.
1498 (finish_repo): Skip during -fcompare-debug-second.
1500 2009-06-06 Ian Lance Taylor <iant@google.com>
1502 * parser.c (cp_parser_label_for_labeled_statement): Support
1503 attribute on labels if immediately followed by semicolon.
1504 * semantics.c (finish_label_stmt): Return new label.
1505 * pt.c (tsubst_expr): Handle attributes for LABEL_EXPR.
1507 2009-06-03 Ian Lance Taylor <iant@google.com>
1509 * Make-lang.in (cc1plus-checksum.o): Depend upon $(CONFIG_H) and
1512 2009-06-02 Mark Mitchell <mark@codesourcery.com>
1514 * decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
1516 2009-06-02 Jason Merrill <jason@redhat.com>
1520 * typeck.c (cp_build_modify_expr): Always pass init-lists to the
1522 * call.c (implicit_conversion): Allow init-list conversion to scalar
1523 during direct-initialization, too. Mark the conversion bad if it
1524 has too many levels of braces.
1525 (convert_like_real): And give a helpful error.
1529 * decl.c (cp_finish_decl): Handle auto deduction from ().
1530 * typeck.c (build_x_indirect_ref): Handle dereferencing an operand
1531 with dependent type that is known to be a pointer.
1533 2009-06-02 Simon Martin <simartin@users.sourceforge.net>
1536 * pt.c (register_specialization): Properly setup DECL_CONTEXT for
1537 specializations in an invalid namespace.
1539 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
1541 * error.c (print_instantiation_partial_context): Print column
1544 2009-05-29 Ian Lance Taylor <iant@google.com>
1546 * error.c (cp_printer): Don't use va_arg with enum type.
1548 2009-05-28 Dodji Seketeli <dodji@redhat.com>
1551 * cp-tree.h (canonical_type_variant): Remove this function declaration.
1552 (strip_typedefs): New function declaration.
1553 * tree.c (strip_typedefs): New function definition.
1554 (canonical_type_variant): Remove function definition.
1555 * cvt.c (convert_from_reference): No need to use
1556 canonical_type_variant.
1557 * typeck.c (cp_build_indirect_ref): Likewise.
1558 * error.c (dump_template_bindings): Use strip_typedefs instead of
1559 canonical_type_variant.
1560 * pt.c (convert_template_argument, unify): Likewise.
1561 * mangle.c (canonicalize_for_substitution): Don't use
1562 canonical_type_variant.
1564 2009-05-27 Jason Merrill <jason@redhat.com>
1566 * call.c (implicit_conversion): Handle conversion from
1567 initializer-list to scalar.
1568 (convert_like_real): Likewise. Avoid crashing on list
1569 initialization with bad conversions.
1570 (can_convert): Use LOOKUP_EXPLICIT.
1571 (can_convert_arg_bad): Add flags parm.
1572 * cp-tree.h: Adjust.
1573 * typeck.c (convert_for_assignment): Pass flags.
1575 2009-05-27 Ian Lance Taylor <iant@google.com>
1577 * Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
1578 (cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
1580 2009-05-26 Ian Lance Taylor <iant@google.com>
1582 * Make-lang.in (g++spec.o): Use $(COMPILER).
1583 (g++$(exeext), cc1plus-dummy$(exeext)): Likewise.
1584 (cc1plus$(exeext)): Likewise.
1586 2009-05-26 Dodji Seketeli <dodji@redhat.com>
1589 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Remove this accessor.
1590 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): New accessor.
1591 (get_types_needing_access_check): Declare new entry point.
1592 * pt.c (append_type_to_template_for_access_check_1,
1593 get_types_needing_access_check): New functions.
1594 (perform_typedefs_access_check): Accept FUNCTION_DECLs and
1595 RECORD_TYPEs rather than TEMPLATE_DECLs. Use the new
1596 get_types_needing_access_check, no more
1597 MEMBER_TYPES_NEEDING_ACCESS_CHECK.
1598 (instantiate_class_template): Set input_location to the source
1599 location of the most specialized template definition.
1600 Perform access check using the RECORD_TYPE of the template, not its
1601 associated most generic TEMPLATE_DECL.
1602 (append_type_to_template_for_access_check): Augment function
1603 comments. Use the new get_types_needing_access_check, not
1604 MEMBER_TYPE_NEEDING_ACCESS_CHECK. Use the new
1605 append_type_to_template_for_access_check_1 subroutine.
1607 2009-05-22 Jason Merrill <jason@redhat.com>
1610 * typeck.c (cp_build_binary_op): Allow ENUMERAL_TYPE in
1611 arithmetic comparisons.
1612 (cp_common_type): Handle scoped enums.
1614 * call.c (promoted_arithmetic_type_p): Don't use INTEGRAL_TYPE_P.
1615 (add_builtin_candidate, add_builtin_candidates): Likewise.
1616 (convert_like_real): Likewise.
1617 * class.c (check_bitfield_decl): Likewise.
1618 * decl.c (check_static_variable_definition): Likewise.
1619 (compute_array_index_type): Likewise.
1620 * decl2.c (grokbitfield): Likewise.
1621 * init.c (build_new_1): Likewise.
1622 * pt.c (convert_nontype_argument): Likewise.
1623 (current_instantiation): Likewise.
1624 * tree.c (pod_type_p): Likewise.
1625 * typeck.c (build_static_cast_1): Likewise.
1626 (build_reinterpret_cast_1): Likewise.
1628 2009-05-22 Richard Guenther <rguenther@suse.de>
1631 * init.c (avoid_placement_new_aliasing): Remove.
1632 (build_new_1): Do not call it.
1634 2009-05-22 Mark Mitchell <mark@codesourcery.com>
1636 * decl2.c (decl_needed_p): Consider dllexport'd functions needed.
1637 * semantics.c (expand_or_defer_fn): Similarly.
1639 2009-05-20 Ian Lance Taylor <iant@google.com>
1641 * parser.c (cp_parser_postfix_expression): Change args to a vec.
1642 Release it when done.
1643 (tree_vector): Define typedef. Define VEC functions.
1644 (cp_parser_parenthesized_expression_list): Change return type to
1645 vec. Change all callers.
1646 (cp_parser_new_expression): Change placement and initializer to
1647 vecs. Release them when done.
1648 (cp_parser_new_placement): Change return type to vec. Change all
1650 (cp_parser_new_initializer): Likewise.
1651 * typeck.c (build_function_call_vec): Just call
1652 cp_build_function_call_vec.
1653 (cp_build_function_call): Just build a vec and call
1654 cp_build_function_call_vec.
1655 (cp_build_function_call_vec): New function based on old
1656 cp_build_function_call.
1657 (convert_arguments): Remove nargs and argarray parameters. Change
1658 values to a vec. Change caller.
1659 (build_x_compound_expr_from_vec): New function.
1660 (cp_build_modify_expr): Build vec to pass to
1661 build_special_member_call.
1662 * call.c (struct z_candidate): Add first_arg field. Change args
1664 (convert_class_to_reference): Handle first argument separately.
1665 (add_candidate): Add first_arg parameter. Change args parameter
1666 to vec. Change all callers.
1667 (add_function_candidate, add_conv_candidate): Likewise.
1668 (add_template_candidate_real, add_template_candidate): Likewise.
1669 (add_template_conv_candidate): Likewise.
1670 (build_user_type_conversion_1): Handle first argument separately.
1671 (resolve_args): Change return type and parameter type to vecs.
1673 (perform_overload_resolution): Change args parameter to vec.
1675 (build_new_function_call, build_operator_new_call): Likewise.
1676 (add_candidates): Likewise.
1677 (build_op_call): New globally visible function, built from and
1678 replacing static function build_object_call.
1679 (build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
1681 (build_op_delete_call): Build vec to pass to
1682 cp_build_function_call_vec.
1683 (build_temp): Build vec to pass to build_special_member_call.
1684 (convert_like_real): Likewise.
1685 (perform_direct_initialization_if_possible): Likewise.
1686 (build_over_call): Handle first_arg field. Use build_call_array
1687 rather than build_call_list.
1688 (build_special_member_call): Change args parameter to vec. Change
1690 (build_new_method_call): Likewise.
1691 * init.c (expand_default_init): Change parms to vec.
1692 (build_raw_new_expr): Change placement and init to vecs. Change
1694 (build_new_1, build_new): Likewise.
1695 * class.c (resolve_address_of_overloaded_function): Build array to
1696 pass to fn_type_unification.
1697 * pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
1698 build_new. For CALL_EXPR create a vec rather than a tree_list;
1699 expand a pack if necessary.
1700 (fn_type_unification): Change args parameter to const tree *. Add
1701 nargs parameter. Change all callers.
1702 (type_unification_real): Likewise.
1703 (unify): Build array to pass to type_unification_real.
1704 (get_bindings): Build array to pass to fn_type_unification.
1705 (any_type_dependent_arguments_p): Change args parameter to a vec.
1707 (make_args_non_dependent): Renamed from build_non_dependent_args.
1708 Change return type to void. Change parameter type to vec. Change
1710 (do_auto_deduction): Pass an array to type_unification_real.
1711 * semantics.c (perform_koenig_lookup): Change args to vec. Change
1713 (finish_call_expr): Change args to vec. Change all callers. Call
1714 build_op_call instead of passing CALL_EXPR to build_new_op.
1715 (cxx_omp_create_clause_info): Allocate vec to pass to
1716 build_special_member_call.
1717 * decl2.c (build_offset_ref_call_from_tree): Change args parameter
1718 to vec. Change all callers.
1719 * name-lookup.c (lookup_function_nonclass): Likewise.
1720 (struct arg_lookup): Change args to vec.
1721 (arg_assoc_namespace): Handle args as a vec.
1722 (arg_assoc_args_vec): New static function.
1723 (lookup_arg_dependent): Change args parameter to vec. Change all
1725 * method.c (do_build_assign_ref): Allocate vec to pass to
1726 build_special_member_call.
1727 * except.c (build_throw): Likewise.
1728 * typeck2.c (build_functional_cast): Likewise.
1729 * cvt.c (ocp_convert): Likewise.
1730 * tree.c (build_min_non_dep_call_vec): Change last parameter to
1731 vec. Change all callers.
1732 * cp-tree.h: Update declarations.
1733 * name-lookup.h: Update declarations.
1735 2009-05-20 Sandra Loosemore <sandra@codesourcery.com>
1737 * typeck.c (default_conversion): Check targetm.promoted_type.
1738 * decl.c (grokdeclarator): Check targetm.invalid_return_type.
1739 (grokparms): Check targetm.invalid_parameter_type.
1740 * cvt.c (ocp_convert): Check targetm.convert_to_type.
1741 (build_expr_type_conversion): Check targetm.promoted_type.
1743 2009-05-19 Andrew Pinski <andrew_pinski@playstation.sony.com>
1745 * typeck.c (build_binary_op): Allow % on integal vectors.
1747 2009-05-18 Jason Merrill <jason@redhat.com>
1749 Implement explicit conversions ops as specified in N2437.
1750 * decl.c (grokdeclarator): Handle explicit conversion ops.
1751 (check_initializer): Pass flags to store_init_value.
1752 * decl2.c (maybe_emit_vtables): Likewise.
1753 * init.c (expand_aggr_init_1): Likewise.
1754 * call.c (convert_class_to_reference): Take flags parm,
1755 check DECL_NONCONVERTING_P.
1756 (build_user_type_conversion_1): Check DECL_NONCONVERTING_P.
1757 (add_builtin_candidates): Simplify getting type of conversion.
1758 (build_object_call): Likewise. Check DECL_NONCONVERTING_P.
1759 (implicit_conversion): Pass through LOOKUP_ONLYCONVERTING.
1760 (reference_binding): Take flags parm. Direct-initialize copy parm.
1761 (add_function_candidate): Direct-initialize the copy parm.
1762 (add_conv_candidate): Use LOOKUP_IMPLICIT, not LOOKUP_NORMAL.
1763 (build_builtin_candidate): Add LOOKUP_ONLYCONVERTING.
1764 (conditional_conversion): Likewise.
1765 (convert_like_real): Only complain about DECL_NONCONVERTING_P
1767 (perform_implicit_conversion_flags): Add flags parm to
1768 perform_implicit_conversion. Improve diagnostics.
1769 * cp-tree.h (LOOKUP_IMPLICIT): New macro.
1770 (LOOKUP_COPY_PARM): New bit macro.
1771 * cvt.c (build_expr_type_conversion): Check DECL_NONCONVERTING_P.
1772 * typeck.c (convert_for_assignment): Take flags parm, pass it to
1773 perform_implicit_conversion_flags.
1774 (cp_build_modify_expr): Pass flags to convert_for_assignment.
1775 (convert_for_initialization): Likewise.
1776 * typeck2.c (store_init_value): Take flags parm, pass to
1778 (digest_init_flags): Add flags parm to digest_init.
1779 (digest_init_r): Take flags parm, pass to convert_for_initialization.
1780 (process_init_constructor_array): Pass it.
1781 (process_init_constructor_record): Likewise.
1782 (process_init_constructor_union): Likewise.
1784 2009-05-16 Jason Merrill <jason@redhat.com>
1787 * pt.c (tsubst_qualified_id): Retain the type if we aren't dealing
1788 with a dependent type. Actually look up the destructor.
1789 * semantics.c (finish_id_expression): Fix logic.
1790 (finish_qualified_id_expr): Don't try to use 'this' if we aren't in
1792 * typeck.c (build_x_unary_op): Diagnose taking the address of a
1793 constructor or destructor.
1794 * tree.c (get_first_fn): Handle OFFSET_REF.
1796 2009-05-17 Joseph Myers <joseph@codesourcery.com>
1798 * tree.c (cxx_printable_name_internal): Allow consecutive
1799 translated and untranslated cached copies of the name of the
1802 2009-05-15 Ian Lance Taylor <iant@google.com>
1804 * cp-tree.h (enum cp_lvalue_kind_flags): Rename from
1805 cp_lvalue_kind. Change all uses.
1806 (enum base_access_flags): Rename from enum base_access. Change
1808 * parser.c (enum cp_parser_flags): Remove enum tag.
1810 2009-05-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
1813 * call.c (build_new_op): Update calls to warn_logical_operator.
1815 2009-05-14 Ian Lance Taylor <iant@google.com>
1817 * class.c (layout_class_type): Change itk to unsigned int.
1818 * decl.c (finish_enum): Change itk to unsigned int.
1819 * parser.c (cp_parser_check_decl_spec): Change ds to int. Remove
1822 2009-05-13 David Mandelin <dmandelin@mozilla.com>:
1824 * decl.c (duplicate_decls): Preserve parameter attributes.
1826 2009-05-10 Jan Hubicka <jh@suse.cz>
1828 * decl2.c (cxx_callgraph_analyze_expr): Use
1829 cgraph_mark_address_taken.
1831 2009-05-10 Joseph Myers <joseph@codesourcery.com>
1833 * call.c (name_as_c_string): Call type_as_string_translate.
1834 Translate identifiers to locale character set.
1835 * cp-tree.h (lang_decl_name): Update prototype.
1836 (type_as_string_translate, decl_as_string_translate,
1837 cxx_printable_name_translate): Declare.
1838 * cxx-pretty-print.c (M_): Define.
1839 (pp_cxx_unqualified_id, pp_cxx_canonical_template_parameter): Mark
1840 English fragments for conditional translation with M_.
1841 * decl.c (grokdeclarator): Translate identifiers to locale
1842 character set for diagnostics.
1843 * error.c (M_): Define.
1844 (dump_template_bindings, dump_type, dump_aggr_type,
1845 dump_type_prefix, dump_global_iord, dump_simple_decl, dump_decl,
1846 dump_function_decl, dump_template_parms, dump_expr,
1847 dump_binary_op, op_to_string, assop_to_string): Mark English
1848 fragments for conditional translation with M_.
1849 (type_as_string): Disable translation of identifiers.
1850 (type_as_string_translate): New.
1851 (expr_as_string): Disable translation of identifiers.
1852 (decl_as_string): Disable translation of identifiers.
1853 (decl_as_string_translate): New.
1854 (lang_decl_name): Add parameter translate.
1855 (args_to_string): Call type_as_string_translate.
1856 (cp_print_error_function): Call cxx_printable_name_translate.
1857 (print_instantiation_full_context,
1858 print_instantiation_partial_context): Call
1859 decl_as_string_translate.
1860 * parser.c (cp_lexer_get_preprocessor_token): Use %qE for
1861 identifier in diagnostic.
1862 * tree.c (cxx_printable_name): Change to
1863 cxx_printable_name_internal. Add parameter translate.
1864 (cxx_printable_name, cxx_printable_name_translate): New wrappers
1865 round cxx_printable_name_internal.
1867 2009-05-08 H.J. Lu <hongjiu.lu@intel.com>
1870 * call.c (build_call_a): Updated warn_deprecated_use call.
1871 (build_over_call): Likewise.
1872 * decl.c (grokdeclarator): Likewise.
1873 (grokparms): Likewise.
1874 * semantics.c (finish_id_expression): Likewise.
1875 * typeck.c (build_class_member_access_expr): Likewise.
1876 (finish_class_member_access_expr): Likewise.
1878 2009-05-06 Dodji Seketeli <dodji@redhat.com>
1881 * pt.c (tsubst_copy) <case PARM_DECL>: We don't want to tsubst the
1882 whole list of PARM_DECLs, just the current one.
1884 2009-05-05 Shujing Zhao <pearly.zhao@oracle.com>
1887 (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
1888 mangle_compound_literal): Remove unused declarations.
1889 (build_vfield_ref, cxx_print_statistics, clone_function_decl,
1890 adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
1891 pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
1892 check_for_out_of_scope_variable, print_other_binding_stack,
1893 maybe_push_decl, cxx_mark_addressable, force_target_expr,
1894 build_target_expr_with_type, finish_case_label,
1895 cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
1896 check_template_keyword, cxx_omp_predetermined_sharing,
1897 cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
1898 cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
1899 cxx_omp_privatize_by_reference): Rearrange the declarations line to
1900 match the comment that indicates the .c file which the functions are
1902 (cxx_print_xnode, cxx_print_decl, cxx_print_type,
1903 cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
1905 2009-05-05 Nathan Sidwell <nathan@codesourcery.com>
1907 * typeck.c (cp_build_compound_expr): Require RHS to have a known
1909 * class.c (resolve_address_of_overloaded_function): Use
1910 OVL_CURRENT for error message.
1911 (instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
1912 with them. Do not copy the node.
1914 2009-05-05 Jakub Jelinek <jakub@redhat.com>
1917 * pt.c (tsubst): If magic NOP_EXPR with side-effects has no type,
1918 set it from its operand's type after tsubst_expr.
1920 2009-05-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1923 * parser.c (cp_lexer_get_preprocessor_token): Do not store the
1924 canonical spelling for keywords.
1925 (cp_parser_attribute_list): Use the canonical spelling for
1926 keywords in attributes.
1928 2009-05-01 Joseph Myers <joseph@codesourcery.com>
1930 * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
1931 pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression,
1932 pp_cxx_new_expression, pp_cxx_delete_expression,
1933 pp_cxx_unary_expression, pp_cxx_assignment_operator,
1934 pp_cxx_assignment_expression, pp_cxx_expression,
1935 pp_cxx_function_specifier, pp_cxx_decl_specifier_seq,
1936 pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq,
1937 pp_cxx_exception_specification, pp_cxx_direct_declarator,
1938 pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement,
1939 pp_cxx_namespace_alias_definition, pp_cxx_template_parameter,
1940 pp_cxx_canonical_template_parameter, pp_cxx_template_declaration,
1941 pp_cxx_declaration, pp_cxx_typeid_expression,
1942 pp_cxx_va_arg_expression, pp_cxx_offsetof_expression,
1943 pp_cxx_trait_expression): Mostly use pp_string and
1944 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1945 for non-identifiers. Mark English strings for translation.
1946 * cxx-pretty-print.h (pp_cxx_ws_string): Define.
1947 * error.c (dump_template_parameter, dump_template_bindings,
1948 dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl,
1949 dump_decl, dump_template_decl, dump_function_decl,
1950 dump_parameters, dump_exception_spec, dump_template_parms,
1951 dump_expr, dump_binary_op, dump_unary_op, op_to_string,
1952 assop_to_string, args_to_string, cp_print_error_function,
1953 print_instantiation_full_context,
1954 print_instantiation_partial_context): Mostly use pp_string and
1955 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1956 for non-identifiers. Mark English strings for translation.
1957 (dump_global_iord): Mark strings for translation; use longer
1958 strings instead of substituting single words.
1959 (function_category): Return a format string marked for
1960 translation, not a single word or phrase to substitute in a longer
1963 2009-04-28 Ben Elliston <bje@au.ibm.com>
1968 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1970 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
1972 2009-04-27 Ian Lance Taylor <iant@google.com>
1974 * semantics.c (finish_omp_clauses): Change type of c_kind to enum
1977 2009-04-27 Jakub Jelinek <jakub@redhat.com>
1980 * cvt.c (convert_to_void) <case INDIRECT_REF>: Only warn about
1981 -Wunused-value if implicit.
1983 2009-04-24 Ian Lance Taylor <iant@google.com>
1985 * call.c (build_temp): Change 0 to enum constant.
1986 * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
1988 * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
1989 * decl2.c (constrain_visibility): Likewise.
1990 * parser.c (cp_lexer_get_preprocessor_token): Likewise.
1991 (cp_parser_flags): Typedef to int rather than enum type.
1992 (cp_parser_expression_stack_entry): Change prec field to enum
1995 * typeck.c (build_modify_expr): Add lhs_origtype parameter.
1998 2009-04-22 Dodji Seketeli <dodji@redhat.com>
2001 * parser.c (cp_parser_template_argument_list): Display an error
2002 when an ellipsis is not preceded by a parameter pack. Also, warn
2003 about variadic templates usage without -std=c++0x.
2005 2009-04-21 Taras Glek <tglek@mozilla.com>
2007 * cp-tree.h: Update GTY annotations to new syntax.
2009 * mangle.c: Likewise.
2010 * name-lookup.c: Likewise.
2011 * name-lookup.h: Likewise.
2012 * parser.c: Likewise.
2015 * semantics.c: Likewise.
2016 * typeck2.c: Likewise.
2018 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2021 * parser.c (cp_parser_error): Pass token->flags to c_parse_error.
2023 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2026 * typeck.c (check_for_casting_away_constness): We diagnose casting
2027 away any qualifiers not just constness.
2028 (casts_away_constness): Mention that it handles more than just
2031 2009-04-21 Joseph Myers <joseph@codesourcery.com>
2033 * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
2034 ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
2035 ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
2036 ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
2037 ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
2038 cfns.gperf: Add copyright and license notices.
2039 * cfns.h: Regenerate.
2040 * ChangeLog, ChangeLog-2004: Correct dates.
2042 2009-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
2045 * tree.c (lvalue_p_1): Use const_tree.
2046 Use CONST_CAST_TREE to avoid warning.
2047 (lvalue_p): Returns bool, receives const_tree.
2049 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2052 * parser.c (cp_parser_check_decl_spec): Drop redundant flags.
2053 * error.c (pedwarn_cxx98): New.
2054 * cp-tree.h (pedwarn_cxx98): Declare.
2056 2009-04-20 Le-Chun Wu <lcwu@google.com>
2059 * init.c (build_vec_init): Set TREE_NO_WARNING on the
2060 compiler-generated INDIRECT_REF expression.
2062 2009-04-20 Ian Lance Taylor <iant@google.com>
2064 * typeck.c (build_function_call_vec): New function.
2065 (cp_build_function_call): Only pass first parameter to
2066 objc_rewrite_function_call.
2067 (build_modify_expr): Add rhs_origtype parameter. Change all
2069 * decl.c (finish_decl): Add origtype parameter. Change all
2071 * semantics.c (finish_call_expr): Pass VEC to
2072 resolve_overloaded_builtin.
2074 2009-04-20 Ian Lance Taylor <iant@google.com>
2076 * cp-tree.h (base_access): Change typedef to int.
2077 * parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
2078 (cp_parser_omp_threadprivate): Likewise.
2079 * pt.c (unify_pack_expansion): Add casts to enum type.
2081 2009-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
2085 * call.c (build_new_op): Save the original codes of operands
2088 2009-04-18 Kazu Hirata <kazu@codesourcery.com>
2090 * cp-tree.h: Remove the prototype for insert_block.
2091 * decl.c (insert_block): Remove.
2093 2009-04-16 Ian Lance Taylor <iant@google.com>
2095 * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t.
2096 (tsubst_flags_t): Change typedef from enum type to int.
2098 2009-04-16 Paolo Bonzini <bonzini@gnu.org>
2100 * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE
2101 instead of targetm.vector_opaque_p.
2103 2009-04-15 Le-Chun Wu <lcwu@google.com>
2106 * call.c (build_over_call): Set TREE_NO_WARNING on the
2107 compiler-generated INDIRECT_REF expression.
2108 * cvt.c (convert_to_void): Emit warning when stripping off
2111 2009-04-14 Diego Novillo <dnovillo@google.com>
2113 * parser.c (cp_parser_type_specifier_seq): Move call to
2114 invoke_plugin_callbacks ...
2115 (cp_parser_type_specifier_seq): ... here.
2117 2009-04-14 Le-Chun Wu <lcwu@google.com>
2119 * Make-lang.in: Modify dependencies of files including plugin.h.
2120 * decl.c (finish_function): Call invoke_plugin_callbacks.
2121 * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
2123 2009-04-14 Jason Merrill <jason@redhat.com>
2126 * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
2127 about shadowing by tentative parms.
2129 2009-04-13 Jason Merrill <jason@redhat.com>
2132 * call.c (build_over_call): Don't call memcpy if the target is
2133 the same as the source.
2135 2009-04-13 Jason Merrill <jason@redhat.com>
2138 * pt.c (uses_template_parms): Handle CONSTRUCTOR.
2140 2009-04-12 Jason Merrill <jason@redhat.com>
2143 * call.c (joust): Don't crash on variadic fn.
2145 2009-04-10 Jason Merrill <jason@redhat.com>
2148 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return
2149 if we see a close brace without an open brace.
2151 2009-04-10 H.J. Lu <hongjiu.lu@intel.com>
2153 * parser.c (cp_parser_class_specifier): Remove the unused
2154 has_trailing_semicolon.
2156 2009-04-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
2159 * parser.c (cp_parser_check_template_parameters): Take a
2160 cp_declarator parameter.
2161 (cp_parser_elaborated_type_specifier): Update to
2162 cp_parser_check_template_parameters.
2163 (cp_parser_class_head): Likewise.
2164 (cp_parser_check_declarator_template_parameters): Likewise.
2165 (cp_parser_check_template_parameters): Handle first the non-error
2166 conditions. Give more accurate diagnostics if a declarator is
2169 2009-04-08 Jason Merrill <jason@redhat.com>
2172 * error.c (dump_aggr_type): Chase template typedefs if
2173 -fno-pretty-templates.
2175 2009-04-08 Dodji Seketeli <dodji@redhat.com>
2178 * parser.c (cp_parser_enumerator_definition): Make sure the
2179 initializer of the enumerator doesn't contain any bare parameter pack.
2181 2009-04-07 Jason Merrill <jason@redhat.com>
2184 * name-lookup.c (merge_functions): Keep multiple extern "C" functions.
2185 * call.c (joust): Complain about mismatched default arguments
2186 in extern "C" functions.
2187 * class.c (resolve_address_of_overloaded_function): Handle multiple
2188 extern "C" functions.
2189 * pt.c (resolve_overloaded_unification): Likewise.
2191 2009-04-07 Jason Merrill <jason@redhat.com>
2194 * error.c (dump_function_decl): Don't pretty-print templates
2195 if -fno-pretty-templates.
2196 (count_non_default_template_args): Print all args if
2197 -fno-pretty-templates.
2199 2009-04-06 Jason Merrill <jason@redhat.com>
2202 * pt.c (fn_type_unification): For DEDUCE_EXACT check that
2203 the deduced template arguments give us the parameter types
2206 2009-04-05 Giovanni Bajo <giovannibajo@libero.it>
2207 Jason Merrill <jason@redhat.com>
2210 * error.c (count_non_default_template_args): New fn.
2211 (dump_template_parms): Call it.
2212 (dump_template_argument_list): Call it. Add parms parm.
2213 (dump_template_argument): Adjust call to dump_template_argument_list.
2214 (dump_type, dump_decl): Likewise.
2215 (dump_template_bindings): Refactor logic.
2217 2009-04-03 Jason Merrill <jason@redhat.com>
2220 * error.c (dump_template_bindings): Look through typedefs in
2222 (dump_type) [TYPENAME_TYPE]: Print the typedef name if any.
2223 (find_typenames_r): Also collect typedefs.
2224 * pt.c (unify): Strip typedefs.
2227 * semantics.c (finish_id_expression): Don't assume a dependent
2228 member of the current instantiation isn't a valid integral
2229 constant expression. Check dependent_scope_p.
2230 * pt.c (dependent_scope_p): Check TYPE_P.
2231 (tsubst_copy): If args is null, just return.
2233 2009-04-02 Jason Merrill <jason@redhat.com>
2236 * error.c (find_typenames, find_typenames_r): New fns.
2237 (dump_function_decl): Call find_typenames.
2238 (dump_template_bindings): Print typenames as well.
2239 * pt.c (tsubst): Non-static.
2240 * cp-tree.h: Declare it.
2242 2009-04-02 Dodji Seketeli <dodji@redhat.com>
2245 * decl2.c (grokfield): when a typedef appears in a
2246 class, create the typedef variant type node for it.
2247 (save_template_attributes): Creating typedef variant type node
2248 here is now useless.
2249 * decl.c (grokdeclarator): If the typedef'ed struct/class was
2250 anonymous, set the proper type name to all its type variants.
2251 (xref_basetypes) : Fixup the variant types after setting
2253 * name-lookup.c (pushdecl_maybe_friend): Reuse the
2254 set_underlying_type function to install typedef variant types.
2255 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
2257 (append_type_to_template_for_access_check): New entry points.
2258 * semantics.c (check_accessibility_of_qualified_id):
2259 When a typedef that is a member of a class appears in a template,
2260 add it to the template. It will be ...
2261 * class.c (finish_struct_bits): Split type variant fixup into ...
2262 (fixup_type_variants): A new entry point.
2263 * pt.c (instantiate_class_template, instantiate_template ): ... access
2264 checked at template instantiation time.
2265 (resolve_type_name_type): The type name should be the name of the
2267 (retrieve_specialization): Specializations of template typedefs aren't
2268 to looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
2269 (append_type_to_template_for_access_check): New entry point.
2270 (tsubst_decl): For typedefs, build the variant type from the correct
2272 (get_class_bindings): Fix function comment.
2273 (perform_typedefs_access_check): New entry point.
2275 2009-03-31 Jason Merrill <jason@redhat.com>
2278 * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
2279 extern "C" declarations.
2282 * semantics.c (finish_non_static_data_member): Allow such references
2283 without an associated object in sizeof/decltype/alignof.
2285 * ptree.c (cxx_print_decl): Pretty-print full name of
2287 (cxx_print_type): Pretty-print full name of class.
2289 * decl.c (grokdeclarator): Reject pointer to qualified function
2292 PR c++/37806, core issue 547
2293 * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
2295 * tree.c (cp_build_qualified_type_real): Don't apply restrict to a
2297 * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
2298 * decl.c (groktypename): Add is_template_arg parameter.
2299 (grokdeclarator): Allow function cv-quals on a template type arg.
2300 * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
2301 is_template_arg argument in calls to groktypename.
2302 * cp-tree.h: Adjust prototype.
2303 * error.c (dump_type_prefix, dump_type_suffix): Fix plain
2304 FUNCTION_TYPE printing.
2306 * mangle.c (write_expression): Mangle dependent name as
2309 PR c++/38030, 38850, 39070
2310 * pt.c (type_dependent_expression_p_push): New fn.
2311 (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
2312 substitution makes the call non-dependent. Preserve koenig_p.
2313 * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
2314 for non-dependent calls.
2315 * semantics.c (finish_call_expr): Revert earlier changes.
2316 * cp-tree.h: Revert change to finish_call_expr prototype.
2318 2009-03-29 Joseph Myers <joseph@codesourcery.com>
2320 PR preprocessor/34695
2321 * cp-tree.h (cp_cpp_error): Remove.
2322 * error.c (cp_cpp_error): Remove.
2323 * parser.c (cp_lexer_new_main): Set done_lexing instead of
2324 client_diagnostic and error callback.
2326 2009-03-28 Paolo Bonzini <bonzini@gnu.org>
2328 * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
2329 * cp/cp-objcp-common.c (cxx_staticp): Remove.
2330 * cp/cp-tree.h (cxx_staticp): Remove.
2332 2009-03-28 Jakub Jelinek <jakub@redhat.com>
2335 * parser.c (cp_parser_postfix_expression): Don't call
2336 warning_if_disallowed_function_p.
2338 2009-03-27 Jan Hubicka <jh@suse.cz>
2340 * except.c (choose_personality_routine): Set terminate_node to abort
2341 for java exceptions.
2343 2009-03-27 Dodji Seketeli <dodji@redhat.com>
2344 Jakub Jelinek <jakub@redhat.com>
2347 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
2348 (cp_function_decl_explicit_p): New prototype.
2349 * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
2351 2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
2354 * parser.c (cp_parser_elaborated_type_specifier): If we have a
2355 typename tag and don't have either a TYPE_DECL or a
2356 TEMPLATE_ID_EXPR, set the type to NULL.
2358 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
2361 * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
2364 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
2367 * decl.c (check_array_designated_initializer): Handle error_mark_node.
2369 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2372 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
2374 2009-03-26 Andrew Haley <aph@redhat.com>
2377 * decl2.c (possibly_inlined_p): If java exceptions are in use
2378 don't inline a decl unless it is explicitly marked inline.
2379 * lex.c: (pragma_java_exceptions): New variable.
2380 (handle_pragma_java_exceptions): Set pragma_java_exceptions.
2381 * cp-tree.h (pragma_java_exceptions): Declare new variable.
2383 2009-03-24 Jason Merrill <jason@redhat.com>
2386 * name-lookup.c (pushdecl_maybe_friend): Check default args later.
2388 2009-03-23 Jakub Jelinek <jakub@redhat.com>
2391 * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
2392 code if iter is the second operand.
2393 * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
2394 argument. If it is set, don't build the toplevel expression with
2395 build_x_binary_op, but build2.
2396 (cp_parser_assignment_expression, cp_parser_omp_for_incr): Adjust
2398 (cp_parser_omp_for_cond): Don't assume the first operand of the
2399 comparison must be decl.
2401 2009-03-23 Jason Merrill <jason@redhat.com>
2404 * pt.c (make_fnparm_pack): Split out from...
2405 (instantiate_decl): ...here.
2406 (tsubst_pack_expansion): Handle being called in a late-specified
2410 * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
2413 2009-03-20 Jason Merrill <jason@redhat.com>
2416 * parser.c (cp_parser_direct_declarator): In a template, wrap
2417 non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
2418 * pt.c (tsubst): Preserve it in a partial instantiation.
2419 (dependent_type_p_r): Don't check value_dependent_expression_p.
2420 * decl.c (compute_array_index_type): Don't check
2421 value_dependent_expression_p if TREE_SIDE_EFFECTS.
2424 * typeck2.c (check_narrowing): Don't complain about loss of
2425 precision when converting a floating-point constant.
2427 2009-03-19 Jakub Jelinek <jakub@redhat.com>
2430 * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
2431 (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
2433 2009-03-18 Jakub Jelinek <jakub@redhat.com>
2435 * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
2436 (eof_token): Adjust.
2438 2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
2441 * parser.c (cp_parser_explicit_specialization): Don't skip the
2442 rest of the specialization when begin_specialization returns
2445 2009-03-17 Jason Merrill <jason@redhat.com>
2447 * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
2448 (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
2449 * pt.c (check_explicit_specialization): Likewise.
2450 (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
2451 local specialization.
2452 * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
2453 * decl2.c (parm_index): New fn.
2454 * semantics.c (finish_decltype_type): Don't use describable_type.
2455 * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR.
2456 Give a sorry for unsupported codes rather than crash. Mangle
2457 conversions with other than 1 operand. New mangling for PARM_DECL.
2458 * operators.def (ALIGNOF_EXPR): Mangle as "az".
2460 2009-03-17 Jing Yu <jingyu@google.com>
2463 * method.c (use_thunk): Change is_thunk from crtl to cfun.
2465 2009-03-17 Paolo Carlini <paolo.carlini@oracle.com>
2468 * semantics.c (check_trait_type): New.
2469 (finish_trait_expr): Use it.
2471 2009-03-17 Jakub Jelinek <jakub@redhat.com>
2473 * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
2474 instead of calling imported_module_or_decl debug hook if
2475 building_stmt_tree ().
2476 * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
2477 is a NAMESPACE_DECL.
2480 * name-lookup.c (do_namespace_alias): Don't call global_decl debug
2481 hook at function scope.
2484 * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
2487 2009-03-09 Jakub Jelinek <jakub@redhat.com>
2490 * semantics.c (finish_switch_cond): Don't call get_unwidened.
2491 * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
2492 instead of TREE_TYPE (cond).
2494 2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
2497 * parser.c (cp_parser_late_parsing_default_args): Continue
2498 the loop when cp_parser_assignment_expression returns
2501 2009-03-07 Jason Merrill <jason@redhat.com>
2504 * init.c (build_new_1): Don't use a VLA type.
2505 (build_vec_init): Handle getting a pointer for BASE.
2507 2009-03-06 H.J. Lu <hongjiu.lu@intel.com>
2510 * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
2511 when mangling symbols.
2513 2009-03-06 Paolo Carlini <paolo.carlini@oracle.com>
2516 * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
2518 2009-03-06 Alexandre Oliva <aoliva@redhat.com>
2520 * decl.c (record_builtin_java_type): Use canonicalized integer
2523 2009-03-04 Jason Merrill <jason@redhat.com>
2526 * class.c (is_really_empty_class): New fn.
2527 * cp-tree.h: Declare it.
2528 * cp-objcp-common.c (cp_expr_size): Use it.
2531 * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
2532 * parser.c (cp_parser_postfix_expression): Call it for
2534 * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
2535 (get_first_fn): Likewise.
2541 * decl.c (make_typename_type): Do look inside currently open classes.
2542 * parser.c (cp_parser_lookup_name): Likewise.
2543 (cp_parser_template_name): Likewise.
2544 * pt.c (dependent_scope_p): New function.
2545 * cp-tree.h: Declare it.
2546 * class.c (currently_open_class): Return fast if T isn't a class.
2548 2009-02-26 H.J. Lu <hongjiu.lu@intel.com>
2551 * parser.c (cp_parser_mem_initializer): Return error_mark_node
2552 if cp_parser_mem_initializer_id returns error_mark_node.
2554 2009-02-24 Richard Guenther <rguenther@suse.de>
2557 * pt.c (instantiate_decl): Do not instantiate extern, non-inline
2560 2009-02-23 H.J. Lu <hongjiu.lu@intel.com>
2563 * pt.c (coerce_template_template_parms): Return 0 if parameter
2566 2009-02-23 Jason Merrill <jason@redhat.com>
2568 * pt.c (unify): Call maybe_adjust_types_for_deduction when
2569 deducing from an initializer list.
2571 2009-02-20 Jason Merrill <jason@redhat.com>
2574 * decl.c (grokdeclarator): Handle ~identifier.
2576 2009-02-19 Jakub Jelinek <jakub@redhat.com>
2579 * decl2.c (determine_visibility): If visibility changed and
2580 DECL_RTL has been already set, call make_decl_rtl to update symbol
2583 2009-02-19 H.J. Lu <hongjiu.lu@intel.com>
2586 * cp-tree.h (maybe_commonize_var): New.
2588 * decl.c (maybe_commonize_var): Make it extern.
2590 * decl2.c (finish_anon_union): Call maybe_commonize_var.
2592 2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
2595 * parser.c (cp_parser_enum_specifier): Apply all attributes.
2597 2009-02-18 Jason Merrill <jason@redhat.com>
2599 * cfns.h: Tweak pathname for cfns.gperf.
2601 2009-02-13 Jason Merrill <jason@redhat.com>
2604 * semantics.c (finish_call_expr): Change koenig_p parm to int.
2605 If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
2606 * cp-tree.h: Adjust prototype.
2607 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
2609 2009-02-12 Jason Merrill <jason@redhat.com>
2612 * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
2614 2009-02-11 Jason Merrill <jason@redhat.com>
2617 * decl2.c (cp_write_global_declarations):
2618 Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
2621 * init.c (build_value_init_noctor): Split out from...
2622 (build_value_init): ...here.
2623 (expand_aggr_init_1): Handle value-initialization.
2624 * cp-tree.h: Add declaration.
2625 * class.c (type_has_user_provided_constructor):
2626 Handle non-class arguments.
2628 2009-02-10 Jason Merrill <jason@redhat.com>
2631 * class.c (defaultable_fn_p): Handle ... properly.
2634 * tree.c (lvalue_p_1): Condition rvalue ref handling on
2635 treat_class_rvalues_as_lvalues, too.
2637 2009-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2640 * typeck.c (build_x_array_ref): New.
2641 * cp-tree.h: Declare it.
2642 * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
2644 2009-02-09 Jason Merrill <jason@redhat.com>
2647 * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
2648 * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
2649 * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
2650 * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
2651 for build_value_init TARGET_EXPR.
2652 * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
2654 2009-02-06 Paolo Carlini <paolo.carlini@oracle.com>
2658 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
2660 2009-02-04 Jakub Jelinek <jakub@redhat.com>
2663 * operators.def: Use COMPONENT_REF code for ->/pt operator again,
2664 remove ./dt operator.
2665 * mangle.c (write_expression): Handle COMPONENT_REF after handling
2666 ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
2667 write_string ("dt") instead of using operators.def.
2669 2009-02-03 Jason Merrill <jason@redhat.com>
2671 * typeck.c (cp_build_unary_op): Only complain about taking address
2672 of main if pedantic.
2674 2009-02-03 Jakub Jelinek <jakub@redhat.com>
2677 * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
2680 * typeck2.c (digest_init_r): Don't call process_init_constructor
2683 2009-02-03 Paolo Bonzini <bonzini@gnu.org>
2686 * pt.c (convert_nontype_argument_function): Expect expr to be an
2690 * typeck.c (merge_types): Call resolve_typename_type if only
2691 one type is a typename.
2693 2009-02-02 Jason Merrill <jason@redhat.com>
2696 * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node
2699 2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
2702 * parser.c (cp_parser_pure_specifier): If there are no tokens left
2703 do not call cp_lexer_consume_token.
2705 2009-01-30 Jakub Jelinek <jakub@redhat.com>
2708 * parser.c (cp_parser_already_scoped_statement): Handle __label__
2711 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2714 * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
2716 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2719 * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
2721 2009-01-29 Paolo Carlini <paolo.carlini@oracle.com>
2723 * typeck.c (invalid_nonstatic_memfn_p): Use
2724 DECL_NONSTATIC_MEMBER_FUNCTION_P.
2726 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com>
2729 * call.c (build_over_call): If convert_for_arg_passing returns
2730 error_mark_node unconditionally return it.
2732 2009-01-22 Adam Nemet <anemet@caviumnetworks.com>
2734 * class.c (check_field_decls): Also inherit packed for bitfields
2735 regardless of their type.
2737 2009-01-22 Dodji Seketeli <dodji@redhat.com>
2740 * decl2.c (grokfield): Reverting changes of PR c++/26693
2741 (save_template_attributes): Likewise.
2742 * decl.c (grokdeclarator): Likewise.
2743 * name-lookup.c (pushdecl_maybe_friend): Likewise.
2744 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
2745 (append_type_to_template_for_access_check): Likewise.
2746 * semantics.c (check_accessibility_of_qualified_id): Likewise.
2747 * pt.c (instantiate_class_template, instantiate_template ): Likewise.
2749 (resolve_type_name_type): Likewise.
2750 (append_type_to_template_for_access_check): Likewise.
2752 2009-01-21 Dodji Seketeli <dodji@redhat.com>
2755 * decl2.c (grokfield): when a typedef appears in a
2756 class, create the typedef variant type node for it.
2757 (save_template_attributes): Creating typedef variant type node
2758 here is now useless.
2759 * decl.c (grokdeclarator): If the typedef'ed struct/class was
2760 anonymous, set the proper type name to all its type variants.
2761 * name-lookup.c (pushdecl_maybe_friend): Reuse the
2762 set_underlying_type function to install typedef variant types.
2763 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
2765 (append_type_to_template_for_access_check): New entry points.
2766 * semantics.c (check_accessibility_of_qualified_id):
2767 When a typedef that is a member of a class appears in a template,
2768 add it to the template. It will be ...
2769 * pt.c (instantiate_class_template, instantiate_template ): ... access
2770 checked at template instantiation time.
2771 (tsubst): Handle the case of being called with NULL args.
2772 (resolve_type_name_type): The type name should be the name of the
2774 (append_type_to_template_for_access_check): New entry point.
2776 2009-01-19 Jason Merrill <jason@redhat.com>
2779 * parser.c (cp_parser_unqualified_id): In a template,
2781 * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
2783 2009-01-16 Jason Merrill <jason@redhat.com>
2786 * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
2787 * init.c (build_new): Don't call describable_type unless we
2791 * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
2794 * search.c (protected_accessible_p): N doesn't vary.
2796 2009-01-15 Jason Merrill <jason@redhat.com>
2799 * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
2800 accept hidden friends.
2802 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2805 * decl.c (grokdeclarator): Check for a non namespace/class context.
2807 2009-01-15 Jason Merrill <jason@redhat.com>
2811 * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to
2812 a function isn't necessarily an lvalue. Take tree, not const_tree.
2813 (lvalue_p, real_lvalue_p): Take tree, not const_tree.
2814 * typeck.c (lvalue_or_else): Likewise.
2815 * cp-tree.h: Adjust prototypes.
2817 2009-01-15 Steve Ellcey <sje@cup.hp.com>
2820 * pt.c (tsubst): Check for NULL args.
2822 2009-01-15 Dodji Seketeli <dodji@redhat.com>
2825 * name-lookup.c (pushtag): Don't create members to types that are not
2828 2009-01-14 Nick Clifton <nickc@redhat.com>
2831 * parser.c: Pass cp_id_kind computed in
2832 cp_parser_postfix_dot_deref_expression to
2833 cp_parser_primary_expression.
2835 2009-01-13 Jakub Jelinek <jakub@redhat.com>
2838 * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
2839 STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
2842 2009-01-12 Jason Merrill <jason@redhat.com>
2843 Steve Ellcey <sje@cup.hp.com>
2846 * name-lookup.c (lookup_name_real): Keep looking past a hidden
2849 2009-01-12 Dodji Seketeli <dodji@redhat.com>
2852 * pt.c (parameter_of_template_p): New function.
2853 * cp-tree.h: Declare it.
2854 * name-lookup.c (binding_to_template_parms_of_scope_p): New
2856 (outer_binding): Take template parameters in account when looking for
2859 2009-01-12 Jason Merrill <jason@redhat.com>
2862 * tree.c (pod_type_p): Return 1 for structs created by the back end.
2864 2009-01-12 Jakub Jelinek <jakub@redhat.com>
2867 * parser.c (cp_parser_builtin_offsetof): Allow `->' in
2868 offsetof member-designator, handle it as `[0].'.
2871 * decl.c (start_function): If grokdeclarator hasn't returned
2872 FUNCTION_DECL nor error_mark_node, issue diagnostics.
2874 2009-01-11 Jakub Jelinek <jakub@redhat.com>
2877 * cp-gimplify.c (genericize_if_stmt): Renamed from ...
2878 (gimplify_if_stmt): ... this.
2879 (cp_gimplify_expr): Don't handle IF_STMT here.
2880 (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
2882 2009-01-10 Andrew Pinski <pinskia@gmail.com>
2885 * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
2888 * typeck2.c (build_functional_cast): Check for reference type and NULL
2891 2009-01-09 Steve Ellcey <sje@cup.hp.com>
2893 * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
2895 2009-01-09 Jakub Jelinek <jakub@redhat.com>
2898 * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
2900 2009-01-09 John F. Carr <jfc@mit.edu>
2903 * parser.c (cp_parser_class_specifier): Clear
2904 parser->in_unbraced_linkage_specification_p while parsing class
2907 2009-01-07 Jakub Jelinek <jakub@redhat.com>
2910 * semantics.c (finish_goto_stmt): Convert destination to
2913 2009-01-06 Jason Merrill <jason@redhat.com>
2920 * pt.c (check_default_tmpl_args): Don't complain about
2921 out-of-order parameter packs in the enclosing class
2922 or parameter packs after default args.
2923 (coerce_template_parms): If we have more than one
2924 parameter pack, don't flatten argument packs.
2925 (template_args_equal): Handle argument packs.
2926 (comp_template_args): Don't flatten argument packs.
2927 (check_instantiated_arg): Split out from...
2928 (check_instantiated_args): Here. Handle arg packs.
2929 (convert_template_argument): Just check that nontype argument
2930 packs have the right type.
2932 2009-01-05 Dodji Seketeli <dodji@redhat.com>
2935 * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
2937 2009-01-05 Jason Merrill <jason@redhat.com>
2940 * typeck2.c (process_init_constructor_union): Handle union with
2943 * mangle.c (write_expression): Remove mangling for zero-operand
2947 * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
2951 * class.c (defaultable_fn_p): Only operator== can be a copy
2952 assignment operator.
2954 2009-01-02 Jason Merrill <jason@redhat.com>
2957 * typeck2.c (process_init_constructor_union): Handle excess
2959 (process_init_constructor_record): Likewise.
2962 * typeck2.c (digest_init_r): Don't use process_init_constructor
2963 for non-aggregate classes.
2966 Copyright (C) 2009 Free Software Foundation, Inc.
2968 Copying and distribution of this file, with or without modification,
2969 are permitted in any medium without royalty provided the copyright
2970 notice and this notice are preserved.