PR c++/82600
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wreturn-local-addr-4.C
blob492dcb9e76fc6e3ab353c78281678fc120cf639c
1 // PR c++/82600
2 // { dg-do compile }
4 void *b[10];
6 template <int N>
7 void **
8 foo (int x)
10   void **a = b;         // { dg-bogus "address of local variable 'a' returned" }
11   return &a[x];
14 void **
15 bar (int x)
17   return foo <0> (x);