r303317 - The constant expression evaluator should examine function arguments for non-constexpr function calls unless the EvalInfo says to stop.

Joerg Sonnenberger via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 10 16:25:12 PDT 2017


On Tue, May 30, 2017 at 07:01:22PM -0700, Nick Lewycky wrote:
> Joerg Sonnenberger wrote:
> > On Wed, May 17, 2017 at 11:56:55PM -0000, Nick Lewycky via cfe-commits wrote:
> > > Author: nicholas
> > > Date: Wed May 17 18:56:54 2017
> > > New Revision: 303317
> > > 
> > > URL: http://llvm.org/viewvc/llvm-project?rev=303317&view=rev
> > > Log:
> > > The constant expression evaluator should examine function arguments for non-constexpr function calls unless the EvalInfo says to stop.
> > 
> > Crashes with -std=c++11 on:
> > 
> > enum SizeHint { MinimumSize, MaximumSize };
> > class QSizeF {
> > public:
> >    constexpr QSizeF();
> >    QSizeF m_fn1(QSizeF);
> >    double wd;
> >    double ht;
> > };
> > constexpr QSizeF::QSizeF() : wd(), ht() {}
> > class A {
> >    void m_fn2();
> >    QSizeF m_fn3(SizeHint, const QSizeF&  = QSizeF());
> > };
> > void A::m_fn2() { m_fn3(MinimumSize).m_fn1(m_fn3(MaximumSize)); }
> 
> Did you run this with assertions disabled? This looks like another testcase
> for PR33140, but it should hit an assertion first.

Right, same problem as the second test case. This is somewhat
high-profile for me as it affects Qt5.

Joerg


More information about the cfe-commits mailing list