File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -455,6 +455,13 @@ void CheckHelper::CheckCommonBlock(const Symbol &symbol) {
455455 if (symbol.attrs ().test (Attr::BIND_C)) {
456456 CheckBindC (symbol);
457457 }
458+ for (MutableSymbolRef ref : symbol.get <CommonBlockDetails>().objects ()) {
459+ if (ref->test (Symbol::Flag::CrayPointee)) {
460+ messages_.Say (ref->name (),
461+ " Cray pointee '%s' may not be a member of a COMMON block" _err_en_US,
462+ ref->name ());
463+ }
464+ }
458465}
459466
460467// C859, C860
@@ -2509,6 +2516,13 @@ void CheckHelper::CheckEquivalenceSet(const EquivalenceSet &set) {
25092516 }
25102517 }
25112518 // TODO: Move C8106 (&al.) checks here from resolve-names-utils.cpp
2519+ for (const EquivalenceObject &object : set) {
2520+ if (object.symbol .test (Symbol::Flag::CrayPointee)) {
2521+ messages_.Say (object.symbol .name (),
2522+ " Cray pointee '%s' may not be a member of an EQUIVALENCE group" _err_en_US,
2523+ object.symbol .name ());
2524+ }
2525+ }
25122526}
25132527
25142528void CheckHelper::CheckBlockData (const Scope &scope) {
Original file line number Diff line number Diff line change 1+ ! RUN: %python %S/test_errors.py %s %flang_fc1
2+ pointer (p,x)
3+ ! ERROR: Cray pointee 'y' may not be a member of an EQUIVALENCE group
4+ pointer (p,y)
5+ ! ERROR: Cray pointee 'x' may not be a member of a COMMON block
6+ common x
7+ equivalence (y,z)
8+ end
You can’t perform that action at this time.
0 commit comments