// Core 1273 // { dg-do compile { target c++11 } } template struct C; template struct D; class A { int i; static int j; friend struct C; friend struct D; } a; class B { int i; static int j; friend struct C; friend struct D; } b; template struct C { template decltype (a.i) f() { } // #1 template decltype (b.i) f() { } // #2 }; template struct D { template decltype (A::j) f() { } // #1 template decltype (B::j) f() { } // #2 }; int main() { C().f(); // calls #1 C().f(); // calls #2 D().f(); // calls #1 D().f(); // calls #2 }