Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,7 @@ OpenMP Support
an invalid expression. (#GH139073)
- Fixed a crashing bug with ``omp simd collapse`` if the argument to
``collapse`` was an invalid expression. (#GH138493)
- Fixed a crashing bug with a malformed ``cancel`` directive. (#GH139360)
- Fixed a crashing bug with ``omp distribute dist_schedule`` if the argument to
``dist_schedule`` was not strictly positive. (#GH139266)

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Parse/ParseOpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2487,7 +2487,7 @@ StmtResult Parser::ParseOpenMPExecutableDirective(
} else if (DKind == OMPD_cancellation_point || DKind == OMPD_cancel) {
CancelRegion = parseOpenMPDirectiveKind(*this);
if (Tok.isNot(tok::annot_pragma_openmp_end))
ConsumeToken();
ConsumeAnyToken();
}

if (isOpenMPLoopDirective(DKind))
Expand Down
5 changes: 5 additions & 0 deletions clang/test/OpenMP/cancel_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,8 @@ label1 : {
return 0;
}

namespace GH139360 {
void f(){
#pragma omp cancel( // expected-error {{one of 'for', 'parallel', 'sections' or 'taskgroup' is expected}}
}
} // namesapce GH139360