<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - fatal error: parser recursion limit reached when using deeply nested parentheses"
   href="http://llvm.org/bugs/show_bug.cgi?id=15195">15195</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>fatal error: parser recursion limit reached when using deeply nested parentheses
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.2
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>darwin.driggers@sas.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=9977" name="attach_9977" title="Standalone source code to replicate the error message">attachment 9977</a> <a href="attachment.cgi?id=9977&action=edit" title="Standalone source code to replicate the error message">[details]</a></span>
Standalone source code to replicate the error message

The exact error is:
clang -c x2.c
x2.c:5389:3: fatal error: parser recursion limit reached, program too complex
{ FOO_VERSIONLONG},                       /* fixed index is 334*/
  ^
x2.c:4871:31: note: expanded from macro 'FOO_VERSIONLONG'
#define FOO_VERSIONLONG      (FOO_VERSIONLONG_IDXXX|MYFLAG)
                              ^
x2.c:584:36: note: expanded from macro 'FOO_VERSIONLONG_IDXXX'
#define FOO_VERSIONLONG_IDXXX     (FOO_VBUFSIZE_IDXXX + 1)
                                   ^

Clang version info:
clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-apple-darwin11.4.2
Thread model: posix

The above error is present in the 3.2 production version of clang and with the
latest(Feb. 05, 2013) build using the source from trunk.

I was able to checkout the source for clang version 3.2 and the current trunk
and make the following change in clang/lib/Parse/RAIIObjectsForParser.h, line
374, to get around the error:
enum { MaxDepth = 2048 }; // Increase MaxDepth 

Please increase MaxDepth to a minimum of 2k.

I've verified the problem exists on MacOS X and Linux.

This bug/enhancement request appears related to <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - clang crashes from gcc torture test limits-structnest.c"
   href="show_bug.cgi?id=10752">bug 10752</a>.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>