1 2009-03-31 Jason Merrill <jason@redhat.com>
4 * semantics.c (finish_non_static_data_member): Allow such references
5 without an associated object in sizeof/decltype/alignof.
7 * ptree.c (cxx_print_decl): Pretty-print full name of
9 (cxx_print_type): Pretty-print full name of class.
11 * decl.c (grokdeclarator): Reject pointer to qualified function
14 PR c++/37806, core issue 547
15 * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
17 * tree.c (cp_build_qualified_type_real): Don't apply restrict to a
19 * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
20 * decl.c (groktypename): Add is_template_arg parameter.
21 (grokdeclarator): Allow function cv-quals on a template type arg.
22 * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
23 is_template_arg argument in calls to groktypename.
24 * cp-tree.h: Adjust prototype.
25 * error.c (dump_type_prefix, dump_type_suffix): Fix plain
26 FUNCTION_TYPE printing.
28 * mangle.c (write_expression): Mangle dependent name as
31 PR c++/38030, 38850, 39070
32 * pt.c (type_dependent_expression_p_push): New fn.
33 (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
34 substitution makes the call non-dependent. Preserve koenig_p.
35 * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
36 for non-dependent calls.
37 * semantics.c (finish_call_expr): Revert earlier changes.
38 * cp-tree.h: Revert change to finish_call_expr prototype.
40 2009-03-29 Joseph Myers <joseph@codesourcery.com>
43 * cp-tree.h (cp_cpp_error): Remove.
44 * error.c (cp_cpp_error): Remove.
45 * parser.c (cp_lexer_new_main): Set done_lexing instead of
46 client_diagnostic and error callback.
48 2009-03-28 Paolo Bonzini <bonzini@gnu.org>
50 * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
51 * cp/cp-objcp-common.c (cxx_staticp): Remove.
52 * cp/cp-tree.h (cxx_staticp): Remove.
54 2009-03-28 Jakub Jelinek <jakub@redhat.com>
57 * parser.c (cp_parser_postfix_expression): Don't call
58 warning_if_disallowed_function_p.
60 2009-03-27 Jan Hubicka <jh@suse.cz>
62 * except.c (choose_personality_routine): Set terminate_node to abort
65 2009-03-27 Dodji Seketeli <dodji@redhat.com>
66 Jakub Jelinek <jakub@redhat.com>
69 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
70 (cp_function_decl_explicit_p): New prototype.
71 * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
73 2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
76 * parser.c (cp_parser_elaborated_type_specifier): If we have a
77 typename tag and don't have either a TYPE_DECL or a
78 TEMPLATE_ID_EXPR, set the type to NULL.
80 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
83 * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
86 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
89 * decl.c (check_array_designated_initializer): Handle error_mark_node.
91 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
94 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
96 2009-03-26 Andrew Haley <aph@redhat.com>
99 * decl2.c (possibly_inlined_p): If java exceptions are in use
100 don't inline a decl unless it is explicitly marked inline.
101 * lex.c: (pragma_java_exceptions): New variable.
102 (handle_pragma_java_exceptions): Set pragma_java_exceptions.
103 * cp-tree.h (pragma_java_exceptions): Declare new variable.
105 2009-03-24 Jason Merrill <jason@redhat.com>
108 * name-lookup.c (pushdecl_maybe_friend): Check default args later.
110 2009-03-23 Jakub Jelinek <jakub@redhat.com>
113 * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
114 code if iter is the second operand.
115 * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
116 argument. If it is set, don't build the toplevel expression with
117 build_x_binary_op, but build2.
118 (cp_parser_assignment_expression, cp_parser_omp_for_incr): Adjust
120 (cp_parser_omp_for_cond): Don't assume the first operand of the
121 comparison must be decl.
123 2009-03-23 Jason Merrill <jason@redhat.com>
126 * pt.c (make_fnparm_pack): Split out from...
127 (instantiate_decl): ...here.
128 (tsubst_pack_expansion): Handle being called in a late-specified
132 * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
135 2009-03-20 Jason Merrill <jason@redhat.com>
138 * parser.c (cp_parser_direct_declarator): In a template, wrap
139 non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
140 * pt.c (tsubst): Preserve it in a partial instantiation.
141 (dependent_type_p_r): Don't check value_dependent_expression_p.
142 * decl.c (compute_array_index_type): Don't check
143 value_dependent_expression_p if TREE_SIDE_EFFECTS.
146 * typeck2.c (check_narrowing): Don't complain about loss of
147 precision when converting a floating-point constant.
149 2009-03-19 Jakub Jelinek <jakub@redhat.com>
152 * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
153 (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
155 2009-03-18 Jakub Jelinek <jakub@redhat.com>
157 * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
160 2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
163 * parser.c (cp_parser_explicit_specialization): Don't skip the
164 rest of the specialization when begin_specialization returns
167 2009-03-17 Jason Merrill <jason@redhat.com>
169 * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
170 (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
171 * pt.c (check_explicit_specialization): Likewise.
172 (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
173 local specialization.
174 * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
175 * decl2.c (parm_index): New fn.
176 * semantics.c (finish_decltype_type): Don't use describable_type.
177 * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR.
178 Give a sorry for unsupported codes rather than crash. Mangle
179 conversions with other than 1 operand. New mangling for PARM_DECL.
180 * operators.def (ALIGNOF_EXPR): Mangle as "az".
182 2009-03-17 Jing Yu <jingyu@google.com>
185 * method.c (use_thunk): Change is_thunk from crtl to cfun.
187 2009-03-17 Paolo Carlini <paolo.carlini@oracle.com>
190 * semantics.c (check_trait_type): New.
191 (finish_trait_expr): Use it.
193 2009-03-17 Jakub Jelinek <jakub@redhat.com>
195 * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
196 instead of calling imported_module_or_decl debug hook if
197 building_stmt_tree ().
198 * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
202 * name-lookup.c (do_namespace_alias): Don't call global_decl debug
203 hook at function scope.
206 * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
209 2009-03-09 Jakub Jelinek <jakub@redhat.com>
212 * semantics.c (finish_switch_cond): Don't call get_unwidened.
213 * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
214 instead of TREE_TYPE (cond).
216 2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
219 * parser.c (cp_parser_late_parsing_default_args): Continue
220 the loop when cp_parser_assignment_expression returns
223 2009-03-07 Jason Merrill <jason@redhat.com>
226 * init.c (build_new_1): Don't use a VLA type.
227 (build_vec_init): Handle getting a pointer for BASE.
229 2009-03-06 H.J. Lu <hongjiu.lu@intel.com>
232 * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
233 when mangling symbols.
235 2009-03-06 Paolo Carlini <paolo.carlini@oracle.com>
238 * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
240 2009-03-06 Alexandre Oliva <aoliva@redhat.com>
242 * decl.c (record_builtin_java_type): Use canonicalized integer
245 2009-03-04 Jason Merrill <jason@redhat.com>
248 * class.c (is_really_empty_class): New fn.
249 * cp-tree.h: Declare it.
250 * cp-objcp-common.c (cp_expr_size): Use it.
253 * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
254 * parser.c (cp_parser_postfix_expression): Call it for
256 * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
257 (get_first_fn): Likewise.
263 * decl.c (make_typename_type): Do look inside currently open classes.
264 * parser.c (cp_parser_lookup_name): Likewise.
265 (cp_parser_template_name): Likewise.
266 * pt.c (dependent_scope_p): New function.
267 * cp-tree.h: Declare it.
268 * class.c (currently_open_class): Return fast if T isn't a class.
270 2009-02-26 H.J. Lu <hongjiu.lu@intel.com>
273 * parser.c (cp_parser_mem_initializer): Return error_mark_node
274 if cp_parser_mem_initializer_id returns error_mark_node.
276 2009-02-24 Richard Guenther <rguenther@suse.de>
279 * pt.c (instantiate_decl): Do not instantiate extern, non-inline
282 2009-02-23 H.J. Lu <hongjiu.lu@intel.com>
285 * pt.c (coerce_template_template_parms): Return 0 if parameter
288 2009-02-23 Jason Merrill <jason@redhat.com>
290 * pt.c (unify): Call maybe_adjust_types_for_deduction when
291 deducing from an initializer list.
293 2009-02-20 Jason Merrill <jason@redhat.com>
296 * decl.c (grokdeclarator): Handle ~identifier.
298 2009-02-19 Jakub Jelinek <jakub@redhat.com>
301 * decl2.c (determine_visibility): If visibility changed and
302 DECL_RTL has been already set, call make_decl_rtl to update symbol
305 2009-02-19 H.J. Lu <hongjiu.lu@intel.com>
308 * cp-tree.h (maybe_commonize_var): New.
310 * decl.c (maybe_commonize_var): Make it extern.
312 * decl2.c (finish_anon_union): Call maybe_commonize_var.
314 2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
317 * parser.c (cp_parser_enum_specifier): Apply all attributes.
319 2009-02-18 Jason Merrill <jason@redhat.com>
321 * cfns.h: Tweak pathname for cfns.gperf.
323 2009-02-13 Jason Merrill <jason@redhat.com>
326 * semantics.c (finish_call_expr): Change koenig_p parm to int.
327 If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
328 * cp-tree.h: Adjust prototype.
329 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
331 2009-02-12 Jason Merrill <jason@redhat.com>
334 * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
336 2009-02-11 Jason Merrill <jason@redhat.com>
339 * decl2.c (cp_write_global_declarations):
340 Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
343 * init.c (build_value_init_noctor): Split out from...
344 (build_value_init): ...here.
345 (expand_aggr_init_1): Handle value-initialization.
346 * cp-tree.h: Add declaration.
347 * class.c (type_has_user_provided_constructor):
348 Handle non-class arguments.
350 2009-02-10 Jason Merrill <jason@redhat.com>
353 * class.c (defaultable_fn_p): Handle ... properly.
356 * tree.c (lvalue_p_1): Condition rvalue ref handling on
357 treat_class_rvalues_as_lvalues, too.
359 2009-02-10 Paolo Carlini <paolo.carlini@oracle.com>
362 * typeck.c (build_x_array_ref): New.
363 * cp-tree.h: Declare it.
364 * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
366 2009-02-09 Jason Merrill <jason@redhat.com>
369 * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
370 * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
371 * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
372 * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
373 for build_value_init TARGET_EXPR.
374 * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
376 2009-02-06 Paolo Carlini <paolo.carlini@oracle.com>
380 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
382 2009-02-04 Jakub Jelinek <jakub@redhat.com>
385 * operators.def: Use COMPONENT_REF code for ->/pt operator again,
386 remove ./dt operator.
387 * mangle.c (write_expression): Handle COMPONENT_REF after handling
388 ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
389 write_string ("dt") instead of using operators.def.
391 2009-02-03 Jason Merrill <jason@redhat.com>
393 * typeck.c (cp_build_unary_op): Only complain about taking address
396 2009-02-03 Jakub Jelinek <jakub@redhat.com>
399 * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
402 * typeck2.c (digest_init_r): Don't call process_init_constructor
405 2009-02-03 Paolo Bonzini <bonzini@gnu.org>
408 * pt.c (convert_nontype_argument_function): Expect expr to be an
412 * typeck.c (merge_types): Call resolve_typename_type if only
413 one type is a typename.
415 2009-02-02 Jason Merrill <jason@redhat.com>
418 * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node
421 2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
424 * parser.c (cp_parser_pure_specifier): If there are no tokens left
425 do not call cp_lexer_consume_token.
427 2009-01-30 Jakub Jelinek <jakub@redhat.com>
430 * parser.c (cp_parser_already_scoped_statement): Handle __label__
433 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
436 * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
438 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
441 * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
443 2009-01-29 Paolo Carlini <paolo.carlini@oracle.com>
445 * typeck.c (invalid_nonstatic_memfn_p): Use
446 DECL_NONSTATIC_MEMBER_FUNCTION_P.
448 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com>
451 * call.c (build_over_call): If convert_for_arg_passing returns
452 error_mark_node unconditionally return it.
454 2009-01-22 Adam Nemet <anemet@caviumnetworks.com>
456 * class.c (check_field_decls): Also inherit packed for bitfields
457 regardless of their type.
459 2009-01-22 Dodji Seketeli <dodji@redhat.com>
462 * decl2.c (grokfield): Reverting changes of PR c++/26693
463 (save_template_attributes): Likewise.
464 * decl.c (grokdeclarator): Likewise.
465 * name-lookup.c (pushdecl_maybe_friend): Likewise.
466 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
467 (append_type_to_template_for_access_check): Likewise.
468 * semantics.c (check_accessibility_of_qualified_id): Likewise.
469 * pt.c (instantiate_class_template, instantiate_template ): Likewise.
471 (resolve_type_name_type): Likewise.
472 (append_type_to_template_for_access_check): Likewise.
474 2009-01-21 Dodji Seketeli <dodji@redhat.com>
477 * decl2.c (grokfield): when a typedef appears in a
478 class, create the typedef variant type node for it.
479 (save_template_attributes): Creating typedef variant type node
481 * decl.c (grokdeclarator): If the typedef'ed struct/class was
482 anonymous, set the proper type name to all its type variants.
483 * name-lookup.c (pushdecl_maybe_friend): Reuse the
484 set_underlying_type function to install typedef variant types.
485 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
487 (append_type_to_template_for_access_check): New entry points.
488 * semantics.c (check_accessibility_of_qualified_id):
489 When a typedef that is a member of a class appears in a template,
490 add it to the template. It will be ...
491 * pt.c (instantiate_class_template, instantiate_template ): ... access
492 checked at template instantiation time.
493 (tsubst): Handle the case of being called with NULL args.
494 (resolve_type_name_type): The type name should be the name of the
496 (append_type_to_template_for_access_check): New entry point.
498 2009-01-19 Jason Merrill <jason@redhat.com>
501 * parser.c (cp_parser_unqualified_id): In a template,
503 * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
505 2009-01-16 Jason Merrill <jason@redhat.com>
508 * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
509 * init.c (build_new): Don't call describable_type unless we
513 * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
516 * search.c (protected_accessible_p): N doesn't vary.
518 2009-01-15 Jason Merrill <jason@redhat.com>
521 * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
522 accept hidden friends.
524 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
527 * decl.c (grokdeclarator): Check for a non namespace/class context.
529 2009-01-15 Jason Merrill <jason@redhat.com>
533 * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to
534 a function isn't necessarily an lvalue. Take tree, not const_tree.
535 (lvalue_p, real_lvalue_p): Take tree, not const_tree.
536 * typeck.c (lvalue_or_else): Likewise.
537 * cp-tree.h: Adjust prototypes.
539 2009-01-15 Steve Ellcey <sje@cup.hp.com>
542 * pt.c (tsubst): Check for NULL args.
544 2009-01-15 Dodji Seketeli <dodji@redhat.com>
547 * name-lookup.c (pushtag): Don't create members to types that are not
550 2009-01-14 Nick Clifton <nickc@redhat.com>
553 * parser.c: Pass cp_id_kind computed in
554 cp_parser_postfix_dot_deref_expression to
555 cp_parser_primary_expression.
557 2009-01-13 Jakub Jelinek <jakub@redhat.com>
560 * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
561 STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
564 2009-01-12 Jason Merrill <jason@redhat.com>
565 Steve Ellcey <sje@cup.hp.com>
568 * name-lookup.c (lookup_name_real): Keep looking past a hidden
571 2009-01-12 Dodji Seketeli <dodji@redhat.com>
574 * pt.c (parameter_of_template_p): New function.
575 * cp-tree.h: Declare it.
576 * name-lookup.c (binding_to_template_parms_of_scope_p): New
578 (outer_binding): Take template parameters in account when looking for
581 2009-01-12 Jason Merrill <jason@redhat.com>
584 * tree.c (pod_type_p): Return 1 for structs created by the back end.
586 2009-01-12 Jakub Jelinek <jakub@redhat.com>
589 * parser.c (cp_parser_builtin_offsetof): Allow `->' in
590 offsetof member-designator, handle it as `[0].'.
593 * decl.c (start_function): If grokdeclarator hasn't returned
594 FUNCTION_DECL nor error_mark_node, issue diagnostics.
596 2009-01-11 Jakub Jelinek <jakub@redhat.com>
599 * cp-gimplify.c (genericize_if_stmt): Renamed from ...
600 (gimplify_if_stmt): ... this.
601 (cp_gimplify_expr): Don't handle IF_STMT here.
602 (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
604 2009-01-10 Andrew Pinski <pinskia@gmail.com>
607 * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
610 * typeck2.c (build_functional_cast): Check for reference type and NULL
613 2009-01-09 Steve Ellcey <sje@cup.hp.com>
615 * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
617 2009-01-09 Jakub Jelinek <jakub@redhat.com>
620 * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
622 2009-01-09 John F. Carr <jfc@mit.edu>
625 * parser.c (cp_parser_class_specifier): Clear
626 parser->in_unbraced_linkage_specification_p while parsing class
629 2009-01-07 Jakub Jelinek <jakub@redhat.com>
632 * semantics.c (finish_goto_stmt): Convert destination to
635 2009-01-06 Jason Merrill <jason@redhat.com>
642 * pt.c (check_default_tmpl_args): Don't complain about
643 out-of-order parameter packs in the enclosing class
644 or parameter packs after default args.
645 (coerce_template_parms): If we have more than one
646 parameter pack, don't flatten argument packs.
647 (template_args_equal): Handle argument packs.
648 (comp_template_args): Don't flatten argument packs.
649 (check_instantiated_arg): Split out from...
650 (check_instantiated_args): Here. Handle arg packs.
651 (convert_template_argument): Just check that nontype argument
652 packs have the right type.
654 2009-01-05 Dodji Seketeli <dodji@redhat.com>
657 * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
659 2009-01-05 Jason Merrill <jason@redhat.com>
662 * typeck2.c (process_init_constructor_union): Handle union with
665 * mangle.c (write_expression): Remove mangling for zero-operand
669 * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
673 * class.c (defaultable_fn_p): Only operator== can be a copy
676 2009-01-02 Jason Merrill <jason@redhat.com>
679 * typeck2.c (process_init_constructor_union): Handle excess
681 (process_init_constructor_record): Likewise.
684 * typeck2.c (digest_init_r): Don't use process_init_constructor
685 for non-aggregate classes.