Changeset View
Changeset View
Standalone View
Standalone View
flang/lib/Semantics/resolve-names.cpp
Show First 20 Lines • Show All 4,022 Lines • ▼ Show 20 Lines | for (auto &bindingName : x.bindingNames) { | ||||
context().SetError(*s); | context().SetError(*s); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
void DeclarationVisitor::Post(const parser::FinalProcedureStmt &x) { | void DeclarationVisitor::Post(const parser::FinalProcedureStmt &x) { | ||||
for (auto &name : x.v) { | if (currScope().IsDerivedType() && currScope().symbol()) { | ||||
MakeTypeSymbol(name, FinalProcDetails{}); | if (auto *details{currScope().symbol()->detailsIf<DerivedTypeDetails>()}) { | ||||
for (const auto &subrName : x.v) { | |||||
if (const auto *name{ResolveName(subrName)}) { | |||||
auto pair{ | |||||
details->finals().emplace(name->source, DEREF(name->symbol))}; | |||||
if (!pair.second) { // C787 | |||||
Say(name->source, | |||||
"FINAL subroutine '%s' already appeared in this derived type"_err_en_US, | |||||
name->source) | |||||
.Attach(pair.first->first, | |||||
"earlier appearance of this FINAL subroutine"_en_US); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | } | ||||
} | } | ||||
bool DeclarationVisitor::Pre(const parser::TypeBoundGenericStmt &x) { | bool DeclarationVisitor::Pre(const parser::TypeBoundGenericStmt &x) { | ||||
const auto &accessSpec{std::get<std::optional<parser::AccessSpec>>(x.t)}; | const auto &accessSpec{std::get<std::optional<parser::AccessSpec>>(x.t)}; | ||||
const auto &genericSpec{std::get<Indirection<parser::GenericSpec>>(x.t)}; | const auto &genericSpec{std::get<Indirection<parser::GenericSpec>>(x.t)}; | ||||
const auto &bindingNames{std::get<std::list<parser::Name>>(x.t)}; | const auto &bindingNames{std::get<std::list<parser::Name>>(x.t)}; | ||||
auto info{GenericSpecInfo{genericSpec.value()}}; | auto info{GenericSpecInfo{genericSpec.value()}}; | ||||
▲ Show 20 Lines • Show All 2,495 Lines • Show Last 20 Lines |