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

Oleksandr T. via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 20 15:34:53 PST 2024


================
@@ -49,3 +49,15 @@ void check() {
   test_type(g);
   test_type(h); // expected-note {{instantiation}}
 }
+
+namespace GH63009 {
+struct S {
+  [[noreturn]] S() { throw int {}; }
+};
+
+int test_no_return_constructor() { S(); } // ok
----------------
a-tarasyuk wrote:

@AaronBallman I've added tests.

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


More information about the cfe-commits mailing list