This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH for c++/78948 (instantiation from discarded statement)


On Mon, Jan 09, 2017 at 08:49:25AM -0500, Nathan Sidwell wrote:
> On 01/08/2017 01:34 AM, Jason Merrill wrote:
> > P0292 defines the notion of "discarded statement" which is almost but
> > not quite the same as "unevaluated operand".  This PR shows a case
> > where we need to be able to tell that we're in a discarded statement
> > at a lower level than in the parser, so this patch moves the
> > information about being in a discarded statement from the parser into
> > saved_scope.  I've also added a test for a couple of cases that
> > demonstrate why we can't just use cp_unevaluated_context.
> 
> > +  if constexpr(sizeof(long long) == sizeof(char*))
> > +    ;
> > +  else
> > +    sizeof_mismatch<sizeof(long long)>();
> 
> This is going to behave differently on 32 and 64 bit HW.  Is that
> intentional? (If so, a comment would be nice)

Yeah, it fails on i686-linux and other ILP32 and similar targets.

FAIL: g++.dg/cpp1z/constexpr-if10.C   (test for excess errors)

Could we do e.g.
sed -i -e 's/long long/int */g' testsuite/g++.dg/cpp1z/constexpr-if10.C
so that it is something where if constexpr will be always true?

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]