Commit Graph

153648 Commits

Author SHA1 Message Date
GCC Administrator
c193a01040 Daily bump.
From-SVN: r253087
2017-09-22 00:16:13 +00:00
Alan Modra
896c30e0fd PR81996, __builtin_return_address(0) fails
rs6000_return_addr assumes that the stack link is at frame+0, which is
true for count>0.  For count==0, rs6000_return_addr is called with
frame==frame_pointer_rtx and the stack link is *not* at frame+0 if
-fstack-protector-all or -fsanitize=address because rs6000.h sets
FRAME_GROWS_DOWNWARD for those options.

	PR target/81996
	* gcc/config/rs6000/rs6000.c (rs6000_return_addr): Use
	stack_pointer_rtx for count 0.  Update comments.  Break up
	large rtl expression.

From-SVN: r253067
2017-09-21 22:25:37 +09:30
Wilco Dijkstra
c568955a6d PR71951: Fix unwinding with -fomit-frame-pointer
As described in PR71951, if libgcc is built with -fomit-frame-pointer,
unwinding crashes, for example while doing a backtrace.  The underlying
reason is the Dwarf unwinder does not setup the frame pointer register
in the initialization code.  When later unwinding a function that uses
the frame pointer, it tries to read FP using _Unwind_GetGR, and this
crashes if has never restored FP.  To unwind correctly the first frame
must save and restore FP (it is unwound in a special way so that it
uses SP instead of FP).  This is done by adding -fno-omit-frame-pointer.

    gcc/
	PR target/71951
	* config/aarch64/aarch64.h (LIBGCC2_UNWIND_ATTRIBUTE): Define.

From-SVN: r253063
2017-09-21 12:16:31 +00:00
Jonathan Wakely
6445b688e5 Fix tests for std::clamp
* testsuite/25_algorithms/clamp/1.cc: Fix order of arguments and
	expected results when using predicate defining reverse order.
	* testsuite/25_algorithms/clamp/constexpr.cc: Likewise.

From-SVN: r253053
2017-09-21 11:11:21 +01:00
GCC Administrator
f7d5449279 Daily bump.
From-SVN: r253045
2017-09-21 00:16:17 +00:00
Jonathan Wakely
7899221766 Fix libstdc++ testsuite failures with -D_GLIBCXX_USE_CXX11_ABI=0
Backport from mainline
2017-06-14  Jonathan Wakely  <jwakely@redhat.com>

	* doc/xml/manual/test.xml: Correct instructions on running tests.
	* testsuite/27_io/basic_ios/copyfmt/char/1.cc: Adjust to pass when
	-D_GLIBCXX_USE_CXX11_ABI=0 added to RUNTESTFLAGS.
	* testsuite/27_io/basic_ios/exceptions/char/1.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_arithmetic/char/
	exceptions_failbit.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/
	exceptions_failbit.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_other/char/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_other/wchar_t/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/basic_istream/sentry/char/12297.cc: Likewise.
	* testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc: Likewise.
	* testsuite/27_io/basic_ostream/inserters_other/char/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/basic_ostream/inserters_other/wchar_t/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/ios_base/storage/2.cc: Likewise.

From-SVN: r253039
2017-09-20 23:26:26 +01:00
Jonathan Wakely
ae6af5239b PR libstdc++/79162 Fix std::string regression due to LWG 2946 (old ABI)
PR libstdc++/79162
	* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
	(basic_string::_If_sv): Remove from the overload set when the
	argument is derived from basic_string.

From-SVN: r253038
2017-09-20 23:26:19 +01:00
Jonathan Wakely
094932a3c3 PR libstdc++/79162 Fix std::string regression due to LWG 2946
PR libstdc++/79162
	* include/bits/basic_string.h (basic_string::_If_sv): Remove from the
	overload set when the argument is derived from basic_string.
	* testsuite/21_strings/basic_string/cons/char/moveable2_c++17.cc: New
	test.
	* testsuite/21_strings/basic_string/cons/wchar_t/moveable2_c++17.cc:
	New test.

