This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] PR c++/52321 print note for static_cast to/from incomplete type
- From: Jason Merrill <jason at redhat dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Cc: nathan at acm dot org
- Date: Mon, 17 Dec 2018 15:45:34 -0500
- Subject: Re: [PATCH] PR c++/52321 print note for static_cast to/from incomplete type
- References: <20181217153753.GA28463@redhat.com>
On 12/17/18 10:37 AM, Jonathan Wakely wrote:
If build_static_cast_1 returns false, and one or both type is a
pointer/reference to an incomplete class, print a note saying so. This
doesn't attempt to check whether the static_cast failed because the
type is incomplete (which was checked inside build_static_cast_1 but
not in the caller). It just informs the user that it is incomplete,
which is probably the most likely reason.
* typeck.c (build_static_cast): Print a note when the destination
type or the operand is a pointer/reference to incomplete class type.
Tested powerpc64le-linux. OK for trunk?