Skip to content

Commit a5c72cc

Browse files
Fix test and remove redundant check
1 parent 98aca98 commit a5c72cc

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

flang/lib/Semantics/check-omp-structure.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,12 +1440,7 @@ void OmpStructureChecker::Enter(const parser::OpenMPDeclareMapperConstruct &x) {
14401440
dir.source, llvm::omp::Directive::OMPD_declare_mapper);
14411441
const auto &spec{std::get<parser::OmpDeclareMapperSpecifier>(x.t)};
14421442
const auto &type = std::get<parser::TypeSpec>(spec.t);
1443-
if (const auto derivedTypeSpec{
1444-
std::get_if<parser::DerivedTypeSpec>(&type.u)}) {
1445-
if (derivedTypeSpec->derivedTypeSpec->typeSymbol().attrs().test(
1446-
Attr::ABSTRACT))
1447-
context_.Say(dir.source, "Type must not be abstract"_err_en_US);
1448-
} else {
1443+
if (!std::get_if<parser::DerivedTypeSpec>(&type.u)) {
14491444
context_.Say(dir.source, "Type is not a derived type"_err_en_US);
14501445
}
14511446
}

flang/test/Semantics/OpenMP/declare-mapper02.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
integer :: y
66
end type t1
77

8-
!ERROR: Type must not be abstract
8+
!ERROR: ABSTRACT derived type may not be used here
99
!$omp declare mapper(mm : t1::x) map(x, x%y)
1010
end

0 commit comments

Comments
 (0)