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() {
113
113
<< (It.second .size () - 1 ) << Source->getSourceRange ();
114
114
}
115
115
}
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 ;
117
119
}
118
120
119
121
StdAllocatorCaller InterpState::getStdAllocatorCaller (StringRef Name) const {
Original file line number Diff line number Diff line change @@ -20,3 +20,10 @@ namespace DynamicCast {
20
20
// both-note {{dynamic_cast}}
21
21
};
22
22
}
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