1/* { dg-do compile } */
2/* { dg-require-effective-target lto } */
3/* { dg-options "-flto -Wuninitialized -O1" }  */
4
5template <typename T> struct Q1 { typedef int x; };
6template <typename T> struct Q2 {
7  typename Q1<T>::x f() {
8    int k;
9    return k; /* { dg-warning "'k' is used uninitialized in this function" }  */
10  }
11};
12int foo() { return Q2<int>().f(); }
13