aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
AgeCommit message (Collapse)AuthorFilesLines
2013-01-04Update Copyright years for files modified in 2011 and/or 2012.Jakub Jelinek13-14/+14
From-SVN: r194903
2013-01-03re PR c++/55419 (ICE in gimplify_init_ctor_preeval, at gimplify.c:3587)Jason Merrill2-2/+5
PR c++/55419 PR c++/55753 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch TREE_CONSTANT. From-SVN: r194870
2013-01-03re PR c++/55842 (C++11 ICE with boost multi-precision and boost variant)Jason Merrill2-1/+5
PR c++/55842 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept. From-SVN: r194869
2013-01-03re PR c++/55856 (ICE on tuple with rvalue ref member)Jason Merrill2-2/+9
PR c++/55856 * semantics.c (build_data_member_initialization): Handle DECL_EXPR. From-SVN: r194865
2013-01-03re PR c++/53650 (large array causes huge memory use)Jason Merrill5-2/+38
PR c++/53650 * call.c (type_has_extended_temps): New. * cp-tree.h: Declare it. * decl.c (check_initializer): Use build_aggr_init for arrays if it is false. * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic. From-SVN: r194860
2013-01-03ChangeLog rotation.Jakub Jelinek2-3063/+3068
From-SVN: r194840
2013-01-02re PR c++/54325 (C++11 uniform initialization syntax for argument-less ↵Jason Merrill2-0/+7
abstract base class constructor fails) PR c++/54325 * call.c (build_new_method_call_1): Don't use build_value_init for user-provided default constructors. From-SVN: r194820
2013-01-02* decl.c (check_default_argument): Use LOOKUP_IMPLICIT.Jason Merrill2-1/+3
From-SVN: r194816
2013-01-02re PR c++/55804 (GCC omits required call to constructor)Jason Merrill2-6/+37
PR c++/55804 PR c++/55032 PR c++/55245 * tree.c (build_array_type_1): Revert earlier change. * cp/tree.c (build_cplus_array_type): Copy layout information to main variant if necessary. From-SVN: r194811
2012-12-28rtti.c (LONGPTR_T): New helper-macro.Kai Tietz2-2/+16
* rtti.c (LONGPTR_T): New helper-macro. (get_pseudo_ti_init): Initialize offset_type by LONGPTR_T type instead of 'long' type. (create_tinfo_types): Use for offset/flags field LONGPTR_T type instead of 'long' type. From-SVN: r194745
2012-12-27Before this patch...Sriraman Tallam1-2/+0
Before this patch, function multiversioning determines that two functions are different by comparing the arch type and isa flags that are set after the target string is processed. This leads to cases where the versions become identical when the command-line target options are altered. This patch modifies the function version determination to just compare the target string. 2012-12-27 Sriraman Tallam <tmsriram@google.com> * doc/tm.texi.in (TARGET_OPTION_SUPPORTS_FUNCTION_VERSIONS): Document new target hook. * doc/tm.texi: Regenerate. * c-family/c-common.c (handle_target_attribute): Retain target attribute for targets that support versioning. * target.def (supports_function_versions): New hook. * cp/class.c (add_method): Remove calls to DECL_FUNCTION_SPECIFIC_TARGET. * config/i386/i386.c (ix86_function_versions): Use target string to check for function versions instead of target flags. * (ix86_supports_function_versions): New function. * (is_function_default_version): Check target string. * TARGET_OPTION_SUPPORTS_FUNCTION_VERSIONS: New macro. 2012-12-27 Sriraman Tallam <tmsriram@google.com> * testsuite/g++.dg/mv1.C: Remove target options. * testsuite/g++.dg/mv2.C: Ditto. * testsuite/g++.dg/mv3.C: Ditto. * testsuite/g++.dg/mv4.C: Ditto. * testsuite/g++.dg/mv5.C: Ditto. From-SVN: r194730
2012-12-19re PR c++/55724 ([C++11] Default type of a template value is not working)Jason Merrill2-20/+13
PR c++/55724 * pt.c (type_unification_real): Re-combine post-deduction loops. From-SVN: r194620
2012-12-14re PR c++/55685 (ICE: canonical types differ for identical types)Jason Merrill2-1/+5
PR c++/55685 * pt.c (tsubst_copy_and_build): Don't use SIZEOF_EXPR_TYPE_P in templates. From-SVN: r194517
2012-12-14re PR c++/42315 (ICE with invalid array initializer)Jason Merrill2-3/+6
PR c++/42315 * decl.c (maybe_deduce_size_from_array_init): Don't change the variable type. From-SVN: r194509
2012-12-13re PR c++/55652 (ICE (segfault) with templates and structs)Jakub Jelinek2-1/+7
PR c++/55652 * typeck2.c (merge_exception_specifiers): Don't call operand_equal_p if noex is NULL. * g++.dg/cpp0x/noexcept19.C: New test. From-SVN: r194479
2012-12-11re PR c++/54883 (Name mangling of types in an unnamed namespace)Jason Merrill2-8/+12
PR c++/54883 * decl2.c (min_vis_r): Handle anon visibility for enums. From-SVN: r194430
2012-12-11re PR c++/53094 (constexpr vector subscripting)Marc Glisse3-2/+14
2012-12-11 Marc Glisse <marc.glisse@inria.fr> PR c++/53094 cp/ * tree.c (cp_tree_equal): Handle VECTOR_CST. * semantics.c (cxx_eval_bare_aggregate): Protect a dereference. Handle VECTOR_CST. testsuite/ * g++.dg/cpp0x/constexpr-53094-1.C: New testcase. * g++.dg/cpp0x/constexpr-53094-2.C: Likewise. * g++.dg/cpp0x/constexpr-53094-3.C: Likewise. From-SVN: r194421
2012-12-11re PR c++/55643 ([C++11] incorrect "warning: variable ‘myVar’ set but ↵Jakub Jelinek2-0/+6
not used" with an "enum class"-typed variable is casted to double for the use) PR c++/55643 * expr.c (mark_exp_read): Handle FLOAT_EXPR similarly to NOP_EXPR. * g++.dg/warn/Wunused-var-19.C: New test. From-SVN: r194415
2012-12-11re PR c++/54416 (ICE (segv) in codegen)Jason Merrill2-1/+11
PR c++/54416 * pt.c (maybe_process_partial_specialization): Don't accept definition of a specialization without the appropriate header. From-SVN: r194408
2012-12-11* pt.c (maybe_process_partial_specialization): Handle aliases first.Jason Merrill2-17/+17
From-SVN: r194407
2012-12-11re PR c++/55619 (Chromium build fails with: error: memory input is not ↵Jakub Jelinek2-3/+16
directly addressable) PR c++/55619 * semantics.c (finish_asm_stmt): Don't call decay_conversion on input operands that can be only in memory. * g++.dg/ext/asm12.C: New test. From-SVN: r194404
2012-12-10Make-lang.in (cp/typeck.o): Add dependency on $(PARAMS_H).Eric Botcazou2-2/+7
* Make-lang.in (cp/typeck.o): Add dependency on $(PARAMS_H). (cp/name-lookup.o): Likewise. From-SVN: r194369
2012-12-10* decl2.c (cp_write_global_declarations): Return after writing a PCH.Steven Bosscher2-1/+10
From-SVN: r194363
2012-12-07re PR c++/55127 (Incorrect "dependent scope" error with partial ↵Jason Merrill5-9/+47
specialization of non-type parameter) PR c++/55127 * search.c (accessible_in_template_p): New. * cp-tree.h: Declare it. * pt.c (instantiation_dependent_scope_ref_p): New. (value_dependent_expression_p): Use it. (instantiation_dependent_r): Likewise. * semantics.c (finish_decltype_type): Handle SCOPE_REF. From-SVN: r194318
2012-12-07re PR c++/55419 (ICE in gimplify_init_ctor_preeval, at gimplify.c:3587)Jason Merrill2-2/+5
PR c++/55419 * tree.c (build_target_expr): Don't set TREE_CONSTANT. From-SVN: r194317
2012-12-08re PR c++/55513 (Incorrect snprintf folding when building with -std=c++0x)Aldy Hernandez2-6/+16
PR c++/55513 * semantics.c (cxx_eval_builtin_function_call): Set non_constant_p after folding. From-SVN: r194316
2012-12-07tree.c (build_aggr_init_expr): Remove tsubst_flags_t parameter.Paolo Carlini4-6/+12
2012-12-07 Paolo Carlini <paolo.carlini@oracle.com> * tree.c (build_aggr_init_expr): Remove tsubst_flags_t parameter. (build_cplus_new): Adjust. * cp-tree.h: Adjust declaration. * init.c (build_value_init): Adjust. From-SVN: r194312
2012-12-07PR c++/54401 - Confusing diagnostics about type-alias at class scopeDodji Seketeli2-2/+33
Consider this invalid example given in the PR, where T is not defined: 1 template<typename> 2 struct X { 3 using type = T; 4 }; g++ yields the confusing diagnostics: test.cc:3:10: error: expected nested-name-specifier before 'type' using type = T; ^ test.cc:3:10: error: using-declaration for non-member at class scope test.cc:3:15: error: expected ';' before '=' token using type = T; ^ test.cc:3:15: error: expected unqualified-id before '=' token I think this is because in cp_parser_member_declaration we tentatively parse an alias declaration; we then have a somewhat meaningful diagnostic which alas is not emitted because we are parsing tentatively. As the parsing didn't succeed (because the input is invalid) we try to parse a using declaration, which fails as well; but then the diagnostic emitted is the one for the failed attempt at parsing a using declaration, not an alias declaration. Oops. The idea of this patch is to commit the tentative parse when we see the '=' token in the alias-declaration. That way any error encounter after that token is reported to the user. We are now getting the following output: test.cc:3:18: erreur: expected type-specifier before ‘T’ using type = T; ^ test.cc:3:18: erreur: ‘T’ does not name a type I don't really like the "before 'T'" there, but I think we maybe could revisit the format of what cp_parser_error emits in general, now that we have caret diagnostics; We could maybe do away with the "before T" altogether? In the mean time, it seems to me that this patch brings an improvement over what we already have in trunk, and the issue above could be addressed separately. Tested on x86_64-unknown-linux-gnu against trunk. gcc/cp/ * parser.c (cp_parser_alias_declaration): Commit to tentative parse when see the '=' token. Get out if the type-id is invalid. Update function comment. (cp_parser_member_declaration): Don't try to parse a using declaration if we know that we expected an alias declaration; that is, if we see the '=' token after the identifier. gcc/testsuite/ * g++.dg/cpp0x/alias-decl-28.C: New test. * g++.dg/cpp0x/alias-decl-16.C: Update. From-SVN: r194306
2012-12-06re PR c++/54325 (C++11 uniform initialization syntax for argument-less ↵Jason Merrill2-6/+10
abstract base class constructor fails) PR c++/54325 * tree.c (build_aggr_init_expr): Don't check for abstract class. From-SVN: r194284
2012-12-06re PR c++/55058 (Unexpected invalid type conversion error)Jason Merrill2-2/+10
PR c++/55058 * pt.c (tsubst): Keep the quals when looking through a typedef. From-SVN: r194282
2012-12-06re PR c++/55249 (Multiple copy constructors for template class lead to link ↵Jason Merrill2-1/+5
errors) PR c++/55249 * tree.c (build_vec_init_elt): Use the type of the initializer. From-SVN: r194281
2012-12-06re PR c++/54744 (internal compiler error: Segmentation fault, by dependent ↵Jason Merrill4-4/+19
base, member typedef and ctor-initializer) PR c++/54744 * pt.c (resolve_typename_type): Check TYPENAME_IS_RESOLVING_P on scope. * init.c (expand_member_init): Check for being in a template first. * parser.c (cp_parser_mem_initializer_list): Only check class types for equivalence to the current class. From-SVN: r194267
2012-12-06re PR c++/54913 (qualified lookup in ctor of class template fails to find ↵Jason Merrill2-2/+8
static member of reference type) PR c++/54913 * semantics.c (finish_qualified_id_expr): convert_from_reference after building a SCOPE_REF. From-SVN: r194266
2012-12-06re PR c++/54207 ([C++0x] ICE in build_noexcept_spec when bool is ↵Jakub Jelinek4-7/+22
#defined/typedef'd) PR c++/54207 * except.c (build_noexcept_spec): Avoid direct comparison with boolean_true_node or boolean_false_node, instead use operand_equal_p and/or INTEGER_CST check. * pt.c (tsubst_exception_specification): Likewise. * typeck2.c (merge_exception_specifiers): Likewise. * g++.dg/cpp0x/noexcept18.C: New test. From-SVN: r194263
2012-12-06re PR c++/55573 (ICE in adjust_temp_type, at cp/semantics.c:6454)Jakub Jelinek2-1/+6
PR c++/55573 * semantics.c (adjust_temp_type): Handle VECTOR_CST. * g++.dg/cpp0x/constexpr-55573.C: New test. From-SVN: r194262
2012-12-06re PR c++/54947 ([C++11] lambda cannot capture-by-copy inside braced-init-list)Jason Merrill2-1/+9
PR c++/54947 * parser.c (cp_parser_initializer_list): Don't require an expression in [] to be constant until we know it's a C99 designator. From-SVN: r194256
2012-12-06re PR c++/55015 (Lambda functions not found at link time when declared in an ↵Jason Merrill3-3/+12
inline function) PR c++/55015 PR c++/53821 * semantics.c (maybe_add_lambda_conv_op): Revert earlier change. * decl.c (start_preparsed_function): Make local class methods comdat in templates, too. From-SVN: r194251
2012-12-06re PR c++/54653 (tsubst_template_parms ICE)Jason Merrill3-2/+14
PR c++/54653 * parser.c (cp_parser_class_head): A partial specialization scope counts as a template. * pt.c (tsubst_template_parms): Handle template template parm parms. (tsubst_decl) [TEMPLATE_DECL]: Handle getting a template template argument back. From-SVN: r194249
2012-12-06re PR c++/55564 (internal error using decltype of a template type parameter ↵Jason Merrill2-2/+8
for late-specified function result type) PR c++/55564 * pt.c (unify) [ARRAY_TYPE]: Unify the element type before the bounds. From-SVN: r194248
2012-12-03re PR c++/54170 (Call to lambda elided)Paolo Carlini3-11/+16
/cp 2012-12-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/54170 * cvt.c (cp_convert_to_pointer): Don't discard side-effects from expressions of nullptr_t. * typeck.c (build_ptrmemfunc): Likewise. /testsuite 2012-12-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/54170 * g++.dg/cpp0x/lambda/lambda-nullptr.C: New. From-SVN: r194098
2012-12-01re PR c++/55542 (g++ segmentation fault)Jakub Jelinek2-4/+13
PR c++/55542 * pt.c (make_ith_pack_parameter_name): Return NULL if name is NULL. (tsubst_decl): Call make_ith_pack_parameter_name even if DECL_NAME is NULL. * g++.dg/cpp0x/vt-55542.C: New test. From-SVN: r194010
2012-11-29re PR c++/53137 (g++ segfault)Jason Merrill3-8/+17
PR c++/53137 * pt.c (tsubst_expr) [DECL_EXPR]: Set LAMBDA_EXPR_THIS_CAPTURE here. (tsubst_copy_and_build) [LAMBDA_EXPR]: And clear it here. (instantiate_class_template_1): Not here. From-SVN: r193954
2012-11-29re PR c++/53094 (constexpr vector subscripting)Marc Glisse2-0/+7
2012-11-29 Marc Glisse <marc.glisse@inria.fr> PR c++/53094 gcc/ * fold-const.c (fold): Replace a CONSTRUCTOR with a VECTOR_CST. gcc/cp/ * cvt.c (ocp_convert): Call convert_to_vector. gcc/testsuite/ * g++.dg/ext/vector20.C: New testcase. From-SVN: r193938
2012-11-29re PR bootstrap/53912 (bootstrap fails using default c++ mode in stage 2 and ↵Kai Tietz2-5/+12
3 for native x86_64-w64-mingw32) PR target/53912 * class.c (dump_class_hierarchy_r): Cast from pointer via uintptr_t. (dump_vtable): Likewise. From-SVN: r193934
2012-11-29re PR c++/52654 ([C++11] Warn on overflow in user-defined literals)Ed Smith-Rowland2-1/+23
gcc/c-family/ 2012-11-29 Ed Smith-Rowland <3dw4rd@verizon.net> PR c++/52654 * c-common.h (overflow_type): New enum. (build_userdef_literal): Add overflow_type argument. (tree_userdef_literal): Add overflow_type. (USERDEF_LITERAL_OVERFLOW): New access macro. * c-common.c (build_userdef_literal): Add overflow_type argument. * c-lex.c (c_lex_with_flags): Add overflow_type to build_userdef_literal calls. (interpret_integer, interpret_float): Add overflow_type argument. gcc/cp/ 2012-11-29 Ed Smith-Rowland <3dw4rd@verizon.net> PR c++/52654 * parser.c (cp_parser_string_literal): Add overflow_type arg. (cp_parser_userdef_numeric_literal): Warn on numeric overflow. gcc/testsuite/ 2012-11-29 Ed Smith-Rowland <3dw4rd@verizon.net> PR c++/52654 * g++.dg/cpp0x/udlit-overflow.C: New. * g++.dg/cpp0x/udlit-overflow-neg.C: New. From-SVN: r193918
2012-11-28re PR other/54279 (first stage build with g++ fails with "." as the first ↵Andrew Pinski2-5/+14
component of $PATH) 2012-11-28 Andrew Pinski <apinski@cavium.com> PR bootstrap/54279 * configure.ac (CXX_FOR_TARGET): Change over to use xg++. * configure: Regenerate. * Makefile.tpl (POSTSTAGE1_CXX_EXPORT): Change over to use xg++. * Makefile.in: Regenerate. 2012-11-28 Andrew Pinski <apinski@cavium.com> PR bootstrap/54279 * Makefile.in (${QMTEST_DIR}/context): Use xg++ instead of g++. 2012-11-28 Andrew Pinski <apinski@cavium.com> PR bootstrap/54279 * Make-lang.in (g++$(exeext)): Rename to (xg++$(exeext)): This. (g++-cross$(exeext)): Use xg++$(exeext) instead of g++$(exeext). (c++.start.encap): Likewise. (c++.install-common): Likewise. 2012-11-28 Andrew Pinski <apinski@cavium.com> PR bootstrap/54279 * lib/g++.exp (g++_init): Search for xg++ instead of g++ in the build directories. * lib/obj-c++.exp (obj-c++_init): Likewise. 2012-11-28 Andrew Pinski <apinski@cavium.com> PR bootstrap/54279 * scripts/testsuite_flags.in (--build-cxx): Use xg++ instead of g++. * testsuite/lib/libstdc++.exp (libstdc++_init): Likewise. From-SVN: r193910
2012-11-24re PR c++/55446 (array new with size zero vanishes from object code)Paolo Carlini2-2/+7
/cp 2012-11-24 Paolo Carlini <paolo.carlini@oracle.com> PR c++/55446 * init.c (build_vec_init): Do not early return error_mark_mode when integer_all_onesp (maxindex). /testsuite 2012-11-24 Paolo Carlini <paolo.carlini@oracle.com> PR c++/55446 * g++.dg/init/new41.C: New. From-SVN: r193785
2012-11-23re PR c++/54046 (wrong control reaches end of non-void function for switch ↵Jakub Jelinek4-0/+29
case with throw and default) PR c++/54046 * Makefile.in (gimple-low.o): Depend on langhooks.h. * gimple-low.c: Include langhooks.c. (block_may_fallthru): Handle TARGET_EXPR and ERROR_MARK, by default call lang_hooks.block_may_fallthru. * langhooks.h (struct lang_hooks): Add block_may_fallthru langhook. * langhooks-def.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Define. (LANG_HOOKS_INITIALIZER): Use it. * cp-objcp-common.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Redefine. * cp-objcp-common.c (cxx_block_may_fallthru): New function. * cp-tree.h (cxx_block_may_fallthru): New prototype. * g++.dg/warn/Wreturn-type-8.C: New test. From-SVN: r193762
2012-11-23re PR c++/55418 (Valgrind: Conditional jump or move depends on uninitialised ↵Markus Trippelsdorf2-2/+7
value(s) in implicitly_declare_fn() method.c:1623) 2012-11-23 Markus Trippelsdorf <markus@trippelsdorf.de> PR c++/55418 * method.c (implicitly_declare_fn): Properly initialize trivial_p. From-SVN: r193758
2012-11-22re PR c++/55137 (Unexpected static structure initialization)Jason Merrill2-115/+113
PR c++/55137 * semantics.c (verify_constant): Track overflow separately. (reduced_constant_expression_p): Don't check it here. (cxx_eval_constant_expression): Check it on CSTs. (cxx_eval_outermost_constant_expr): Treat overflows as non-constant at this point, but still return the folded version. (potential_constant_expression_1): Don't check overflow. From-SVN: r193727