Debian Codegraph @

gcc/testsuite/g++.dg/warn/noreturn-8.C

raw
1 // PR c++/60364
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wpedantic" }
4
5 void f (); // { dg-message "previous declaration" }
6 void f [[noreturn]] (); // { dg-error "declared '\\\[\\\[noreturn\\\]\\\]' but its first declaration was not" }
7
8 void f2 ();
9 void f2 [[gnu::noreturn]] ();
10
11 void f3 ();
12 __attribute__((noreturn)) void f3 ();
13
14 void f4 () { __builtin_abort (); } // { dg-message "previous declaration" }
15 void f4 [[noreturn]] (); // { dg-error "declared '\\\[\\\[noreturn\\\]\\\]' but its first declaration was not" }
16
17 void f5 () { __builtin_abort (); }
18 void f5 [[gnu::noreturn]] ();
19
20 void f6 () { __builtin_abort (); }
21 __attribute__((noreturn)) void f6 ();