https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63506
--- Comment #5 from Steffen Müthing <steffen.muething at iwr dot
uni-heidelberg.de> ---
The exact same problem is present on operator[] :
//-------------------------------
struct proxy {};
struct iterator
{
proxy operator*() { return proxy(); }
proxy operator[](int i) { return proxy(); }
};
//#define DEACTIVATE
#ifndef DEACTIVATE
template<typename T = int>
#endif
void foo(iterator it)
{
auto&& x = *it;
auto&& y = it[1];
}
int main()
{
iterator it;
foo(it);
}
//-------------------------------