view gcc/testsuite/g++.dg/torture/pr77555.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do link }
// { dg-options "-std=c++11" }

extern "C" int printf(const char*, ...);
struct A {
  A(int, char *p2) { printf(p2); }
};
template <int, typename> struct B { static A static_var; };
template <int LINE, typename GETTER>
A B<LINE, GETTER>::static_var{0, GETTER::get()};
struct C {
  void unused() {
    static char function_static;
    struct D {
      static char *get() { return &function_static; }
    };
    auto addr = B<0, D>::static_var;
  }
};
int main() {}