<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - isCXX11ConstantExpr related segfault"
   href="https://bugs.llvm.org/show_bug.cgi?id=36645">36645</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>isCXX11ConstantExpr related segfault
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>taruti@taruti.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20019" name="attach_20019" title="clang 6.0 crash">attachment 20019</a> <a href="attachment.cgi?id=20019&action=edit" title="clang 6.0 crash">[details]</a></span>
clang 6.0 crash

OpenCPN recently enabled C++11 and when trying out clang instead of gcc I
stumbled upon a crash in clang. This seems to occur on both 6.0.0-1 and a trunk
version in Debian sid. 

The crash goes away with -std=c++98.

This is enough to reproduce this (produced by multidelta)
```
struct DATUM {
         const char *name;
         short ellipsoid;
};
struct DATUM const gDatum[] = {
        { "Adindan", 5}
};
void datumParams(short datum, double *a, double *es) {
  extern struct DATUM const gDatum[];
}
static int isWGS84(int i) {
  if (gDatum[i].ellipsoid != gDatum[0].ellipsoid)         return i;

```

Which crashes with:
clang++-7 -c georef.ii -O0 -emit-llvm -o /dev/null
clang++-6.0 -c georef.ii -O0 -emit-llvm -o /dev/null
and does not crash with -std=c++98.

Attached are logs of crashes from both clang versions and a preprocessed
original source file. Original source is at <a href="https://github.com/OpenCPN/OpenCPN">https://github.com/OpenCPN/OpenCPN</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>