Lines Matching defs:generic
608 // derived type with same name as a generic
628 // procedure pointer with same name as a generic
875 // Add to generic the symbol for the subprogram with the same name
879 // A new GenericInfo is pushed for each interface block and generic stmt
885 Symbol *symbol{nullptr}; // the generic symbol being defined
1191 // Map type-bound generic to binding names of its specific bindings
3057 [&](const Indirection<parser::GenericSpec> &generic) {
3058 GenericSpecInfo genericSpecInfo{generic.value()};
3194 // Privacy is not enforced in module files so that generic interfaces
3332 // We are use-associating a generic that either shadows a procedure
3337 // empty local generic now into which the use-associated generic may
3394 // Fortran allows a generic interface to share its name with a derived type,
3395 // or with the name of a non-generic procedure (which should be one of the
3396 // generic's specific procedures). Implementing all these possibilities is
3402 // - two distinct non-generic procedures
3403 // - a generic and a non-generic that is not already one of its specifics
3404 // - anything other than a derived type, non-generic procedure, or
3405 // generic procedure being combined with something other than an
3538 // When two non-generic procedures arrived, try to combine them.
3548 return; // both symbols are non-generic procedures
3562 return; // local generic can extend intrinsic
3566 return; // used non-generic is already a specific of local generic
3576 // Local is the specific of the used generic or an intrinsic with the
3587 return; // local non-generic is already a specific of used generic
3608 // At this point, there must be at least one generic interface.
3621 // Create a local copy of a previously use-associated generic so that
3624 GenericDetails generic;
3625 generic.CopyFrom(DEREF(localGeneric));
3628 localSymbol->name(), localSymbol->attrs(), std::move(generic))};
3653 // Create a local copy of the use-associated generic, then extend it
3654 // with the combined derived type &/or non-generic procedure.
3655 GenericDetails generic;
3656 generic.CopyFrom(*useGeneric);
3660 std::move(generic))};
3687 // Create a UseDetails symbol for this USE and add it to generic
3689 GenericDetails &generic, const SourceName &name, const Symbol &useSymbol) {
3692 generic.AddUse(newSymbol);
3805 if (auto *generic{symbol.detailsIf<GenericDetails>()}) {
3806 if (generic->derivedType()) {
3807 // If a generic interface has a derived type of the same
3809 // the generic must have the same accessibility.
3810 if (generic->derivedType()->attrs().test(Attr::PUBLIC)) {
3812 } else if (generic->derivedType()->attrs().test(Attr::PRIVATE)) {
3847 Say("A PROCEDURE statement is only allowed in a generic interface block"_err_en_US);
3893 // this generic interface. Resolve those names to symbols.
3895 Symbol &generic, bool isEndOfSpecificationPart) {
3896 auto &details{generic.get<GenericDetails>()};
3901 auto range{specificsForGenericProcs_.equal_range(&generic)};
3908 : FindInScope(generic.owner(), *name)};
3915 // not the specific procedure shadowed by a generic, because that specific
3943 "'%s' is not a procedure that can appear in a generic interface"_err_en_US;
3952 retain.emplace(&generic, std::make_pair(name, kind));
3957 // is saved in the generic's specifics, not its ultimate symbol,
3962 "Procedure '%s' is already specified in generic '%s'"_err_en_US,
3963 name->source, MakeOpName(generic.name()));
3966 "Procedure '%s' from module '%s' is already specified in generic '%s'"_err_en_US,
3968 MakeOpName(generic.name()));
3983 if (Symbol * generic{genericInfo_.top().symbol};
3984 generic && generic->has<GenericDetails>()) {
3985 ResolveSpecificsInGeneric(*generic, false);
3991 void InterfaceVisitor::CheckGenericProcedures(Symbol &generic) {
3992 ResolveSpecificsInGeneric(generic, true);
3993 auto &details{generic.get<GenericDetails>()};
3996 proc->name().begin() > generic.name().begin() ? proc->name()
3997 : generic.name(),
3998 "'%s' should not be the name of both a generic interface and a procedure unless it is a specific procedure of the generic"_warn_en_US,
3999 generic.name());
4004 generic.set(Symbol::Flag::Function);
4019 SayDerivedType(generic.name(),
4029 generic.name(),
4031 generic.name())}) {
4039 generic.set(Symbol::Flag::Function);
4041 generic.set(Symbol::Flag::Subroutine);
4484 if (auto *generic{entrySymbol->detailsIf<GenericDetails>()}) {
4485 if (auto *specific{generic->specific()}) {
4486 // Forward reference to ENTRY from a generic interface
4636 if (auto *generic{symbol->detailsIf<GenericDetails>()}) {
4637 symbol = generic->specific();
4705 generic{DEREF(FindSymbol(name)).detailsIf<GenericDetails>()}) {
4706 generic->clear_specific();
4771 // If the extant symbol is a generic, check its homonymous specific
4773 if (auto *generic{symbol.detailsIf<GenericDetails>()}) {
4774 return generic->specific() &&
4775 HandlePreviousCalls(name, *generic->specific(), subpFlag);
4901 // If name is a generic, return specific subprogram with the same name.
4912 // found generic, want specific procedure
4917 // Defining an interface in a generic of the same name which is
5459 // procedure pointer with same name as a generic
6193 // track specifics seen for the current generic to detect duplicates:
6196 for (const auto &[generic, bindingName] : genericBindings_) {
6197 if (generic != currGeneric) {
6198 currGeneric = generic;
6204 "Binding name '%s' was already specified for generic '%s'"_err_en_US,
6205 bindingName->source, generic->name())
6217 generic->get<GenericDetails>().AddSpecificProc(
6346 // look in ancestor types for a generic of the same name
6353 "Type bound generic procedure '%s' may not have the same name as a non-generic symbol inherited from an ancestor type"_err_en_US)
7082 auto *generic{ultimate ? ultimate->detailsIf<GenericDetails>() : nullptr};
7083 if (generic) {
7084 if (Symbol * genDT{generic->derivedType()}) {
7086 generic = nullptr;
7090 (generic && &ultimate->owner() == &outer)) {
7095 } else if (generic) {
7096 // forward ref to type with later homonymous generic
7098 generic->set_derivedType(*symbol);
8705 // or the result of an inquiry intrinsic function or generic procedure.
9156 // Create a local copy of a use associated generic so that
9165 // Extending an extant generic in the same scope
9169 // Host association of a generic is handled elsewhere
9173 // Create a new generic for this scope.
9835 for (const auto &generic : node.genericSpecs()) {
9836 if (const auto *name{std::get_if<parser::Name>(&generic->u)}) {
9838 // If this scope has both a generic interface and a contained
9839 // subprogram with the same name, create the generic's symbol
9843 CreateGeneric(*generic);