From-SVN: r253025
2017-09-20 19:52:56 +01:00
Jonathan Wakely
7ef7062dbc Fix failing C++17 test
* testsuite/24_iterators/range_access_cpp17.cc: Fix order of dg-do
	and dg-options directives. Fix invalid test.

From-SVN: r253020
2017-09-20 17:51:03 +01:00
Jonathan Wakely
6c8a90ba12 PR libstdc++/82262 fix std::hash<std::optional<const T>>
PR libstdc++/82262
	* include/std/optional (__optional_hash_call_base): Add template
	parameter for remove_const_t<_Tp> and use it consistently.
	* testsuite/20_util/optional/hash.cc: Test optional<const T>.

From-SVN: r253015
2017-09-20 15:22:29 +01:00
Jonathan Wakely
598c1fda3c PR libstdc++/82254 fix std::is_nothrow_invocable_r w.r.t throwing conversions
PR libstdc++/82254
	* include/std/type_traits (__is_invocable): Add partial specialization
	for INVOKE<void> case and remove is_void<R> check from partial
	specialization for INVOKE<R> case.
	(__is_nt_invocable_impl): New helper for is_nothrow_invocable_r.
	(is_nothrow_invocable_r): Use __is_nt_invocable_impl.
	* testsuite/20_util/is_nothrow_invocable/value.cc: Add tests for
	conversions that can throw or fail to convert. Use static assert
	strings to explain negative results.
	* testsuite/20_util/is_nothrow_invocable/value_ext.cc: Use
	is_nothrow_constructible in is_nt_invocable_conv.

From-SVN: r253014
2017-09-20 15:22:25 +01:00
Jerry DeLisle
49614a55fb backport: re PR fortran/78387 (OpenMP segfault/stack size exceeded writing to internal file)
2017-09-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backport from trunk
	PR libgfortran/78387
	* io/list_read.c (nml_read_obj): Remove use of stash.
	* io/transfer.c (st_read_done, st_write_done): Likewise.
	* io/unit.c (stash_internal_unit): Delete function.
	(get_unit): Remove use of stash.
	(init_units): Likewise.
	(close_units): Likewise.
	* io/write.c (nml_write_obj): Likewise:

From-SVN: r252992
2017-09-20 01:32:59 +00:00
GCC Administrator
93a3014866 Daily bump.
From-SVN: r252989
2017-09-20 00:16:18 +00:00
Uros Bizjak
9e634ac9bc i386.c (fold_builtin_cpu): Add M_AMDFAM17H to processor_model and "amdfam17h" to arch_names_table.
* config/i386/i386.c (fold_builtin_cpu): Add M_AMDFAM17H
	to processor_model and "amdfam17h" to arch_names_table.
	* doc/extend.texi (__builtin_cpu_is): Document amdfam17h CPU name.

From-SVN: r252978
2017-09-19 16:57:14 +02:00
Martin Liska
cf9ff480ce Ignore empty string in target attribute (PR c++/81355).
2017-09-19  Martin Liska  <mliska@suse.cz>

	PR c++/81355
	* config/i386/i386.c (sorted_attr_string): Skip empty strings.

From-SVN: r252970
2017-09-19 09:03:05 +00:00
Martin Liska
c2d655fa22 Revert backport.
From-SVN: r252969
2017-09-19 09:02:33 +00:00
GCC Administrator
a851022421 Daily bump.
From-SVN: r252960
2017-09-19 00:16:16 +00:00
Jason Merrill
4d26b83715 PR c++/81236 - ICE with template-id in generic lambda
* parser.c (parsing_default_capturing_generic_lambda): Don't check
	for enclosing template.
	* semantics.c (finish_qualified_id_expr): Call it.
	* cp-tree.h: Adjust.

From-SVN: r252946
2017-09-18 14:37:16 -04:00
Jason Merrill
f16091882b PR c++/80767 - unnecessary instantiation of generic lambda
PR c++/82030 - ICE inheriting from multiple lambdas
	* call.c (convert_like_real): Call build_user_type_conversion_1 if
	cand is null.
	(add_conv_candidate): Build a ck_user conversion with no candidate.
	(compare_ics): Handle null candidate.

From-SVN: r252945
2017-09-18 14:37:10 -04:00
Jason Merrill
4d093be23a PR c++/78840 - ICE with const and nested generic lambda
* g++.dg/cpp1y/lambda-generic-const5.C: New.

