c++: resolvedness of resolve_nondeduced_context result [PR126406]

In r16-5967-gbae0ed69e1862a we removed the mark_used call from
resolve_nondeduced_context under the rationale that it should be
the caller's responsiblity to mark_used.

Removing the call however now means that resolve_nondeduced_context
could return a specialization whose type is not yet fully resolved
(i.e. has an uninstantiated noexcept or undeduced return type), and
callers that immediately inspect TREE_TYPE of the result (such as
standard_conversion and build_conditional_expr) now misbehave.

In light of such callers, this patch reverts r16-5967; it's not
necessary to fix PR119343 because after r16-6276 convert_to_void
now properly propagates an error_mark_node result from
resolve_nondeduced_context.

	PR c++/126406
	PR c++/119343

gcc/cp/ChangeLog:

	* pt.cc (resolve_nondeduced_context): Revert r16-5967 change.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/cond2a.C: New test.
	* g++.dg/cpp1y/auto-fn67.C: New test.
	* g++.dg/cpp1z/noexcept-type29.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
(cherry picked from commit e873aac49eb2b58ae18e05f4150826278bdbb3cb)
4 files changed