[clang] [Clang] skip warnings for constructors marked with the [[noreturn]] attribute (PR #115558)

via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 21 00:12:29 PST 2024


================
@@ -122,3 +122,25 @@ namespace PR10801 {
     thingy(b);
   }
 }
+
+namespace GH63009 {
+struct S1 {
+  [[noreturn]] S1();
+};
+
+struct S2 {
+  [[noreturn]] ~S2();
+};
+
+int foo();
+
+int test_1() {
+  S1 s1;
+  foo();
+}
+
+int test_2() {
+  S2 s2;
+  foo();
----------------
Sirraide wrote:

Hmm, I’d expect these two functions to raise a `-Wmissing-noreturn` warning. That’s probably something we should investigate, but that doesn’t have to be in this pr imo since I’d say it’s more important that we *don’t* issue a `-Wreturn-type` warning here.

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


More information about the cfe-commits mailing list