Skip to content
Snippets Groups Projects
Commit b510b83a authored by Patrick Palka's avatar Patrick Palka
Browse files

c++: overeager type completion in convert_to_void [PR111419]

Here convert_to_void always completes the type of an indirection or
id-expression, but according to [expr.context] an lvalue-to-rvalue
conversion is applied to a discarded-value expression only if "the
expression is a glvalue of volatile-qualified type".  This patch
restricts convert_to_void's type completion to match.

	PR c++/111419

gcc/cp/ChangeLog:

	* cvt.cc (convert_to_void) <case INDIRECT_REF>: Only call
	complete_type if the type is volatile.
	<case VAR_DECL>: Likewise.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/concepts-requires36.C: New test.
	* g++.dg/expr/discarded1.C: New test.
	* g++.dg/expr/discarded1a.C: New test.
parent ddd064e3
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment