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

c++: hard error w/ ptr+N and incomplete type [PR103700]

In pointer_int_sum when called from a SFINAE context, we need to avoid
calling size_in_bytes_loc on an incomplete pointed-to type since this
latter function isn't SFINAE-enabled and always emits an error on such
input.

	PR c++/103700

gcc/c-family/ChangeLog:

	* c-common.c (pointer_int_sum): When quiet, return
	error_mark_node for an incomplete pointed-to type and don't
	call size_in_bytes_loc.

gcc/testsuite/ChangeLog:

	* g++.dg/template/sfinae32.C: New test.
parent 9407058a
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