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
4 changes: 3 additions & 1 deletion clang/lib/AST/ByteCode/InterpState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ bool InterpState::maybeDiagnoseDanglingAllocations() {
<< (It.second.size() - 1) << Source->getSourceRange();
}
}
return NoAllocationsLeft;
// Keep evaluating before C++20, since the CXXNewExpr wasn't valid there
// in the first place.
return NoAllocationsLeft || !getLangOpts().CPlusPlus20;
}

StdAllocatorCaller InterpState::getStdAllocatorCaller(StringRef Name) const {
Expand Down
7 changes: 7 additions & 0 deletions clang/test/AST/ByteCode/cxx11-pedantic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ namespace DynamicCast {
// both-note {{dynamic_cast}}
};
}

namespace NewDelete {
struct T {
int n : *new int(4); // both-warning {{constant expression}} \
// both-note {{until C++20}}
};
}
Loading