Infinite loop while parsing OpenMP directive #25595
Labels
bugzilla
Issues migrated from bugzilla
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
Extended Description
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.
The text was updated successfully, but these errors were encountered: