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
Tue May 30 16:52:57 PDT 2017


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)); }

Joerg


More information about the cfe-commits mailing list