http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51934
--- Comment #15 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-01-23 15:19:37 UTC --- > Well, if it hangs before the fix with the noreturn attribute, then it is > trivial to replace the return a; with for (;;); It does not hang: macbook] f90/bug% cat pr51344_db.C /* { dg-do compile } */ class A; template <class T> class B { friend __attribute__((noreturn)) A& operator >>(A& a, B& b) { for (;;); /* return a; */ } }; [macbook] f90/bug% time g++-fsf-4.6 -c pr51344_db.C 0.010u 0.015s 0:00.05 40.0% 0+0k 0+4io 0pf+0w while [macbook] f90/bug% cat pr51344_db.C /* { dg-do compile } */ class A; template <class T> class B { friend __attribute__((format)) A& operator >>(A& a, B& b) { for (;;); /* return a; */ } }; macbook] f90/bug% time g++-fsf-4.6 -c pr51344_db.C ^C0.002u 0.005s 0:37.44 0.0% 0+0k 0+1io 0pf+0w ^ | interrupted