<html>
    <head>
      <base href="https://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 --- - Parser segmentation fault"
   href="https://llvm.org/bugs/show_bug.cgi?id=30831">30831</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Parser segmentation fault
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.9
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jj.oconnor15@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=17508" name="attach_17508" title="contains test.cpp, the stack traces from 3.8 and 3.9, the above text, and the /tmp files those stacks told me to include with a bug report">attachment 17508</a> <a href="attachment.cgi?id=17508&action=edit" title="contains test.cpp, the stack traces from 3.8 and 3.9, the above text, and the /tmp files those stacks told me to include with a bug report">[details]</a></span>
contains test.cpp, the stack traces from 3.8 and 3.9, the above text, and the
/tmp files those stacks told me to include with a bug report

I wrote some nonsense code by accident and segfaulted the parser. It's short
enough to fit in here (it's only 8 lines):

__________________________
template <typename T>
class A {
public:
  static A<T> const a;
};

template <typename T>
A<T> A<T>::a = A<T>();
__________________________

The parser says it was on the token '=' when it died.

The compiler (specifically the parse step) crashes with this invocation:
$ clang++ test.cpp

Also:
$ clang++-3.9 test.cpp

Here's some OS and version information:

$ clang++ --version
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ clang++-3.9 --version
clang version 3.9.0-svn275918-1~exp1 (branches/release_39)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
HOME_URL="<a href="http://www.ubuntu.com/">http://www.ubuntu.com/</a>"
SUPPORT_URL="<a href="http://help.ubuntu.com/">http://help.ubuntu.com/</a>"
BUG_REPORT_URL="<a href="http://bugs.launchpad.net/ubuntu/">http://bugs.launchpad.net/ubuntu/</a>"
UBUNTU_CODENAME=xenial

$ uname -a
Linux refraction 4.4.0-34-generic #53-Ubuntu SMP Wed Jul 27 16:06:39 UTC 2016
x86_64 x86_64 x86_64 GNU/Linux</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>