1 // { dg-do compile { target c++11 } } 2 3 struct proxy {}; 4 5 struct iterator 6 { 7 proxy operator*() { return proxy(); } 8 9 proxy operator[](int i) { return proxy(); } 10 }; 11 12 //#define DEACTIVATE 13 14 #ifndef DEACTIVATE 15 template<typename T = int> 16 #endif foo(iterator it)17void foo(iterator it) 18 { 19 auto&& x = *it; 20 auto&& y = it[1]; 21 } 22 main()23int main() 24 { 25 iterator it; 26 foo(it); 27 } 28