From-SVN: r252944
2017-09-18 14:37:04 -04:00
Jason Merrill
5de2272480 PR c++/80935 - wrong C++17 error with lambda
* decl.c (check_for_uninitialized_const_var): Check
	is_instantiation_of_constexpr.

From-SVN: r252943
2017-09-18 14:36:59 -04:00
Jason Merrill
3ef1cd3d1e PR c++/81671 - nullptr_t template parameter
* pt.c (convert_nontype_argument): Fix nullptr_t check.

From-SVN: r252942
2017-09-18 14:36:53 -04:00
Jason Merrill
3f2b67a9bb PR c++/81525 - wrong constant value with generic lambda
* pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
	(tsubst_copy) [VAR_DECL]: Handle auto.

From-SVN: r252941
2017-09-18 14:36:47 -04:00
Richard Biener
e1eaa7a325 backport: [multiple changes]
2017-09-18  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2017-09-04  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82084
	* fold-const.h (can_native_encode_string_p): Declare.
	* fold-const.c (can_native_encode_string_p): Factor out from ...
	(native_encode_string): ... here.
	* tree-vect-stmts.c (vectorizable_store): Call it to avoid
	vectorizing stores from constants we later cannot handle.

	* g++.dg/torture/pr82084.C: New testcase.

	2017-09-06  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82108
	* tree-vect-stmts.c (vectorizable_load): Fix pointer adjustment
	for gap in the non-permutation SLP case.

	* gcc.dg/vect/pr82108.c: New testcase.

From-SVN: r252918
2017-09-18 10:13:54 +00:00
GCC Administrator
8983f2c385 Daily bump.
From-SVN: r252899
2017-09-18 00:16:14 +00:00
GCC Administrator
12636f3580 Daily bump.
From-SVN: r252891
2017-09-17 00:16:17 +00:00
GCC Administrator
fdd753cbaa Daily bump.
From-SVN: r252869
2017-09-16 00:16:12 +00:00
Jakub Jelinek
33a5063b3d backport: re PR c++/81314 (Undefined reference to a function with -fopenmp)
Backported from mainline
	2017-09-14  Jakub Jelinek  <jakub@redhat.com>

	PR c++/81314
	* cp-gimplify.c (omp_var_to_track): Look through references.
	(omp_cxx_notice_variable): Likewise.

	* testsuite/libgomp.c++/pr81314.C: New test.

From-SVN: r252806
2017-09-15 13:27:07 +02:00
Jakub Jelinek
8ccf92f52b backport: re PR target/81325 (-fcompare-debug failure on ppc64le)
Backported from mainline
	2017-09-14  Jakub Jelinek  <jakub@redhat.com>
 
	PR target/81325
	* cfgbuild.c (find_bb_boundaries): Ignore debug insns in decisions
	if and where to split a bb, except for splitting before debug insn
	sequences followed by non-label real insn.  Delete debug insns
	in between basic blocks.

	* g++.dg/cpp0x/pr81325.C: New test.

From-SVN: r252805
2017-09-15 13:26:03 +02:00
Jakub Jelinek
47d845c39f backport: re PR target/82112 (internal compiler error: in fold_convert_loc, at fold-const.c:2262)
Backported from mainline
	2017-09-12  Jakub Jelinek  <jakub@redhat.com>

	PR target/82112
	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): For
	ALTIVEC_BUILTIN_VEC_LD if arg1 has array type call default_conversion
	on it early, rather than manual conversion late.  For
	ALTIVEC_BUILTIN_VEC_ST if arg2 has array type call default_conversion
	instead of performing manual conversion.

	* gcc.target/powerpc/pr82112.c: New test.
	* g++.dg/ext/altivec-18.C: New test.

