<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 - 'omp target' directive segfaults Clang with std=c++11"
   href="https://bugs.llvm.org/show_bug.cgi?id=44578">44578</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>'omp target' directive segfaults Clang with std=c++11
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>9.0
          </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>OpenMP
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>gcc.j.kelling@hzdr.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23022" name="attach_23022" title="source, output, clang commandline, temps">attachment 23022</a> <a href="attachment.cgi?id=23022&action=edit" title="source, output, clang commandline, temps">[details]</a></span>
source, output, clang commandline, temps

The attached code ( templateInt.cpp ), invoking a version of the later
std::invoke inside an omp target region crashes clang when compiled with the
command line:

clang++  -fopenmp -fopenmp=libomp -fopenmp-targets=x86_64-pc-linux-gnu
-stdlib=libc++ --save-temps -fopenmp=libomp -g   -std=gnu++11 templateInt.cpp

It does compile with std=c++14, but it is c++11 compliant (note, that
BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION is defined and thus trailing return types
are given for auto functions).

This crash looks similar to [1] but is different. Compiling the code crashing
example from [1] with the above commandline does succeed.

[1] <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - 'omp target' directive segfaults Clang with std::decay from libstdc++"
   href="show_bug.cgi?id=43771">https://bugs.llvm.org/show_bug.cgi?id=43771</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>