building the resulting expression because it invokes a deleted constructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182624
91177308-0d34-0410-b5e6-
96231b3b80d8
ExprResult Res = S.PerformCopyInitialization(
Element, Init.get()->getExprLoc(), Init,
/*TopLevelOfInitList=*/ true);
- assert(!Res.isInvalid() && "Result changed since try phase.");
+ if (Res.isInvalid())
+ return ExprError();
Converted[i] = Res.take();
}
InitListExpr *Semantic = new (S.Context)
void h() { g({f}); }
// expected-error@-1 {{no matching function for call to 'g'}}
}
+
+namespace deleted_copy {
+ struct X {
+ X(int i) {}
+ X(const X& x) = delete; // expected-note {{here}}
+ void operator=(const X& x) = delete;
+ };
+
+ std::initializer_list<X> x{1}; // expected-error {{invokes deleted constructor}}
+}