1 2009-10-19 Jakub Jelinek <jakub@redhat.com>
3 * parser.c (cp_lexer_print_token, cp_parser_is_string_literal,
4 cp_parser_string_literal, cp_parser_primary_expression): Likewise.
5 (cp_lexer_get_preprocessor_token): Use C_LEX_STRING_JOIN instead
8 2009-10-15 Jason Merrill <jason@redhat.com>
11 * error.c (dump_template_bindings): Wrap argument packs in {}.
14 * parser.c (CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS): New.
15 (cp_parser_type_specifier): Don't try to parse a class-specifier
16 or enum-specifier in that case.
17 (cp_parser_trailing_type_id): New.
18 (cp_parser_late_return_type_opt): Call it.
19 (cp_parser_type_id_1): Add is_trailing_return parm.
20 (cp_parser_type_specifier_seq): Likewise.
22 2009-10-14 Jason Merrill <jason@redhat.com>
25 * call.c (print_z_candidates): Don't print deleted candidates.
26 (print_z_candidate): Note deleted candidates.
28 2009-10-14 Larry Evans <cppljevans@suddenlink.net>
31 * tree.c (cp_tree_equal): Add test for TEMPLATE_PARM_PARAMETER_PACK
34 2009-10-12 Jason Merrill <jason@redhat.com>
37 * parser.c (cp_parser_decltype): Set greater_than_is_operator_p.
40 * pt.c (type_unification_real): Call convert_template_argument
41 for function default template arguments.
42 (check_default_tmpl_args): Suggest -std=c++0x when function default
43 template args seen in C++98 mode.
45 2009-10-11 Jason Merrill <jason@redhat.com>
48 * typeck.c (build_reinterpret_cast_1): Handle rvalue refs
51 2009-10-11 Richard Guenther <rguenther@suse.de>
53 * tree.c (cp_free_lang_data): Drop anonymous aggregate names.
55 2009-10-08 Jason Merrill <jason@redhat.com>
58 * pt.c (maybe_adjust_types_for_deduction): Do rvalue ref adjustment
59 even when DEDUCE_EXACT.
62 * pt.c (resolve_nondeduced_context): New.
63 * cvt.c (convert_to_void): Call it.
64 * semantics.c (finish_decltype_type): Likewise.
65 * typeck.c (decay_conversion): Here too.
66 * pt.c (tsubst_decl): Don't clobber input_location.
67 Don't register a bad specialization.
69 2009-10-07 Gabriel Dos Reis <gdr@cs.tamu.edu>
71 * cp-tree.h: Fix location of documentation for DECL_LANG_FLAG_7.
73 2009-10-07 Jason Merrill <jason@redhat.com>
76 * pt.c (tsubst_pack_expansion): Don't do anything now if we
77 have incomplete packs of different lengths.
80 * tree.c (build_qualified_name): Call convert_from_reference.
82 2009-10-06 Jason Merrill <jason@redhat.com>
84 Fix lookup of initialized captures in unevaluated context.
85 * cp-tree.h (DECL_NORMAL_CAPTURE_P): New.
86 * name-lookup.c (qualify_lookup): Check it.
87 * parser.c (cp_parser_lambda_introducer): Pass explicit_init_p
89 * semantics.c (add_capture): Set DECL_NORMAL_CAPTURE_P
90 on captures without explicit init.
91 (add_default_capture): Pass explicit_init_p.
93 Fix capture by copy of types with explicit copy constructor.
94 * cp-tree.h (TARGET_EXPR_DIRECT_INIT_P): New.
95 (DIRECT_INIT_EXPR_P): New.
96 * typeck.c (convert_for_initialization): Just return if
98 * semantics.c (build_lambda_object): Use
99 TARGET_EXPR_DIRECT_INIT_P for normal captures.
101 2009-10-05 Jason Merrill <jason@redhat.com>
103 * parser.c: Mark lambda_scope and lambda_count for PCH.
105 2009-10-03 Jason Merrill <jason@redhat.com>
108 * parser.c (cp_parser_lambda_introducer): Avoid infinite loop on
111 2009-10-02 Jason Merrill <jason@redhat.com>
113 * mangle.c (write_unnamed_type_name): Implement.
114 (local_class_index): Split out from...
115 (discriminator_for_local_entity): ...here.
116 (nested_anon_class_index): New.
117 * cp-tree.h (TYPE_FUNCTION_SCOPE_P): New.
119 2009-10-02 Janis Johnson <janis187@us.ibm.com>
121 * call.c (convert_arg_to_ellipsis): Avoid promoting decimal32
124 2009-10-01 Jason Merrill <jason@redhat.com>
126 * parser.c (cp_parser_lambda_expression): Compute visibility.
127 (no_linkage_lambda_type_p): Remove.
128 * cp-tree.h: Remove declaration.
129 * tree.c (no_linkage_check): Don't call it. Don't check template
130 args. Don't check TREE_PUBLIC Types.
132 2009-10-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
133 Jason Merrill <jason@redhat.com>
135 * decl.c (grokdeclarator): Set constexprness before announcing
138 2009-10-01 Gabriel Dos Reis <gdr@cs.tamu.edu>
140 * decl.c (record_builtin_java_type): Undo unintended change.
141 (cxx_init_decl_processing): Likewise.
143 2009-10-01 Jason Merrill <jason@redhat.com>
145 * pt.c (register_specialization): Push DECL_SOURCE_LOCATION to the
148 * decl.c (grok_special_member_properties): Only adjust
149 TYPE_HAS_COMPLEX_* if the function is defaulted in the class body.
150 (cp_finish_decl): Push DECL_DELETED_FN/DECL_DEFAULTED_FN to the
153 2009-09-30 Gabriel Dos Reis <gdr@cs.tamu.edu>
155 * decl.c (check_for_uninitialized_const_var): Check constexpr
157 (grokdeclarator): Handle `constexpr'.
158 (check_tag_decl): Reject `constexpr'.
159 (check_function_type): Check constexpr functions.
160 * cp-tree.h (ds_constexpr): New cp_decl_spec enumerator.
161 (CLASSTYPE_LITERAL_P): New.
162 (lang_type_class::is_literal): New.
163 (lang_type_class::dummy): Adjust width.
164 (literal_type_p): Declare.
165 * parser.c (cp_parser_check_decl_spec): Print it.
166 (cp_parser_decl_specifier_seq): Accept "constexpr".
167 * semantics.c (validate_constexpr_fundecl): Define.
168 (literal_type_p): Define.
170 2009-09-30 Jason Merrill <jason@redhat.com>
172 * semantics.c (lambda_expr_this_capture): Fix default capture
173 of explicit capture of 'this'.
175 2009-09-30 Jason Merrill <jason@redhat.com>
177 * parser.c (cp_parser_lambda_expression): Don't add __ to __this.
179 2009-09-30 Jason Merrill <jason@redhat.com>
181 * cp-tree.h (LANG_DECL_U2_CHECK): Check LANG_DECL_HAS_MIN.
183 2009-09-29 John Freeman <jfreeman08@gmail.com>
184 Jason Merrill <jason@redhat.com>
186 Add support for lambda-expressions as per N2927.
187 * cp-tree.def (VEC_INIT_EXPR, LAMBDA_EXPR): New.
188 * cp-tree.h (LAMBDA_TYPE_P, LAMBDA_FUNCTION_P): New.
189 (LAMBDA_EXPR_DEFAULT_CAPTURE_MODE): New.
190 (LAMBDA_EXPR_DEFAULT_CAPTURE_LIST): New.
191 (LAMBDA_EXPR_THIS_CAPTURE, LAMBDA_EXPR_CAPTURES_THIS_P): New.
192 (LAMBDA_EXPR_MUTABLE_P, LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): New.
193 (LAMBDA_EXPR_RETURN_TYPE, LAMBDA_EXPR_LOCATION): New.
194 (LAMBDA_EXPR_EXTRA_SCOPE, LAMBDA_EXPR_DISCRIMINATOR): New.
195 (struct tree_lambda_expr): New.
196 (union lang_tree_node): Add lambda_expression.
197 (struct lang_type_class): Add lazy_move_ctor flag, lambda_expr field.
198 (CLASSTYPE_LAZY_MOVE_CTOR, CLASSTYPE_LAMBDA_EXPR): New.
199 (LAMBDA_TYPE_EXTRA_SCOPE, VEC_INIT_EXPR_SLOT): New.
200 (VEC_INIT_EXPR_INIT, DECLTYPE_FOR_LAMBDA_CAPTURE): New.
201 (DECLTYPE_FOR_LAMBDA_RETURN): New.
202 (enum special_function_kind): Add sfk_move_constructor.
203 (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT, LAMBDANAME_P): New.
204 * parser.c (cp_parser_lambda_expression, cp_parser_lambda_introducer)
205 (cp_parser_lambda_declarator_opt, cp_parser_lambda_body): New.
206 (start_lambda_scope, record_lambda_scope, finish_lambda_scope): New.
207 (no_linkage_lambda_type_p): New.
208 (cp_parser_primary_expression): Recognize lambda expression.
209 (cp_parser_init_declarator): Note lambda scope.
210 (cp_parser_function_definition_after_declarator): Likewise.
211 (cp_parser_late_parsing_default_args): Likewise.
212 (cp_parser_skip_to_closing_parenthesis): Skip to end of lambda capture
214 (cp_parser_parameter_declaration): Don't defer lambda default args.
215 * semantics.c (finish_non_static_data_member, finish_id_expression):
216 Handle default capture for lambda expressions.
217 (finish_this_expr): Handle 'this' keyword inside of lambda expressions.
218 (outer_automatic_var_p): New.
219 (finish_decltype_type): Handle decltypes within lambda expressions.
220 (classtype_has_nothrow_assign_or_copy_p): Synthesized move constructor.
221 (build_lambda_expr, build_lambda_object, begin_lambda_type)
222 (lambda_return_type, lambda_capture_field_type, apply_lambda_return_type)
223 (capture_decltype, add_capture, add_default_capture)
224 (lambda_expr_this_capture): New.
225 * mangle.c (write_unnamed_type_name): New. Incomplete.
226 (write_closure_type_name): New.
227 (write_unqualified_name): Recognize unnamed, closure types.
228 (write_type): Do not write decltypes from lambda expressions.
229 (decl_mangling_context): New.
230 (write_name): Use it. Handle PARM_DECL scope.
231 (write_prefix): Likewise. Handle VAR_DECL/FIELD_DECL scope.
232 (write_compact_number): Factor out from...
233 (write_expression, write_template_param): ...here.
234 (discriminator_for_local_entity): Recognize lambdas.
235 (write_local_name): Handle PARM_DECL scope.
236 * typeck.c (structural_comptypes): Compare decltypes from lambda
238 (check_return_expr): Deduce lambda return type from multiple return
240 * class.c (add_implicitly_declared_members): Add lazy move constructor
242 (check_bases_and_members): Delete default constructor and assignment
243 operator for lambda types.
244 (maybe_note_name_used_in_class): Do not confuse lambda expression with
246 * decl.c (reshape_init_r): Array copy.
247 (grokfndecl): Synthesized move constructor.
248 (cp_tree_node_structure): Lambda expression.
249 * method.c (use_thunk): Synthesized move constructor.
250 (do_build_copy_constructor): Likewise.
251 (locate_copy): Likewise.
252 (implicitly_declare_fn): Likewise.
253 * cp-objcp-common.c (cp_tree_size): Handle LAMBDA_EXPR.
254 * error.c (dump_aggr_type): Recognize lambda type.
255 (dump_function_decl): Recognize lambda function.
256 (function_category): Likewise.
257 (dump_function_name): Hide lambda name.
258 * tree.c (build_array_copy, move): New.
259 (special_function_p): Synthesized move constructor.
260 (no_linkage_check): Handle lambdas.
261 * search.c (lookup_fnfields_1): Synthesized move constructor.
262 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr):
263 Handle VEC_INIT_EXPR.
264 * typeck2.c (digest_init_r): Array copy.
265 * pt.c (get_template_info): Don't touch typedefs.
266 (instantiate_decl): Don't resubstitute artificial decls.
267 (tsubst_decl, tsubst, tsubst_copy_and_build): Handle lambdas.
268 (lookup_template_class): Don't fall back on name lookup.
269 * name-lookup.c (make_lambda_name): New.
270 (pushdecl_class_level): Handle default capture for lambda expressions.
271 (qualify_lookup): Handle decltypes within lambda expressions.
272 (pushtag): Handle ts_within_enclosing_non_class in function scope.
274 2009-09-28 Janis Johnson <janis187@us.ibm.com>
276 * mangle.c (write_builtin_type): Support decimal float types.
278 2009-09-28 Richard Henderson <rth@redhat.com>
280 * cp-objcp-common.h (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New.
282 2009-09-24 Jakub Jelinek <jakub@redhat.com>
284 * method.c (make_thunk, make_alias_for): Don't set
285 DECL_NO_STATIC_CHAIN.
286 * decl.c (builtin_function_1, grokfndecl): Likewise.
287 * lex.c (build_lang_decl): Likewise.
289 2009-09-23 Dodji Seketeli <dodji@redhat.com>
292 * decl.c (cp_finish_decl): Record the types used by the global
293 variable declaration we've just parsed.
295 2009-09-22 Dodji Seketeli <dodji@redhat.com>
297 * cp-lang.c (LANG_HOOKS_FUNCTION_PARAMETER_PACK_P,
298 LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P,
299 LANG_HOOKS_GET_GENERIC_FUNCTION_DECL): Initialize these
300 hooks for the c++ FE.
301 * cp-tree.h (function_parameter_pack_p, get_function_template_decl,
302 function_parameter_expanded_from_pack_p): Declare ...
303 * pt.c (function_parameter_pack_p, get_function_template_decl,
304 function_parameter_expanded_from_pack_p): ... new hooks.
305 (get_template_info): Make this more robust.
306 (template_args_variadic_p, make_ith_pack_parameter_name): Add a new
307 line between comment and function.
308 (get_template_argument_pack_elems): Fix comment.
309 (tsubst_decl): Arguments of function parameter packs are not
310 parameter packs themselves.
312 2009-09-21 Jason Merrill <jason@redhat.com>
315 * tree.c (trivial_type_p): Fix logic.
317 2009-09-21 Jason Merrill <jason@redhat.com>
319 * name-lookup.c (push_class_level_binding): Sanity check.
321 2009-09-18 Jason Merrill <jason@redhat.com>
323 * decl2.c (determine_visibility): Make anonymous types internal.
324 (mark_used): Complain about types without linkage used in
325 decls with internal linkage.
326 (vague_linkage_fn_p): Split out from...
327 * decl.c (maybe_commonize_var): ...here.
328 (grokdeclarator): Adjust linkage when a typedef gives linkage name.
329 * tree.c (no_linkage_check): Check the enclosing class and template
332 * cp-tree.h (TYPE_NAMESPACE_SCOPE_P): New.
334 * pt.c (get_pattern_parm): New.
335 (listify): Split out from...
336 (listify_autos): ...here.
337 (unify): Deduce std::initializer_list for T.
338 * call.c (build_over_call): Warn about it.
340 2009-09-17 Andrew Pinski <pinskia@gcc.gnu.org>
343 * typeck.c (cp_build_unary_op): Check TREE_CODE for bools instead of
345 (convert_for_assignment): Likewise.
346 * cvt.c (type_promotes_to): Likewise.
348 2009-09-14 Richard Henderson <rth@redhat.com>
349 Jakub Jelinek <jakub@redhat.com>
351 * cp-tree.h (finish_asm_stmt): Update decl.
352 * parser.c (cp_parser_asm_definition): Parse asm goto.
353 (cp_parser_asm_label_list): New.
354 * pt.c (tsubst_copy_asm_operands): Don't recurse on labels.
355 (tsubst_expr): Handle asm labels.
356 * semantics.c (finish_asm_stmt): Add and use labels parameter.
358 2009-09-14 Richard Henderson <rth@redhat.com>
360 * except.c (init_exception_processing): Don't call
361 default_init_unwind_resume_libfunc.
362 (cp_protect_cleanup_actions): Return the decl to call.
363 (build_exc_ptr): Use __builtin_eh_pointer.
364 * optimize.c (clone_body): Set eh_lp_nr, not eh_region.
366 2009-09-13 Richard Guenther <rguenther@suse.de>
367 Rafael Avila de Espindola <espindola@google.com>
369 * except.c (init_exception_processing): Do not set
370 lang_eh_runtime_type.
371 (choose_personality_routine): Do not set eh_personality_decl,
372 set pragma_java_exceptions.
373 * cp-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
374 (LANG_HOOKS_EH_PERSONALITY): Likewise.
375 (cp_eh_personality_decl): New.
376 (cp_eh_personality): Likewise.
377 * Make-lang.in (cp-lang.o): Add $(EXPR_H) and $(EXCEPT_H)
380 2009-09-13 Wei Guozhi <carrot@google.com>
383 * cp/optimize.c (build_delete_destructor_body): New function.
384 (maybe_clone_body): Call build_delete_destructor_body for
387 2009-09-10 Jason Merrill <jason@redhat.com>
389 * repo.c (extract_string, get_base_filename, init_repo): constify.
391 2009-09-09 Jason Merrill <jason@redhat.com>
393 * error.c (find_typenames_r): Also add decltypes.
395 2009-09-09 Paolo Carlini <paolo.carlini@oracle.com>
398 * decl2.c (grokfield): Check for explicit template argument lists.
400 2009-09-09 Jack Howarth <howarth@bromo.med.uc.edu>
403 * Make-lang.in: Remove redundant code from linkage for darwin10.
405 2009-09-08 Paolo Carlini <paolo.carlini@oracle.com>
408 * decl.c (build_init_list_var_init): Check return value of
409 perform_implicit_conversion.
411 2009-09-08 Jason Merrill <jason@redhat.com>
413 * class.c (currently_open_class): Make sure we're dealing with the
416 * cp-tree.h (enum overload_flags): Remove OP_FLAG.
417 * method.c (lazily_declare_fn): Check for dtorness in ABI warning.
419 * name-lookup.c (is_class_level): Remove.
420 (push_binding_level, leave_scope, resume_scope): Adjust.
421 (pushlevel_class): Adjust.
422 (poplevel_class): Make sure we're on class_binding_level.
424 * decl.c (grokmethod): Rename from start_method.
425 (finish_method): Remove.
427 * parser.c (cp_parser_save_member_function_body): Adjust.
429 2009-09-03 Doug Kwan <dougkwan@google.com>
431 * tree.c (cp_fix_function_decl_p): New.
432 (cp_free_lang_data): New.
434 2009-09-03 Diego Novillo <dnovillo@google.com>
436 * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H).
437 * decl2.c: Include pointer-set.h.
438 (collect_candidates_for_java_method_aliases): New.
439 (cp_write_global_declarations): Call it.
440 Add local variable CANDIDATES. If set, call
441 build_java_method_aliases.
442 (build_java_method_aliases): Add argument CANDIDATES.
443 Use it to determine if FNDECL should get a hidden alias.
444 * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define.
445 * cp-tree.h (cp_free_lang_data): Declare.
447 2009-09-03 Richard Guenther <rguenther@suse.de>
449 * method.c (use_thunk): Use cgraph_finalize_function to hand
450 off thunks to the cgraph.
451 * semantics.c (emit_associated_thunks): Do not emit thunks
452 for really extern functions.
454 2009-09-03 Diego Novillo <dnovillo@google.com>
456 * cp-lang.c (lang_hooks): Remove const qualifier.
458 2009-09-02 Jason Merrill <jason@redhat.com>
460 * semantics.c (describable_type): Don't pretend to be in a template.
462 * ptree.c (cxx_print_type) [DECLTYPE_TYPE]: Print the expression.
464 2009-09-01 Alexandre Oliva <aoliva@redhat.com>
466 * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New.
467 * cp-lang.c (cxx_dwarf_name): Pass it.
468 * error.c (count_non_default_template_args): Take flags as
469 argument. Adjust all callers. Skip counting of default
470 arguments if the new flag is given.
472 2009-09-01 Dodji Seketeli <dodji@redhat.com>
475 * pt.c (make_ith_pack_parameter_name): Don't use strnlen that is a
478 2009-09-01 Richard Guenther <rguenther@suse.de>
480 * cp-objcp-common.c (cp_expr_size): Use tree_expr_size.
481 * cp-objcp-common.h (LANG_HOOKS_EXPR_SIZE): Do not define.
483 2009-09-01 Richard Guenther <rguenther@suse.de>
485 * cp-objcp-common.h (LANG_HOOKS_MARK_ADDRESSABLE): Remove.
487 2009-08-31 Dodji Seketeli <dodji@redhat.com>
490 * cp-tree.h (get_template_info): Parameter should be const.
491 (CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): Fix typo.
492 (get_template_argument_pack_elems,
493 get_primary_template_innermost_parameters,
494 get_template_innermost_arguments, template_template_parameter_p):
496 * pt.c (get_template_argument_pack_elems,
497 get_template_innermost_parameters, get_template_innermost_arguments,
498 template_template_parameter_p):
499 ... New C++ front end implementation of new language hooks.
500 (primary_template_instantiation_p): New private helper.
501 (make_ith_pack_parameter_name): Use snprintf and strnlen instead of
503 (get_template_info): Const-ify parameter.
504 * cp-lang.c (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
505 LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
506 LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
507 LANG_HOOKS_GENERIC_TYPE_PARAMETER_DECL_P): Initialize these
508 interfaces for the C++ front-end.
510 2009-08-31 Jason Merrill <jason@redhat.com>
513 * parser.c (cp_parser_enum_specifier): Make sure the : is followed by a
514 type-specifier-seq before we commit.
516 2009-08-28 Richard Guenther <rguenther@suse.de>
519 * cp-gimplify.c (cp_genericize_r): Do not leak zero-sized stores
522 2009-08-27 Richard Guenther <rguenther@suse.de>
524 * class.c (build_vtbl_ref_1): Remove excess vertical space.
525 * Make-lang.in (CXX_TREE_H): Remove c-common.def dependency
526 tracked by $(TREE_H).
527 * semantics.c (expand_or_defer_fn): Zero DECL_SAVED_TREE.
529 2009-08-26 Jason Merrill <jason@redhat.com>
531 * call.c (build_builtin_candidate): Don't set LOOKUP_ONLYCONVERTING
532 if we're contextually converting to bool.
533 (build_conditional_expr): Likewise.
534 * typeck.c (condition_conversion): Likewise.
536 * call.c (build_conditional_expr): Fix logic errors.
537 (build_new_op): Remove dead COND_EXPR handling.
539 2009-08-24 Jason Merrill <jason@redhat.com>
541 * cp-tree.h (DECL_DEFERRED_FN): Remove.
542 (struct lang_decl_fn): Remove deferred flag.
543 * class.c (build_clone): Don't set it.
544 * decl2.c (note_vague_linkage_fn): Don't check or set it.
545 (mark_used): Don't check it.
546 * method.c (make_thunk, make_alias_for): Don't set it.
548 * decl2.c (mark_used): Streamline logic.
553 * cp-tree.h (DECL_ODR_USED): New macro.
554 (struct lang_decl_base): Add odr_used flag.
555 * decl.c (duplicate_decls): Propagate it. Use it for error.
556 * pt.c (register_specialization): Use it for error.
557 * decl2.c (mark_used): Use it as gating flag rather than TREE_USED.
558 (cp_write_global_declarations): Use it for error.
559 (tree_used_ok): Remove.
560 * cp-tree.h: Remove tree_used_ok.
561 * call.c (build_call_a): Don't call it.
562 * init.c (build_offset_ref): Likewise.
564 2009-08-21 Jakub Jelinek <jakub@redhat.com>
567 * tree.c (lvalue_p_1) <case CONST_DECL>: Return clk_none if
570 2009-08-19 Jason Merrill <jason@redhat.com>
574 * decl2.c (mark_used): Increment function_depth during synthesis.
575 * parser.c (cp_parser_default_argument): Not here.
577 2009-08-19 Jakub Jelinek <jakub@redhat.com>
579 * method.c (use_thunk): Call free_after_compilation after
580 assemble_end_function.
582 2009-08-17 Richard Guenther <rguenther@suse.de>
584 * decl.c (build_ptrmemfunc_type): Keep variant chain intact.
586 (finish_enum): Keep variant chain intact.
587 * tree.c (cp_build_reference_type): Likewise.
589 2009-08-16 Jason Merrill <jason@redhat.com>
591 Make TREE_USED match the [basic.def.odr] concept for FUNCTION_DECL
592 and VAR_DECL, so mark_used only has effect the first time.
593 * decl2.c (mark_used): Just return if TREE_USED is already set.
594 Don't set TREE_USED if cp_unevaluated_operand is set.
595 (tree_used_ok): New fn.
596 * init.c (build_offset_ref): Check it instead of TREE_USED.
597 * call.c (build_call_a): Likewise.
598 * cp-tree.h: Declare it.
599 (DECL_NO_LINKAGE_CHECKED): No longer needed.
600 (struct lang_decl_base): Remove no_linkage_checked bitfield.
602 * decl2.c (finish_static_data_member_decl): Don't set TREE_USED.
604 * decl2.c (mark_used): It's ok to synthesize for default args now.
606 2009-08-10 Jason Merrill <jason@redhat.com>
608 Implement DR 757: It's OK for a decl to use a type without linkage
609 so long as the decl is defined in the current translation unit.
610 * decl2.c (no_linkage_decls): New vector.
611 (mark_used): Add decls that use types with no linkage.
612 (cp_write_global_declarations): Check that they are defined.
613 (decl_defined_p, no_linkage_error): New fns.
614 * cp-tree.h (DECL_NO_LINKAGE_CHECKED): New macro.
615 (struct lang_decl_base): Add flag.
616 * decl.c (grokfndecl): Don't check type linkage.
617 (grokvardecl): If the type has no linkage, just make sure
618 DECL_LANG_SPECIFIC is set.
619 * pt.c (check_instantiated_arg): Don't check type linkage.
620 * name-lookup.c (is_local_extern): New fn.
621 * name-lookup.h: Declare it.
623 2009-08-05 Jason Merrill <jason@redhat.com>
626 * init.c (build_vec_init): Evaluate the initializer before
627 starting the initialization try block.
629 2009-08-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
632 * typeck.c (convert_for_assignment): Do not warn for any boolean
633 variant. Use explicit location.
635 2009-08-04 Dodji Seketeli <dodji@redhat.com>
638 * pt.c (tsubst_default_argument): Let access checks of the
639 default argument happen in the context of the current function.
641 2009-08-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
644 * call.c (build_new_op): Only try prefix operator if -fpermissive,
645 otherwise just error.
647 2009-08-04 Dodji Seketeli <dodji@redhat.com>
650 * error.c (lang_decl_name): Print qualified names for decls
653 2009-08-03 Jason Merrill <jason@redhat.com>
654 Jakub Jelinek <jakub@redhat.com>
657 * init.c (build_vec_init): Look through a TARGET_EXPR around a
660 2009-07-31 Jason Merrill <jason@redhat.com>
661 Douglas Gregor <doug.gregor@gmail.com>
663 Remove implicit binding of lvalues to rvalue references (N2831)
664 * call.c (convert_class_to_reference): Binding an lvalue to an
665 rvalue reference is bad. If the user-defined conversion is bad,
666 set bad_p before merging conversions.
667 (maybe_handle_ref_bind): Don't push down bad_p.
668 (reference_binding): Binding an lvalue to an rvalue reference is bad.
669 (convert_like_real): Give a helpful error about binding lvalue
671 (reference_related_p): No longer static.
672 * typeck.c (build_typed_address): New.
673 (build_static_cast_1): Add static_cast from lvalue to &&.
676 2009-07-31 Jason Merrill <jason@redhat.com>
678 * call.c (reference_binding): Rename lvalue_p to is_lvalue.
679 Do direct binding of "rvalues" in memory to rvalue references.
680 * tree.c (lvalue_p_1): Can't be both non-addressable lvalue and
682 * typeck.c (build_static_cast_1): Do direct binding of memory
683 "rvalues" to rvalue references.
684 * cvt.c (cp_fold_convert): New.
685 * cp-tree.h: Declare it.
687 2009-07-31 Jason Merrill <jason@redhat.com>
689 * typeck.c (build_address): Do fold away ADDR_EXPR of INDIRECT_REF.
690 * tree.c (rvalue): Use cp_build_qualified_type, not TYPE_MAIN_VARIANT.
692 2009-07-29 Jason Merrill <jason@redhat.com>
695 * cp-tree.h (enum tsubst_flags): Add tf_no_class_instantiations.
696 * error.c (count_non_default_template_args): Pass it.
697 * pt.c (tsubst) [TYPENAME_TYPE]: Don't complete type if it's set.
699 2009-07-29 Richard Guenther <rguenther@suse.de>
702 * cp-gimplify.c (cp_genericize_r): Properly walk the BIND_EXPR
705 2009-07-26 Simon Martin <simartin@users.sourceforge.net>
708 * decl.c (grokdeclarator): Do not set TREE_NO_WARNING for functions
709 with a qualified return type.
711 2009-07-24 Jason Merrill <jason@redhat.com>
714 * call.c (build_op_delete_call): If this is for a new-expression
715 and the op delete is deleted, do nothing.
718 * call.c (compare_ics): Give list-initialization of std::init_list
719 priority over conversion to scalar, too.
721 2009-07-22 Jason Merrill <jason@redhat.com>
723 * mangle.c (mangle_type_string_for_rtti): Rename to be clearer.
724 (needs_fake_anon): New.
725 (write_name): Check it.
726 (write_nested_name): Add a fake anonymous namespace scope if true.
727 * name-lookup.c (get_anonymous_namespace_name): No longer static.
728 * rtti.c, cp-tree.h: Adjust.
730 2009-07-22 Richard Guenther <rguenther@suse.de>
733 * cp-gimplify.c (cp_gimplify_expr): Move handling of using
735 (cp_genericize_r): ... genericization stage.
736 (cp_genericize): Adjust.
738 2009-07-21 Jason Merrill <jason@redhat.com>
741 * call.c (reference_binding): Implement binding to { }.
742 (initialize_reference): Binding temporary to non-const && is fine.
743 * decl.c (grok_reference_init): Remove error for CONSTRUCTOR.
745 * decl.c (reshape_init_r): { T } is not an aggregate initializer
748 2009-07-17 Richard Guenther <rguenther@suse.de>
751 * decl.c (finish_function): Do not emit unused result warnings
753 * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use
754 c_warn_unused_result_pass.
755 * semantics.c (expand_or_defer_fn): Adjust assertion about IL status.
756 * optimize.c (clone_body): Clone in GENERIC.
757 (maybe_clone_body): Do not clear DECL_SAVED_TREE.
758 * decl2.c (cp_write_global_declarations): Fix body test.
759 Do not call cgraph_optimize.
760 * Make-lang.in (optimize.o): Add tree-iterator.h dependency.
761 * method.c (use_thunk): Register thunk with
762 cgraph_finalize_function.
763 * error.c (function_category): Guard access of DECL_LANG_SPECIFIC.
765 2009-07-17 Richard Guenther <rguenther@suse.de>
767 * init.c (build_vec_delete_1): Do not set DECL_REGISTER on the
770 2009-07-17 Aldy Hernandez <aldyh@redhat.com>
771 Manuel López-Ibáñez <manu@gcc.gnu.org>
774 * typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c,
775 tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c,
776 call.c, cvt.c, mangle.c: Add location argument to
777 fold_{unary,binary,ternary}, fold_build[123], build_call_expr,
778 build_size_arg, build_fold_addr_expr, build_call_array,
779 non_lvalue, size_diffop, fold_build1_initializer,
780 fold_build2_initializer, fold_build3_initializer,
781 fold_build_call_array, fold_build_call_array_initializer,
782 fold_single_bit_test, omit_one_operand, omit_two_operands,
783 invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref,
784 fold_indirect_ref, combine_comparisons, fold_builtin_*,
785 fold_call_expr, build_range_check, maybe_fold_offset_to_address,
786 round_up, round_down.
788 2009-07-16 Jason Merrill <jason@redhat.com>
791 Split POD into "standard-layout" and "trivial" as per N2230,
792 Support std::is_standard_layout and std::is_trivial traits.
793 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_STD_LAYOUT,
795 (struct lang_type_class): Add non_std_layout.
796 (CLASSTYPE_NON_STD_LAYOUT): New.
797 * class.c (check_bases): Set it.
798 (check_field_decls): Likewise.
799 (check_bases_and_members): Likewise.
800 * parser.c (cp_parser_primary_expression): Handle RID_IS_STD_LAYOUT,
802 (cp_parser_trait_expr): Likewise.
803 * semantics.c (trait_expr_value): Handle CPTK_IS_STD_LAYOUT,
805 (finish_trait_expr): Likewise.
806 * tree.c (scalarish_type_p, trivial_type_p, std_layout_type_p): New.
807 (pod_type_p): Use them.
808 (type_has_nontrivial_copy_init, type_has_nontrivial_default_init): New.
810 Adjust bits of the language that no longer refer to POD types.
811 * call.c (convert_arg_to_ellipsis): Use type_has_nontrivial_copy_init
812 and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
813 (build_x_va_arg): Likewise.
814 (call_builtin_trap): Remove.
815 * decl.c (declare_local_label): Use type_has_nontrivial_default_init
816 and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
817 (cp_finish_decl): Likewise.
818 (check_previous_goto_1, check_goto): Adjust error.
819 * typeck.c (build_class_member_access_expr): Check
820 CLASSTYPE_NON_STD_LAYOUT rather than CLASSTYPE_NON_POD_P.
822 2009-07-14 Taras Glek <tglek@mozilla.com>
823 Rafael Espindola <espindola@google.com>
825 * Make-lang.in: Added CP_PLUGIN_HEADERS and
826 c.install-target to export cp-tree.h cxx-pretty-print.h
827 name-lookup.h headers for plugins.
829 2009-07-14 Jason Merrill <jason@redhat.com>
832 * decl.c (decls_match): A non-extern-C declaration doesn't match
833 a builtin extern-C declaration.
836 * name-lookup.c (qualified_lookup_using_namespace): Don't stop
837 looking in used namespaces just because we found something on
841 * semantics.c (perform_koenig_lookup): Handle empty template args.
843 * call.c (build_over_call): Use can_trust_pointer_alignment.
845 2009-07-14 Dodji Seketeli <dodji@redhat.com>
849 * decl2.c (grokfield): Don't call set_underlying_type on typedef
850 decls that are type names.
852 2009-07-13 Andrew Pinski <andrew_pinski@playstation.sony.com>
855 * parser.c (cp_parser_elaborated_type_specifier): Accept typename in
856 front of qualified names.
858 2009-07-12 Jason Merrill <jason@redhat.com>
861 * tree.c (rvalue): Use lvalue_or_rvalue_with_address_p.
864 * cp-tree.h (enum cp_lvalue_kind_flags): Add clk_rvalueref.
865 * tree.c (lvalue_p_1): Return it. Remove
866 treat_class_rvalues_as_lvalues parm.
867 (real_lvalue_p): Disallow pseudo-lvalues here.
868 (lvalue_or_rvalue_with_address_p): New fn.
869 * call.c (initialize_reference): Use it instead of real_lvalue_p.
872 * init.c (build_new_1): Handle initializer list as array initializer.
873 (build_vec_init): Likewise.
874 * typeck.c (cp_build_modify_expr): Likewise.
875 * typeck2.c (process_init_constructor_array): Error rather than abort
876 if too many initializers.
878 2009-07-10 Jakub Jelinek <jakub@redhat.com>
881 * error.c (cp_print_error_function): Check for NULL block.
883 2008-07-09 Simon Martin <simartin@users.sourceforge.net>
884 Jason Merrill <jason@redhat.com>
886 * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
887 append_type_to_template_for_access_check_1): Use CLASS_TYPE_P.
889 2009-07-09 Dodji Seketeli <dodji@redhat.com>
892 * pt.c (type_unification_real): Use tsubst_template_arg instead
893 of tsubst to substitute default template arguments.
895 2009-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
898 * init.c (build_new_1): Set TREE_NO_WARNING for compiler-generated
900 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
903 2009-07-07 Jason Merrill <jason@redhat.com>
906 * pt.c (tsubst_decl): Don't abort if we didn't change anything
907 in a TEMPLATE_DECL's args.
909 2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
911 * semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by
914 2009-07-07 Jason Merrill <jason@redhat.com>
917 * decl.c (build_enumerator): Don't add enumerators for a
918 scoped enum to the enclosing class.
921 * decl.c (start_enum): Allow dependent underlying type.
924 * decl.c (finish_enum): Finish scope even in a template.
926 2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
928 * init.c: Replace %J by an explicit location. Update all calls.
930 * typeck2.c: Likewise.
932 * name-lookup.c: Likewise.
934 2009-07-06 Manuel López-Ibáñez <manu@gcc.gnu.org>
936 * decl.c: Replace %H by an explicit location. Update all calls.
937 * except.c: Likewise.
938 * semantics.c: Likewise.
939 * parser.c: Likewise.
941 2009-07-06 Simon Martin <simartin@users.sourceforge.net>
944 * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
945 append_type_to_template_for_access_check_1): Use
946 RECORD_OR_UNION_CODE_P.
948 2009-07-04 Jason Merrill <jason@redhat.com>
950 * pt.c (retrieve_specialization): Don't get confused by a
951 using-declaration that brings in another instance of this template
954 * ptree.c (cxx_print_type): Fix logic.
956 * cp-tree.h (LANG_DECL_FN_CHECK): Fix non-checking version.
959 * cp-tree.h (struct lang_decl_parm): New.
960 (struct lang_decl): Add it.
961 (LANG_DECL_PARM_CHECK): New.
962 (DECL_PARM_INDEX): New.
963 * decl2.c (parm_index): Remove.
964 * lex.c (retrofit_lang_decl): Handle parms.
965 (cxx_dup_lang_specific_decl): Likewise.
966 * mangle.c (write_expression): Adjust.
967 * tree.c (cp_tree_equal): Adjust.
968 (decl_linkage): Only check DECL_COMDAT for functions and variables.
969 * parser.c (cp_parser_parameter_declaration_list): Set
971 * pt.c (iterative_hash_template_arg): Hash it.
973 2009-07-03 Jason Merrill <jason@redhat.com>
975 * cp-tree.h (struct lang_decl): Overhaul.
976 (struct lang_decl_flags): Remove.
977 (struct lang_decl_base): New.
978 (struct lang_decl_min): New.
979 (struct lang_decl_fn): New.
980 (struct lang_decl_ns): New.
981 (CAN_HAVE_FULL_LANG_DECL_P): Replace with LANG_DECL_HAS_MIN.
982 (LANG_DECL_MIN_CHECK): New.
983 (LANG_DECL_FN_CHECK): New.
984 (LANG_DECL_NS_CHECK): New.
985 (STRIP_TEMPLATE): New.
986 (NON_THUNK_FUNCTION_CHECK): Remove.
987 (DECL_DECLARES_FUNCTION_P): New.
989 * lex.c (retrofit_lang_decl, cxx_dup_lang_specific_decl): Adjust.
990 * decl.c (push_local_name, duplicate_decls): Adjust.
991 * decl2.c (start_objects): Don't set u2sel.
992 * semantics.c (finish_omp_threadprivate): Adjust.
993 * class.c (build_clone): Don't do much on TEMPLATE_DECLs.
994 (decl_cloned_function_p): Out-of-line implementation of macros.
995 (clone_function_decl, adjust_clone_args): Use DECL_CLONED_FUNCTION_P.
996 * mangle.c (write_unqualified_name): Don't check function flags
998 * method.c (make_alias_for): Don't set DECL_CLONED_FUNCTION.
999 * pt.c (build_template_decl): Don't set function flags.
1000 (check_default_tmpl_args): Check that it's a function.
1001 (instantiate_template): Use DECL_ABSTRACT_ORIGIN to find the
1004 * pt.c (tsubst_decl) [FUNCTION_DECL]: Don't tsubst
1005 DECL_CLONED_FUNCTION.
1007 * cp-tree.h (struct lang_type_class): Move sorted_fields here.
1008 * class.c (finish_struct_1): Adjust.
1009 * ptree.c (cxx_print_decl, cxx_print_type): Adjust.
1010 * search.c (lookup_field_1): Adjust.
1012 * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Remove.
1013 * decl.c (finish_method): Don't add to it.
1014 * class.c (fixup_pending_inline): Remove.
1015 (fixup_inline_methods): Remove.
1016 (finish_struct_1): Don't call it.
1018 * error.c (dump_function_name): Handle null name.
1020 2009-07-02 Mark Mitchell <mark@codesourcery.com>
1022 * typeck.c (cp_build_binary_op): Move warnings about use of NULL
1023 in arithmetic earlier and allow comparisions of NULL with
1024 pointers-to-members.
1026 2009-07-02 Jason Merrill <jason@redhat.com>
1028 Use hash tables for template specialization lookup.
1029 * pt.c (struct spec_entry): New type.
1030 (decl_specializations, type_specializations): New hash tables.
1031 (register_specialization, retrieve_specialization): Use them.
1032 (reregister_specialization, lookup_template_class): Use them.
1033 (eq_specializations, hash_tmpl_and_args, hash_specialization): New.
1034 (iterative_hash_template_arg): New.
1035 (init_template_processing): New
1036 (process_partial_specialization): Don't look to see if we already
1037 have this partial specialization.
1038 (maybe_process_partial_specialization): Handle reassigning
1039 full specializations when we get an explicit specialization
1040 of the partial instantiation.
1041 (tsubst_friend_function): Adjust specialization reassignment code.
1042 (instantiate_template): Only do one lookup.
1043 (instantiate_decl): Don't do any lookup.
1044 * cp-tree.h: Declare init_template_processing.
1045 * decl.c (duplicate_decls): Pass args to reregister_specialization.
1047 2009-07-01 Jason Merrill <jason@redhat.com>
1049 * cp-tree.h (DECL_CLASS_TEMPLATE_P): Use DECL_IMPLICIT_TYPEDEF_P.
1051 * pt.c (register_specialization): Use duplicate_decls to merge
1052 the argument with a previous specialization.
1053 (check_explicit_specialization): Call register_specialization to
1054 merge the TEMPLATE_DECL with a previous version.
1055 (determine_specialization): Return the args even if fn is a template.
1057 2009-07-01 Ian Lance Taylor <iant@google.com>
1059 * g++spec.c (lang_specific_driver): Bump num_args by 1.
1061 2009-06-30 Jason Merrill <jason@redhat.com>
1064 * pt.c (tsubst_pack_expansion): Handle unexpanded packs in an
1065 EXPR_PACK_EXPANSION.
1067 2009-06-29 Jason Merrill <jason@redhat.com>
1070 * error.c (dump_template_parms): Pass all args to
1071 count_non_default_template_args.
1072 (count_non_default_template_args): Pull out the inner ones.
1074 2009-06-26 H.J. Lu <hongjiu.lu@intel.com>
1076 * decl.c (duplicate_decls): Re-indent.
1078 2009-06-25 Ian Lance Taylor <iant@google.com>
1080 * call.c (avoid_sign_compare_warnings): New static function.
1081 (build_new_op): Call it.
1082 * typeck.c (cp_build_binary_op): Don't call warn_sign_compare if
1083 TREE_NO_WARNING is set on either operand.
1085 2009-06-25 Ian Lance Taylor <iant@google.com>
1087 * g++spec.c (SKIPOPT): define.
1088 (lang_specific_driver): Handle -static-libstdc++. Only add
1089 LIBSTDCXX_STATIC if we add LIBSTDCXX.
1091 2009-06-25 Ian Lance Taylor <iant@google.com>
1093 * cvt.c (convert_to_void): Only warn about COND_EXPR if neither
1094 the second nor third operand has side effects.
1096 2009-06-25 Ian Lance Taylor <iant@google.com>
1098 * parser.c (cp_parser_binary_expression): Increment
1099 c_inhibit_evaluation_warnings while parsing the right hand side of
1100 "true || x" or "false && x".
1101 * typeck.c (cp_build_binary_op): Only call warn_for_sign_compare
1102 if c_inhibit_evaluation_warnings is zero.
1104 2009-06-24 Jason Merrill <jason@redhat.com>
1106 * error.c (dump_decl): Do say "typedef" for the injected class name.
1108 * pt.c (lookup_template_class): Use currently_open_class,
1109 compare template args later.
1112 * decl.c (decls_match): Check DECL_TI_TEMPLATE too.
1113 * class.c (resolve_address_of_overloaded_function): Fix typo.
1115 2009-06-18 Aldy Hernandez <aldyh@redhat.com>
1117 * class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.
1118 * decl.c (finish_decl): Remove.
1119 (declare_global_var): Replace finish_decl with cp_finish_decl.
1120 (start_method): Same.
1121 * rtti.c (emit_tinfo_decl): Same.
1122 * pt.c (tsubst_expr): Same.
1123 (instantiate_decl): Same.
1124 * decl2.c (grokbitfield): Same.
1125 * name-lookup.c (pushdecl_top_level_1): Same.
1126 * cp-tree.h: Remove finish_decl.
1128 2009-06-16 David Edelsohn <edelsohn@gnu.org>
1130 * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL.
1131 (lang_specific_driver): Always allocate extra argument.
1132 Add LIBSTDCXX_STATIC to arglist if defined and linking
1135 2009-06-16 Ian Lance Taylor <iant@google.com>
1137 * Make-lang.in (cp/class.o): Depend upon gt-cp-class.h.
1138 (cp/semantics.o): Depend upon gt-cp-semantics.h.
1140 2009-06-16 Ian Lance Taylor <iant@google.com>
1142 * parser.c (cp_unevaluated_operand): Define global variable.
1143 (cp_parser_question_colon_clause): Increment
1144 c_inhibit_evaluation_warnings when evaluating an expression which
1145 will never be executed.
1146 (cp_parser_decltype): Increment cp_unevaluated_operand and
1147 c_inhibit_evaluation_warnings, not skip_evaluation.
1148 (cp_parser_sizeof_operand): Likewise.
1149 (cp_parser_enclosed_template_argument_list): Save
1150 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
1152 * cp-tree.h (struct saved_scope): Remove skip_evaluation field.
1153 Add unevaluated_operand and inhibit_evaluation_warnings fields.
1154 (cp_unevaluated_operand): Declare.
1155 * name-lookup.c (push_to_top_level): Save cp_unevaluated_operand
1156 and c_inhibit_evaluation_warnings rather than skip_evaluation.
1157 (pop_from_top_level): Restore cp_unevaluated_operand and
1158 c_inhibit_evaluation_warnings rather than skip_evaluation.
1159 * class.c (build_base_path): Check cp_unevaluated_operand rather
1160 than skip_evaluation.
1161 * typeck.c (build_class_member_access_expr): Likewise.
1162 (cp_build_binary_op): Don't warn about bad shift counts if
1163 c_inhibit_evaluation_warnings is non-zero.
1164 * pt.c (coerce_template_parms): Save state of
1165 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
1167 (tsubst_aggr_type): Likewise.
1168 (tsubst_pack_expansion): Check cp_unevaluated_operand rather than
1170 (tsubst_copy): Likewise.
1171 (tsubst): Set cp_unevaluated_operand and
1172 c_inhibit_evaluation_warnings, not skip_evaluation.
1173 (tsubst_copy_and_build): Likewise.
1174 * call.c (convert_arg_to_ellipsis): Check cp_unevaluated_operand
1175 rather than skip_evaluation.
1176 * decl2.c (mark_used): Likewise.
1177 * semantics.c (finish_non_static_data_member): Likewise.
1178 * cvt.c (cp_convert_and_check): Check
1179 c_inhibit_evaluation_warnings rather than skip_evaluation.
1180 * mangle.c (write_type): Set cp_unevaluated_operand rather than
1183 2009-06-15 Ian Lance Taylor <iant@google.com>
1185 * parser.c (cp_parser_direct_declarator): Add braces around
1186 variables declared before label.
1188 2009-06-15 Rafael Avila de Espindola <espindola@google.com>
1190 * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove.
1191 * cp-tree.h (cxx_comdat_group): Change signature.
1192 * decl.c (duplicate_decls): Use DECL_COMDAT_GROUP.
1193 (cxx_comdat_group): Change signature.
1194 * decl2.c (comdat_linkage, maybe_make_one_only): Update call to
1196 (constrain_visibility, get_guard): Use DECL_COMDAT_GROUP.
1197 * method.c (use_thunk): Update call to make_decl_one_only.
1198 * optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP
1200 2009-06-12 Aldy Hernandez <aldyh@redhat.com>
1202 * typeck.c (cp_build_binary_op): Pass location to overflow_warning.
1203 (build_modify_expr): New arg.
1204 * semantics.c (finish_unary_op_expr): Pass location to
1206 (handle_omp_for_class_iterator): Pass location to build_modify_expr.
1207 * typeck.c (cxx_sizeof_or_alignof_type): Pass location to
1208 c_sizeof_or_alignof_type.
1209 (build_array_ref): New argument.
1210 (build_compound_expr): Same.
1211 (build_const_cast): Same.
1212 (build_ptrmemfunc): Pass location to build_c_cast.
1213 * init.c (avoid_placement_new_aliasing): Pass location to
1215 (build_vec_delete_1): Pass location to cp_build_modify_expr,
1216 build_compound_expr.
1217 * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
1218 * decl.c (poplevel): Pass location to c_build_bind_expr.
1219 (finish_case_label): Pass location to build_case_label.
1220 (finish_constructor_body): Same.
1221 (finish_destructor_body): Pass location to build_stmt.
1222 (cxx_maybe_build_cleanup): Same, but to build_compound_expr.
1223 * call.c (build_new_op): Pass location to build_array_ref.
1224 (build_x_va_arg): Pass location to build_va_arg.
1225 * except.c (expand_end_catch_block): Pass location to
1227 * cp-tree.h (build_array_ref): New argument.
1228 (build_compound_expr): Same.
1229 (build_c_cast): Same.
1230 * cp-gimplify.c (gimplify_if_stmt): Pass location on down.
1231 (gimplify_switch_stmt): Same.
1232 * typeck2.c (split_nonconstant_init_1): Same.
1233 * pt.c (tsubst_copy): Same.
1234 * semantics.c (add_decl_expr): Same.
1235 (do_poplevel): Same.
1236 (push_cleanup): Same.
1237 (finish_goto_stmt): Same.
1238 (finish_expr_stmt): Same.
1239 (begin_if_stmt): Same.
1240 (begin_while_stmt): Same.
1241 (begin_do_stmt): Same.
1242 (finish_return_stmt): Same.
1243 (begin_for_stmt): Same.
1244 (finish_break_stmt): Same.
1245 (finish_continue_stmt): Same.
1246 (begin_switch_stmt): Same.
1247 (begin_try_block): Same.
1248 (begin_handler): Same.
1249 (finish_asm_stmt): Same.
1250 (finish_label_stmt): Same.
1251 (finish_stmt_expr_expr): Same.
1252 (finalize_nrv_r): Same.
1253 (finish_omp_atomic): Same.
1254 * name-lookup.c (do_using_directive): Same.
1255 * decl2.c (grok_array_decl): Same.
1256 * parser.c (cp_parser_cast_expression): Same.
1257 (cp_parser_selection_statement): Same.
1258 (cp_parser_implicitly_scoped_statement): Same.
1259 (cp_parser_objc_selector_expression): Same.
1260 (cp_parser_objc_synchronized_statement): Same.
1261 (cp_parser_objc_throw_statement): Same.
1262 (cp_parser_omp_critical): Same.
1263 (cp_parser_omp_master): Same.
1264 * typeck.c (build_function_call): Add location argument.
1265 * init.c: Add location argument to all build_decl calls.
1271 * semantics.c: Same.
1274 * cp-gimplify.c: Same.
1276 (cp_make_fname_decl): Add location argument. Pass location ot
1278 (finish_case_label): Same.
1279 * cp-tree.h (finish_case_label): Add location argument.
1280 * parser.c (cp_parser_label_for_labeled_statement): Pass location to
1283 2009-06-09 Jason Merrill <jason@redhat.com>
1286 * decl2.c (mark_used): Return after complaining about deleted fn.
1288 2009-06-08 Jason Merrill <jason@redhat.com>
1290 * parser.c (cp_parser_type_id_1): 'auto' type is ok with a
1291 late-specified return type.
1293 2009-06-08 Jakub Jelinek <jakub@redhat.com>
1296 * call.c (check_dtor_name): Return false even if
1297 get_type_value (name) is error_mark_node.
1301 * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
1302 on error_mark_node. Check for VLAs outside of function context
1303 before check whether to wrap bounds into a NOP_EXPR with
1306 2009-06-08 Alexandre Oliva <aoliva@redhat.com>
1308 * repo.c (get_base_filename): Use aux_base_name rather than
1309 alternate temporary file during second compare debug compilation.
1310 (finish_repo): Skip during -fcompare-debug-second.
1312 2009-06-06 Ian Lance Taylor <iant@google.com>
1314 * parser.c (cp_parser_label_for_labeled_statement): Support
1315 attribute on labels if immediately followed by semicolon.
1316 * semantics.c (finish_label_stmt): Return new label.
1317 * pt.c (tsubst_expr): Handle attributes for LABEL_EXPR.
1319 2009-06-03 Ian Lance Taylor <iant@google.com>
1321 * Make-lang.in (cc1plus-checksum.o): Depend upon $(CONFIG_H) and
1324 2009-06-02 Mark Mitchell <mark@codesourcery.com>
1326 * decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
1328 2009-06-02 Jason Merrill <jason@redhat.com>
1332 * typeck.c (cp_build_modify_expr): Always pass init-lists to the
1334 * call.c (implicit_conversion): Allow init-list conversion to scalar
1335 during direct-initialization, too. Mark the conversion bad if it
1336 has too many levels of braces.
1337 (convert_like_real): And give a helpful error.
1341 * decl.c (cp_finish_decl): Handle auto deduction from ().
1342 * typeck.c (build_x_indirect_ref): Handle dereferencing an operand
1343 with dependent type that is known to be a pointer.
1345 2009-06-02 Simon Martin <simartin@users.sourceforge.net>
1348 * pt.c (register_specialization): Properly setup DECL_CONTEXT for
1349 specializations in an invalid namespace.
1351 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
1353 * error.c (print_instantiation_partial_context): Print column
1356 2009-05-29 Ian Lance Taylor <iant@google.com>
1358 * error.c (cp_printer): Don't use va_arg with enum type.
1360 2009-05-28 Dodji Seketeli <dodji@redhat.com>
1363 * cp-tree.h (canonical_type_variant): Remove this function declaration.
1364 (strip_typedefs): New function declaration.
1365 * tree.c (strip_typedefs): New function definition.
1366 (canonical_type_variant): Remove function definition.
1367 * cvt.c (convert_from_reference): No need to use
1368 canonical_type_variant.
1369 * typeck.c (cp_build_indirect_ref): Likewise.
1370 * error.c (dump_template_bindings): Use strip_typedefs instead of
1371 canonical_type_variant.
1372 * pt.c (convert_template_argument, unify): Likewise.
1373 * mangle.c (canonicalize_for_substitution): Don't use
1374 canonical_type_variant.
1376 2009-05-27 Jason Merrill <jason@redhat.com>
1378 * call.c (implicit_conversion): Handle conversion from
1379 initializer-list to scalar.
1380 (convert_like_real): Likewise. Avoid crashing on list
1381 initialization with bad conversions.
1382 (can_convert): Use LOOKUP_EXPLICIT.
1383 (can_convert_arg_bad): Add flags parm.
1384 * cp-tree.h: Adjust.
1385 * typeck.c (convert_for_assignment): Pass flags.
1387 2009-05-27 Ian Lance Taylor <iant@google.com>
1389 * Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
1390 (cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
1392 2009-05-26 Ian Lance Taylor <iant@google.com>
1394 * Make-lang.in (g++spec.o): Use $(COMPILER).
1395 (g++$(exeext), cc1plus-dummy$(exeext)): Likewise.
1396 (cc1plus$(exeext)): Likewise.
1398 2009-05-26 Dodji Seketeli <dodji@redhat.com>
1401 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Remove this accessor.
1402 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): New accessor.
1403 (get_types_needing_access_check): Declare new entry point.
1404 * pt.c (append_type_to_template_for_access_check_1,
1405 get_types_needing_access_check): New functions.
1406 (perform_typedefs_access_check): Accept FUNCTION_DECLs and
1407 RECORD_TYPEs rather than TEMPLATE_DECLs. Use the new
1408 get_types_needing_access_check, no more
1409 MEMBER_TYPES_NEEDING_ACCESS_CHECK.
1410 (instantiate_class_template): Set input_location to the source
1411 location of the most specialized template definition.
1412 Perform access check using the RECORD_TYPE of the template, not its
1413 associated most generic TEMPLATE_DECL.
1414 (append_type_to_template_for_access_check): Augment function
1415 comments. Use the new get_types_needing_access_check, not
1416 MEMBER_TYPE_NEEDING_ACCESS_CHECK. Use the new
1417 append_type_to_template_for_access_check_1 subroutine.
1419 2009-05-22 Jason Merrill <jason@redhat.com>
1422 * typeck.c (cp_build_binary_op): Allow ENUMERAL_TYPE in
1423 arithmetic comparisons.
1424 (cp_common_type): Handle scoped enums.
1426 * call.c (promoted_arithmetic_type_p): Don't use INTEGRAL_TYPE_P.
1427 (add_builtin_candidate, add_builtin_candidates): Likewise.
1428 (convert_like_real): Likewise.
1429 * class.c (check_bitfield_decl): Likewise.
1430 * decl.c (check_static_variable_definition): Likewise.
1431 (compute_array_index_type): Likewise.
1432 * decl2.c (grokbitfield): Likewise.
1433 * init.c (build_new_1): Likewise.
1434 * pt.c (convert_nontype_argument): Likewise.
1435 (current_instantiation): Likewise.
1436 * tree.c (pod_type_p): Likewise.
1437 * typeck.c (build_static_cast_1): Likewise.
1438 (build_reinterpret_cast_1): Likewise.
1440 2009-05-22 Richard Guenther <rguenther@suse.de>
1443 * init.c (avoid_placement_new_aliasing): Remove.
1444 (build_new_1): Do not call it.
1446 2009-05-22 Mark Mitchell <mark@codesourcery.com>
1448 * decl2.c (decl_needed_p): Consider dllexport'd functions needed.
1449 * semantics.c (expand_or_defer_fn): Similarly.
1451 2009-05-20 Ian Lance Taylor <iant@google.com>
1453 * parser.c (cp_parser_postfix_expression): Change args to a vec.
1454 Release it when done.
1455 (tree_vector): Define typedef. Define VEC functions.
1456 (cp_parser_parenthesized_expression_list): Change return type to
1457 vec. Change all callers.
1458 (cp_parser_new_expression): Change placement and initializer to
1459 vecs. Release them when done.
1460 (cp_parser_new_placement): Change return type to vec. Change all
1462 (cp_parser_new_initializer): Likewise.
1463 * typeck.c (build_function_call_vec): Just call
1464 cp_build_function_call_vec.
1465 (cp_build_function_call): Just build a vec and call
1466 cp_build_function_call_vec.
1467 (cp_build_function_call_vec): New function based on old
1468 cp_build_function_call.
1469 (convert_arguments): Remove nargs and argarray parameters. Change
1470 values to a vec. Change caller.
1471 (build_x_compound_expr_from_vec): New function.
1472 (cp_build_modify_expr): Build vec to pass to
1473 build_special_member_call.
1474 * call.c (struct z_candidate): Add first_arg field. Change args
1476 (convert_class_to_reference): Handle first argument separately.
1477 (add_candidate): Add first_arg parameter. Change args parameter
1478 to vec. Change all callers.
1479 (add_function_candidate, add_conv_candidate): Likewise.
1480 (add_template_candidate_real, add_template_candidate): Likewise.
1481 (add_template_conv_candidate): Likewise.
1482 (build_user_type_conversion_1): Handle first argument separately.
1483 (resolve_args): Change return type and parameter type to vecs.
1485 (perform_overload_resolution): Change args parameter to vec.
1487 (build_new_function_call, build_operator_new_call): Likewise.
1488 (add_candidates): Likewise.
1489 (build_op_call): New globally visible function, built from and
1490 replacing static function build_object_call.
1491 (build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
1493 (build_op_delete_call): Build vec to pass to
1494 cp_build_function_call_vec.
1495 (build_temp): Build vec to pass to build_special_member_call.
1496 (convert_like_real): Likewise.
1497 (perform_direct_initialization_if_possible): Likewise.
1498 (build_over_call): Handle first_arg field. Use build_call_array
1499 rather than build_call_list.
1500 (build_special_member_call): Change args parameter to vec. Change
1502 (build_new_method_call): Likewise.
1503 * init.c (expand_default_init): Change parms to vec.
1504 (build_raw_new_expr): Change placement and init to vecs. Change
1506 (build_new_1, build_new): Likewise.
1507 * class.c (resolve_address_of_overloaded_function): Build array to
1508 pass to fn_type_unification.
1509 * pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
1510 build_new. For CALL_EXPR create a vec rather than a tree_list;
1511 expand a pack if necessary.
1512 (fn_type_unification): Change args parameter to const tree *. Add
1513 nargs parameter. Change all callers.
1514 (type_unification_real): Likewise.
1515 (unify): Build array to pass to type_unification_real.
1516 (get_bindings): Build array to pass to fn_type_unification.
1517 (any_type_dependent_arguments_p): Change args parameter to a vec.
1519 (make_args_non_dependent): Renamed from build_non_dependent_args.
1520 Change return type to void. Change parameter type to vec. Change
1522 (do_auto_deduction): Pass an array to type_unification_real.
1523 * semantics.c (perform_koenig_lookup): Change args to vec. Change
1525 (finish_call_expr): Change args to vec. Change all callers. Call
1526 build_op_call instead of passing CALL_EXPR to build_new_op.
1527 (cxx_omp_create_clause_info): Allocate vec to pass to
1528 build_special_member_call.
1529 * decl2.c (build_offset_ref_call_from_tree): Change args parameter
1530 to vec. Change all callers.
1531 * name-lookup.c (lookup_function_nonclass): Likewise.
1532 (struct arg_lookup): Change args to vec.
1533 (arg_assoc_namespace): Handle args as a vec.
1534 (arg_assoc_args_vec): New static function.
1535 (lookup_arg_dependent): Change args parameter to vec. Change all
1537 * method.c (do_build_assign_ref): Allocate vec to pass to
1538 build_special_member_call.
1539 * except.c (build_throw): Likewise.
1540 * typeck2.c (build_functional_cast): Likewise.
1541 * cvt.c (ocp_convert): Likewise.
1542 * tree.c (build_min_non_dep_call_vec): Change last parameter to
1543 vec. Change all callers.
1544 * cp-tree.h: Update declarations.
1545 * name-lookup.h: Update declarations.
1547 2009-05-20 Sandra Loosemore <sandra@codesourcery.com>
1549 * typeck.c (default_conversion): Check targetm.promoted_type.
1550 * decl.c (grokdeclarator): Check targetm.invalid_return_type.
1551 (grokparms): Check targetm.invalid_parameter_type.
1552 * cvt.c (ocp_convert): Check targetm.convert_to_type.
1553 (build_expr_type_conversion): Check targetm.promoted_type.
1555 2009-05-19 Andrew Pinski <andrew_pinski@playstation.sony.com>
1557 * typeck.c (build_binary_op): Allow % on integal vectors.
1559 2009-05-18 Jason Merrill <jason@redhat.com>
1561 Implement explicit conversions ops as specified in N2437.
1562 * decl.c (grokdeclarator): Handle explicit conversion ops.
1563 (check_initializer): Pass flags to store_init_value.
1564 * decl2.c (maybe_emit_vtables): Likewise.
1565 * init.c (expand_aggr_init_1): Likewise.
1566 * call.c (convert_class_to_reference): Take flags parm,
1567 check DECL_NONCONVERTING_P.
1568 (build_user_type_conversion_1): Check DECL_NONCONVERTING_P.
1569 (add_builtin_candidates): Simplify getting type of conversion.
1570 (build_object_call): Likewise. Check DECL_NONCONVERTING_P.
1571 (implicit_conversion): Pass through LOOKUP_ONLYCONVERTING.
1572 (reference_binding): Take flags parm. Direct-initialize copy parm.
1573 (add_function_candidate): Direct-initialize the copy parm.
1574 (add_conv_candidate): Use LOOKUP_IMPLICIT, not LOOKUP_NORMAL.
1575 (build_builtin_candidate): Add LOOKUP_ONLYCONVERTING.
1576 (conditional_conversion): Likewise.
1577 (convert_like_real): Only complain about DECL_NONCONVERTING_P
1579 (perform_implicit_conversion_flags): Add flags parm to
1580 perform_implicit_conversion. Improve diagnostics.
1581 * cp-tree.h (LOOKUP_IMPLICIT): New macro.
1582 (LOOKUP_COPY_PARM): New bit macro.
1583 * cvt.c (build_expr_type_conversion): Check DECL_NONCONVERTING_P.
1584 * typeck.c (convert_for_assignment): Take flags parm, pass it to
1585 perform_implicit_conversion_flags.
1586 (cp_build_modify_expr): Pass flags to convert_for_assignment.
1587 (convert_for_initialization): Likewise.
1588 * typeck2.c (store_init_value): Take flags parm, pass to
1590 (digest_init_flags): Add flags parm to digest_init.
1591 (digest_init_r): Take flags parm, pass to convert_for_initialization.
1592 (process_init_constructor_array): Pass it.
1593 (process_init_constructor_record): Likewise.
1594 (process_init_constructor_union): Likewise.
1596 2009-05-16 Jason Merrill <jason@redhat.com>
1599 * pt.c (tsubst_qualified_id): Retain the type if we aren't dealing
1600 with a dependent type. Actually look up the destructor.
1601 * semantics.c (finish_id_expression): Fix logic.
1602 (finish_qualified_id_expr): Don't try to use 'this' if we aren't in
1604 * typeck.c (build_x_unary_op): Diagnose taking the address of a
1605 constructor or destructor.
1606 * tree.c (get_first_fn): Handle OFFSET_REF.
1608 2009-05-17 Joseph Myers <joseph@codesourcery.com>
1610 * tree.c (cxx_printable_name_internal): Allow consecutive
1611 translated and untranslated cached copies of the name of the
1614 2009-05-15 Ian Lance Taylor <iant@google.com>
1616 * cp-tree.h (enum cp_lvalue_kind_flags): Rename from
1617 cp_lvalue_kind. Change all uses.
1618 (enum base_access_flags): Rename from enum base_access. Change
1620 * parser.c (enum cp_parser_flags): Remove enum tag.
1622 2009-05-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
1625 * call.c (build_new_op): Update calls to warn_logical_operator.
1627 2009-05-14 Ian Lance Taylor <iant@google.com>
1629 * class.c (layout_class_type): Change itk to unsigned int.
1630 * decl.c (finish_enum): Change itk to unsigned int.
1631 * parser.c (cp_parser_check_decl_spec): Change ds to int. Remove
1634 2009-05-13 David Mandelin <dmandelin@mozilla.com>:
1636 * decl.c (duplicate_decls): Preserve parameter attributes.
1638 2009-05-10 Jan Hubicka <jh@suse.cz>
1640 * decl2.c (cxx_callgraph_analyze_expr): Use
1641 cgraph_mark_address_taken.
1643 2009-05-10 Joseph Myers <joseph@codesourcery.com>
1645 * call.c (name_as_c_string): Call type_as_string_translate.
1646 Translate identifiers to locale character set.
1647 * cp-tree.h (lang_decl_name): Update prototype.
1648 (type_as_string_translate, decl_as_string_translate,
1649 cxx_printable_name_translate): Declare.
1650 * cxx-pretty-print.c (M_): Define.
1651 (pp_cxx_unqualified_id, pp_cxx_canonical_template_parameter): Mark
1652 English fragments for conditional translation with M_.
1653 * decl.c (grokdeclarator): Translate identifiers to locale
1654 character set for diagnostics.
1655 * error.c (M_): Define.
1656 (dump_template_bindings, dump_type, dump_aggr_type,
1657 dump_type_prefix, dump_global_iord, dump_simple_decl, dump_decl,
1658 dump_function_decl, dump_template_parms, dump_expr,
1659 dump_binary_op, op_to_string, assop_to_string): Mark English
1660 fragments for conditional translation with M_.
1661 (type_as_string): Disable translation of identifiers.
1662 (type_as_string_translate): New.
1663 (expr_as_string): Disable translation of identifiers.
1664 (decl_as_string): Disable translation of identifiers.
1665 (decl_as_string_translate): New.
1666 (lang_decl_name): Add parameter translate.
1667 (args_to_string): Call type_as_string_translate.
1668 (cp_print_error_function): Call cxx_printable_name_translate.
1669 (print_instantiation_full_context,
1670 print_instantiation_partial_context): Call
1671 decl_as_string_translate.
1672 * parser.c (cp_lexer_get_preprocessor_token): Use %qE for
1673 identifier in diagnostic.
1674 * tree.c (cxx_printable_name): Change to
1675 cxx_printable_name_internal. Add parameter translate.
1676 (cxx_printable_name, cxx_printable_name_translate): New wrappers
1677 round cxx_printable_name_internal.
1679 2009-05-08 H.J. Lu <hongjiu.lu@intel.com>
1682 * call.c (build_call_a): Updated warn_deprecated_use call.
1683 (build_over_call): Likewise.
1684 * decl.c (grokdeclarator): Likewise.
1685 (grokparms): Likewise.
1686 * semantics.c (finish_id_expression): Likewise.
1687 * typeck.c (build_class_member_access_expr): Likewise.
1688 (finish_class_member_access_expr): Likewise.
1690 2009-05-06 Dodji Seketeli <dodji@redhat.com>
1693 * pt.c (tsubst_copy) <case PARM_DECL>: We don't want to tsubst the
1694 whole list of PARM_DECLs, just the current one.
1696 2009-05-05 Shujing Zhao <pearly.zhao@oracle.com>
1699 (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
1700 mangle_compound_literal): Remove unused declarations.
1701 (build_vfield_ref, cxx_print_statistics, clone_function_decl,
1702 adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
1703 pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
1704 check_for_out_of_scope_variable, print_other_binding_stack,
1705 maybe_push_decl, cxx_mark_addressable, force_target_expr,
1706 build_target_expr_with_type, finish_case_label,
1707 cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
1708 check_template_keyword, cxx_omp_predetermined_sharing,
1709 cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
1710 cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
1711 cxx_omp_privatize_by_reference): Rearrange the declarations line to
1712 match the comment that indicates the .c file which the functions are
1714 (cxx_print_xnode, cxx_print_decl, cxx_print_type,
1715 cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
1717 2009-05-05 Nathan Sidwell <nathan@codesourcery.com>
1719 * typeck.c (cp_build_compound_expr): Require RHS to have a known
1721 * class.c (resolve_address_of_overloaded_function): Use
1722 OVL_CURRENT for error message.
1723 (instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
1724 with them. Do not copy the node.
1726 2009-05-05 Jakub Jelinek <jakub@redhat.com>
1729 * pt.c (tsubst): If magic NOP_EXPR with side-effects has no type,
1730 set it from its operand's type after tsubst_expr.
1732 2009-05-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1735 * parser.c (cp_lexer_get_preprocessor_token): Do not store the
1736 canonical spelling for keywords.
1737 (cp_parser_attribute_list): Use the canonical spelling for
1738 keywords in attributes.
1740 2009-05-01 Joseph Myers <joseph@codesourcery.com>
1742 * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
1743 pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression,
1744 pp_cxx_new_expression, pp_cxx_delete_expression,
1745 pp_cxx_unary_expression, pp_cxx_assignment_operator,
1746 pp_cxx_assignment_expression, pp_cxx_expression,
1747 pp_cxx_function_specifier, pp_cxx_decl_specifier_seq,
1748 pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq,
1749 pp_cxx_exception_specification, pp_cxx_direct_declarator,
1750 pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement,
1751 pp_cxx_namespace_alias_definition, pp_cxx_template_parameter,
1752 pp_cxx_canonical_template_parameter, pp_cxx_template_declaration,
1753 pp_cxx_declaration, pp_cxx_typeid_expression,
1754 pp_cxx_va_arg_expression, pp_cxx_offsetof_expression,
1755 pp_cxx_trait_expression): Mostly use pp_string and
1756 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1757 for non-identifiers. Mark English strings for translation.
1758 * cxx-pretty-print.h (pp_cxx_ws_string): Define.
1759 * error.c (dump_template_parameter, dump_template_bindings,
1760 dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl,
1761 dump_decl, dump_template_decl, dump_function_decl,
1762 dump_parameters, dump_exception_spec, dump_template_parms,
1763 dump_expr, dump_binary_op, dump_unary_op, op_to_string,
1764 assop_to_string, args_to_string, cp_print_error_function,
1765 print_instantiation_full_context,
1766 print_instantiation_partial_context): Mostly use pp_string and
1767 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1768 for non-identifiers. Mark English strings for translation.
1769 (dump_global_iord): Mark strings for translation; use longer
1770 strings instead of substituting single words.
1771 (function_category): Return a format string marked for
1772 translation, not a single word or phrase to substitute in a longer
1775 2009-04-28 Ben Elliston <bje@au.ibm.com>
1780 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1782 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
1784 2009-04-27 Ian Lance Taylor <iant@google.com>
1786 * semantics.c (finish_omp_clauses): Change type of c_kind to enum
1789 2009-04-27 Jakub Jelinek <jakub@redhat.com>
1792 * cvt.c (convert_to_void) <case INDIRECT_REF>: Only warn about
1793 -Wunused-value if implicit.
1795 2009-04-24 Ian Lance Taylor <iant@google.com>
1797 * call.c (build_temp): Change 0 to enum constant.
1798 * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
1800 * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
1801 * decl2.c (constrain_visibility): Likewise.
1802 * parser.c (cp_lexer_get_preprocessor_token): Likewise.
1803 (cp_parser_flags): Typedef to int rather than enum type.
1804 (cp_parser_expression_stack_entry): Change prec field to enum
1807 * typeck.c (build_modify_expr): Add lhs_origtype parameter.
1810 2009-04-22 Dodji Seketeli <dodji@redhat.com>
1813 * parser.c (cp_parser_template_argument_list): Display an error
1814 when an ellipsis is not preceded by a parameter pack. Also, warn
1815 about variadic templates usage without -std=c++0x.
1817 2009-04-21 Taras Glek <tglek@mozilla.com>
1819 * cp-tree.h: Update GTY annotations to new syntax.
1821 * mangle.c: Likewise.
1822 * name-lookup.c: Likewise.
1823 * name-lookup.h: Likewise.
1824 * parser.c: Likewise.
1827 * semantics.c: Likewise.
1828 * typeck2.c: Likewise.
1830 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1833 * parser.c (cp_parser_error): Pass token->flags to c_parse_error.
1835 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1838 * typeck.c (check_for_casting_away_constness): We diagnose casting
1839 away any qualifiers not just constness.
1840 (casts_away_constness): Mention that it handles more than just
1843 2009-04-21 Joseph Myers <joseph@codesourcery.com>
1845 * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
1846 ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
1847 ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
1848 ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
1849 ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
1850 cfns.gperf: Add copyright and license notices.
1851 * cfns.h: Regenerate.
1852 * ChangeLog, ChangeLog-2004: Correct dates.
1854 2009-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1857 * tree.c (lvalue_p_1): Use const_tree.
1858 Use CONST_CAST_TREE to avoid warning.
1859 (lvalue_p): Returns bool, receives const_tree.
1861 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1864 * parser.c (cp_parser_check_decl_spec): Drop redundant flags.
1865 * error.c (pedwarn_cxx98): New.
1866 * cp-tree.h (pedwarn_cxx98): Declare.
1868 2009-04-20 Le-Chun Wu <lcwu@google.com>
1871 * init.c (build_vec_init): Set TREE_NO_WARNING on the
1872 compiler-generated INDIRECT_REF expression.
1874 2009-04-20 Ian Lance Taylor <iant@google.com>
1876 * typeck.c (build_function_call_vec): New function.
1877 (cp_build_function_call): Only pass first parameter to
1878 objc_rewrite_function_call.
1879 (build_modify_expr): Add rhs_origtype parameter. Change all
1881 * decl.c (finish_decl): Add origtype parameter. Change all
1883 * semantics.c (finish_call_expr): Pass VEC to
1884 resolve_overloaded_builtin.
1886 2009-04-20 Ian Lance Taylor <iant@google.com>
1888 * cp-tree.h (base_access): Change typedef to int.
1889 * parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
1890 (cp_parser_omp_threadprivate): Likewise.
1891 * pt.c (unify_pack_expansion): Add casts to enum type.
1893 2009-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
1897 * call.c (build_new_op): Save the original codes of operands
1900 2009-04-18 Kazu Hirata <kazu@codesourcery.com>
1902 * cp-tree.h: Remove the prototype for insert_block.
1903 * decl.c (insert_block): Remove.
1905 2009-04-16 Ian Lance Taylor <iant@google.com>
1907 * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t.
1908 (tsubst_flags_t): Change typedef from enum type to int.
1910 2009-04-16 Paolo Bonzini <bonzini@gnu.org>
1912 * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE
1913 instead of targetm.vector_opaque_p.
1915 2009-04-15 Le-Chun Wu <lcwu@google.com>
1918 * call.c (build_over_call): Set TREE_NO_WARNING on the
1919 compiler-generated INDIRECT_REF expression.
1920 * cvt.c (convert_to_void): Emit warning when stripping off
1923 2009-04-14 Diego Novillo <dnovillo@google.com>
1925 * parser.c (cp_parser_type_specifier_seq): Move call to
1926 invoke_plugin_callbacks ...
1927 (cp_parser_type_specifier_seq): ... here.
1929 2009-04-14 Le-Chun Wu <lcwu@google.com>
1931 * Make-lang.in: Modify dependencies of files including plugin.h.
1932 * decl.c (finish_function): Call invoke_plugin_callbacks.
1933 * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
1935 2009-04-14 Jason Merrill <jason@redhat.com>
1938 * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
1939 about shadowing by tentative parms.
1941 2009-04-13 Jason Merrill <jason@redhat.com>
1944 * call.c (build_over_call): Don't call memcpy if the target is
1945 the same as the source.
1947 2009-04-13 Jason Merrill <jason@redhat.com>
1950 * pt.c (uses_template_parms): Handle CONSTRUCTOR.
1952 2009-04-12 Jason Merrill <jason@redhat.com>
1955 * call.c (joust): Don't crash on variadic fn.
1957 2009-04-10 Jason Merrill <jason@redhat.com>
1960 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return
1961 if we see a close brace without an open brace.
1963 2009-04-10 H.J. Lu <hongjiu.lu@intel.com>
1965 * parser.c (cp_parser_class_specifier): Remove the unused
1966 has_trailing_semicolon.
1968 2009-04-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
1971 * parser.c (cp_parser_check_template_parameters): Take a
1972 cp_declarator parameter.
1973 (cp_parser_elaborated_type_specifier): Update to
1974 cp_parser_check_template_parameters.
1975 (cp_parser_class_head): Likewise.
1976 (cp_parser_check_declarator_template_parameters): Likewise.
1977 (cp_parser_check_template_parameters): Handle first the non-error
1978 conditions. Give more accurate diagnostics if a declarator is
1981 2009-04-08 Jason Merrill <jason@redhat.com>
1984 * error.c (dump_aggr_type): Chase template typedefs if
1985 -fno-pretty-templates.
1987 2009-04-08 Dodji Seketeli <dodji@redhat.com>
1990 * parser.c (cp_parser_enumerator_definition): Make sure the
1991 initializer of the enumerator doesn't contain any bare parameter pack.
1993 2009-04-07 Jason Merrill <jason@redhat.com>
1996 * name-lookup.c (merge_functions): Keep multiple extern "C" functions.
1997 * call.c (joust): Complain about mismatched default arguments
1998 in extern "C" functions.
1999 * class.c (resolve_address_of_overloaded_function): Handle multiple
2000 extern "C" functions.
2001 * pt.c (resolve_overloaded_unification): Likewise.
2003 2009-04-07 Jason Merrill <jason@redhat.com>
2006 * error.c (dump_function_decl): Don't pretty-print templates
2007 if -fno-pretty-templates.
2008 (count_non_default_template_args): Print all args if
2009 -fno-pretty-templates.
2011 2009-04-06 Jason Merrill <jason@redhat.com>
2014 * pt.c (fn_type_unification): For DEDUCE_EXACT check that
2015 the deduced template arguments give us the parameter types
2018 2009-04-05 Giovanni Bajo <giovannibajo@libero.it>
2019 Jason Merrill <jason@redhat.com>
2022 * error.c (count_non_default_template_args): New fn.
2023 (dump_template_parms): Call it.
2024 (dump_template_argument_list): Call it. Add parms parm.
2025 (dump_template_argument): Adjust call to dump_template_argument_list.
2026 (dump_type, dump_decl): Likewise.
2027 (dump_template_bindings): Refactor logic.
2029 2009-04-03 Jason Merrill <jason@redhat.com>
2032 * error.c (dump_template_bindings): Look through typedefs in
2034 (dump_type) [TYPENAME_TYPE]: Print the typedef name if any.
2035 (find_typenames_r): Also collect typedefs.
2036 * pt.c (unify): Strip typedefs.
2039 * semantics.c (finish_id_expression): Don't assume a dependent
2040 member of the current instantiation isn't a valid integral
2041 constant expression. Check dependent_scope_p.
2042 * pt.c (dependent_scope_p): Check TYPE_P.
2043 (tsubst_copy): If args is null, just return.
2045 2009-04-02 Jason Merrill <jason@redhat.com>
2048 * error.c (find_typenames, find_typenames_r): New fns.
2049 (dump_function_decl): Call find_typenames.
2050 (dump_template_bindings): Print typenames as well.
2051 * pt.c (tsubst): Non-static.
2052 * cp-tree.h: Declare it.
2054 2009-04-02 Dodji Seketeli <dodji@redhat.com>
2057 * decl2.c (grokfield): when a typedef appears in a
2058 class, create the typedef variant type node for it.
2059 (save_template_attributes): Creating typedef variant type node
2060 here is now useless.
2061 * decl.c (grokdeclarator): If the typedef'ed struct/class was
2062 anonymous, set the proper type name to all its type variants.
2063 (xref_basetypes) : Fixup the variant types after setting
2065 * name-lookup.c (pushdecl_maybe_friend): Reuse the
2066 set_underlying_type function to install typedef variant types.
2067 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
2069 (append_type_to_template_for_access_check): New entry points.
2070 * semantics.c (check_accessibility_of_qualified_id):
2071 When a typedef that is a member of a class appears in a template,
2072 add it to the template. It will be ...
2073 * class.c (finish_struct_bits): Split type variant fixup into ...
2074 (fixup_type_variants): A new entry point.
2075 * pt.c (instantiate_class_template, instantiate_template ): ... access
2076 checked at template instantiation time.
2077 (resolve_type_name_type): The type name should be the name of the
2079 (retrieve_specialization): Specializations of template typedefs aren't
2080 to looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
2081 (append_type_to_template_for_access_check): New entry point.
2082 (tsubst_decl): For typedefs, build the variant type from the correct
2084 (get_class_bindings): Fix function comment.
2085 (perform_typedefs_access_check): New entry point.
2087 2009-03-31 Jason Merrill <jason@redhat.com>
2090 * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
2091 extern "C" declarations.
2094 * semantics.c (finish_non_static_data_member): Allow such references
2095 without an associated object in sizeof/decltype/alignof.
2097 * ptree.c (cxx_print_decl): Pretty-print full name of
2099 (cxx_print_type): Pretty-print full name of class.
2101 * decl.c (grokdeclarator): Reject pointer to qualified function
2104 PR c++/37806, core issue 547
2105 * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
2107 * tree.c (cp_build_qualified_type_real): Don't apply restrict to a
2109 * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
2110 * decl.c (groktypename): Add is_template_arg parameter.
2111 (grokdeclarator): Allow function cv-quals on a template type arg.
2112 * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
2113 is_template_arg argument in calls to groktypename.
2114 * cp-tree.h: Adjust prototype.
2115 * error.c (dump_type_prefix, dump_type_suffix): Fix plain
2116 FUNCTION_TYPE printing.
2118 * mangle.c (write_expression): Mangle dependent name as
2121 PR c++/38030, 38850, 39070
2122 * pt.c (type_dependent_expression_p_push): New fn.
2123 (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
2124 substitution makes the call non-dependent. Preserve koenig_p.
2125 * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
2126 for non-dependent calls.
2127 * semantics.c (finish_call_expr): Revert earlier changes.
2128 * cp-tree.h: Revert change to finish_call_expr prototype.
2130 2009-03-29 Joseph Myers <joseph@codesourcery.com>
2132 PR preprocessor/34695
2133 * cp-tree.h (cp_cpp_error): Remove.
2134 * error.c (cp_cpp_error): Remove.
2135 * parser.c (cp_lexer_new_main): Set done_lexing instead of
2136 client_diagnostic and error callback.
2138 2009-03-28 Paolo Bonzini <bonzini@gnu.org>
2140 * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
2141 * cp/cp-objcp-common.c (cxx_staticp): Remove.
2142 * cp/cp-tree.h (cxx_staticp): Remove.
2144 2009-03-28 Jakub Jelinek <jakub@redhat.com>
2147 * parser.c (cp_parser_postfix_expression): Don't call
2148 warning_if_disallowed_function_p.
2150 2009-03-27 Jan Hubicka <jh@suse.cz>
2152 * except.c (choose_personality_routine): Set terminate_node to abort
2153 for java exceptions.
2155 2009-03-27 Dodji Seketeli <dodji@redhat.com>
2156 Jakub Jelinek <jakub@redhat.com>
2159 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
2160 (cp_function_decl_explicit_p): New prototype.
2161 * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
2163 2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
2166 * parser.c (cp_parser_elaborated_type_specifier): If we have a
2167 typename tag and don't have either a TYPE_DECL or a
2168 TEMPLATE_ID_EXPR, set the type to NULL.
2170 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
2173 * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
2176 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
2179 * decl.c (check_array_designated_initializer): Handle error_mark_node.
2181 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2184 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
2186 2009-03-26 Andrew Haley <aph@redhat.com>
2189 * decl2.c (possibly_inlined_p): If java exceptions are in use
2190 don't inline a decl unless it is explicitly marked inline.
2191 * lex.c: (pragma_java_exceptions): New variable.
2192 (handle_pragma_java_exceptions): Set pragma_java_exceptions.
2193 * cp-tree.h (pragma_java_exceptions): Declare new variable.
2195 2009-03-24 Jason Merrill <jason@redhat.com>
2198 * name-lookup.c (pushdecl_maybe_friend): Check default args later.
2200 2009-03-23 Jakub Jelinek <jakub@redhat.com>
2203 * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
2204 code if iter is the second operand.
2205 * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
2206 argument. If it is set, don't build the toplevel expression with
2207 build_x_binary_op, but build2.
2208 (cp_parser_assignment_expression, cp_parser_omp_for_incr): Adjust
2210 (cp_parser_omp_for_cond): Don't assume the first operand of the
2211 comparison must be decl.
2213 2009-03-23 Jason Merrill <jason@redhat.com>
2216 * pt.c (make_fnparm_pack): Split out from...
2217 (instantiate_decl): ...here.
2218 (tsubst_pack_expansion): Handle being called in a late-specified
2222 * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
2225 2009-03-20 Jason Merrill <jason@redhat.com>
2228 * parser.c (cp_parser_direct_declarator): In a template, wrap
2229 non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
2230 * pt.c (tsubst): Preserve it in a partial instantiation.
2231 (dependent_type_p_r): Don't check value_dependent_expression_p.
2232 * decl.c (compute_array_index_type): Don't check
2233 value_dependent_expression_p if TREE_SIDE_EFFECTS.
2236 * typeck2.c (check_narrowing): Don't complain about loss of
2237 precision when converting a floating-point constant.
2239 2009-03-19 Jakub Jelinek <jakub@redhat.com>
2242 * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
2243 (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
2245 2009-03-18 Jakub Jelinek <jakub@redhat.com>
2247 * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
2248 (eof_token): Adjust.
2250 2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
2253 * parser.c (cp_parser_explicit_specialization): Don't skip the
2254 rest of the specialization when begin_specialization returns
2257 2009-03-17 Jason Merrill <jason@redhat.com>
2259 * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
2260 (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
2261 * pt.c (check_explicit_specialization): Likewise.
2262 (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
2263 local specialization.
2264 * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
2265 * decl2.c (parm_index): New fn.
2266 * semantics.c (finish_decltype_type): Don't use describable_type.
2267 * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR.
2268 Give a sorry for unsupported codes rather than crash. Mangle
2269 conversions with other than 1 operand. New mangling for PARM_DECL.
2270 * operators.def (ALIGNOF_EXPR): Mangle as "az".
2272 2009-03-17 Jing Yu <jingyu@google.com>
2275 * method.c (use_thunk): Change is_thunk from crtl to cfun.
2277 2009-03-17 Paolo Carlini <paolo.carlini@oracle.com>
2280 * semantics.c (check_trait_type): New.
2281 (finish_trait_expr): Use it.
2283 2009-03-17 Jakub Jelinek <jakub@redhat.com>
2285 * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
2286 instead of calling imported_module_or_decl debug hook if
2287 building_stmt_tree ().
2288 * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
2289 is a NAMESPACE_DECL.
2292 * name-lookup.c (do_namespace_alias): Don't call global_decl debug
2293 hook at function scope.
2296 * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
2299 2009-03-09 Jakub Jelinek <jakub@redhat.com>
2302 * semantics.c (finish_switch_cond): Don't call get_unwidened.
2303 * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
2304 instead of TREE_TYPE (cond).
2306 2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
2309 * parser.c (cp_parser_late_parsing_default_args): Continue
2310 the loop when cp_parser_assignment_expression returns
2313 2009-03-07 Jason Merrill <jason@redhat.com>
2316 * init.c (build_new_1): Don't use a VLA type.
2317 (build_vec_init): Handle getting a pointer for BASE.
2319 2009-03-06 H.J. Lu <hongjiu.lu@intel.com>
2322 * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
2323 when mangling symbols.
2325 2009-03-06 Paolo Carlini <paolo.carlini@oracle.com>
2328 * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
2330 2009-03-06 Alexandre Oliva <aoliva@redhat.com>
2332 * decl.c (record_builtin_java_type): Use canonicalized integer
2335 2009-03-04 Jason Merrill <jason@redhat.com>
2338 * class.c (is_really_empty_class): New fn.
2339 * cp-tree.h: Declare it.
2340 * cp-objcp-common.c (cp_expr_size): Use it.
2343 * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
2344 * parser.c (cp_parser_postfix_expression): Call it for
2346 * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
2347 (get_first_fn): Likewise.
2353 * decl.c (make_typename_type): Do look inside currently open classes.
2354 * parser.c (cp_parser_lookup_name): Likewise.
2355 (cp_parser_template_name): Likewise.
2356 * pt.c (dependent_scope_p): New function.
2357 * cp-tree.h: Declare it.
2358 * class.c (currently_open_class): Return fast if T isn't a class.
2360 2009-02-26 H.J. Lu <hongjiu.lu@intel.com>
2363 * parser.c (cp_parser_mem_initializer): Return error_mark_node
2364 if cp_parser_mem_initializer_id returns error_mark_node.
2366 2009-02-24 Richard Guenther <rguenther@suse.de>
2369 * pt.c (instantiate_decl): Do not instantiate extern, non-inline
2372 2009-02-23 H.J. Lu <hongjiu.lu@intel.com>
2375 * pt.c (coerce_template_template_parms): Return 0 if parameter
2378 2009-02-23 Jason Merrill <jason@redhat.com>
2380 * pt.c (unify): Call maybe_adjust_types_for_deduction when
2381 deducing from an initializer list.
2383 2009-02-20 Jason Merrill <jason@redhat.com>
2386 * decl.c (grokdeclarator): Handle ~identifier.
2388 2009-02-19 Jakub Jelinek <jakub@redhat.com>
2391 * decl2.c (determine_visibility): If visibility changed and
2392 DECL_RTL has been already set, call make_decl_rtl to update symbol
2395 2009-02-19 H.J. Lu <hongjiu.lu@intel.com>
2398 * cp-tree.h (maybe_commonize_var): New.
2400 * decl.c (maybe_commonize_var): Make it extern.
2402 * decl2.c (finish_anon_union): Call maybe_commonize_var.
2404 2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
2407 * parser.c (cp_parser_enum_specifier): Apply all attributes.
2409 2009-02-18 Jason Merrill <jason@redhat.com>
2411 * cfns.h: Tweak pathname for cfns.gperf.
2413 2009-02-13 Jason Merrill <jason@redhat.com>
2416 * semantics.c (finish_call_expr): Change koenig_p parm to int.
2417 If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
2418 * cp-tree.h: Adjust prototype.
2419 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
2421 2009-02-12 Jason Merrill <jason@redhat.com>
2424 * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
2426 2009-02-11 Jason Merrill <jason@redhat.com>
2429 * decl2.c (cp_write_global_declarations):
2430 Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
2433 * init.c (build_value_init_noctor): Split out from...
2434 (build_value_init): ...here.
2435 (expand_aggr_init_1): Handle value-initialization.
2436 * cp-tree.h: Add declaration.
2437 * class.c (type_has_user_provided_constructor):
2438 Handle non-class arguments.
2440 2009-02-10 Jason Merrill <jason@redhat.com>
2443 * class.c (defaultable_fn_p): Handle ... properly.
2446 * tree.c (lvalue_p_1): Condition rvalue ref handling on
2447 treat_class_rvalues_as_lvalues, too.
2449 2009-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2452 * typeck.c (build_x_array_ref): New.
2453 * cp-tree.h: Declare it.
2454 * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
2456 2009-02-09 Jason Merrill <jason@redhat.com>
2459 * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
2460 * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
2461 * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
2462 * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
2463 for build_value_init TARGET_EXPR.
2464 * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
2466 2009-02-06 Paolo Carlini <paolo.carlini@oracle.com>
2470 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
2472 2009-02-04 Jakub Jelinek <jakub@redhat.com>
2475 * operators.def: Use COMPONENT_REF code for ->/pt operator again,
2476 remove ./dt operator.
2477 * mangle.c (write_expression): Handle COMPONENT_REF after handling
2478 ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
2479 write_string ("dt") instead of using operators.def.
2481 2009-02-03 Jason Merrill <jason@redhat.com>
2483 * typeck.c (cp_build_unary_op): Only complain about taking address
2484 of main if pedantic.
2486 2009-02-03 Jakub Jelinek <jakub@redhat.com>
2489 * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
2492 * typeck2.c (digest_init_r): Don't call process_init_constructor
2495 2009-02-03 Paolo Bonzini <bonzini@gnu.org>
2498 * pt.c (convert_nontype_argument_function): Expect expr to be an
2502 * typeck.c (merge_types): Call resolve_typename_type if only
2503 one type is a typename.
2505 2009-02-02 Jason Merrill <jason@redhat.com>
2508 * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node
2511 2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
2514 * parser.c (cp_parser_pure_specifier): If there are no tokens left
2515 do not call cp_lexer_consume_token.
2517 2009-01-30 Jakub Jelinek <jakub@redhat.com>
2520 * parser.c (cp_parser_already_scoped_statement): Handle __label__
2523 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2526 * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
2528 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2531 * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
2533 2009-01-29 Paolo Carlini <paolo.carlini@oracle.com>
2535 * typeck.c (invalid_nonstatic_memfn_p): Use
2536 DECL_NONSTATIC_MEMBER_FUNCTION_P.
2538 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com>
2541 * call.c (build_over_call): If convert_for_arg_passing returns
2542 error_mark_node unconditionally return it.
2544 2009-01-22 Adam Nemet <anemet@caviumnetworks.com>
2546 * class.c (check_field_decls): Also inherit packed for bitfields
2547 regardless of their type.
2549 2009-01-22 Dodji Seketeli <dodji@redhat.com>
2552 * decl2.c (grokfield): Reverting changes of PR c++/26693
2553 (save_template_attributes): Likewise.
2554 * decl.c (grokdeclarator): Likewise.
2555 * name-lookup.c (pushdecl_maybe_friend): Likewise.
2556 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
2557 (append_type_to_template_for_access_check): Likewise.
2558 * semantics.c (check_accessibility_of_qualified_id): Likewise.
2559 * pt.c (instantiate_class_template, instantiate_template ): Likewise.
2561 (resolve_type_name_type): Likewise.
2562 (append_type_to_template_for_access_check): Likewise.
2564 2009-01-21 Dodji Seketeli <dodji@redhat.com>
2567 * decl2.c (grokfield): when a typedef appears in a
2568 class, create the typedef variant type node for it.
2569 (save_template_attributes): Creating typedef variant type node
2570 here is now useless.
2571 * decl.c (grokdeclarator): If the typedef'ed struct/class was
2572 anonymous, set the proper type name to all its type variants.
2573 * name-lookup.c (pushdecl_maybe_friend): Reuse the
2574 set_underlying_type function to install typedef variant types.
2575 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
2577 (append_type_to_template_for_access_check): New entry points.
2578 * semantics.c (check_accessibility_of_qualified_id):
2579 When a typedef that is a member of a class appears in a template,
2580 add it to the template. It will be ...
2581 * pt.c (instantiate_class_template, instantiate_template ): ... access
2582 checked at template instantiation time.
2583 (tsubst): Handle the case of being called with NULL args.
2584 (resolve_type_name_type): The type name should be the name of the
2586 (append_type_to_template_for_access_check): New entry point.
2588 2009-01-19 Jason Merrill <jason@redhat.com>
2591 * parser.c (cp_parser_unqualified_id): In a template,
2593 * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
2595 2009-01-16 Jason Merrill <jason@redhat.com>
2598 * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
2599 * init.c (build_new): Don't call describable_type unless we
2603 * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
2606 * search.c (protected_accessible_p): N doesn't vary.
2608 2009-01-15 Jason Merrill <jason@redhat.com>
2611 * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
2612 accept hidden friends.
2614 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2617 * decl.c (grokdeclarator): Check for a non namespace/class context.
2619 2009-01-15 Jason Merrill <jason@redhat.com>
2623 * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to
2624 a function isn't necessarily an lvalue. Take tree, not const_tree.
2625 (lvalue_p, real_lvalue_p): Take tree, not const_tree.
2626 * typeck.c (lvalue_or_else): Likewise.
2627 * cp-tree.h: Adjust prototypes.
2629 2009-01-15 Steve Ellcey <sje@cup.hp.com>
2632 * pt.c (tsubst): Check for NULL args.
2634 2009-01-15 Dodji Seketeli <dodji@redhat.com>
2637 * name-lookup.c (pushtag): Don't create members to types that are not
2640 2009-01-14 Nick Clifton <nickc@redhat.com>
2643 * parser.c: Pass cp_id_kind computed in
2644 cp_parser_postfix_dot_deref_expression to
2645 cp_parser_primary_expression.
2647 2009-01-13 Jakub Jelinek <jakub@redhat.com>
2650 * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
2651 STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
2654 2009-01-12 Jason Merrill <jason@redhat.com>
2655 Steve Ellcey <sje@cup.hp.com>
2658 * name-lookup.c (lookup_name_real): Keep looking past a hidden
2661 2009-01-12 Dodji Seketeli <dodji@redhat.com>
2664 * pt.c (parameter_of_template_p): New function.
2665 * cp-tree.h: Declare it.
2666 * name-lookup.c (binding_to_template_parms_of_scope_p): New
2668 (outer_binding): Take template parameters in account when looking for
2671 2009-01-12 Jason Merrill <jason@redhat.com>
2674 * tree.c (pod_type_p): Return 1 for structs created by the back end.
2676 2009-01-12 Jakub Jelinek <jakub@redhat.com>
2679 * parser.c (cp_parser_builtin_offsetof): Allow `->' in
2680 offsetof member-designator, handle it as `[0].'.
2683 * decl.c (start_function): If grokdeclarator hasn't returned
2684 FUNCTION_DECL nor error_mark_node, issue diagnostics.
2686 2009-01-11 Jakub Jelinek <jakub@redhat.com>
2689 * cp-gimplify.c (genericize_if_stmt): Renamed from ...
2690 (gimplify_if_stmt): ... this.
2691 (cp_gimplify_expr): Don't handle IF_STMT here.
2692 (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
2694 2009-01-10 Andrew Pinski <pinskia@gmail.com>
2697 * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
2700 * typeck2.c (build_functional_cast): Check for reference type and NULL
2703 2009-01-09 Steve Ellcey <sje@cup.hp.com>
2705 * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
2707 2009-01-09 Jakub Jelinek <jakub@redhat.com>
2710 * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
2712 2009-01-09 John F. Carr <jfc@mit.edu>
2715 * parser.c (cp_parser_class_specifier): Clear
2716 parser->in_unbraced_linkage_specification_p while parsing class
2719 2009-01-07 Jakub Jelinek <jakub@redhat.com>
2722 * semantics.c (finish_goto_stmt): Convert destination to
2725 2009-01-06 Jason Merrill <jason@redhat.com>
2732 * pt.c (check_default_tmpl_args): Don't complain about
2733 out-of-order parameter packs in the enclosing class
2734 or parameter packs after default args.
2735 (coerce_template_parms): If we have more than one
2736 parameter pack, don't flatten argument packs.
2737 (template_args_equal): Handle argument packs.
2738 (comp_template_args): Don't flatten argument packs.
2739 (check_instantiated_arg): Split out from...
2740 (check_instantiated_args): Here. Handle arg packs.
2741 (convert_template_argument): Just check that nontype argument
2742 packs have the right type.
2744 2009-01-05 Dodji Seketeli <dodji@redhat.com>
2747 * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
2749 2009-01-05 Jason Merrill <jason@redhat.com>
2752 * typeck2.c (process_init_constructor_union): Handle union with
2755 * mangle.c (write_expression): Remove mangling for zero-operand
2759 * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
2763 * class.c (defaultable_fn_p): Only operator== can be a copy
2764 assignment operator.
2766 2009-01-02 Jason Merrill <jason@redhat.com>
2769 * typeck2.c (process_init_constructor_union): Handle excess
2771 (process_init_constructor_record): Likewise.
2774 * typeck2.c (digest_init_r): Don't use process_init_constructor
2775 for non-aggregate classes.
2778 Copyright (C) 2009 Free Software Foundation, Inc.
2780 Copying and distribution of this file, with or without modification,
2781 are permitted in any medium without royalty provided the copyright
2782 notice and this notice are preserved.