<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 - SegFault with __builtin_bit_cast to templated type and auto return type"
   href="https://bugs.llvm.org/show_bug.cgi?id=42936">42936</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SegFault with __builtin_bit_cast to templated type and auto return type
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>Roland.Schulz@Intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>template<class T> struct S { int x;};
auto f() {
    int t = 5;
    return __builtin_bit_cast(S<int>, t);
}

Error:
1.      <source>:8:41: current parser token ';'
2.      <source>:6:10: parsing function body 'f'
3.      <source>:6:10: in compound statement ('{}')
 #4 0x0000557591fc2a05 clang::ASTContext::getASTRecordLayout(clang::RecordDecl
const*) const
(/opt/compiler-explorer/clang-trunk-20190808/bin/clang-10+0x47d8a05)
clang-10: error: unable to execute command: Segmentation fault (core dumped)

<a href="https://godbolt.org/z/4sPmp2">https://godbolt.org/z/4sPmp2</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>