clang-omp / clang_trunk

Other
12 stars 11 forks source link

#pragma omp declare target is not allowed in extern "C" #17

Closed hahnjo closed 9 years ago

hahnjo commented 9 years ago
extern "C" {

#pragma omp declare target
void test()
{
    // does nothing
}
#pragma omp end declare target

}

doesn't compile with clang++ -c -fopenmp target.cpp and gives

target.cpp:3:21: error: directive must be at file or namespace scope
#pragma omp declare target
                    ^
target.cpp:8:25: error: unexpected OpenMP directive '#pragma omp end declare target'
#pragma omp end declare target
                        ^
2 errors generated.