Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion clang/lib/AST/ByteCode/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3397,7 +3397,8 @@ bool Compiler<Emitter>::VisitCXXNewExpr(const CXXNewExpr *E) {
CtorFunc = getFunction(CE->getConstructor());
if (!CtorFunc)
return false;
}
} else if (!DynamicInit)
DynamicInit = Init;

LabelTy EndLabel = this->getLabel();
LabelTy StartLabel = this->getLabel();
Expand Down
6 changes: 6 additions & 0 deletions clang/test/AST/ByteCode/new-delete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,12 @@ namespace IncompleteArray {
return c;
}
static_assert(test4() == 12);


constexpr char *f(int n) {
return new char[n]();
}
static_assert((delete[] f(2), true));
}

namespace NonConstexprArrayCtor {
Expand Down