================
@@ -494,3 +494,32 @@ constexpr int modify_const_variable() {
}
static_assert(modify_const_variable()); // both-error {{not an integral
constant expression}} \
// both-note {{in call to}}
+
+constexpr int nullDest() {
+ new (nullptr) int{12}; // both-note {{construction of dereferenced null
pointer}}
+ return 0;
+}
+static_assert(nullDest() == 0); // both-error {{not an integral constant
expression}} \
+ // both-note {{in call to}}
+
+constexpr int nullArrayDest() {
+ new (nullptr) int{12}; // both-note {{construction of dereferenced null
pointer}}
----------------
shafik wrote:
It looks like you intended to make this an array but did not.
https://github.com/llvm/llvm-project/pull/164804
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits