[llvm-bugs] [Bug 38902] New: incorrect diagnose of user-defined reduction declared in namespace

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 11 13:15:04 PDT 2018


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

            Bug ID: 38902
           Summary: incorrect diagnose of user-defined reduction declared
                    in namespace
           Product: OpenMP
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: kli at ca.ibm.com
                CC: a.bataev at hotmail.com, llvm-bugs at lists.llvm.org

template <typename T>
void bar(T &x, T &y) { x.a += y.a; }

namespace N1
{
  struct A { int a; A() : a(0) {} };
  #pragma omp declare reduction(+: A : bar(omp_out, omp_in))
};

int main ()
{
  N1::A a;
//  A a;
  #pragma omp parallel reduction(+: a)
  {
  }
}

$ clang++ -fopenmp d2a.cpp
d2a.cpp:15:34: error: invalid operands to binary expression ('N1::A' and
'N1::A')
  #pragma omp parallel reduction(+: a)
                                 ^  ~
1 error generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180911/731f626f/attachment.html>


More information about the llvm-bugs mailing list