// PR c++/53223 // { dg-do compile { target c++11 } } #include #define SA(x) static_assert ((x), #x) struct A { int good() const; int operator *() const; int operator ++() const; int operator [](int) const; }; int operator-- (const A&); template void func(T t) { A x; auto &&g1 = x.good(); auto &&g2 = x.operator*(); auto &&error1 = *x; auto &&error2 = ++x; auto &&error3 = --x; auto &&error4 = x[5]; SA ((std::is_same::value)); SA ((std::is_same::value)); SA ((std::is_same::value)); SA ((std::is_same::value)); } void func2(int) { A x; auto &&g = *x; } int main() { func(0); func2(0); }