aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
AgeCommit message (Collapse)AuthorFilesLines
2009-02-12re PR c++/38950 (ICE: deducing function template arguments for array type.)Jason Merrill2-1/+6
PR c++/38950 * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type. From-SVN: r144139
2009-02-11re PR c++/39153 (virtual default dtor not defined)Jason Merrill2-1/+5
PR c++/39153 * decl2.c (cp_write_global_declarations): Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL. From-SVN: r144119
2009-02-11re PR c++/30111 (Value-initialization of POD base class doesn't initialize ↵Jason Merrill4-6/+56
members) PR c++/30111 * init.c (build_value_init_noctor): Split out from... (build_value_init): ...here. (expand_aggr_init_1): Handle value-initialization. * cp-tree.h: Add declaration. * class.c (type_has_user_provided_constructor): Handle non-class arguments. From-SVN: r144112
2009-02-11re PR c++/38649 (Trouble with defaulted constructors)Jason Merrill2-3/+7
PR c++/38649 * class.c (defaultable_fn_p): Handle ... properly. From-SVN: r144092
2009-02-11re PR c++/36744 ([C++0x] function modifying argument received by-value ↵Jason Merrill2-1/+12
affects caller's variable when passed as rvalue) PR c++/36744 * tree.c (lvalue_p_1): Condition rvalue ref handling on treat_class_rvalues_as_lvalues, too. From-SVN: r144091
2009-02-10re PR c++/34397 (ICE on invalid default template parameter)Paolo Carlini4-11/+39
/cp 2009-02-10 Paolo Carlini <paolo.carlini@oracle.com> PR c++/34397 * typeck.c (build_x_array_ref): New. * cp-tree.h: Declare it. * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF. /testsuite 2009-02-10 Paolo Carlini <paolo.carlini@oracle.com> PR c++/34397 * g++.dg/template/crash88.C: New. * g++.dg/template/crash89.C: Likewise. From-SVN: r144083
2009-02-09re PR c++/39109 (Accessible constructor required for new)Jason Merrill6-20/+31
PR c++/39109 * semantics.c (simplify_aggr_init_expr): Do zero-initialization here. * init.c (build_value_init): Not here. Don't build a TARGET_EXPR. * tree.c (get_target_expr): Handle AGGR_INIT_EXPR. * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling for build_value_init TARGET_EXPR. * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro. From-SVN: r144044
2009-02-07re PR c++/35147 (ICE trying to expand an argument pack with zero arguments)Paolo Carlini2-2/+8
/cp 2009-02-06 Paolo Carlini <paolo.carlini@oracle.com> PR c++/35147 PR c++/37737 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH. /testsuite 2009-02-06 Paolo Carlini <paolo.carlini@oracle.com> PR c++/35147 PR c++/37737 * g++.dg/cpp0x/vt-35147.C: New. * g++.dg/cpp0x/vt-37737-1.C: Likewise. * g++.dg/cpp0x/vt-37737-2.C: Likewise. From-SVN: r144001
2009-02-04re PR c++/39095 (Mangling changes break ABI)Jakub Jelinek3-16/+27
PR c++/39095 * operators.def: Use COMPONENT_REF code for ->/pt operator again, remove ./dt operator. * mangle.c (write_expression): Handle COMPONENT_REF after handling ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it write_string ("dt") instead of using operators.def. * g++.dg/abi/mangle31.C: New test. From-SVN: r143933
2009-02-03typeck.c (cp_build_unary_op): Only complain about taking address of main if ↵Jason Merrill2-4/+12
pedantic. * typeck.c (cp_build_unary_op): Only complain about taking address of main if pedantic. From-SVN: r143911
2009-02-03re PR inline-asm/39059 (ICE with fixed-point type in inline-asm)Jakub Jelinek2-0/+9
PR inline-asm/39059 * c-parser.c (c_parser_postfix_expression): If fixed point is not supported, don't accept FIXED_CSTs. * c-decl.c (finish_declspecs): Error if fixed point is not supported and _Sat is used without _Fract/_Accum. Set specs->type to integer_type_node for cts_fract/cts_accum if fixed point is not supported. * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs. * gcc.dg/nofixed-point-2.c: New test. * g++.dg/ext/fixed1.C: Adjust expected diagnostics. * g++.dg/ext/fixed2.C: Likewise. * g++.dg/other/error25.C: Likewise. * g++.dg/lookup/crash7.C: Likewise. * g++.dg/cpp0x/decltype-38655.C: Likewise. From-SVN: r143900
2009-02-03re PR c++/39056 ([c++0x] ICE with invalid initializer list for complex variable)Jakub Jelinek2-1/+8
PR c++/39056 * typeck2.c (digest_init_r): Don't call process_init_constructor for COMPLEX_TYPE. * g++.dg/cpp0x/initlist13.C: New test. From-SVN: r143899
2009-02-03re PR c++/36897 (ICE with function pointer template parameter)Paolo Bonzini3-0/+31
gcc/cp: 2009-02-03 Paolo Bonzini <bonzini@gnu.org> PR c++/36897 * pt.c (convert_nontype_argument_function): Expect expr to be an ADDR_EXPR. PR c++/37314 * typeck.c (merge_types): Call resolve_typename_type if only one type is a typename. gcc/testsuite: 2009-02-03 Paolo Bonzini <bonzini@gnu.org> PR c++/36897 * g++.dg/template/func2.C: New test. PR c++/37314 * g++.dg/template/typename15.C: New. * g++.dg/template/typename16.C: New. From-SVN: r143898
2009-02-02re PR c++/39054 (ICE with invalid pseudo-dtor in template)Jason Merrill2-1/+9
PR c++/39054 * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node in BIT_NOT_EXPR. From-SVN: r143876
2009-02-02re PR c++/39053 (ICE with broken function declaration)Paolo Carlini2-1/+13
/cp 2009-02-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/39053 * parser.c (cp_parser_pure_specifier): If there are no tokens left do not call cp_lexer_consume_token. /testsuite 2009-02-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/39053 * g++.dg/parse/crash52.C: New. From-SVN: r143861
2009-01-30re PR c++/39028 (C++ front-end rejects "__label__" at the beginning of a ↵Jakub Jelinek2-0/+10
block after "for" and "while") PR c++/39028 * parser.c (cp_parser_already_scoped_statement): Handle __label__ declarations. * g++.dg/ext/label12.C: New test. From-SVN: r143797
2009-01-30re PR c++/33465 (Broken diagnostic: 'fix_trunc_expr' and 'float_expr' not ↵Paolo Carlini2-0/+14
supported by dump_expr) /cp 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com> PR c++/33465 * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR. /testsuite 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com> PR c++/33465 * g++.dg/parse/error34.C: New. * g++.dg/parse/error35.C: Likewise. /cp 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com> PR c++/38655 * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE. /testsuite 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com> PR c++/38655 * g++.dg/cpp0x/decltype-38655.C: New. From-SVN: r143790
2009-01-29typeck.c (invalid_nonstatic_memfn_p): Use DECL_NONSTATIC_MEMBER_FUNCTION_P.Paolo Carlini2-2/+7
2009-01-29 Paolo Carlini <paolo.carlini@oracle.com> * typeck.c (invalid_nonstatic_memfn_p): Use DECL_NONSTATIC_MEMBER_FUNCTION_P. From-SVN: r143761
2009-01-27re PR c++/37554 (ICE with invalid cast)Paolo Carlini2-1/+7
/cp 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com> PR c++/37554 * call.c (build_over_call): If convert_for_arg_passing returns error_mark_node unconditionally return it. /testsuite 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com> PR c++/37554 * g++.dg/parse/crash51.C: New. * g++.old-deja/g++.pt/crash9.C: Adjust. From-SVN: r143711
2009-01-23c-decl.c (finish_struct): Move code to set DECL_PACKED after DECL_BIT_FIELD ↵Adam Nemet2-1/+7
is alreay known. * c-decl.c (finish_struct): Move code to set DECL_PACKED after DECL_BIT_FIELD is alreay known. Also inherit packed for bitfields regardless of their type. * c-common.c (handle_packed_attribute): Don't ignore packed on bitfields. * c.opt (Wpacked-bitfield-compat): New warning option. * stor-layout.c (place_field): Warn if offset of a field changed. * doc/extend.texi (packed): Mention the ABI change. * doc/invoke.texi (-Wpacked-bitfield-compat): Document. (Warning Options): Add it to the list. cp/ * class.c (check_field_decls): Also inherit packed for bitfields regardless of their type. testsuite/ * gcc.dg/bitfld-15.c, gcc.dg/bitfld-16.c, gcc.dg/bitfld-17.c,gcc.dg/bitfld-18.c: New tests. * g++.dg/ext/bitfield2.C, g++.dg/ext/bitfield3.C, g++.dg/ext/bitfield4.C, g++.dg/ext/bitfield5.C: New tests. From-SVN: r143584
2009-01-22Reverted commit 143546 related to PR c++/26693Dodji Seketeli7-143/+50
From-SVN: r143562
2009-01-21re PR c++/26693 (Access checks not performed for types in templates)Dodji Seketeli7-35/+167
gcc/ChangeLog: 2009-01-21 Dodji Seketeli <dodji@redhat.com> PR c++/26693 * c-decl.c: (clone_underlying_type): Move this ... * c-common.c (set_underlying_type): ... here. Also, make sure the function properly sets TYPE_STUB_DECL() on the newly created typedef variant type. (is_typedef_decl ): New entry point. * tree.h: Added a new member member_types_needing_access_check to struct tree_decl_non_common. (set_underlying_type): New entry point. (is_typedef_type): Likewise. gcc/cp/ChangeLog/ 2009-01-21 Dodji Seketeli <dodji@redhat.com> PR c++/26693 * decl2.c (grokfield): when a typedef appears in a class, create the typedef variant type node for it. (save_template_attributes): Creating typedef variant type node here is now useless. * decl.c (grokdeclarator): If the typedef'ed struct/class was anonymous, set the proper type name to all its type variants. * name-lookup.c (pushdecl_maybe_friend): Reuse the set_underlying_type function to install typedef variant types. * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor macro. (append_type_to_template_for_access_check): New entry points. * semantics.c (check_accessibility_of_qualified_id): When a typedef that is a member of a class appears in a template, add it to the template. It will be ... * pt.c (instantiate_class_template, instantiate_template ): ... access checked at template instantiation time. (tsubst): Handle the case of being called with NULL args. (resolve_type_name_type): The type name should be the name of the main type variant. (append_type_to_template_for_access_check): New entry point. gcc/testsuite/ChangeLog 2009-01-21 Dodji Seketeli <dodji@redhat.com> PR c++/26693 * g++.dg/template/typedef11.C: New test. * g++.dg/template/typedef12.C: Likewise. * g++.dg/template/typedef13.C: Likewise. * g++.dg/template/typedef14.C: Likewise. * g++.dg/template/sfinae3.C: Compile this pedantically. The only errors expected should be the one saying the typedef is ill formed. * g++.old-deja/g++.pt/typename8.C: Likewise. * g++.dg/template/access11.C: Update this. libstdc++-v3/ChangeLog: 2009-01-21 Dodji Seketeli <dodji@redhat.com> * include/ext/bitmap_allocator.h: the typedefs should be made public if we want them to be accessible. This has been revealed by the patch that fixes PR c++/26693 in g++. From-SVN: r143546
2009-01-19re PR c++/23287 (Explicitly invoking destructor of template class in a ↵Jason Merrill3-3/+34
template and is dependent) PR c++/23287 * parser.c (cp_parser_unqualified_id): In a template, accept ~identifier. * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE. From-SVN: r143502
2009-01-16re PR c++/38877 (Revision 143404 caused ICE on 447.dealII in SPEC CPU 2006)Jason Merrill3-6/+12
PR c++/38877 * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF. * init.c (build_new): Don't call describable_type unless we have an auto. From-SVN: r143446
2009-01-16re PR c++/29470 (Using declaration access semantics change with templates)Jason Merrill2-0/+8
PR c++/29470 * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags. From-SVN: r143445
2009-01-16re PR c++/38579 (Template: Wrong inherited copy-ctor visibility)Jason Merrill2-12/+10
PR c++/38579 * search.c (protected_accessible_p): N doesn't vary. From-SVN: r143439
2009-01-16re PR c++/38850 (Cannot find inline friend function in template class when ↵Jason Merrill2-1/+10
called from within a template function) PR c++/38850 * pt.c (tsubst_copy_and_build): Tell finish_call_expr to accept hidden friends. From-SVN: r143422
2009-01-15re PR c++/29388 (ICE with invalid nested name specifier)Andrew Pinski2-0/+12
2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C++/29388 * decl.c (grokdeclarator): Check for a non namespace/class context. 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C++/29388 * g++.dg/template/error37.C: New testcase. From-SVN: r143411
2009-01-15re PR c++/36334 (typedef to function type leads to problems)Jason Merrill4-12/+30
PR c++/36334 PR c++/37646 * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to a function isn't necessarily an lvalue. Take tree, not const_tree. (lvalue_p, real_lvalue_p): Take tree, not const_tree. * typeck.c (lvalue_or_else): Likewise. * cp-tree.h: Adjust prototypes. From-SVN: r143404
2009-01-15re PR c++/38357 (ICE cc1plus (Segmentation fault))Steve Ellcey2-0/+8
PR c++/38357 * pt.c (tsubst): Check for NULL args. From-SVN: r143402
2009-01-15re PR c++/38636 (ICE with broken ctor declaration)Dodji Seketeli2-0/+9
gcc/cp/ChangeLog: 2009-01-13 Dodji Seketeli <dodji@redhat.com> PR c++/38636 * name-lookup.c (pushtag): Don't create members to types that are not being created. gcc/testsuite/ChangeLog: 2009-01-13 Dodji Seketeli <dodji@redhat.com> PR c++/38636 * g++.dg/parse/crash50.C: New test. From-SVN: r143392
2009-01-14re PR c++/37862 (Parenthesised indirection alters class member access)Nick Clifton2-62/+80
PR c++/37862 * parser.c: Pass cp_id_kind computed in cp_parser_postfix_dot_deref_expression to cp_parser_primary_expression. * g++.cp/parse/pr37862.C: New test. From-SVN: r143369
2009-01-13re PR c++/38795 (ICE with reinterpret_cast and variadic templates)Jakub Jelinek2-1/+12
PR c++/38795 * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR, STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same as CAST_EXPR. * g++.dg/cpp0x/pr38795.C: New test. From-SVN: r143351
2009-01-12tweak commentJason Merrill1-2/+6
From-SVN: r143321
2009-01-12re PR c++/35109 (ICE in lookup_name_real, at cp/name-lookup.c:4056)Jason Merrill2-18/+32
PR c++/35109 * name-lookup.c (lookup_name_real): Keep looking past a hidden binding. Co-Authored-By: Steve Ellcey <sje@cup.hp.com> From-SVN: r143320
2009-01-12re PR c++/36019 (template parameter does not hide class name)Dodji Seketeli4-2/+68
gcc/cp/ChangeLog: 2009-01-12 Dodji Seketeli <dodji@redhat.com> PR c++/36019 * pt.c (parameter_of_template_p): New function. * cp-tree.h: Declare it. * name-lookup.c (binding_to_template_parms_of_scope_p): New function. (outer_binding): Take template parameters in account when looking for a name binding. gcc/testsuite/ChangeLog: 2009-01-12 Dodji Seketeli <dodji@redhat.com> PR c++/36019 * g++.dg/lookup/hidden-class12.C: New test. * g++.dg/lookup/hidden-class13.C: New test. * g++.dg/lookup/hidden-class14.C: New test. * g++.dg/lookup/hidden-class15.C: New test. * g++.dg/lookup/hidden-class16.C: New test. From-SVN: r143315
2009-01-12re PR c++/31488 (va_list considered non-POD)Jason Merrill2-1/+8
PR c++/31488 * tree.c (pod_type_p): Return 1 for structs created by the back end. From-SVN: r143308
2009-01-12re PR c/32041 (offsetof buglet)Jakub Jelinek2-4/+14
PR c/32041 * c-parser.c (c_parser_postfix_expression): Allow `->' in offsetof member-designator, handle it as `[0].'. * parser.c (cp_parser_builtin_offsetof): Allow `->' in offsetof member-designator, handle it as `[0].'. * gcc.dg/pr32041.c: New test. * g++.dg/parse/offsetof9.C: New test. From-SVN: r143305
2009-01-12re PR c++/38794 (Function body accepted in typedef)Jakub Jelinek2-2/+13
PR c++/38794 * decl.c (start_function): If grokdeclarator hasn't returned FUNCTION_DECL nor error_mark_node, issue diagnostics. * g++.dg/parse/typedef9.C: New test. From-SVN: r143292
2009-01-11re PR c++/36254 (wrong "control reaches end of non-void function" warning ↵Jakub Jelinek2-7/+17
with IF_STMT) PR c++/36254 * cp-gimplify.c (genericize_if_stmt): Renamed from ... (gimplify_if_stmt): ... this. (cp_gimplify_expr): Don't handle IF_STMT here. (cp_genericize_r): Call genericize_if_stmt for IF_STMT. * g++.dg/warn/Wreturn-type-5.C: New test. From-SVN: r143281
2009-01-10re PR c++/38648 (ICE with string literal)Andrew Pinski2-1/+4
PR c++/38648 * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl. * g++.dg/expr/string-1.C: New test. * g++.dg/expr/string-2.C: New test. From-SVN: r143245
2009-01-10re PR c++/36695 (Value-initialization of reference type is allowed.)Andrew Pinski2-0/+12
PR c++/36695 * typeck2.c (build_functional_cast): Check for reference type and NULL PARMS. * g++.dg/ext/complex4.C: New test. * g++.dg/ext/complex5.C: New test. * g++.dg/init/reference1.C: New test. * g++.dg/init/reference2.C: New test. * g++.dg/init/reference3.C: New test. From-SVN: r143244
2009-01-09* typeck.c (cp_build_unary_op): Check for ERROR_MARK.Steve Ellcey2-1/+5
From-SVN: r143212
2009-01-09re PR c++/35335 (Broken diagnostic: 'expr_stmt' not supported by dump_expr)Jakub Jelinek2-1/+7
PR c++/35335 * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR. * g++.dg/other/error31.C: New testcase. From-SVN: r143210
2009-01-09re PR c++/37877 (Invalid "invalid use of static" error)John F. Carr2-0/+14
PR c++/37877 * parser.c (cp_parser_class_specifier): Clear parser->in_unbraced_linkage_specification_p while parsing class specifiers. * g++.dg/parse/linkage3.C: New test. From-SVN: r143206
2009-01-08re PR c++/38725 (ICE with goto)Jakub Jelinek2-1/+12
PR c++/38725 * semantics.c (finish_goto_stmt): Convert destination to void *. * g++.dg/ext/label11.C: New test. From-SVN: r143177
2009-01-07re PR c++/35297 (Compiling error with variadic template with fixed parameter ↵Jason Merrill2-72/+152
with default type.) PR c++/35297 PR c++/35477 PR c++/35784 PR c++/36846 PR c++/38276 * pt.c (check_default_tmpl_args): Don't complain about out-of-order parameter packs in the enclosing class or parameter packs after default args. (coerce_template_parms): If we have more than one parameter pack, don't flatten argument packs. (template_args_equal): Handle argument packs. (comp_template_args): Don't flatten argument packs. (check_instantiated_arg): Split out from... (check_instantiated_args): Here. Handle arg packs. (convert_template_argument): Just check that nontype argument packs have the right type. From-SVN: r143166
2009-01-05re PR c++/38698 (ICE initializing union with initializer list)Jason Merrill3-5/+16
PR c++/38698 * typeck2.c (process_init_constructor_union): Handle union with no fields. * mangle.c (write_expression): Remove mangling for zero-operand casts. From-SVN: r143111
2009-01-05re PR c++/38472 (Wrong result type of ternary operator)Dodji Seketeli2-1/+6
gcc/cp/ChangeLog: 2009-01-05 Dodji Seketeli <dodji@redhat.com> PR c++/38472 * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo. Promotion should be done only for integral or enumeration types. gcc/testsuite/ChangeLog: 2009-01-05 Dodji Seketeli <dodji@redhat.com> PR c++/38472 * g++.dg/conversion/usual-arith-conv.C: New test. From-SVN: r143101
2009-01-05re PR c++/38701 (ICE with defaulted function)Jason Merrill1-1/+1
PR c++/38701 * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid defaulting. PR c++/38702 * class.c (defaultable_fn_p): Only operator== can be a copy assignment operator. From-SVN: r143082