https://bugs.llvm.org/show_bug.cgi?id=34445

            Bug ID: 34445
           Summary: OpenMP: Reduction initializer segfaults at runtime in
                    move constructor
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: s6jas...@uni-bonn.de
                CC: llvm-bugs@lists.llvm.org

I did compile the following program with "clang++ -fopenmp -std=c++14 test.cpp"
using a trunk build from a few days ago:

#include <cstdlib>
#include <functional>
#include <memory>

struct A {
  A() : ptr(nullptr, free) {}
  A& operator=(A&&) = default;
  std::unique_ptr<void, std::function<void(void*)>> ptr;
};

int main() {
  A test;
#pragma omp declare reduction(+ : A : omp_out) initializer(omp_priv = A())
#pragma omp parallel reduction(+ : test)
  {}
  return 0;
}

Running it results in a segmentation fault. I'm a little worried that this
could be a user error :/, sorry if this is the case.

GCC reports a missing copy constructor, the Intel compiler version runs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to