This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] clang doesnt diagnose if there is a lexical block around a for stmt for OpenMP loops. It is technically not allowed in the OpenMP standard
AbandonedPublic

Authored by davidsh on Sep 15 2016, 10:15 AM.

Details

Summary

#pragma omp for
{
for(...)
}

This is technically not allowed by the standard, gcc doesnt allow such code.

Diff Detail

Event Timeline

davidsh retitled this revision from to [OpenMP] clang doesnt diagnose if there is a lexical block around a for stmt for OpenMP loops. It is technically not allowed in the OpenMP standard.
davidsh updated this object.
davidsh added a subscriber: cfe-commits.
ABataev added inline comments.Sep 15 2016, 11:13 PM
lib/Sema/SemaOpenMP.cpp
5137–5138

You also should skip all AttributedStmts.

Adding a parameter to IgnoreContainers instead of copying the logic.

kkwli0 edited edge metadata.Oct 4 2016, 2:37 PM

Should we issue a warning message in this case?

ABataev edited edge metadata.Oct 5 2016, 3:30 AM

Should we issue a warning message in this case?

Agree

davidsh abandoned this revision.Oct 28 2016, 8:37 AM