Skip to content

Instantly share code, notes, and snippets.

@vladimir-vg
Created May 15, 2011 19:01
Show Gist options
  • Save vladimir-vg/973431 to your computer and use it in GitHub Desktop.
Save vladimir-vg/973431 to your computer and use it in GitHub Desktop.
g++ goes to infinite loop when try to parse this.
template<class T> struct Loop { Loop<T*> operator->(); };
Loop<int> i, j = i->hooray;
@vladimir-vg
Copy link
Author

$ cat parse-fail.cpp 

template<class T> struct Loop { Loop<T*> operator->(); };
Loop<int> i, j = i->hooray;
$ time g++ parse-fail.cpp 
^C
real    64m54.129s
user    0m0.000s
sys 0m0.000s

$ # really infinite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment