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

            Bug ID: 25221
           Summary: Infinite loop while parsing OpenMP directive
           Product: OpenMP
           Version: unspecified
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Runtime Library
          Assignee: unassignedb...@nondot.org
          Reporter: sfan...@us.ibm.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

While attempting to compile this code (bla.cpp):


//##################
int nested(int a){
  #pragma omp parallel
    ++a;

 auto F = [&](){
   #pragma omp parallel
   {
     #pragma omp target
       ++a;
   }
 };
 F();
  return a;
}
//##################

With the frontend command:

clang -cc1 -internal-isystem $CLANG_PATH/bin/../lib/clang/3.8.0/include
-nostdsysteminc -fopenmp -x c++ -triple x86_64-unknown-unknown -o - bla.cpp

it gets into an infinite loop in the parser. Note that the code needs
-std=c++11, and adding this extra option makes the problem go away.
Nevertheless,  the compiler should not run forever if the user forgets to add
that.

-- 
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