Re:The Following Code Causes Segfault in Clang
by userbinator on Saturday August 02, 2014 @09:59PM
(#8126755)
Depending on available memory, attempting to compile an expression with ridiculously large numbers of nested parentheses (e.g. "return (((...(42)...)));" will also do the trick.
I don't expect a compiler to be able to compile programs that exceed its internal limits, but a better error message would be much appreciated, instead of a hard crash. For comparison, with MSVC the parent's code produces
fatal error C1026: parser stack overflow, program too complex
and the nested parentheses results in
fatal error C1013: compiler limit : too many open parentheses
I don't expect a compiler to be able to compile programs that exceed its internal limits, but a better error message would be much appreciated, instead of a hard crash. For comparison, with MSVC the parent's code produces
and the nested parentheses results in