aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/static33.C
blob: 2d7b97da13851ab8bbcc47e75f6c8288f54db7a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// PR c++/52688
// { dg-do link }

template<typename T>
T f()
{
  static const double staticLocalVariable = 100.0;
  struct local
  {
      static double f() { return staticLocalVariable; }
  };
  return T(local::f());
}

int main()
{
  f<double>();
}