We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8f5e3c commit 4eb66f7Copy full SHA for 4eb66f7
clang/lib/AST/ByteCode/InterpState.cpp
@@ -113,7 +113,9 @@ bool InterpState::maybeDiagnoseDanglingAllocations() {
113
<< (It.second.size() - 1) << Source->getSourceRange();
114
}
115
116
- return NoAllocationsLeft;
+ // Keep evaluating before C++20, since the CXXNewExpr wasn't valid there
117
+ // in the first place.
118
+ return NoAllocationsLeft || !getLangOpts().CPlusPlus20;
119
120
121
StdAllocatorCaller InterpState::getStdAllocatorCaller(StringRef Name) const {
clang/test/AST/ByteCode/cxx11-pedantic.cpp
@@ -20,3 +20,10 @@ namespace DynamicCast {
20
// both-note {{dynamic_cast}}
21
};
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
+}
0 commit comments