- 25 Feb, 2020 24 commits
-
-
libstdc++-v3/ChangeLog: LWG 3325 Constrain return type of transformation function for transform_view * include/std/ranges (transform_view): Constrain the return type of the transformation function as per LWG 3325. * testsuite/std/ranges/adaptors/lwg3325_neg.cc: New test.
Patrick Palka committed -
libstdc++-v3/ChangeLog: LWG 3313 join_view::_Iterator::operator-- is incorrectly constrained * include/std/ranges (join_view::_Iterator::operator--): Require that range_reference_t<_Base> models common_range. * testsuite/std/ranges/adaptors/lwg3313_neg.cc: New test.
Patrick Palka committed -
libstdc++-v3/ChangeLog: LWG 3301 transform_view::_Iterator has incorrect iterator_category * include/std/ranges (transform_view::_Iterator::_S_iter_cat): Adjust determination of iterator_category as per LWG 3301. * testsuite/std/ranges/adaptors/transform.cc: Augment test.
Patrick Palka committed -
libstdc++-v3/ChangeLog: LWG 3292 iota_view is under-constrained * include/std/ranges (iota_view): Require that _Winc models semiregular as per LWG 3292. * testsuite/std/ranges/iota/lwg3292_neg.cc: New test.
Patrick Palka committed -
This patch is part of a series adding support for Armv8.6-A features. It adds intrinsics for brain half-precision float-point (BF16) dot instructions with AdvSIMD support. gcc/ChangeLog: 2020-02-25 Dennis Zhang <dennis.zhang@arm.com> * config/arm/arm_neon.h (vbfdot_f32, vbfdotq_f32): New (vbfdot_lane_f32, vbfdotq_laneq_f32): New. (vbfdot_laneq_f32, vbfdotq_lane_f32): New. * config/arm/arm_neon_builtins.def (vbfdot): New entry. (vbfdot_lanev4bf, vbfdot_lanev8bf): Likewise. * config/arm/iterators.md (VSF2BF): New attribute. * config/arm/neon.md (neon_vbfdot<VCVTF:mode>): New entry. (neon_vbfdot_lanev4bf<VCVTF:mode>): Likewise. (neon_vbfdot_lanev8bf<VCVTF:mode>): Likewise. gcc/testsuite/ChangeLog: 2020-02-25 Dennis Zhang <dennis.zhang@arm.com> * gcc.target/arm/simd/bf16_dot_1.c: New test. * gcc.target/arm/simd/bf16_dot_2.c: New test. * gcc.target/arm/simd/bf16_dot_3.c: New test.
Dennis Zhang committed -
The mutating sequence algorithms std::copy, std::copy_backward, std::move and std::move_backward conditionally use __builtin_memmove for trivially copyable types. However, because memmove isn't usable in constant expressions the use of __builtin_memmove is wrapped in a __memmove function which replaces __builtin_memmove with a handwritten loop when std::is_constant_evaluated() is true. This means we have a manual loop for non-trivially copyable cases, and a different manual loop for trivially copyable but constexpr cases. The latter loop has incorrect semantics for the {copy,move}_backward cases and so isn't used for them. Until earlier today the latter loop also had incorrect semantics for the std::move cases, trying to move from const rvalues. The approach taken by this patch is to remove the __memmove function entirely and use the original (and correct) manual loops for the constexpr cases as well as the non-trivially copyable cases. This was already done for move_backward and copy_backward, but was incorrectly turning copy_backward into move_backward, by failing to use the _IsMove constant to select the right specialization. This patch also fixes that. * include/bits/ranges_algobase.h (__copy_or_move): Do not use memmove during constant evaluation. Call __builtin_memmove directly instead of __memmove. (__copy_or_move_backward): Likewise. * include/bits/stl_algobase.h (__memmove): Remove. (__copy_move<M, true, random_access_iterator_tag>::__copy_m) (__copy_move_backward<M, true, random_access_iterator_tag>::__copy_m): Use __builtin_memmove directly instead of __memmove. (__copy_move_a2): Do not use memmove during constant evaluation. (__copy_move_backward_a2): Use _IsMove constant to select correct __copy_move_backward specialization. * testsuite/25_algorithms/copy_backward/constexpr.cc: Check for copies begin turned into moves during constant evaluation.Jonathan Wakely committed -
Jonathan Wakely committed
-
When running the testsuite with -fdisable-rtl-fwprop2 and -mpure-code for cortex-m0, I noticed that some testcases were failing because we still generate "ldr rX, .LCY", which is what we want to avoid with -mpure-code. This is latent since a recent improvement in fwprop (PR88833). In this patch I change the thumb1_movsi_insn pattern so that it emits the desired instruction sequence when arm_disable_literal_pool is set. To achieve that, I introduce a new required_for_purecode attribute to enable the corresponding alternative in thumb1_movsi_insn and take the actual instruction sequence length into account. gcc/ChangeLog: 2020-02-13 Christophe Lyon <christophe.lyon@linaro.org> * config/arm/arm.md (required_for_purecode): New attribute. (enabled): Handle required_for_purecode. * config/arm/thumb1.md (thumb1_movsi_insn): Add alternative to work with -mpure-code.
Christophe Lyon committed -
git is miscompiled on s390x-linux with -O2 -march=zEC12 -mtune=z13. I've managed to reduce it into the following testcase. The problem is that during combine we see the s->k = -1; bitfield store and change the SET_SRC from a pseudo into a constant: (set (zero_extract:DI (mem/j:HI (plus:DI (reg/v/f:DI 60 [ s ]) (const_int 10 [0xa])) [0 +0 S2 A16]) (const_int 2 [0x2]) (const_int 7 [0x7])) (const_int -1 [0xffffffffffffffff])) This on s390x with the above option isn't recognized as valid instruction, so find_split_point decides to handle it as IOR or IOR/AND. src is -1, mask is 3 and pos is 7. src != mask (this is also incorrect, we want to set all (both) bits in the bitfield), so we go for IOR/AND, but instead of trying mem = (mem & ~0x180) | ((-1 << 7) & 0x180) we actually try mem = (mem & ~0x180) | (-1 << 7) and that is further simplified into: mem = mem | (-1 << 7) aka mem = mem | 0xff80 which doesn't set just the 2-bit bitfield, but also many other bitfields that shouldn't be touched. We really should do: mem = mem | 0x180 instead. The problem is that we assume that no bits but those low len (2 here) will be set in the SET_SRC, but there is nothing that can prevent that, we just should ignore the other bits. The following patch fixes it by masking src with mask, this way already the src == mask test will DTRT, and as the code for or_mask uses gen_int_mode, if the most significant bit is set after shifting it left by pos, it will be properly sign-extended. 2020-02-25 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/93908 * combine.c (find_split_point): For store into ZERO_EXTRACT, and src with mask. * gcc.c-torture/execute/pr93908.c: New test.Jakub Jelinek committed -
* testsuite/25_algorithms/move_backward/93872.cc: Add test left out of previous commit.
Jonathan Wakely committed -
The std::move and std::move_backward algorithms dispatch to the std::__memmove helper when appropriate. That function uses a pointer-to-const for the source values, preventing them from being moved. The two callers of that function have the same problem. Rather than altering __memmove and its callers to work with const or non-const source pointers, this takes a more conservative approach of casting away the const at the point where we want to do a move assignment. This relies on the fact that we only use __memmove when the type is trivially copyable, so we know the move assignment doesn't alter the source anyway. PR libstdc++/93872 * include/bits/stl_algobase.h (__memmove): Cast away const before doing move assignment. * testsuite/25_algorithms/move/93872.cc: New test. * testsuite/25_algorithms/move_backward/93872.cc: New test.
Jonathan Wakely committed -
This fixes a regression whereby the program fails to link with debug info in LTO mode because of an undefined reference to a symbol coming from the object files containing the early debug info. * dwarf2out.c (dwarf2out_size_function): Run in early-DWARF mode.
Eric Botcazou committed -
This adds a testcase for some basic FRE functionality. 2020-02-25 Richard Biener <rguenther@suse.de> * gcc.dg/tree-ssa/ssa-fre-86.c: New testcase.
Richard Biener committed -
gcc/ChangeLog: doc/install.texi (--enable-checking): Adjust wording.
Roman Zhuykov committed -
This avoids altering possibly shared SLP subtrees when attempting to get rid of permutations in SLP reductions by copying the SLP subtree before re-arranging stmts in it. 2020-02-25 Richard Biener <rguenther@suse.de> PR tree-optimization/93868 * tree-vect-slp.c (slp_copy_subtree): New function. (vect_attempt_slp_rearrange_stmts): Copy the SLP tree before re-arranging stmts in it. * gcc.dg/torture/pr93868.c: New testcase.
Richard Biener committed -
dump_passes pushes a dummy function for which it evaluates the gates and checks whether the pass is enabled or disabled. Unfortunately, if any -fdisable-*-*/-fenable-*-* options were seen, we ICE during is_pass_explicitly_enabled_or_disabled because slot is non-NULL then and the code will do: cgraph_uid = func ? cgraph_node::get (func)->get_uid () : 0; but the dummy function doesn't have a cgraph node. So, either we need to create and then remove a cgraph node for the dummy function like the following patch, or function.c would need to export the in_dummy_function flag (or have some way to query that flag from other TUs) and we'd need to check it in is_pass_explicitly_enabled_or_disabled. 2020-02-25 Jakub Jelinek <jakub@redhat.com> PR middle-end/93874 * passes.c (pass_manager::dump_passes): Create a cgraph node for the dummy function and remove it at the end. * gcc.dg/pr93874.c: New test.
Jakub Jelinek committed -
* simplify.c (degrees_f): Remove unused code.
Steven G. Kargl committed -
Seems the test has been badly reduced (if the original doesn't emit warnings, it is always better in the reduction script avoid introducing new ones). Also, the g++.dg/ipa/ test fails with -std=c++98 because it is written in C++11. 2020-02-25 Jakub Jelinek <jakub@redhat.com> PR ipa/93763 * gcc.dg/ipa/pr93763.c: Adjust the test so that it compiles without warnings and still ICEs before the ipa-cp.c fix. * g++.dg/ipa/pr93763.C: Require c++11 effective target.
Jakub Jelinek committed -
2020-02-25 Jakub Jelinek <jakub@redhat.com> PR c/93858 * c-pragma.c (handle_pragma_diagnostic): Add missing ? after "did you mean" hint in diagnostics.
Jakub Jelinek committed -
2020-02-25 Jakub Jelinek <jakub@redhat.com> PR translation/93864 * config/lm32/lm32.c (lm32_setup_incoming_varargs): Fix comment typo paramter -> parameter. * config/aarch64/aarch64.c (aarch64_is_extend_from_extract): Likewise. * ipa-prop.h (struct ipa_agg_replacement_value): Likewise. * intrinsic.texi (CO_BROADCAST): Fix typo, paramter -> parameter. * trans-array.c (gfc_allocate_pdt_comp, gfc_deallocate_pdt_comp, gfc_check_pdt_dummy): Fix comment typo paramter -> parameter. * objc.dg/encode-2.m: Fix comment typo paramter -> parameter. * obj-c++.dg/encode-4.mm: Likewise. * gfortran.dg/data_array_5.f90: Likewise. * gcc.dg/decl-1.c: Likewise.
Jakub Jelinek committed -
This patch rewords the whole description to fix minor issues: - documents 'gimple' and 'types' checks, - clarifies what happens when option is used without '=list', - fixes inaccurate wrong wording about release snapshots, - describes that release checks can only de disabled explicitly. gcc/ChangeLog: * doc/install.texi (--enable-checking): Properly document current behavior. (--enable-stage1-checking): Minor clarification about bootstrap.
Roman Zhuykov committed -
This patch fixes a bug with -fdump-analyzer, which is meant to write purely a dumpfile, but was erroneously sending part of the dump to stderr. gcc/analyzer/ChangeLog: * engine.cc (exploded_graph::get_or_create_node): Dump the program_state to the pp, rather than to stderr.
David Malcolm committed -
* de.po: Update.
Joseph Myers committed -
GCC Administrator committed
-
- 24 Feb, 2020 16 commits
-
-
PR analyzer/93032 tracks a false negative where we fail to report FILE * leaks within zlib/contrib/minizip/mztools.c. The underlying issue is a combinatorial explosion of states within the exploded graph. In particular, the state of the "taint" checker is exploding, leading to the analyzer bailing out. I have a patch kit under construction that fixes the state explosion issue enough for the "file" checker to report the leaks, but doing so requires disabling the "taint" checker. Given that the latter is more of a proof-of-concept, this patch disables it by default, to stop it breaking the other checkers. gcc/analyzer/ChangeLog: PR analyzer/93032 * sm.cc (make_checkers): Require the "taint" checker to be explicitly enabled. gcc/ChangeLog: PR analyzer/93032 * doc/invoke.texi (-Wnanalyzer-tainted-array-index): Note that -fanalyzer-checker=taint is also required. (-fanalyzer-checker=): Note that providing this option enables the given checker, and doing so may be required for checkers that are disabled by default. gcc/testsuite/ChangeLog: PR analyzer/93032 * gcc.dg/analyzer/pr93382.c: Add "-fanalyzer-checker=taint". * gcc.dg/analyzer/taint-1.c: Likewise.
David Malcolm committed -
PR analyzer/93899 reports an ICE within make_region_for_type when handling a param of type OFFSET_TYPE within exploded_graph::add_function_entry. This patch fixes the ICE by further generalizing the "give up on this tree code" logic from r10-6667-gf76a88eb for PR analyzer/93388 and r10-6695-g2e623393 for PR analyzer/93778 by replacing the gcc_unreachable in make_region_for_type with a return of NULL, and handling this in add_region_for_type by notifying the ctxt. Doing so means that numerous places that create regions now need to have a context passed to them, so most of the patch is churn involved in passing a context around to where it's needed. gcc/analyzer/ChangeLog: PR analyzer/93899 * engine.cc (impl_region_model_context::impl_region_model_context): Add logger param. * engine.cc (exploded_graph::add_function_entry): Create an impl_region_model_context and pass it to the push_frame call. Bail if the resulting state is invalid. (exploded_graph::build_initial_worklist): Likewise. (exploded_graph::build_initial_worklist): Handle the case where add_function_entry fails. * exploded-graph.h (impl_region_model_context::impl_region_model_context): Add logger param. * region-model.cc (map_region::get_or_create): Add ctxt param and pass it to add_region_for_type. (map_region::can_merge_p): Pass NULL as a ctxt to call to get_or_create. (array_region::get_element): Pass ctxt to call to get_or_create. (array_region::get_or_create): Add ctxt param and pass it to add_region_for_type. (root_region::push_frame): Pass ctxt to get_or_create calls. (region_model::get_lvalue_1): Likewise. (region_model::make_region_for_unexpected_tree_code): Assert that ctxt is non-NULL. (region_model::get_rvalue_1): Pass ctxt to get_svalue_for_fndecl and get_svalue_for_label calls. (region_model::get_svalue_for_fndecl): Add ctxt param and pass it to get_region_for_fndecl. (region_model::get_region_for_fndecl): Add ctxt param and pass it to get_or_create. (region_model::get_svalue_for_label): Add ctxt param and pass it to get_region_for_label. (region_model::get_region_for_label): Add ctxt param and pass it to get_region_for_fndecl and get_or_create. (region_model::get_field_region): Add ctxt param and pass it to get_or_create_view and get_or_create. (make_region_for_type): Replace gcc_unreachable with return NULL. (region_model::add_region_for_type): Add ctxt param. Handle a return of NULL from make_region_for_type by calling make_region_for_unexpected_tree_code. (region_model::get_or_create_mem_ref): Pass ctxt to calls to get_or_create_view. (region_model::get_or_create_view): Add ctxt param and pass it to add_region_for_type. (selftest::test_state_merging): Pass ctxt to get_or_create_view. * region-model.h (region_model::get_or_create): Add ctxt param. (region_model::add_region_for_type): Likewise. (region_model::get_svalue_for_fndecl): Likewise. (region_model::get_svalue_for_label): Likewise. (region_model::get_region_for_fndecl): Likewise. (region_model::get_region_for_label): Likewise. (region_model::get_field_region): Likewise. (region_model::get_or_create_view): Likewise. gcc/testsuite/ChangeLog: PR analyzer/93899 * g++.dg/analyzer/pr93899.C: New test.
David Malcolm committed -
Patch from Svante Signell. Fixes GCC PR go/93900 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/220592
Ian Lance Taylor committed -
gcc/cp/ChangeLog: * parser.c (cp_parser_check_class_key): Remove a duplicate hunk of code.
Martin Sebor committed -
gcc/cp/ChangeLog: PR c++/93804 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags in shared C/C++ code in headers. gcc/testsuite/ChangeLog: PR c++/93804 * g++.dg/warn/Wredundant-tags-4.C: New test. * g++.dg/warn/Wredundant-tags-5.C: New test. * g++.dg/warn/Wredundant-tags-5.h: New test.
Martin Sebor committed -
Paths emitted by the analyzer can be quite verbose at the default of -fanalyzer-verbosity=2. Consider the double-free in this example: #include <stdlib.h> int foo (); int bar (); void test (int a, int b, int c) { void *p = malloc (1024); while (a) foo (); if (b) foo (); else bar (); if (c) free (p); free (p); } Previously, the analyzer would emit a checker_path containing all control-flow information on the exploded_path leading to the double-free: test.c: In function 'test': test.c:17:3: warning: double-'free' of 'p' [CWE-415] [-Wanalyzer-double-free] 17 | free (p); | ^~~~~~~~ 'test': events 1-9 | | 8 | void *p = malloc (1024); | | ^~~~~~~~~~~~~ | | | | | (1) allocated here | 9 | while (a) | | ~ | | | | | (2) following 'false' branch (when 'a == 0')... | 10 | foo (); | 11 | if (b) | | ~ | | | | | (3) ...to here | | (4) following 'false' branch (when 'b == 0')... |...... | 14 | bar (); | | ~~~~~~ | | | | | (5) ...to here | 15 | if (c) | | ~ | | | | | (6) following 'true' branch (when 'c != 0')... | 16 | free (p); | | ~~~~~~~~ | | | | | (7) ...to here | | (8) first 'free' here | 17 | free (p); | | ~~~~~~~~ | | | | | (9) second 'free' here; first 'free' was at (8) | despite the fact that only the "if (c)" is relevant to triggering the double-free. This patch implements pruning of control flow events at -fanalyzer-verbosity=2, based on reachability information within the exploded_graph. The diagnostic_manager pre-computes reachability information about which exploded_nodes can reach the exploded_node of the diagnostic, and uses this to prune irrelvent control flow edges. The patch also adds a -fanalyzer-verbosity=3 to preserve these edges, so that the "show me everything" debugging level becomes -fanalyzer-verbosity=4. With these changes, the "while (a)" and "if (b)" edges are pruned from the above example, leading to: test.c: In function 'test': test.c:17:3: warning: double-'free' of 'p' [CWE-415] [-Wanalyzer-double-free] 17 | free (p); | ^~~~~~~~ 'test': events 1-5 | | 8 | void *p = malloc (1024); | | ^~~~~~~~~~~~~ | | | | | (1) allocated here |...... | 15 | if (c) | | ~ | | | | | (2) following 'true' branch (when 'c != 0')... | 16 | free (p); | | ~~~~~~~~ | | | | | (3) ...to here | | (4) first 'free' here | 17 | free (p); | | ~~~~~~~~ | | | | | (5) second 'free' here; first 'free' was at (4) | The above example is gcc.dg/analyzer/edges-2.c. gcc/analyzer/ChangeLog: * checker-path.cc (superedge_event::should_filter_p): Update filter for empty descriptions to cover verbosity level 3 as well as 2. * diagnostic-manager.cc: Include "analyzer/reachability.h". (class path_builder): New class. (diagnostic_manager::emit_saved_diagnostic): Create a path_builder and pass it to build_emission_path, rather passing eg; similarly for add_events_for_eedge and ext_state. (diagnostic_manager::build_emission_path): Replace "eg" param with a path_builder, pass it to add_events_for_eedge. (diagnostic_manager::add_events_for_eedge): Replace ext_state param with path_builder; pass it to add_events_for_superedge. (diagnostic_manager::significant_edge_p): New. (diagnostic_manager::add_events_for_superedge): Add path_builder param. Reject insignificant edges at verbosity levels below 3. (diagnostic_manager::prune_for_sm_diagnostic): Update highest verbosity level to 4. * diagnostic-manager.h (class path_builder): New forward decl. (diagnostic_manager::build_emission_path): Replace "eg" param with a path_builder. (diagnostic_manager::add_events_for_eedge): Replace ext_state param with path_builder. (diagnostic_manager::significant_edge_p): New. (diagnostic_manager::add_events_for_superedge): Add path_builder param. * reachability.h: New file. gcc/ChangeLog: * doc/invoke.texi (-fanalyzer-verbosity=): "2" only shows significant control flow events; add a "3" which shows all control flow events; the old "3" becomes "4". gcc/testsuite/ChangeLog: * gcc.dg/analyzer/analyzer-verbosity-2a.c: New test. * gcc.dg/analyzer/analyzer-verbosity-3.c: New test, based on analyzer-verbosity-2.c * gcc.dg/analyzer/analyzer-verbosity-3a.c: New test. * gcc.dg/analyzer/edges-1.c: New test. * gcc.dg/analyzer/edges-2.c: New test. * gcc.dg/analyzer/file-paths-1.c: Add -fanalyzer-verbosity=3.David Malcolm committed -
This is a crash in cp_parser_check_class_key: tree type_decl = TYPE_MAIN_DECL (type); tree name = DECL_NAME (type_decl); // HERE because TYPE_MAIN_DECL of type was null as it's not a class type. Instead of checking CLASS_TYPE_P we should simply check class_key a bit earlier (in this case it was typename_type). 2020-02-24 Marek Polacek <polacek@redhat.com> PR c++/93869 - ICE with -Wmismatched-tags. * parser.c (cp_parser_check_class_key): Check class_key earlier. * g++.dg/warn/Wmismatched-tags-2.C: New test.
Marek Polacek committed -
The expression representing the array returned by SHAPE does not have its shape defined. An ICE occurs when FINDLOC attempts to use the shape of the array. Add shape to expression before returning from SHAPE. Whitespace issues identified by Steven G. Kargl <kargl@gcc.gnu.org> have also been fixed. gcc/fortran/ChangeLog PR fortran/93835 * simplify.c (simplify_findloc_nodim) : Fix whitespace issues. (gfc_simplify_shape) : Create and initialise one shape value for the result expression. Set shape value with the rank of the source array. gcc/testsuite/ChangeLog PR fortran/93835 * gfortran.dg/pr77351.f90 : Check for one error instead of two. * gfortran.dg/pr93835.f08 : New test.
Mark Eggleston committed -
My P0388R4 patch changed build_array_conv to create an identity conversion at the start of the conversion chain and now we crash in convert_like_real: 7457 case ck_identity: 7458 if (BRACE_ENCLOSED_INITIALIZER_P (expr)) 7459 { 7460 int nelts = CONSTRUCTOR_NELTS (expr); 7461 if (nelts == 0) 7462 expr = build_value_init (totype, complain); 7463 else if (nelts == 1) 7464 expr = CONSTRUCTOR_ELT (expr, 0)->value; 7465 else 7466 gcc_unreachable (); // HERE 7467 } in a test like this int f (int const (&)[2]) { return f({1, "M"}); } Instead of creating a ck_identity at the start of the conversion chain, so that conv_get_original_expr can be used with a ck_aggr, let's set u.expr for a ck_aggr, and adjust next_conversion not to try to see what's next in the chain if it gets a ck_aggr. 2020-02-24 Marek Polacek <polacek@redhat.com> PR c++/93712 - ICE with ill-formed array list-initialization. * call.c (next_conversion): Return NULL for ck_aggr. (build_aggr_conv): Set u.expr instead of u.next. (build_array_conv): Likewise. (build_complex_conv): Likewise. (conv_get_original_expr): Handle ck_aggr. * g++.dg/cpp0x/initlist-array11.C: New test.Marek Polacek committed -
This adds some missing pieces of the Ranges TS that make back_insert_iterator and front_insert_iterator conform to the new output_iterator requirements. It also fixes a bug in ranges::__copy_or_move and ranges::__copy_or_move_backward in which we were inspecting the iter_value_t of the output iterator, but output iterators such as back_insert_iterator and front_insert_iterator whose value_type = void do not have an iter_value_t according to [readable.traits] p4. The entire __use_memmove condition should probably be rewritten, but the simplest fix for now is to inspect the iterator_traits of the output iterator instead. libstdc++-v3/ChangeLog: PR libstdc++/93884 * include/bits/ranges_algobase.h (__copy_or_move, __copy_or_move_backward): Don't inspect the iter_value_t of the output iterator, instead inspect its iterator_traits directly. * include/bits/stl_iterator.h (back_insert_iterator::container): Conditionally initialize. (back_insert_iterator::difference_type): Conditionally define. (back_insert_iterator::back_insert_iterator): Conditionally define this default constructor. (front_insert_iterator::container): Conditionally initialize. (front_insert_iterator::difference_type): Conditionally define. (front_insert_iterator::front_insert_iterator): Conditionally define this default constructor. * 24_iterators/back_insert_iterator/pr93884.cc: New test. * 24_iterators/front_insert_iterator/pr93884.cc: New test.
Patrick Palka committed -
This patch adds std::shift_left and std::shift_right as per P0769R2. Alhough these are STL-style algos, this patch places them in <bits/ranges_algo.h> because they make use of some functions in the ranges namespace that are more easily reachable from <bits/ranges_algo.h> than from <bits/stl_algo.h>, namely ranges::next. In order to place these algos in <bits/stl_algo.h>, we would need to include <bits/range_access.h> from <bits/stl_algo.h> which would undesirably increase the size of <bits/stl_algo.h>. libstdc++-v3/ChangeLog: P0769R2 Add shift to <algorithm> * include/bits/ranges_algo.h (shift_left, shift_right): New. * testsuite/25_algorithms/shift_left/1.cc: New test. * testsuite/25_algorithms/shift_right/1.cc: New test.
Patrick Palka committed -
Patch from Svante Signell. Fixes GCC PR go/93900 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/220589
Ian Lance Taylor committed -
Using a BOZ constant in a structure constructor in a data statement resulted in an ICE. Output a "BOZ literal constant cannot appear in a structure constructor" error message instead. Original patch provided by Steven G. Kargl <kargl@gcc.gnu.org>. Test case added later. gcc/fortran/ChangeLog PR fortran/93604 * decl.c (gfc_match_data) : Check whether the data expression is a derived type and is a constructor. If a BOZ constant is encountered in the constructor output an error and return MATCH_ERROR. gcc/testsuite/ChangeLog PR fortran/93604 * gfortran.dg/pr93604.f90 : New test.
Mark Eggleston committed -
The following patch implements my understanding of P1937R2, though I wonder if https://eel.is/c++draft/expr.const#14.example-1 shouldn't have been also either removed or adjusted by the P1937R2 paper. 2020-02-24 Jakub Jelinek <jakub@redhat.com> P1937R2 - Fixing inconsistencies between const{expr,eval} functions * call.c (build_over_call): Don't evaluate immediate functions in unevaluated operands. * g++.dg/ext/consteval1.C: Change dg-{message,error} into dg-bogus. * g++.dg/cpp2a/consteval6.C: Likewise. * g++.dg/cpp2a/consteval3.C: Change dg-error for unevaluated operands into dg-bogus.
Jakub Jelinek committed -
Somehow I missed that the _M_value member can throw on construction. * include/bits/stream_iterator.h (istream_iterator(default_sentinel_t)): Make noexcept-specifier conditional. * testsuite/24_iterators/istream_iterator/cons/sentinel.cc: Check noexcept-specifier.
Jonathan Wakely committed -
The grammar for variadic init-capture was fixed at the Prague C++ meeting where we finalized C++20. gcc/cp/ChangeLog 2020-02-24 Jason Merrill <jason@redhat.com> P0780R2: Resolve lambda init-capture pack grammar. * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than ...&x=y.
Jason Merrill committed
-