File tree Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -1616,14 +1616,18 @@ void OmpVisitor::Post(const parser::OpenMPBlockConstruct &x) {
16161616bool OmpVisitor::Pre (const parser::OpenMPDeclareMapperConstruct &x) {
16171617 AddOmpSourceRange (x.source );
16181618 BeginDeclTypeSpec ();
1619- PushScope (Scope::Kind::OtherConstruct, nullptr );
16201619 const auto &spec{std::get<parser::OmpDeclareMapperSpecifier>(x.t )};
1620+ Symbol *mapperSym{nullptr };
16211621 if (const auto &mapperName{std::get<std::optional<parser::Name>>(spec.t )}) {
1622- Symbol *mapperSym{&MakeSymbol (*mapperName, Attrs{})};
1622+ mapperSym =
1623+ &MakeSymbol (*mapperName, MiscDetails{MiscDetails::Kind::ConstructName});
16231624 mapperName->symbol = mapperSym;
1624- } else if (0 ) {
1625- Symbol *mapperSym{&MakeSymbol (" default" , Attrs{})};
1625+ } else {
1626+ mapperSym = &MakeSymbol (
1627+ " default" , Attrs{}, MiscDetails{MiscDetails::Kind::ConstructName});
16261628 }
1629+
1630+ PushScope (Scope::Kind::OtherConstruct, nullptr );
16271631 Walk (std::get<parser::TypeSpec>(spec.t ));
16281632 const auto &varName{std::get<parser::ObjectName>(spec.t )};
16291633 DeclareObjectEntity (varName);
Original file line number Diff line number Diff line change 1+ ! RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=50
2+ ! Test the source code starting with omp syntax
3+
4+ integer :: y
5+
6+ ! ERROR: Type is not a derived type
7+ ! $omp declare mapper(mm : integer::x) map(x, y)
8+ end
Original file line number Diff line number Diff line change 1+ ! RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=50
2+ ! Test the source code starting with omp syntax
3+
4+ type, abstract :: t1
5+ integer :: y
6+ end type t1
7+
8+ ! ERROR: Type must not be abstract
9+ ! $omp declare mapper(mm : t1::x) map(x, x%y)
10+ end
You can’t perform that action at this time.
0 commit comments