gcc/libstdc++-v3/testsuite
Jason Merrill baf38d2e36 c++: Check abstract type only on object creation. [PR86252]
Abstract checking has been problematic for a while; when I implemented an
earlier issue resolution to do more checking it led to undesirable
instantiations, and so backed some of it out.  During the C++20 process we
decided with P0929R2 that we should go the other way, and only check
abstractness when we're actually creating an object, not when merely forming
an array or function type.  This means that we can remove the machinery for
checking whether a newly complete class makes some earlier declaration
ill-formed.  This change was moved as a DR, so I'm applying it to all
standard levels.  This could be reconsidered if it causes problems, but I
don't expect it to.

The change to the libstdc++ result_of test brings the expected behavior in
line with that for incomplete types, but as in PR97841 I think the libstdc++
handling of incomplete types in this and other type_traits is itself wrong,
so I expect these lines and others to change again before long.

gcc/cp/ChangeLog:

	* decl.c (cp_finish_decl): Only check abstractness on definition.
	(require_complete_types_for_parms): Check abstractness here.
	(create_array_type_for_decl): Not here.
	(grokdeclarator, grokparms, complete_vars): Not here.
	* pt.c (tsubst, tsubst_arg_types, tsubst_function_type): Not here.
	* typeck2.c (struct pending_abstract_type): Remove.
	(struct abstract_type_hasher): Remove.
	(abstract_pending_vars, complete_type_check_abstract): Remove.
	(abstract_virtuals_error_sfinae): Handle arrays.
	* call.c (conv_is_prvalue): Split out from...
	(conv_binds_ref_to_prvalue): ...here.
	(implicit_conversion_1): Rename from implicit_conversion.
	(implicit_conversion): An abstract prvalue is bad.
	(convert_like_internal): Don't complain if expr is already
	error_mark_node.

gcc/testsuite/ChangeLog:

	* g++.dg/other/abstract1.C: Adjust.
	* g++.dg/other/abstract2.C: Adjust.
	* g++.dg/other/abstract4.C: Adjust.
	* g++.dg/other/abstract5.C: Adjust.
	* g++.dg/other/abstract8.C: New test.
	* g++.dg/template/sfinae-dr657.C: Adjust.
	* g++.old-deja/g++.other/decl3.C: Adjust.

libstdc++-v3/ChangeLog:

	* testsuite/20_util/result_of/sfinae_friendly_1.cc: Adjust.
2020-11-15 12:07:13 -05:00
..
17_intro
18_support libstdc++: Fix test failure with --disable-linux-futex 2020-11-04 15:30:54 +00:00
19_diagnostics
20_util c++: Check abstract type only on object creation. [PR86252] 2020-11-15 12:07:13 -05:00
21_strings libstdc++: Make _GLIBCXX_DEBUG checks constexpr compatible 2020-11-09 21:11:13 +01:00
22_locale libstdc++: Avoid warnings in tests 2020-10-29 22:47:21 +00:00
23_containers libstdc++: Remove <debug/array> 2020-11-09 21:20:01 +01:00
24_iterators
25_algorithms libstdc++: Make _GLIBCXX_DEBUG checks constexpr compatible 2020-11-09 21:11:13 +01:00
26_numerics libstdc++: Prefer double to long double in std::shuffle_order_engine 2020-10-31 12:54:03 +00:00
27_io libstdc++: Implement std::emit_on_flush etc. 2020-11-11 00:19:40 +00:00
28_regex
29_atomics
30_threads libstdc++: Remove redundant overflow check for futex timeout [PR 93456] 2020-11-13 23:08:34 +00:00
abi
backward
config
data
decimal
experimental libstdc++: Use non-throwing increment in recursive_directory_iterator [PR 97731] 2020-11-05 18:01:26 +00:00
ext libstdc++: Avoid warnings in tests 2020-10-29 22:47:21 +00:00
lib libstdc++: Improve comments for check_effective_target_cxx11-abi 2020-10-14 12:52:47 +01:00
libstdc++-abi
libstdc++-dg
libstdc++-prettyprinters
libstdc++-xmethods
performance
special_functions
std libstdc++: Don't initialize from *this inside some views [PR97600] 2020-10-30 20:33:19 -04:00
tr1 libstdc++: Prevent deprecation warnings from <tr1/shared_ptr> 2020-10-29 22:47:22 +00:00
tr2
util libstdc++: Avoid warnings in tests 2020-10-29 22:47:21 +00:00
Makefile.am
Makefile.in