<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 - Custom OpenMP reduction in C++ template causes SEGFAULT at compile time"
   href="https://bugs.llvm.org/show_bug.cgi?id=34321">34321</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Custom OpenMP reduction in C++ template causes SEGFAULT at compile time
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>4.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>s6jaschu@uni-bonn.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=19040" name="attach_19040" title="Crash report">attachment 19040</a> <a href="attachment.cgi?id=19040&action=edit" title="Crash report">[details]</a></span>
Crash report

The following reduced test case does crash clang:

struct Summary {
  void merge(const Summary& other) {}
};

template <typename K>
void work() {
  Summary global_summary;
#pragma omp declare reduction(+ : Summary : omp_out.merge(omp_in))
#pragma omp parallel for reduction(+ : global_summary)
  for (int k = 1; k <= 100; ++k) {
  }
}

struct A {};

int main(int argc, char** argv) {
  work<A>();
  return 0;
}

I did compile it with "LDFLAGS="-L/usr/local/opt/llvm/lib
-Wl,-rpath,/usr/local/opt/llvm/lib" /usr/local/opt/llvm/bin/clang++ -std=c++11
-fopenmp=libomp main.cpp" using the homebrew version of llvm on macOS.</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>