From-SVN: r252804
2017-09-15 13:24:49 +02:00
Jakub Jelinek
c395cf94fc backport: re PR target/82112 (internal compiler error: in fold_convert_loc, at fold-const.c:2262)
Backported from mainline
	2017-09-12  Jakub Jelinek  <jakub@redhat.com>

	PR target/82112
	* c-common.c (sync_resolve_size): Instead of c_dialect_cxx ()
	assertion check that in the condition.
	(get_atomic_generic_size): Likewise.  Before testing if parameter
	has pointer type, if it has array type, call for C++
	default_conversion to perform array-to-pointer conversion.

	* c-c++-common/pr82112.c: New test.
	* gcc.dg/pr82112.c: New test.

From-SVN: r252803
2017-09-15 13:22:57 +02:00
Martin Liska
84b42a8f0f Fix backport.
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-09-14  Martin Liska  <mliska@suse.cz>

	* gimple-ssa-strength-reduction.c (create_add_on_incoming_edge):
	Add proper printf format.

From-SVN: r252790
2017-09-15 08:19:50 +00:00
Martin Liska
5b7919a004 Backport r252024
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-09-12  Martin Liska  <mliska@suse.cz>

	PR testsuite/82114
	* gcc.dg/gimplefe-14.c (main): Add handling of case 0.

From-SVN: r252789
2017-09-15 08:19:33 +00:00
Martin Liska
f38aca72f0 Backport r251530
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-08-30  Martin Liska  <mliska@suse.cz>

	PR inline-asm/82001
	* ipa-icf-gimple.c (func_checker::compare_tree_list_operand):
	Rename to ...
	(func_checker::compare_asm_inputs_outputs): ... this function.
	(func_checker::compare_gimple_asm): Use the function to compare
	also ASM constrains.
	* ipa-icf-gimple.h: Rename the function.
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-08-30  Martin Liska  <mliska@suse.cz>

	PR inline-asm/82001
	* gcc.dg/ipa/pr82001.c: New test.

From-SVN: r252788
2017-09-15 08:19:15 +00:00
Martin Liska
4bcb671a49 Subject: Backport r251400
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-08-29  Martin Liska  <mliska@suse.cz>

	PR other/39851
	* gcc.c (driver_handle_option): Add new argument.
	* opts-common.c (handle_option): Pass
	target_option_override_hook.
	* opts-global.c (lang_handle_option): Add new option.
	(set_default_handlers):  Add new argument.
	(decode_options): Likewise.
	* opts.c (target_handle_option): Likewise.
	(common_handle_option): Call target_option_override_hook.
	* opts.h (struct cl_option_handler_func): Add hook for
	target option override.
	(struct cl_option_handlers): Likewise.
	(set_default_handlers): Add new argument.
	(decode_options): Likewise.
	(common_handle_option): Likewise.
	(target_handle_option): Likewise.
	* toplev.c (toplev::main): Pass targetm.target_option.override
	hook.
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-08-29  Martin Liska  <mliska@suse.cz>

	PR other/39851
	* c-common.c (parse_optimize_options): Add argument to function
	call.
	* c-pragma.c (handle_pragma_diagnostic): Likewise.

From-SVN: r252787
2017-09-15 08:18:34 +00:00
Martin Liska
6f29f57e2a Backport r251406
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-08-29  Martin Liska  <mliska@suse.cz>

	PR other/39851
	* gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL.

From-SVN: r252786
2017-09-15 08:14:24 +00:00
Martin Liska
99fc8910b0 Backport r251020
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-08-10  Martin Liska  <mliska@suse.cz>

	PR c++/81355
	* c-attribs.c (handle_target_attribute):
	Report warning for an empty string argument of target attribute.
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-08-10  Martin Liska  <mliska@suse.cz>

	PR c++/81355
	* g++.dg/other/pr81355.C: New test.

From-SVN: r252785
2017-09-15 08:13:58 +00:00
Martin Liska
d87e2f8f94 Backport r250951
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-08-08  Martin Liska  <mliska@suse.cz>

	PR tree-opt/81696
	* ipa-icf-gimple.c (func_checker::compare_cst_or_decl): Consider
	LABEL_DECLs that can be from a different function.
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-08-08  Martin Liska  <mliska@suse.cz>

	PR tree-opt/81696
	* gcc.dg/ipa/pr81696.c: New test.

From-SVN: r252784
2017-09-15 08:13:23 +00:00
Martin Liska
627aed2616 Backport r250336
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-07-19  Martin Liska  <mliska@suse.cz>

	PR sanitizer/63361
	* c-c++-common/ubsan/float-cast-overflow-1.c: Add either
	-ffloat-store or -mieee for targets that need it.

From-SVN: r252783
2017-09-15 08:13:02 +00:00
Martin Liska
1afc6fafb2 Backport r249735
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-06-28  Martin Liska  <mliska@suse.cz>

	PR ipa/81128
	* ipa-visibility.c (non_local_p): Handle visibility.
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-06-28  Martin Liska  <mliska@suse.cz>

	PR ipa/81128
	* c-attribs.c (handle_alias_ifunc_attribute): Append ifunc alias
	to a function declaration.
2017-09-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-06-28  Martin Liska  <mliska@suse.cz>

	PR ipa/81128
	* gcc.target/i386/pr81128.c: New test.

From-SVN: r252782
2017-09-15 08:12:30 +00:00
GCC Administrator
d4895db7a0 Daily bump.
From-SVN: r252778
2017-09-15 00:16:13 +00:00
GCC Administrator
2a5c8dd0ba Daily bump.
From-SVN: r252743
2017-09-14 00:16:17 +00:00
Jonathan Wakely
12657787f9 PR libstdc++/79162 implement LWG 2946 and LWG 2758
Backport from mainline
2017-09-04  Daniel Kruegler  <daniel.kruegler@gmail.com>

	PR libstdc++/79162
	Implement LWG 2946, LWG 2758's resolution missed further corrections
	* include/bits/basic_string.h (basic_string::compare): Add missing
	required noexcept specifications.
	(basic_string): Introduce internal _S_to_string_view and __sv_wrapper
	for implicit string_view conversion.
	(basic_string::basic_string): Fix explicit string_view conversion by
	implicit conversion using _S_to_string_view and __sv_wrapper.
	(basic_string): Introduce internal basic_string(__sv_wrapper, Alloc)
	constructor.
	(basic_string): Fix operator=(T) template by operator=(const T&)
	template for uncopyable types (PR 79162).
	(basic_string::operator+=, basic_string::append, basic_string::assign)
	(basic_string::insert, basic_string::replace, basic_string::find)
	(basic_string::rfind, basic_string::find_first_of)
	(basic_string::find_last_of, basic_string::find_first_not_of)
	(basic_string::find_last_not_of, basic_string::compare): Replace
	__sv_type argument by template const T& (LWG 2946) and correct
	documentation describing __sv_type argument.
	(basic_string::find, basic_string::rfind, basic_string::find_first_of)
	(basic_string::find_last_of, basic_string::find_first_not_of)
	(basic_string::find_last_not_of, basic_string::compare): Replace
	unconditional noexcept specification by conditional noexcept
	specification to partially balance the removal of noexcept by LWG 2946.
	* testsuite/21_strings/basic_string/79162.cc: New.
	* testsuite/21_strings/basic_string/lwg2946.cc: New.

From-SVN: r252337
2017-09-13 17:38:47 +01:00
Jonathan Wakely
c2f99c9d9a PR libstdc++/81468 constrain std::chrono::time_point constructor
PR libstdc++/81468
	* include/std/chrono (time_point(const time_point<_Dur2>&)): Add
	missing constraint from LWG DR 1177.
	* testsuite/20_util/duration/cons/dr1177.cc: New.
	* testsuite/20_util/time_point/cons/81468.cc: New.
	* testsuite/20_util/duration/literals/range.cc: Update dg-error line.

From-SVN: r252090
2017-09-13 16:20:21 +01:00
Jonathan Wakely
61068cc174 Fix broken URLs in libstdc++ API docs
* doc/doxygen/mainpage.html: Fix broken URLs.

From-SVN: r252071
2017-09-13 11:22:35 +01:00
Jonathan Wakely
a9b45e7046 PR libstdc++/81835 fix broken URLs in libstdc++ docs
PR libstdc++/81835
	* doc/xml/manual/extensions.xml: Replace unstable URL.
	* doc/html/manual/ext_demangling.html: Regenerate.
	* libsupc++/cxxabi.h (__cxa_demangle): Fix broken URL.

From-SVN: r252067
2017-09-13 11:07:25 +01:00
GCC Administrator
8e3a97d59a Daily bump.
From-SVN: r252050
2017-09-13 00:16:13 +00:00
Bill Schmidt
ce1a6c358b backport: re PR target/81833 (PowerPC: VSX: Miscompiles ffmpeg's scalarproduct_int16_vsx at -O1)
[gcc]

2017-09-12  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	2017-09-05  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/81833
	* config/rs6000/altivec.md (altivec_vsum2sws): Convert from a
	define_insn to a define_expand.
	(altivec_vsum2sws_direct): New define_insn.
	(altivec_vsumsws): Convert from a define_insn to a define_expand.

[gcc/testsuite]

2017-09-12  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	2017-09-05  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/81833
	* gcc.target/powerpc/pr81833-1.c: New file.
	* gcc.target/powerpc/pr81833-2.c: New file.

From-SVN: r252042
2017-09-12 21:02:13 +00:00
Jonathan Wakely
e38bde5423 PR libstdc++/70483 make std::experimental::string_view fully constexpr
Backport from mainline
2017-09-12  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/70483
	* include/experimental/bits/string_view.tcc (basic_string_view::find)
	(basic_string_view::rfind, basic_string_view::find_first_of)
	(basic_string_view::find_last_of, basic_string_view::find_first_not_of)
	(basic_string_view::find_last_not_of): Add constexpr specifier.
	* include/experimental/string_view (basic_string_view::remove_prefix)
	(basic_string_view::remove_suffix, basic_string_view::swap)
	(basic_string_view::compare, basic_string_view::find)
	(basic_string_view::rfind, basic_string_view::find_first_of)
	(basic_string_view::find_last_of, basic_string_view::find_first_not_of)
	(basic_string_view::find_last_not_of, operator==, operator!=)
	(operator<, operator>, operator<=, operator>=): Likewise.
	* testsuite/experimental/string_view/operations/compare/char/70483.cc:
	New.

From-SVN: r252032
2017-09-12 17:27:14 +01:00
Jonathan Wakely
53e7178da5 PR libstdc++/70483 make std::string_view fully constexpr
Backport from mainline
2017-09-11  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/70483
	* include/bits/string_view.tcc (basic_string_view::find)
	(basic_string_view::rfind, basic_string_view::find_first_of)
	(basic_string_view::find_last_of, basic_string_view::find_first_not_of)
	(basic_string_view::find_last_not_of): Add constexpr specifier.
	* include/std/string_view (basic_string_view::operator=)
	(basic_string_view::rbegin, basic_string_view::rend)
	(basic_string_view::crbegin, basic_string_view::crend)
	(basic_string_view::remove_prefix, basic_string_view::remove_suffix)
	(basic_string_view::swap, basic_string_view::compare)
	(basic_string_view::find, basic_string_view::rfind)
	(basic_string_view::find_first_of, basic_string_view::find_last_of)
	(basic_string_view::find_first_not_of)
	(basic_string_view::find_last_not_of, basic_string_view::_M_check)
	(basic_string_view::_M_limit, operator==, operator!=, operator<)
	(operator>, operator<=, operator>=): Likewise.
	* testsuite/21_strings/basic_string_view/modifiers/remove_prefix/
	char/1.cc: Repeat tests in constexpr context.
	* testsuite/21_strings/basic_string_view/modifiers/remove_prefix/
	wchar_t/1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/modifiers/remove_suffix/
	char/1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/modifiers/remove_suffix/
	wchar_t/1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/find/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/find/char/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/find/char/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/find/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/find/wchar_t/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/find/wchar_t/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operators/char/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operators/wchar_t/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/range_access/char/1.cc: Test
	cbegin, cend, rbegin, rend, crbegin and crend.
	* testsuite/21_strings/basic_string_view/range_access/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/compare/char/1.cc:
	Remove trailing whitespace.
	* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/
	1.cc: Likewise.
	* testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc:
	New.
	* testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc:
	New.
	* testsuite/21_strings/basic_string_view/operations/compare/char/2.cc:
	New.
	* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/
	2.cc: New.

From-SVN: r252031
2017-09-12 17:27:09 +01:00