Skip to main content
11 events
when toggle format what by license comment
Feb 21, 2015 at 7:22 review Suggested edits
Feb 21, 2015 at 8:17
Oct 2, 2014 at 3:02 comment added bwDraco Still crashes the compiler as of GCC 4.9.1 (MinGW-w64): "cc1plus.exe has stopped working". Visual C++ gives main.cpp(2): fatal error C1202: recursive type or function dependency context too complex.
Feb 21, 2014 at 10:12 comment added Aschratt +1 for meta stack overflow :p
Feb 18, 2014 at 11:44 comment added masterX244 +1 for stackoverflow @compiler; btw java can be stackoverflown in compiler, too :P
Feb 17, 2014 at 22:35 comment added Casey @hvd It seems to be exploiting a bug in GCC. clang catches the erroneous usage - which I assume you are already aware of - but it makes my GCC spew almost 2 megabytes of error messages.
Feb 17, 2014 at 21:37 comment added hvd @Casey Nice idea! I'm surprised that that fails, though. In the trailing return type, the function being declared isn't available yet, unless later found by ADL, but int has no associated namespace. If I try it with a struct S, I do expect it to fail, and unlike the version with int it also causes a segfault in clang.
Feb 17, 2014 at 21:13 comment added Casey template <typename T> auto foo(T t) -> decltype(foo(t)); decltype(foo(0)) x; is a bit shorter.
Feb 17, 2014 at 18:45 comment added hvd @AlecTeal It detects an excessively large template instantiation depth. It doesn't call it recursion, because it isn't, other than in GCC's own source code. :) But you have a larger stack than I did on the system I tested this on. If you use a larger maximum (try 200000, or perhaps even 2000000), you'll get the same segmentation fault.
Feb 17, 2014 at 18:39 comment added Alec Teal GCC detects recursion and stops gracefully this side (4.8 and above seem to be fine)
Feb 17, 2014 at 16:59 comment added user16488 I confess I would have called this an obvious recursion in your metaprogram.
Feb 17, 2014 at 13:33 history answered hvd CC BY-SA 3.0