aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
AgeCommit message (Collapse)AuthorFilesLines
2011-02-21re PR c++/47207 ([C++0x] ICE: in decl_constant_var_p, at cp/decl2.c:3563 on ↵Jason Merrill4-7/+22
invalid code) PR c++/47207 * decl2.c (decl_constant_var_p): A constexpr var needs an initializer to be constant. * semantics.c (cxx_eval_constant_expression): Complain about constexpr var used in its own initializer. * call.c (set_up_extended_ref_temp): Set DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P too. From-SVN: r170365
2011-02-21re PR c++/47199 ([C++0x] ICE: expected class 'type', have 'declaration' ↵Jason Merrill2-1/+9
(function_decl) in same_type_ignoring_top_level_qualifiers_p, at cp/typeck.c:1407 with -fno-elide-constructors) PR c++/47199 * semantics.c (cxx_eval_call_expression): Call cxx_eval_constant_expression in trivial shortcut. From-SVN: r170356
2011-02-20re PR c++/46831 ([C++0x] Crash when it tries to do an invalid ICS with a ↵Jason Merrill2-2/+8
conversion function template) PR c++/46831 * call.c (convert_class_to_reference): Don't try to set up a second conv sequence for non-viable candidates. From-SVN: r170354
2011-02-20re PR c++/47703 ([C++0x] ICE: std::sort chokes on simple lambda function)Jason Merrill2-1/+8
PR c++/47703 * error.c (location_of): Handle non-tagged types. From-SVN: r170349
2011-02-20re PR c++/46472 ([C++0X] constexpr is not constexpr)Jason Merrill3-2/+18
PR c++/46472 * method.c (process_subob_fn): Instantiate constexpr templates. * optimize.c (maybe_clone_body): Propagate DECL_DECLARED_CONSTEXPR_P. From-SVN: r170348
2011-02-20re PR c++/46394 ([C++0X] [4.6 Regression] no matching function with default ↵Dodji Seketeli2-7/+46
template parameter) PR c++/46394 gcc/cp/ PR c++/46394 * pt.c (tsubst_pack_expansion): do not use cp_tree_equal/same_type_p to detect an expansion of a parameter pack. gcc/testsuite/ PR c++/46394 * g++.dg/template/typedef38.C: New test. From-SVN: r170341
2011-02-19re PR c++/47503 ([C++0x] ICE: in adjust_temp_type, at cp/semantics.c:5876 ↵Jason Merrill2-0/+9
with -fno-elide-constructors) PR c++/47503 * semantics.c (cxx_eval_call_expression): Shortcut trivial copy. From-SVN: r170330
2011-02-18re PR c++/47795 (internal compiler error: tree check: expected record_type ↵Paolo Carlini2-0/+9
or union_type or qual_union_type, have error_mark in finish_non_static_data_member, at cp/semantics.c:1513) /cp 2011-02-18 Paolo Carlini <paolo.carlini@oracle.com> PR c++/47795 * semantics.c (finish_non_static_data_member): Early return if object is error_mark_node. /testsuite 2011-02-18 Paolo Carlini <paolo.carlini@oracle.com> PR c++/47795 * g++.dg/cpp0x/lambda/lambda-ice3.C: New. From-SVN: r170275
2011-02-18re PR c++/47208 ([C++0x] ICE: in decl_constant_var_p, at cp/decl2.c:3563 ↵Dodji Seketeli3-2/+15
with missing #include <initializer_list>) PR c++/47208 gcc/cp/ PR c++/47208 * pt.c (do_auto_deduction): Do not mention error_mark_node in diagnostics. * semantics.c (finish_id_expression): Do not pass erroneous decl to decl_constant_var_p. gcc/testsuite/ PR c++/47208 * g++.dg/cpp0x/auto21.C: New test. From-SVN: r170268
2011-02-17re PR c++/47783 (Warning 'set but not used' [-Wunused-but-set-parameter] ↵Jakub Jelinek2-0/+6
incorrectly issued for update through reference wrapper) PR c++/47783 * cvt.c (convert_from_reference): Call mark_exp_read. * g++.dg/warn/Wunused-parm-4.C: New test. From-SVN: r170255
2011-02-17re PR c++/47172 ([C++0x] cannot call member function without object)Dodji Seketeli3-3/+24
Fix PR c++/47172 gcc/cp/ PR c++/47172 * pt.c (finish_call_expr): Consider a call expression that has a dependent "this" pointer as being dependent. Add comments. (dependent_type_p, type_dependent_expression_p): Update comments. gcc/testsuite/ * g++.dg/template/inherit6.C: New test. From-SVN: r170240
2011-02-16re PR c++/47326 ([C++0x] ICE in tsubst_copy (triggered by dependency of ↵Dodji Seketeli2-3/+16
return type on parameter pack size)) PR c++/47326 gcc/cp/ PR c++/47326 * pt.c (tsubst_copy)<case SIZEOF_EXPR>: Ensure that even pack expansion arguments are not evaluated. gcc/testsuite/ PR c++/47326 * g++.dg/cpp0x/variadic106.C: New test. From-SVN: r170222
2011-02-16re PR c++/47704 ([C++0x] Java-related error message when trying to ↵Jakub Jelinek3-2/+13
instantiate a strongly typed enum with new) PR c++/47704 * cp-tree.h (ENUM_FIXED_UNDERLYING_TYPE_P): Use TYPE_LANG_FLAG_5 instead of TYPE_LANG_FLAG_3. * pt.c (lookup_template_class): Copy over ENUM_FIXED_UNDERLYING_TYPE_P. * g++.dg/cpp0x/enum8.C: New test. From-SVN: r170209
2011-02-15re PR c++/46807 (internal compiler error: in synthesized_method_walk)Jason Merrill2-11/+10
PR c++/46807 * method.c (synthesized_method_walk): Always exit early for trivial fn in C++98 mode. From-SVN: r170207
2011-02-14re PR c++/47482 ([C++0x] ICE: unexpected expression ‘sizeof ("A")’ of ↵Jason Merrill2-0/+10
kind sizeof_expr) PR c++/47482 * parser.c (cp_parser_enumerator_definition): Call fold_non_dependent_expr. From-SVN: r170156
2011-02-13Revert r170108, r170107, r170105, r170104, r170103, r170102, r170101, r170097.Iain Sandoe4-61/+2026
From-SVN: r170111
2011-02-13t-darwin (config/darwin.h.rebuild): Harden against parallel builds.Mike Stump2-4/+3
* config/t-darwin (config/darwin.h.rebuild): Harden against parallel builds. cp: * Make-lang.in (objcp/plugin/parser.h): Harden against parallel builds. From-SVN: r170108
2011-02-13t-darwin (build/slashify1): Harden against rebuilds.Mike Stump2-4/+8
* config/t-darwin (build/slashify1): Harden against rebuilds. * config/slashify.c: Nix parms to quite the build. cp: (build/slashify): Harden against rebuilds. From-SVN: r170107
2011-02-13parser.h: Add arguments to all plugins.Mike Stump2-9/+11
objcp: * plugin/parser.h: Add arguments to all plugins. cp: * parser.c (cp_parser_primary_expression): Add arguments to all the plugins. From-SVN: r170105
2011-02-13lex.h: Plugify.Mike Stump4-8/+13
objcp: * plugin/lex.h: Plugify. cp: * lex.c: Plugify. * Make-lang.in (objcp/plugin/lex.h): Likewise. From-SVN: r170104
2011-02-13parser.c (cp_parser_declaration): Remove unused variable.Tobias Burnus2-1/+4
2011-02-13 Tobias Burnus <burnus@net-b.de> * parser.c (cp_parser_declaration): Remove unused variable. From-SVN: r170103
2011-02-13Make-lang.in (cp/parser.o): Move c-family/c-objc.h dependancy down.Mike Stump2-3/+8
* Make-lang.in (cp/parser.o): Move c-family/c-objc.h dependancy down. From-SVN: r170102
2011-02-13t-darwin (build/slashify): Allow others to reuse easier.Mike Stump3-2020/+37
gcc: * config/t-darwin (build/slashify): Allow others to reuse easier. objcp: * Make-lang.in (obj-c++.tags): Plugify Objective-C++. * plugin/parser.h: Likewise. * plugin/parser.c: Likewise. cp: * Make-lang.in (build/slashify): Plugify Objective-C++. (cp/parser.o): Likewise. (objcp/plugin/parser.h): Likewise. From-SVN: r170101
2011-02-11Revert "Fix PR c++/47172"Dodji Seketeli3-25/+3
gcc/cp/ * pt.c (finish_call_expr, dependent_type_p) (type_dependent_expression_p): Revert the previous attempt to fix PR c++/47172. gcc/testsuite/ * g++.dg/template/inherit6.C: Reverted. From-SVN: r170055
2011-02-11re PR c++/47172 ([C++0x] cannot call member function without object)Dodji Seketeli3-3/+25
Fix PR c++/47172 gcc/cp/ PR c++/47172 * pt.c (finish_call_expr): Consider a call expression that has a dependent "this" pointer as being dependent. Add comments. (dependent_type_p, type_dependent_expression_p): Update comments. gcc/testsuite/ * g++.dg/template/inherit6.C: New test. From-SVN: r170045
2011-02-10decl.c (cp_make_fname_decl): Set DECL_THIS_STATIC at toplevel.Jason Merrill3-2/+9
* decl.c (cp_make_fname_decl): Set DECL_THIS_STATIC at toplevel. * semantics.c (finish_fname): Only return the name if we're in a function. From-SVN: r170009
2011-02-10decl.c (build_enumerator): Don't perform integral promotions on non-integral ↵Jason Merrill2-1/+5
constants. * decl.c (build_enumerator): Don't perform integral promotions on non-integral constants. From-SVN: r170008
2011-02-10* cvt.c (convert_to_void): Handle null op1.Jason Merrill2-4/+10
From-SVN: r170007
2011-02-10class.c (type_has_constexpr_default_constructor): Make sure the caller ↵Jason Merrill3-3/+12
stripped an enclosing array. * class.c (type_has_constexpr_default_constructor): Make sure the caller stripped an enclosing array. * init.c (perform_member_init): Strip arrays before calling it. From-SVN: r170006
2011-02-10re PR c++/47511 ([C++0x] ICE: unexpected ast of kind template_decl in ↵Jason Merrill2-0/+6
potential_constant_expression_1, at cp/semantics.c:7711) PR c++/47511 * semantics.c (potential_constant_expression_1): Handle TEMPLATE_DECL. From-SVN: r170005
2011-02-03re PR c++/47398 (tree check: accessed elt 10 of tree_vec with 9 elts in ↵Dodji Seketeli2-0/+9
tsubst, at cp/pt.c:10500) Fix PR c++/47398 gcc/cp/ PR c++/47398 * tree.c (cp_tree_equal)<TEMPLATE_PARM_INDEX>: Take the number of template parameters in account. gcc/testsuite/ PR c++/47398 * g++.dg/template/typedef37.C: New test. * g++.dg/template/param1.C: Adjust expected error message. From-SVN: r169807
2011-02-03re PR c++/46890 (Failed to compile scummvm's player_v4a.cpp)Nathan Froyd2-9/+12
gcc/c-family/ PR c++/46890 * c-common.h (keyword_is_decl_specifier): Declare. * c-common.c (keyword_is_decl_specifier): Define. (keyword_is_function_specifier): New function. gcc/cp/ PR c++/46890 * parser.c (cp_parser_class_specifier): Fix setting of want_semicolon. gcc/testsuite/ PR c++/46890 * g++.dg/parser/semicolon3.C: Adjust. * g++.dg/parser/semicolon4.C: New testcase. * g++.dg/pr46890.C: New testcase. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r169797
2011-01-31re PR c++/47416 (ICE in build_data_member_initialization, at ↵Jakub Jelinek2-12/+17
cp/semantics.c:5509) PR c++/47416 * semantics.c (build_data_member_initialization): Handle STATEMENT_LIST always instead of just for CLEANUP_BODY. * g++.dg/cpp0x/pr47416.C: New test. From-SVN: r169447
2011-01-31configure.ac (gcc_cv_ld_static_option): Define.Rainer Orth2-3/+8
gcc: * configure.ac (gcc_cv_ld_static_option): Define. (gcc_cv_ld_dynamic_option): Define. (gcc_cv_ld_static_dynamic): Tru64 UNIX support -noso/-so_archive instead. (HAVE_LD_STATIC_DYNAMIC): Update message. (LD_STATIC_OPTION): Define. (LD_DYNAMIC_OPTION): Define. * configure: Regenerate. * config.in: Regenerate. * gcc.c (init_spec) [USE_LIBUNWIND_EXCEPTIONS && HAVE_LD_STATIC_DYNAMIC]: Use them. gcc/cp: * g++spec.c (lang_specific_driver) [HAVE_LD_STATIC_DYNAMIC] Use LD_STATIC_OPTION, LD_DYNAMIC_OPTION. gcc/fortran: * gfortranspec.c (add_arg_libgfortran) [HAVE_LD_STATIC_DYNAMIC] Use LD_STATIC_OPTION, LD_DYNAMIC_OPTION. gcc/go: * gospec.c (lang_specific_driver) [HAVE_LD_STATIC_DYNAMIC] Use LD_STATIC_OPTION, LD_DYNAMIC_OPTION. From-SVN: r169435
2011-01-29re PR preprocessor/47311 ([C++0x] ICE in tsubst @cp/pt.c:10502)Dodji Seketeli4-21/+36
Fix PR c++/47311 gcc/cp/ PR c++/47311 * cp-tree.h (fixup_template_parms): Declare. * pt.c (end_template_parm_list): Do not fixup template parms here. (fixup_template_parms): Remove static. Fix typo in the comments. Remove useless code statement. (fixup_template_parm): For a template template parameter, fixup its attributes before fixing up its type. * parser.c (cp_parser_template_declaration_after_export): After parsing template parameters fixup their types. gcc/testsuite/ PR c++/47311 * g++.dg/template/param2.C: New test. From-SVN: r169377
2011-01-26re PR c++/47476 ([C++0x] ICE in potential_constant_expression_1)Jakub Jelinek2-0/+7
PR c++/47476 * semantics.c (potential_constant_expression_1): Handle TRUTH_XOR_EXPR. * g++.dg/cpp0x/pr47476.C: New test. From-SVN: r169306
2011-01-26ChangeLog: Add missing PR reference.Dave Korn1-0/+1
* gcc/c-family/ChangeLog: Add missing PR reference. * gcc/ChangeLog: Likewise. * gcc/cp/ChangeLog: Likewise. * gcc/testsuite/ChangeLog: Likewise. From-SVN: r169269
2011-01-26c.opt (-fkeep-inline-dllexport): New switch.Dave Korn3-4/+11
gcc/c-family/ChangeLog: * c.opt (-fkeep-inline-dllexport): New switch. gcc/ChangeLog: * tree.c (handle_dll_attribute): Handle it. * doc/extend.texi (@item dllexport): Mention it. * doc/invoke.texi (@item -fno-keep-inline-dllexport): Document it. gcc/cp/ChangeLog: * semantics.c (expand_or_defer_fn_1): Handle it. * decl2.c (decl_needed_p): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/dll-9a.c: New test file. * gcc.dg/dll-11.c: Likewise. * gcc.dg/dll-12.c: Likewise. * gcc.dg/dll-12a.c: Likewise. * gcc.dg/dll-11a.c: Likewise. * gcc.dg/dll-9.c: Likewise. * gcc.dg/dll-10.c: Likewise. * gcc.dg/dll-10a.c: Likewise. * g++.dg/ext/dllexport4a.cc: Likewise. * g++.dg/ext/dllexport4.C: Likewise. * g++.dg/ext/dllexport5.C: Likewise. * g++.dg/ext/dllexport5a.cc: Likewise. From-SVN: r169268
2011-01-21re PR c++/47041 (Internal compiler error in ↵Jason Merrill2-1/+20
build_data_member_initialization, add cp/semantics.c:5483) PR c++/47041 * semantics.c (build_constexpr_constructor_member_initializers): Handle trivial copy. From-SVN: r169108
2011-01-21re PR c++/47388 (ICE: in begin_for_stmt, at cp/semantics.c:863 with ↵Jakub Jelinek2-5/+14
-fno-for-scope and for(;;) inside a template) PR c++/47388 * semantics.c (begin_for_stmt): If -fno-for-scope, don't assume init must be NULL if scope is NULL. (begin_range_for_stmt): Likewise. * g++.dg/cpp0x/range-for10.C: New test. * g++.dg/template/for1.C: New test. From-SVN: r169105
2011-01-21re PR c++/46552 ([C++0x] Internal compiler error on pointer to member ↵Jason Merrill2-0/+4
variable with template) PR c++/46552 * semantics.c (cxx_eval_constant_expression): Handle OFFSET_REF. From-SVN: r169099
2011-01-21re PR c++/46977 ([C++0x] ICE: SIGSEGV in htab_find_slot_with_hash ↵Jason Merrill5-56/+176
(hashtab.c:650)) PR c++/46977 * semantics.c (potential_constant_expression_1): Split out from potential_constant_expression. Add want_rval parm. Handle template expression forms. Don't enforce restriction on address of automatic variable here. Add a couple of diagnostics that had been missing. (require_potential_constant_expression): New entry point. (build_data_member_initialization, register_constexpr_fundef): Adjust. (maybe_constant_value): Check potential_constant_expression. * pt.c (fold_non_dependent_expr_sfinae): Likewise. * tree.c (build_vec_init_expr): Adjust. From-SVN: r169096
2011-01-19re PR c++/47303 (ICE: in varpool_node, at varpool.c:134 with -fabi-version=1)Jakub Jelinek3-2/+9
PR c++/47303 * decl2.c (finish_anon_union): Only call mangle_decl if TREE_STATIC or DECL_EXTERNAL. * g++.dg/template/anonunion1.C: New test. From-SVN: r169000
2011-01-17re PR c++/47067 ([c++0x] ICE in cxx_eval_bare_aggregate, at cp/semantics.c:6352)Jason Merrill2-18/+49
PR c++/47067 * semantics.c (base_field_constructor_elt): New fn. (cxx_eval_bare_aggregate): Use it. (build_data_member_initialization): Leave COMPONENT_REF for vfield inits. From-SVN: r168937
2011-01-17parser.c (cp_parser_range_for): Remove the "unused variable" warning workaround.Rodrigo Rivas Costa2-9/+5
* parser.c (cp_parser_range_for): Remove the "unused variable" warning workaround. From-SVN: r168936
2011-01-15re PR c++/33558 ('mutable' incorrectly accepted on reference members)Giovanni Funchal2-0/+12
2011-01-15 Giovanni Funchal <gafunchal@gmail.com> Jonathan Wakely <jwakely.gcc@gmail.com> PR c++/33558 * decl.c (grokdeclarator): Reject mutable reference members. Co-Authored-By: Jonathan Wakely <jwakely.gcc@gmail.com> From-SVN: r168843
2011-01-14re PR c++/47289 ([C++0x] ICE in tsubst_pack_expansion (triggered by decltype))Jason Merrill2-2/+5
PR c++/47289 * pt.c (coerce_template_parms): Fix error recovery. From-SVN: r168822
2011-01-14re PR c++/46903 ([C++0x] ICE unexpected expression of kind template_id_expr)Jason Merrill2-0/+6
PR c++/46903 * typeck2.c (check_narrowing): Only check arithmetic types. From-SVN: r168783
2011-01-14re PR c++/46688 (g++ requires a function declaration when it should not)Jason Merrill2-1/+12
PR c++/46688 * tree.c (build_vec_init_expr): Handle flexible array properly. From-SVN: r168782
2011-01-13re PR c++/47213 (ICE: SIGSEGV in determine_visibility (decl2.c:2076) with ↵Kai Tietz3-3/+13
-fvisibility-ms-compat) 2011-01-13 Kai Tietz <kai.tietz@onevision.com> PR c++/47213 * g++.dg/ext/pr47213.C: New. 2011-01-13 Kai Tietz <kai.tietz@onevision.com> PR c++/47213 * cp-tree.h (CLASSTYPE_VISIBILITY): Use TYPE_MAIN_DECL instead of TYPE_NAME. (CLASSTYPE_VISIBILITY_SPECIFIED): Likewise. * decl2.c (determine_visibility): Add check of CLASS_TYPE_P for underlying_type. 2011-01-13 Kai Tietz <kai.tietz@onevision.com> PR c++/47213 * config/i386/cygming.h (TARGET_ASM_ASSEMBLE_VISIBILITY): PE specific hook. * config/i386/i386-protos.h (i386_pe_assemble_visibility): New function prototype. * config/i386/winnt.c (i386_pe_assemble_visibility): Warn only if attribute was specified by user. From-SVN: r168763