@@ -1058,7 +1058,6 @@ class DeclarationVisitor : public ArraySpecVisitor,
10581058 const parser::Name *ResolveDesignator (const parser::Designator &);
10591059 int GetVectorElementKind (
10601060 TypeCategory category, const std::optional<parser::KindSelector> &kind);
1061- std::optional<DerivedTypeSpec> ResolveDerivedType (const parser::Name &);
10621061
10631062protected:
10641063 bool BeginDecl ();
@@ -1206,6 +1205,7 @@ class DeclarationVisitor : public ArraySpecVisitor,
12061205 Symbol &DeclareProcEntity (
12071206 const parser::Name &, Attrs, const Symbol *interface);
12081207 void SetType (const parser::Name &, const DeclTypeSpec &);
1208+ std::optional<DerivedTypeSpec> ResolveDerivedType (const parser::Name &);
12091209 std::optional<DerivedTypeSpec> ResolveExtendsType (
12101210 const parser::Name &, const parser::Name *);
12111211 Symbol *MakeTypeSymbol (const SourceName &, Details &&);
@@ -1609,21 +1609,26 @@ void OmpVisitor::Post(const parser::OpenMPBlockConstruct &x) {
16091609 }
16101610}
16111611
1612+ // This "manually" walks the tree of the cosntruct, because the order
1613+ // elements are resolved by the normal visitor will try to resolve
1614+ // the map clauses attached to the directive without having resolved
1615+ // the type, so the type is figured out using the implicit rules.
16121616bool OmpVisitor::Pre (const parser::OpenMPDeclareMapperConstruct &x) {
16131617 AddOmpSourceRange (x.source );
16141618 BeginDeclTypeSpec ();
16151619 PushScope (Scope::Kind::OtherConstruct, nullptr );
16161620 const auto &spec{std::get<parser::OmpDeclareMapperSpecifier>(x.t )};
1617- if (const auto &mapperName{
1618- std::get<std::optional<Fortran::parser::Name>>(spec.t )}) {
1621+ if (const auto &mapperName{std::get<std::optional<parser::Name>>(spec.t )}) {
16191622 Symbol *mapperSym{&MakeSymbol (*mapperName, Attrs{})};
16201623 mapperName->symbol = mapperSym;
1624+ } else if (0 ) {
1625+ Symbol *mapperSym{&MakeSymbol (" default" , Attrs{})};
16211626 }
1622- Walk (std::get<Fortran:: parser::TypeSpec>(spec.t ));
1623- const auto &varName{std::get<Fortran:: parser::ObjectName>(spec.t )};
1627+ Walk (std::get<parser::TypeSpec>(spec.t ));
1628+ const auto &varName{std::get<parser::ObjectName>(spec.t )};
16241629 DeclareObjectEntity (varName);
16251630
1626- Walk (std::get<std::list<std::list<Fortran:: parser::OmpMapClause>> >(x.t ));
1631+ Walk (std::get<parser::OmpClauseList >(x.t ));
16271632
16281633 EndDeclTypeSpec ();
16291634 return false ;
0 commit comments