Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wunused-label-4.C
blobd194f043d215117d2b84123d0f0e00d1ada03281
1 // PR c++/113582
2 // { dg-do compile { target c++17 } }
3 // { dg-options "-Wunused-label" }
5 template<bool B> void
6 do_something ()
8 #pragma GCC diagnostic push
9 #pragma GCC diagnostic ignored "-Wunused-label"
10 start:
11   if constexpr(B)
12     goto start;
13 #pragma GCC diagnostic pop
16 template<bool B> void
17 do_something2 ()
19 start: // { dg-warning "defined but not used" }
20   if constexpr(B)
21     goto start;
24 void
25 g ()
27   do_something<0>();
28   do_something2<0>();