// PR c++/85901 // { dg-do compile { target c++11 } } template struct A; template struct A { template static auto c(int U::*p, TT o) -> decltype(o.*p); // { dg-message {A} } }; struct X {}; int x = A::c(); // { dg-error "no matching function for call" }