[LLVMbugs] [Bug 24121] New: [OPENMP] canonical loop rejected when comparison has implicit conversions or destruction

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 14 11:01:58 PDT 2015


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

            Bug ID: 24121
           Summary: [OPENMP] canonical loop rejected when comparison has
                    implicit conversions or destruction
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hstong at ca.ibm.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14587
  --> https://llvm.org/bugs/attachment.cgi?id=14587&action=edit
Test canonical loop with custom random access iterators

When a user-defined random access iterator is used with the OpenMP loop
construct, Clang rejects canonical loops if the comparison operation entails
implicit conversions or the creation of temporaries requiring non-trivial
destruction.

Source is attached; various cases are included under macro control.

CASE_0: this works; it includes an namespace operator< for the iterator type
CASE_1: this fails; calling the same operator< now involves non-trivial temp
destruction
CASE_2: this fails; the operator< returns a class object which is contextually
convertible to bool
CASE_3: this fails; a built-in operator< is used, requiring implicit conversion
of the operands


### COMPILER INVOCATION:
clang++ -fopenmp=libomp -std=c++11 openmpCmpOp.cc -DCASE_0 -c
clang++ -fopenmp=libomp -std=c++11 openmpCmpOp.cc -DCASE_1 -c
clang++ -fopenmp=libomp -std=c++11 openmpCmpOp.cc -DCASE_2 -c
clang++ -fopenmp=libomp -std=c++11 openmpCmpOp.cc -DCASE_3 -c


### OUTPUT (failing cases):
openmpCmpOp.cc:62:29: error: condition of OpenMP for loop must be a relational
comparison ('<', '<=', '>', or '>=') of loop variable 'it'
  for (It<char> it = begin; it < end; ++it) {
                            ^~~~~~~~
1 error generated.


### EXPECTED OUTPUT:
(Compiles successfully).


### COMPILER VERSION INFO:
clang version 3.7.0 (trunk)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/ppc64le-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/ppc64le-redhat-linux/4.8.3
Selected GCC installation: /usr/lib/gcc/ppc64le-redhat-linux/4.8.3
Candidate multilib: .;@m64
Selected multilib: .;@m64

-- 
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/20150714/3c2cafed/attachment.html>


More information about the llvm-bugs mailing list