[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 25 07:39:12 PDT 2024


================
@@ -51,6 +51,11 @@ struct A { ~A(); };
 }
 
 namespace test5 {
+struct A { ~A(); };
+[[clang::always_destroy]] A a; // no warning
+}
+
----------------
AaronBallman wrote:

```suggestion
struct A { ~A(); };
[[clang::always_destroy]] A a; // no warning

void func() {
  [[clang::always_destroy]] static A a; // no warning
}
}

```

https://github.com/llvm/llvm-project/pull/86486


More information about the cfe-commits mailing list