aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
AgeCommit message (Collapse)AuthorFilesLines
2017-10-10Update ChangeLog and version files for releasereleases/gcc-5.5.0releases/gcc-5GCC Administrator1-0/+4
From-SVN: r253576
2017-09-25[Patch, Darwin] Fix 81037 by adjutng headersIain Sandoe1-2/+0
2017-09-26 Iain Sandoe <iain@codesourcery.com> Ryan Mounce <ryan@mounce.com.au> PR bootstrap/81037 Backport from mainline r235362 2016-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com> * system.h (list, map, set, vector): Include conditionally. * auto-profile.c (INCLUDE_MAP, INCLUDE_SET): Define. * graphite-isl-ast-to-gimple.c (INCLUDE_MAP): Define. * ipa-icf.c (INCLUDE_LIST): Define. * ipa-icf-gimple.c (INCLUDE_LIST): Define. * config/sh/sh.c (INCLUDE_VECTOR): Define. * config/sh/sh_treg_combine.cc (INCLUDE_ALGORITHM): Define. (INCLUDE_LIST, INCLUDE_VECTOR): Define. * fortran/trans-common.c (INCLUDE_MAP): Define. Backport from mainline r235361 2016-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com> * auto-profile.c: Remove <string.h> include. * diagnostic.c: Remove <new> include. * genmatch.c: Likewise. * pretty-print.c: Likewise. * toplev.c: Likewise * c/c-objc-common.c: Likewise. * cp/error.c: Likewise. * fortran/error.c: Likewise. Co-Authored-By: Ryan Mounce <ryan@mounce.com.au> From-SVN: r253181
2017-09-18PR c++/80294 - ICE with constexpr and inheritance.Jason Merrill2-5/+14
* constexpr.c (reduced_constant_expression_p): A null constructor element is non-constant. (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before returning an empty base. From-SVN: r252940
2017-09-18PR c++/79607 - ICE with T{} initializerJason Merrill2-0/+6
* decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR. From-SVN: r252939
2017-09-18PR c++/72457 - ICE with list-value-initialized base.Jason Merrill3-4/+14
* init.c (expand_aggr_init_1): Only handle value-init of bases. * constexpr.c (build_data_member_initialization): Handle multiple initializers for the same field. From-SVN: r252938
2017-09-18PR c++/55922 - list-value-initialization of baseJason Merrill2-0/+19
PR c++/63151 * init.c (expand_aggr_init_1): Handle list-initialization from {}. From-SVN: r252937
2017-09-16backport: re PR c++/80984 (ICE with label/variable ambiguity)Jakub Jelinek2-2/+11
Backported from mainline 2017-06-13 Jakub Jelinek <jakub@redhat.com> PR c++/80984 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in BLOCK_VARS (outer) chain. (cxx_omp_const_qual_no_mutable): Likewise. * g++.dg/opt/nrv18.C: New test. From-SVN: r252879
2017-09-16backport: re PR c++/81154 (OpenMP with shared variable in a template class ↵Jakub Jelinek2-7/+17
crash) Backported from mainline 2017-06-21 Jakub Jelinek <jakub@redhat.com> PR c++/81154 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses): Complain about t not being a variable if t is OVERLOAD even when processing_template_decl. * g++.dg/gomp/pr81154.C: New test. From-SVN: r252878
2017-06-08re PR c/81006 (ICE with zero-size array and #pragma omp task depend)Jakub Jelinek2-3/+9
PR c/81006 * c-typeck.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE to sizetype before size_binop. * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE to sizetype before size_binop. * c-c++-common/gomp/pr81006.c: New test. From-SVN: r249038
2017-05-30backport: re PR c++/80363 (#'vec_cond_expr' not supported by ↵Jakub Jelinek2-0/+6
dump_expr#<expression error>) Backported from mainline 2017-04-11 Jakub Jelinek <jakub@redhat.com> PR c++/80363 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR. * g++.dg/ext/pr80363.C: New test. From-SVN: r248670
2017-05-30backport: re PR c++/80176 (cannot bind reference to static member function ↵Jakub Jelinek2-0/+18
using object access expression) Backported from mainline 2017-04-10 Jakub Jelinek <jakub@redhat.com> PR c++/80176 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second operand, if it is a static member function, recurse on the BASELINK. * g++.dg/init/ref23.C: New test. From-SVN: r248669
2017-05-30backport: re PR c++/80141 (ICE with pragma omp declare)Jakub Jelinek2-2/+9
Backported from mainline 2017-03-22 Jakub Jelinek <jakub@redhat.com> PR c++/80141 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN, case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not processing_template_decl. * g++.dg/gomp/pr80141.C: New test. From-SVN: r248663
2017-05-30backport: re PR c++/79896 (ICE in gimplify_expr, at gimplify.c:11950 on ↵Jakub Jelinek3-3/+15
non-int128 target) Backported from mainline 2017-03-10 Jakub Jelinek <jakub@redhat.com> PR c++/79896 * decl.c (finish_enum_value_list): If value is error_mark_node, don't copy it and change its type. * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL of CONST_DECL is error_mark_node. * g++.dg/ext/int128-5.C: New test. From-SVN: r248659
2017-05-30backport: re PR c++/79664 (ICE with #pragma omp parallel in constexpr function)Jakub Jelinek3-1/+40
Backported from mainline 2017-02-22 Jakub Jelinek <jakub@redhat.com> PR c++/79664 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree. * constexpr.c (potential_constant_expression_1): Handle OMP_*, OACC_* and CILK_* trees. * g++.dg/gomp/pr79664.C: New test. From-SVN: r248650
2017-05-30backport: re PR c++/79512 (ICE: Segfault in gimple_build_call_1, at ↵Jakub Jelinek2-0/+11
gimple.c:218) Backported from mainline 2017-02-16 Jakub Jelinek <jakub@redhat.com> PR c++/79512 * c-parser.c (c_parser_omp_target): For -fopenmp-simd ignore #pragma omp target even when not followed by identifier. * parser.c (cp_parser_omp_target): For -fopenmp-simd ignore #pragma omp target even when not followed by identifier. * c-c++-common/gomp/pr79512.c: New test. From-SVN: r248643
2017-05-30backport: re PR c++/78341 (ICE on invalid C++ code on x86_64-linux-gnu ↵Jakub Jelinek2-5/+7
(internal compiler error: in cp_parser_std_attribute_spec, at cp/parser.c:24597)) Backported from mainline 2017-01-11 Jakub Jelinek <jakub@redhat.com> PR c++/78341 * parser.c (cp_parser_std_attribute_spec): Remove over-eager assertion. Formatting fix. * g++.dg/cpp0x/pr78341.C: New test. From-SVN: r248639
2017-05-30backport: re PR c++/78949 (incorrect "unused variable" warning with SSE2)Jakub Jelinek2-0/+8
Backported from mainline 2017-01-04 Jakub Jelinek <jakub@redhat.com> PR c++/78949 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has vector type. * c-c++-common/Wunused-var-16.c: New test. From-SVN: r248637
2017-05-30backport: re PR c++/78649 (ICE on invalid C++ code on x86_64-linux-gnu ↵Jakub Jelinek2-1/+7
(internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in build_value_init_noctor, at cp/init.c:380)) Backported from mainline 2016-12-02 Jakub Jelinek <jakub@redhat.com> PR c++/78649 * pt.c (tsubst_init): Don't call build_value_init if decl's type is error_mark_node. * g++.dg/cpp0x/pr78649.C: New test. From-SVN: r248630
2017-05-30backport: re PR c++/77739 (internal compiler error: in create_tmp_var, at ↵Jakub Jelinek2-7/+23
gimple-expr.c:524) Backported from mainline 2016-11-23 Jakub Jelinek <jakub@redhat.com> PR c++/77739 * cp-gimplify.c (cp_gimplify_tree) <case VEC_INIT_EXPR>: Pass false as handle_invisiref_parm_p to cp_genericize_tree. (struct cp_genericize_data): Add handle_invisiref_parm_p field. (cp_genericize_r): Don't wrap is_invisiref_parm into references if !wtd->handle_invisiref_parm_p. (cp_genericize_tree): Add handle_invisiref_parm_p argument, set wtd.handle_invisiref_parm_p to it. (cp_genericize): Pass true as handle_invisiref_parm_p to cp_genericize_tree. Formatting fix. * g++.dg/cpp1y/pr77739.C: New test. From-SVN: r248627
2017-05-30backport: re PR c++/77285 (extern thread_local linkage)Jakub Jelinek2-0/+8
Backported from mainline 2016-11-18 Jakub Jelinek <jakub@redhat.com> PR c++/77285 * mangle.c (mangle_tls_init_fn, mangle_tls_wrapper_fn): Call check_abi_tags. * g++.dg/tls/pr77285-1.C: New test. * g++.dg/tls/pr77285-2.C: New test. From-SVN: r248624
2017-05-30backport: re PR c++/78089 (__builtin_shuffle parsing bug)Jakub Jelinek2-12/+27
Backported from mainline 2016-10-31 Jakub Jelinek <jakub@redhat.com> PR c++/78089 * parser.c (cp_parser_postfix_expression): Replace return statement in the first switch with setting postfix_expression to the return expression and break;. * c-c++-common/builtin-shuffle-1.c: New test. From-SVN: r248620
2017-05-30backport: re PR c++/77467 (Segmentation fault with switch statement in ↵Jakub Jelinek2-29/+110
constexpr function) Backported from mainline 2016-09-28 Jakub Jelinek <jakub@redhat.com> PR c++/77467 * constexpr.c (enum constexpr_switch_state): New. (struct constexpr_ctx): Add css_state field. (label_matches): Add CTX and STMT arguments, remove I and DEFAULT_LABEL. For CASE_LABEL_EXPR assert ctx->css_state != NULL, handle default labels according to css_state. (cxx_eval_statement_list): Remove statement skipping, label_matches and default_label handling code. (cxx_eval_loop_expr): Exit after first iteration even if switches (jump_target). (cxx_eval_switch_expr): Set up css_state field in ctx, if default label has been seen in the body, but no cases matched, evaluate the body second time. (cxx_eval_constant_expression): Handle stmt skipping and label_matches here. Handle PREDICT_EXPR. For MODIFY_EXPR or INIT_EXPR, assert statement is not skipped. For COND_EXPR during skipping, don't evaluate condition, just the then block and if still skipping at the end also the else block. (cxx_eval_outermost_constant_expr): Adjust constexpr_ctx initializer. (is_sub_constant_expr): Likewise. * g++.dg/cpp1y/constexpr-77467.C: New test. From-SVN: r248615
2017-05-30backport: re PR c++/77722 (-fsanitize=undefined doesn't give runtime error ↵Jakub Jelinek2-8/+12
in function without return value, unless at least 2 instructions) Backported from mainline 2016-09-27 Jakub Jelinek <jakub@redhat.com> PR c++/77722 * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Instrument also functions that have just a STATEMENT_LIST instead of BIND_EXPR, or BIND_EXPR with some statement rather than STATEMENT_LIST as body. * g++.dg/ubsan/return-4.C: New test. * g++.dg/ubsan/return-5.C: New test. * g++.dg/ubsan/return-6.C: New test. From-SVN: r248614
2017-05-30backport: re PR c++/77637 (ICE on x86_64-linux-gnu (Segmentation fault, ↵Jakub Jelinek2-2/+12
tree_check, cp_parser_std_attribute_list...)) Backported from mainline 2016-09-20 Jakub Jelinek <jakub@redhat.com> PR c++/77637 * parser.c (cp_parser_std_attribute_list): Reject ... without preceding attribute. * g++.dg/cpp0x/gen-attrs-62.C: New test. From-SVN: r248611
2017-05-30backport: re PR c++/77375 (constant object with mutable subobject allocated ↵Jakub Jelinek2-0/+8
in read-only memory) Backported from mainline 2016-09-16 Jakub Jelinek <jakub@redhat.com> PR c++/77375 * class.c (check_bases): Set CLASSTYPE_HAS_MUTABLE if any TYPE_HAS_MUTABLE_P for any bases. * g++.dg/cpp0x/mutable1.C: New test. From-SVN: r248608
2017-05-30backport: re PR c++/72868 (Constexpr expressions mistreat case ranges)Jakub Jelinek2-0/+14
Backported from mainline 2016-08-11 Jakub Jelinek <jakub@redhat.com> PR c++/72868 * constexpr.c (label_matches): Handle case range expressions. * g++.dg/cpp1y/constexpr-switch4.C: New test. From-SVN: r248595
2017-01-12re PR c++/77812 (incorrectly rejects valid C++ code that uses enum in ↵Nathan Sidwell2-1/+12
template instantiation) cp/ PR c++/77812 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl is a new overload. testsuite/ PR c++/77812 * g++.dg/pr77812.C: New. From-SVN: r244351
2016-12-08re PR c++/78551 (Internal compiler error with constexpr initialization of union)Nathan Sidwell2-9/+58
PR c++/78551 * constexpr.c (extract_string_elt): New. Broken out of ... (cxx_eval_array_reference): ... here. Call it. (cxx_eval_store_expression): Convert init by STRING_CST into CONSTRUCTOR, if needed. PR c++/78551 * g++.dg/cpp1y/pr78551.C: New. From-SVN: r243457
2016-08-05re PR c++/68724 (ice in unify, at cp/pt.c:19902)Nathan Sidwell2-1/+6
PR c++/68724 * pt.c (unify): TRAIT_EXPR is an expr. PR c++/68724 * g++.dg/cpp0x/pr68724.C: New. From-SVN: r239177
2016-07-26PR c++/71833 - member template with two parameter packsJason Merrill2-3/+10
* pt.c (coerce_template_parameter_pack): Fix logic for pack index. From-SVN: r238765
2016-07-21PR c++/69223 - ICE with deduced template return type.Jason Merrill2-2/+8
* semantics.c (apply_deduced_return_type): Call complete_type_or_else before building the new RESULT_DECL. From-SVN: r238630
2016-07-21PR c++/71630 - extern variable templateJason Merrill2-1/+8
* pt.c (instantiate_decl): Fix pattern_defined for namespace scope variable templates. From-SVN: r238629
2016-07-21PR c++/71913 - missing copy elision with new.Jason Merrill2-3/+10
* call.c (unsafe_copy_elision_p): It's OK to elide when initializing an unknown object. From-SVN: r238628
2016-07-20re PR c++/71909 (g++ accepts an unreachable function catch block that lacks ↵Jakub Jelinek2-3/+46
a corresponding try) PR c++/71909 * parser.c (cp_parser_save_member_function_body): Consume __transaction_relaxed or __transaction_atomic with optional attribute. Only skip catch with block if try keyword is seen. * g++.dg/parse/pr71909.C: New test. * g++.dg/tm/pr71909.C: New test. From-SVN: r238526
2016-07-19backport: re PR c++/71871 (ICE on mixing templates and vector extensions ↵Jakub Jelinek2-2/+9
ternary operator) Backported from mainline 2016-07-18 Jakub Jelinek <jakub@redhat.com> PR c++/71871 * typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change. * g++.dg/ext/vector31.C: New test. From-SVN: r238464
2016-07-07backport: re PR c++/71528 (multiple extern reference declarations produce ↵Jakub Jelinek2-0/+12
uninitialized access) Backported from mainline 2016-06-14 Jakub Jelinek <jakub@redhat.com> PR c++/71528 * decl.c (duplicate_decls): For DECL_INITIALIZED_P non-external olddecl vars, preserve their TREE_READONLY bit. * g++.dg/opt/pr71528.C: New test. From-SVN: r238098
2016-07-07backport: re PR c++/71516 (ICE on invalid C++ code (invalid use of forward ↵Jakub Jelinek2-2/+11
declared type) on x86_64-linux-gnu: Segmentation fault (program cc1plus)) Backported from mainline 2016-06-14 Jakub Jelinek <jakub@redhat.com> PR c++/71516 * decl.c (complete_vars): Handle gracefully type == error_mark_node. * g++.dg/init/pr71516.C: New test. From-SVN: r238097
2016-06-08re PR c++/71442 (r232569 breaks -Wunused-*)Jakub Jelinek2-1/+7
PR c++/71442 * pt.c (tsubst_copy): Only set TREE_USED on DECLs. * g++.dg/cpp0x/Wunused-variable-1.C: New test. From-SVN: r237234
2016-06-03Update ChangeLog and version files for releasereleases/gcc-5.4.0Richard Biener1-0/+4
From-SVN: r237056
2016-05-23Backport PRs 68142, 69634, 69845, 70347Richard Biener2-2/+26
2016-05-23 Richard Biener <rguenther@suse.de> Backport from mainline 2016-02-11 Alexandre Oliva <aoliva@redhat.com> PR target/69634 * regstat.c (regstat_bb_compute_calls_crossed): Disregard debug insns. * gcc.dg/pr69634.c: New. 2016-03-23 Patrick Palka <ppalka@gcc.gnu.org> PR c++/70347 * typeck.c (process_init_constructor_union): If the initializer is empty, use the union's NSDMI if it has one. * g++.dg/cpp1y/nsdmi-union1.C: New test. 2015-10-30 Richard Biener <rguenther@suse.de> PR middle-end/68142 * fold-const.c (extract_muldiv_1): Avoid introducing undefined overflow. * c-c++-common/ubsan/pr68142.c: New testcase. 2016-03-24 Richard Henderson <rth@redhat.com> PR middle-end/69845 * fold-const.c (extract_muldiv_1): Correct test for multiplication overflow. * gcc.dg/tree-ssa/pr69845-1.c: New test. * gcc.dg/tree-ssa/pr69845-2.c: New test. From-SVN: r236588
2016-05-20re PR c++/70466 ([ICE on invalid code in tree check: expected constructor, ↵Paolo Carlini2-1/+8
have parm_decl in convert_like_real, at cp/call.c:6371 with -std=c++11) /cp 2016-05-20 Paolo Carlini <paolo.carlini@oracle.com> PR c++/70466 * call.c (convert_like_real): Check that we are actually converting from an init list. /testsuite 2016-05-20 Paolo Carlini <paolo.carlini@oracle.com> PR c++/70466 * g++.dg/template/pr70466-1.C: New. * g++.dg/template/pr70466-2.C: Likewise. From-SVN: r236530
2016-05-18PR c++/70505 - partial instantiation of template-idJason Merrill2-3/+8
* pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR unknown_type_node, too. From-SVN: r236411
2016-05-18PR c++/70494 - lambda capture of arrayJason Merrill3-10/+14
* decl.c (cxx_maybe_build_cleanup): Handle non-decls. * typeck2.c (split_nonconstant_init_1): Use it. From-SVN: r236410
2016-05-18PR c++/70648 - constexpr empty list-initializationJason Merrill2-0/+6
* constexpr.c (cxx_eval_store_expression): Also copy CONSTRUCTOR_NO_IMPLICIT_ZERO. From-SVN: r236409
2016-05-18PR c++/70353 - __func__ and constexprJason Merrill2-2/+9
gcc/ * tree-inline.c (remap_decls): Don't add_local_decl if cfun is null. gcc/cp/ * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics in constexpr functions. From-SVN: r236408
2016-05-18PR c++/70095 - variable template partial specializationJason Merrill2-1/+6
* pt.c (instantiate_decl): Fix call to variable_template_p. From-SVN: r236407
2016-05-18Fix constexpr handling of SAVE_EXPR in loops.Jason Merrill2-6/+43
* constexpr.c (struct constexpr_ctx): Add save_exprs field. (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping. (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set. (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize. From-SVN: r236406
2016-05-18* method.c (synthesized_method_walk): operator= can also be constexpr.Jason Merrill2-2/+15
From-SVN: r236405
2016-05-03re PR c++/70635 (ICE on (and rejects) valid code on x86_64-linux-gnu: ↵Paolo Carlini2-2/+8
Segmentation fault (program cc1plus)) /cp 2016-05-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/70635 * pt.c (resolve_typename_type): Fix typos in infinite recursion avoidance mechanism. /testsuite 2016-05-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/70635 * g++.dg/parse/pr70635.C: New. From-SVN: r235846
2016-04-18re PR c/70297 (GCC Segfaults when using -g3)Marek Polacek2-0/+17
PR c/70297 * c-decl.c (merge_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN. * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN. * c-c++-common/pr70297.c: New test. * g++.dg/cpp0x/typedef-redecl.C: New test. * gcc.dg/typedef-redecl2.c: New test. From-SVN: r235150