Previously, clang would assert on the following:
struct S { constexpr S (const int& ir = 0) {} }; constexpr S foo[2];
The problem was that while initializing foo, CallStackFrame::createTemporary() was called twice for the MaterializeTemporaryExpr for 0 in the default constructor (once for each array element) without ending the lifetime of the first. This caused createTemporary() to assert. This patch fixes this problem by separating the lifetime of temporaries created for successive calls to the ctor when initializing arrays.
https://bugs.llvm.org/show_bug.cgi?id=34858
Thanks for taking a look!
Erik