aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
AgeCommit message (Collapse)AuthorFilesLines
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
2009-01-05re PR c++/38701 (ICE with defaulted function)Jason Merrill3-2/+16
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: r143081
2009-01-02re PR c++/38698 (ICE initializing union with initializer list)Jason Merrill2-2/+24
PR c++/38698 * typeck2.c (process_init_constructor_union): Handle excess initializers. (process_init_constructor_record): Likewise. PR c++/38684 * typeck2.c (digest_init_r): Don't use process_init_constructor for non-aggregate classes. From-SVN: r143024
2008-12-31re PR c++/38647 (ICE using __FUNCTION__ as template parameter)Jakub Jelinek2-9/+37
PR c++/38647 * parser.c (cp_parser_primary_expression) <case RID_FUNCTION_NAME>: Return error_mark_node if cp_parser_non_integral_constant_expression returns true. * g++.dg/template/function1.C: New test. From-SVN: r142978
2008-12-31re PR c++/38640 (ICE with decltype of template value parameter)Jakub Jelinek2-0/+6
PR c++/38640 * semantics.c (finish_decltype_type): Handle TEMPLATE_PARM_INDEX. * g++.dg/cpp0x/decltype15.C: New test. From-SVN: r142973
2008-12-29re PR c++/38635 (ICE parsing broken code)Jakub Jelinek2-1/+5
PR c++/38635 * parser.c (cp_parser_condition): Use cp_parser_require instead of cp_lexer_consume_token to consume =. * g++.dg/parse/cond4.C: New test. From-SVN: r142951
2008-12-29re PR c++/38637 (ICE with template declaration of enum)Jakub Jelinek2-0/+8
PR c++/38637 * decl.c (start_enum): If enumtype is error_mark_node, exit early. * g++.dg/cpp0x/enum2.C: New test. From-SVN: r142946
2008-12-28re PR c++/38650 (Trouble with volatile and #pragma omp for)Jakub Jelinek2-13/+42
PR c++/38650 * semantics.c (finish_omp_for): Don't add CLEANUP_POINT_EXPR around volatile iteration var in condition and/or increment expression. * testsuite/libgomp.c/pr38650.c: New test. * testsuite/libgomp.c++/pr38650.C: New test. From-SVN: r142940
2008-12-27re PR c++/38639 (ICE with invalid use of auto in parallel for-loop)Jakub Jelinek2-4/+7
PR c++/38639 * pt.c (tsubst_omp_for_iterator): RECUR on whole init_expr instead of just its type. * g++.dg/gomp/pr38639.C: New test. From-SVN: r142933
2008-12-21revert accidental checkinJason Merrill1-4/+4
From-SVN: r142869
2008-12-21re PR c++/38597 ([c++0x] ICE when auto return type function given as ↵Jason Merrill3-4/+10
argument to function template) PR c++/38597 * name-lookup.c (arg_assoc_type): Handle DECLTYPE_TYPE. From-SVN: r142868
2008-12-20re PR c++/36921 (warning "comparison does not have mathematical meaning" is ↵Jakub Jelinek1-0/+8
not correct for overloaded operators that do not return boolean) PR c++/36921 * c-common.c (warn_about_parentheses): Remove ARG_UNUSED from arg_left. Don't warn about X<=Y<=Z if comparison's type isn't integral. * g++.dg/warn/pr36921.C: New. Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org> From-SVN: r142849
2008-12-19re PR c++/38577 (ICE: tree check: expected call_expr, have compound_expr in ↵Jakub Jelinek2-0/+17
build_new_method_call, at cp/call.c:6000) PR c++/38577 * call.c (build_new_method_call): Handle call being COMPOUND_EXPR or NOP_EXPR. * g++.dg/template/call6.C: New test. From-SVN: r142842
2008-12-18re PR c++/38427 (crash for reference init code)Jakub Jelinek2-9/+22
PR c++/38427 * init.c (perform_member_init): For value-initialized references call permerror instead of warning and don't emit any INIT_EXPR. * g++.dg/init/ctor9.C: New test. From-SVN: r142818
2008-12-18re PR c++/38485 (GCC can't parse a parenthesized comma in a template-id ↵Jason Merrill2-0/+7
within a default argument) PR c++/38485 * parser.c (cp_parser_token_starts_cast_expression): An EOF can't start a cast-expression. From-SVN: r142815
2008-12-17semantics.c (describable_type): New function.Jason Merrill8-6/+140
gcc/cp: * semantics.c (describable_type): New function. (finish_decltype_type): Use it for dependent exprs. * cp-tree.h: Declare it. * mangle.c (write_type) [DECLTYPE_TYPE]: Set skip_evaluation. (write_expression): If skip_evaluation, use type stubs. * tree.c (cp_tree_equal): Handle PARM_DECLs from different declarations of a function. * init.c (build_new): Do auto deduction if type is describable. * decl.c (cp_finish_decl): Likewise. * parser.c (cp_parser_omp_for_loop): Likewise. gcc/testsuite: * g++.dg/cpp0x/auto6.C: Test more stuff. * g++.dg/cpp0x/auto12.C: New test. libiberty: * cp-demangle.c (d_expression): Handle rvalue stubs too. [DEMANGLE_COMPONENT_CAST]: Update mangling. (d_print_comp): Avoid extra ", " with empty template argument packs. Remove handling for obsolete T() mangling. From-SVN: r142799
2008-12-10re PR c++/35319 (ICE throwing fixed-point types)Jason Merrill2-0/+61
PR c++/35319 * mangle.c (write_builtin_type): Add mangling for decimal floating point and fixed point types. (write_type): Pass FIXED_POINT_TYPE along. * cp-demangle.c (cplus_demangle_type): Support fixed-point types. (d_print_comp, d_dump): Likewise. From-SVN: r142661
2008-12-10re PR c++/37971 (Rejects default argument that is a template via access ↵Mark Mitchell4-30/+61
failure) PR c++/37971 * class.c (resolve_address_of_overloaded_function): Check accessibility of member functions unless FLAGS indicates otherwise. * call.c (standard_conversion): Adjust flags passed to instantiate_type. (convert_default_arg): Do not perform access checks. * cp-tree.h (tsubst_flags_t): Add tf_no_access_control. PR c++/37971 * g++.dg/overload/defarg2.C: New test. * g++.dg/overload/defarg3.C: Likewise. From-SVN: r142628
2008-12-08* decl2.c (mark_used): Remove assemble_external call.Steve Ellcey2-2/+4
From-SVN: r142563
2008-12-08re PR debug/38390 (Missing DW_TAG_imported_module)Dodji Seketeli2-1/+8
gcc/cp/ChangeLog: 2008-12-07 Dodji Seketeli <dodji@redhat.com> PR debug/38390 * name-lookup.c (kept_level_p): Don't forget the case of levels having using directives. gcc/testsuite/ChangeLog: 2008-12-07 Dodji Seketeli <dodji@redhat.com> PR debug/38390 * g++.dg/debug/dwarf2/imported-module-2.C: New test. From-SVN: r142562
2008-12-08re PR middle-end/38240 (Vector type definitions not compatible with ↵Richard Henderson3-5/+12
attribute target) PR 38240 * tree.h (TYPE_MODE): Invoke vector_type_mode when needed. (SET_TYPE_MODE): New. * c-decl.c (parser_xref_tag): Use it. (finish_enum): Likewise. * tree.c (build_pointer_type_for_mode): Likewise. (build_reference_type_for_mode, build_index_type): Likewise. (build_range_type, make_vector_type): Likewise. (build_common_tree_nodes_2): Likewise. * stor-layout.c (compute_record_mode): Likewise. (finalize_type_size, layout_type, make_fract_type): Likewise. (make_accum_type, initialize_sizetypes): Likewise. (vector_type_mode): New. * function.c (allocate_struct_function): Call invoke_set_current_function_hook before querying anything else. * config/i386/i386.c (ix86_valid_target_attribute_inner_p): Add avx. cp/ * class.c (finish_struct_bits): Use SET_TYPE_MODE. * decl.c (record_unknown_type): Likewise. (start_enum, finish_enum): Likewise. From-SVN: r142556
2008-12-05re PR c++/35336 (Broken diagnostic: 'bit_field_ref' not supported by dump_expr)Jakub Jelinek2-0/+6
PR c++/35336 * c-pretty-print.c (pp_c_postfix_expression): Handle BIT_FIELD_REF. (pp_c_expression): Likewise. * error.c (dump_expr): Handle BIT_FIELD_REF. * g++.dg/other/error30.C: New test. From-SVN: r142497
2008-12-05Fix dates.Eric Botcazou1-1/+1
From-SVN: r142470
2008-12-05re PR bootstrap/38262 (GCC components unnecessarily link with shared gmp/mpfr)Jakub Jelinek1-0/+6
PR bootstrap/38262 Fixup ChangeLog entries. From-SVN: r142466
2008-12-05re PR bootstrap/38262 (GCC components unnecessarily link with shared gmp/mpfr)Sebastian Pop1-2/+2
2008-11-07 Sebastian Pop <sebastian.pop@amd.com> PR bootstrap/38262 * java/Make-lang.in (jc1): Add BACKENDLIBS, remove GMPLIBS. * objc/Make-lang.in (cc1obj-dummy, cc1obj): Same. * objcp/Make-lang.in (cc1objplus-dummy, cc1objplus): Same. * cp/Make-lang.in (cc1plus-dummy, cc1plus): Same. * ada/gcc-interface/Make-lang.in (gnat1): Same. * fortran/Make-lang.in (f951): Same. * Makefile.in (LIBS): Remove GMPLIBS, CLOOGLIBS and PPLLIBS. (BACKENDLIBS): New. (cc1-dummy, cc1): Add BACKENDLIBS, remove GMPLIBS. From-SVN: r142464
2008-12-04re PR c++/37906 (has_trivial_default_constructor vs. deleted copy ctor)Jason Merrill3-4/+15
PR c++/37906 * decl.c (grok_special_member_properties): Set TYPE_HAS_COMPLEX_DFLT here. * class.c (check_bases_and_members): Rather than assuming any user-declared default constructor is complex here. From-SVN: r142442
2008-12-04re PR middle-end/36509 (gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c)Richard Guenther2-0/+10
2008-12-04 Richard Guenther <rguenther@suse.de> PR middle-end/36509 PR c++/38334 * Makefile.in (tree-ssa-alias-warnings.o): Remove. (tree-ssa-structalias.o): Remove errors.h dependency. (tree-ssa-reassoc.o): Likewise. * tree-ssa-reassoc.c: Do not include errors.h. * tree-ssa-alias-warnings.c: Remove. * tree-ssa-alias.c (compute_may_aliases): Remove call to strict_aliasing_warning_backend. * tree-ssa-structalias.c (emit_pointer_definition): New function. (emit_alias_warning): Likewise. (set_uids_in_ptset): Warn for clear cases of type-punning. * tree-inline.c (remap_gimple_op_r): Preserve TREE_NO_WARNING on INDIRECT_REFs. cp/ * typeck.c (get_member_function_from_ptrfunc): Mark the vtbl pointer access with TREE_NO_WARNING. * gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c: Adjust, remove XFAIL. * gcc.dg/Wstrict-aliasing-converted-assigned.c: Adjust. * g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C: Likewise. From-SVN: r142437
2008-12-03re PR c++/38232 ("value-initialization of reference" warning too strict)Jason Merrill2-41/+36
PR c++/38232 * init.c (build_value_init): Do initial zero-initialization of a class with an implicitly-defined constructor using build_zero_init rather than in build_value_init. (build_value_init_1): Fold into build_value_init. From-SVN: r142418
2008-12-03re PR c++/38256 (ICE with "operator auto")Jason Merrill3-6/+16
PR c++/38256 * parser.c (cp_parser_conversion_type_id): Diagnose 'operator auto' here. * decl.c (grokdeclarator): Not here. From-SVN: r142410
2008-12-03re PR c++/38380 (explicitly defaulted constructors vs. empty direct ↵Jason Merrill3-9/+9
initialization) PR c++/38380 * decl.c (grokdeclarator): Only set DECL_NONCONVERTING_P on explicit constructors. * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Propagate CONSTRUCTOR_IS_DIRECT_INIT. From-SVN: r142404
2008-12-02PR c++/35782, c++/37860Jason Merrill4-20/+62
PR c++/35782, c++/37860 * call.c (build_user_type_conversion_1): Remember list-initialization. (convert_like_real): Likewise. (build_over_call): Don't require the copy constructor for copy-list-initialization. * cp-tree.h (TARGET_EXPR_LIST_INIT_P): New macro. PR c++/37234 * decl.c (cp_finish_decl): Handle =default and =delete for templates, too. From-SVN: r142379
2008-12-01re PR c++/38257 (ICE with auto and #pragma omp parallel)Jakub Jelinek3-4/+37
PR c++/38257 * parser.c (cp_parser_omp_for_loop): Handle auto. * pt.c (tsubst_omp_for_iterator): Likewise. * testsuite/libgomp.c++/for-7.C: New test. From-SVN: r142320
2008-11-28re PR c++/38233 ('map' value type + new uninitted const member warnings ↵Jason Merrill4-68/+36
causes error) PR c++/38233 * init.c (perform_member_init): Fix value-initialization. (build_value_init_1): Add assert to catch cases that will break in the gimplifier. (build_default_init): Remove. * cp-tree.h: Remove its prototype. * pt.c (tsubst_expr) [DECL_EXPR]: Use build_value_init for value-initialization. From-SVN: r142265
2008-11-28re PR c++/38278 (C++ namespace collision)Jason Merrill2-4/+9
PR c++/38278 * parser.c (cp_parser_class_name): Only call maybe_note_name_used_in_class if we actually found a class name. From-SVN: r142263
2008-11-25re PR c++/28743 (ICE with invalid specialization)Jason Merrill2-3/+14
PR c++/28743 * decl2.c (check_classfn): Error rather than abort on parameter list mismatch. From-SVN: r142212
2008-11-20re PR c++/28513 (QOI: Diagnostic missing since 3.3.x when naming rule is ↵Jason Merrill2-0/+6
violated) PR c++/28513 * parser.c (cp_parser_class_name): Call maybe_note_name_used_in_class. From-SVN: r142056
2008-11-20re PR c++/37540 (ICE on __decltype of method call in function template)Jason Merrill2-6/+20
PR c++/37540 * call.c (build_over_call): Take the address of the function even in a template. (build_new_method_call): Remember the type of the called function in a template. From-SVN: r142054