File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,9 @@ bool InterpState::maybeDiagnoseDanglingAllocations() {
113113 << (It.second .size () - 1 ) << Source->getSourceRange ();
114114 }
115115 }
116- return NoAllocationsLeft;
116+ // Keep evaluating before C++20, since the CXXNewExpr wasn't valid there
117+ // in the first place.
118+ return NoAllocationsLeft || !getLangOpts ().CPlusPlus20 ;
117119}
118120
119121StdAllocatorCaller InterpState::getStdAllocatorCaller (StringRef Name) const {
Original file line number Diff line number Diff line change @@ -20,3 +20,10 @@ namespace DynamicCast {
2020 // both-note {{dynamic_cast}}
2121 };
2222}
23+
24+ namespace NewDelete {
25+ struct T {
26+ int n : *new int (4 ); // both-warning {{constant expression}} \
27+ // both-note {{until C++20}}
28+ };
29+ }
You can’t perform that action at this time.
0 commit comments