This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix 20186
Jason Merrill wrote:
This is checking whether the target type is dependent, NOT the source
type.
But it *should* check the source type. T is a dependent type, so "t" is
value-dependent, and so the cast is value-dependent.
Whilst I would be happy with such an interpretation, I don't think the std
supports it.
14.6.2.2/3 says a cast is type dependent only if the target type is type
dependent, 'even if any subexpression is type-dependent'.
14.6.2.3 says a cast is value dependent if the sub-expression is value
dependent (or the target type is type dependent). It doesn't say 'if the
sub-expression is type-dependent'.
besides, AFAICT only constant expressions can be value-dependent, because
14.6.2.3 talks about constant expressions -- there's no wording about
non-constant expressions. Not sure what that means though ...
Jason, could you point me to the relevent places in the std to support
your position please?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk