Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wnonnull6.C
blob7eff7f6273ba633b6b04b9b18c3c5975c1430949
1 /* PR c++/95984 - Internal compiler error: Error reporting routines re-entered
2    in -Wnonnull on a variadic lambda
3    PR c++/missing -Wnonnull passing nullptr to a nonnull variadic lambda
4    { dg-do compile { target c++14 } }
5    { dg-options "-Wall" } */
7 typedef int F (int);
9 F* pr95984 ()
11   // This also triggered the ICE.
12   return [](auto...) { return 0; };     // { dg-bogus "\\\[-Wnonnull" }
16 __attribute__ ((nonnull)) void f (int, ...);
17 void ff ()
19   f (1, nullptr);                       // { dg-warning "\\\[-Wnonnull" }
22 template <class T> void g (T t)
24   t (1, nullptr);                       // { dg-warning "\\\[-Wnonnull" }
27 void gg (void)
29   g ([](int, auto...) __attribute__ ((nonnull)) { });
32 template <class T> __attribute__ ((nonnull)) void h (T);
34 void hh ()
36   h (nullptr);                          //  { dg-warning "\\\[-Wnonnull" }