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
8 changes: 4 additions & 4 deletions flang/lib/Semantics/check-omp-structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2575,8 +2575,8 @@ void OmpStructureChecker::CheckCancellationNest(
}
break;
default:
// This should have been diagnosed by this point.
llvm_unreachable("Unexpected directive");
// This is diagnosed later.
return;
}
if (!eligibleCancellation) {
context_.Say(source,
Expand Down Expand Up @@ -2614,8 +2614,8 @@ void OmpStructureChecker::CheckCancellationNest(
parser::ToUpperCaseLetters(typeName.str()));
break;
default:
// This should have been diagnosed by this point.
llvm_unreachable("Unexpected directive");
// This is diagnosed later.
return;
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions flang/test/Semantics/OpenMP/cancel-bad-cancel-type.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
!RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags

program test
!ERROR: PARALLEL DO is not a cancellable construct
!$omp cancel parallel do
end