File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1459,6 +1459,20 @@ class OmpVisitor : public virtual DeclarationVisitor {
1459
1459
void Post (const parser::OmpEndSectionsDirective &) {
1460
1460
messageHandler ().set_currStmtSource (std::nullopt);
1461
1461
}
1462
+ bool Pre (const parser::OmpCriticalDirective &x) {
1463
+ AddOmpSourceRange (x.source );
1464
+ return true ;
1465
+ }
1466
+ void Post (const parser::OmpCriticalDirective &) {
1467
+ messageHandler ().set_currStmtSource (std::nullopt);
1468
+ }
1469
+ bool Pre (const parser::OmpEndCriticalDirective &x) {
1470
+ AddOmpSourceRange (x.source );
1471
+ return true ;
1472
+ }
1473
+ void Post (const parser::OmpEndCriticalDirective &) {
1474
+ messageHandler ().set_currStmtSource (std::nullopt);
1475
+ }
1462
1476
};
1463
1477
1464
1478
bool OmpVisitor::NeedsScope (const parser::OpenMPBlockConstruct &x) {
Original file line number Diff line number Diff line change
1
+ ! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
2
+ ! Test that there are no errors for an empty critical construct
3
+
4
+ ! $omp critical
5
+ ! $omp end critical
6
+ end
You can’t perform that action at this time.
0 commit comments