================
@@ -602,6 +602,15 @@ namespace Destructors {
   }
   static_assert(testS() == 1); // both-error {{not an integral constant 
expression}} \
                                // both-note {{in call to 'testS()'}}
+
+  struct A { int n; };
+  constexpr void double_destroy() {
+    A a;
+    a.~A();
+    a.~A(); // both-note {{destruction of object outside its lifetime}}
----------------
shafik wrote:

If we removed this line, will we also obtain a diagnostic on scope exit since 
that would also be a double destruction?

https://github.com/llvm/llvm-project/pull/179957
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to