File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1072,16 +1072,23 @@ namespace Cpp {
10721072 // Here we synthesize a placeholder expression to be able to use
10731073 // Sema::AddOverloadCandidate. Made up expressions are fine because the
10741074 // interface uses the list size and the expression types.
1075+ struct WrapperExpr : public OpaqueValueExpr {
1076+ WrapperExpr () : OpaqueValueExpr(clang::Stmt::EmptyShell()) {}
1077+ };
1078+ WrapperExpr Exprs[arg_types.size ()];
10751079 llvm::SmallVector<Expr*> Args;
10761080 Args.reserve (arg_types.size ());
1081+ size_t idx = 0 ;
10771082 for (auto i : arg_types) {
10781083 QualType Type = QualType::getFromOpaquePtr (i.m_Type );
10791084 ExprValueKind ExprKind = ExprValueKind::VK_PRValue;
10801085 if (Type->isReferenceType ())
10811086 ExprKind = ExprValueKind::VK_LValue;
1082- Args.push_back (new (C)
1083- OpaqueValueExpr (SourceLocation::getFromRawEncoding (1 ),
1084- Type.getNonReferenceType (), ExprKind));
1087+
1088+ new (&Exprs[idx]) OpaqueValueExpr (SourceLocation::getFromRawEncoding (1 ),
1089+ Type.getNonReferenceType (), ExprKind);
1090+ Args.push_back (&Exprs[idx]);
1091+ ++idx;
10851092 }
10861093
10871094 // Create a list of template arguments.
You can’t perform that action at this time.
0 commit comments