@@ -4646,23 +4646,23 @@ bool DeclarationVisitor::Pre(const parser::OldParameterStmt &x) {
46464646bool DeclarationVisitor::Pre (const parser::NamedConstantDef &x) {
46474647 auto &name{std::get<parser::NamedConstant>(x.t ).v };
46484648 auto &symbol{HandleAttributeStmt (Attr::PARAMETER, name)};
4649- if (!ConvertToObjectEntity (symbol) ||
4650- symbol.test (Symbol::Flag::CrayPointer) ||
4649+ ConvertToObjectEntity (symbol);
4650+ auto *details{symbol.detailsIf <ObjectEntityDetails>()};
4651+ if (!details || symbol.test (Symbol::Flag::CrayPointer) ||
46514652 symbol.test (Symbol::Flag::CrayPointee)) {
46524653 SayWithDecl (
46534654 name, symbol, " PARAMETER attribute not allowed on '%s'" _err_en_US);
46544655 return false ;
46554656 }
46564657 const auto &expr{std::get<parser::ConstantExpr>(x.t )};
4657- auto &details{symbol.get <ObjectEntityDetails>()};
4658- if (details.init () || symbol.test (Symbol::Flag::InDataStmt)) {
4658+ if (details->init () || symbol.test (Symbol::Flag::InDataStmt)) {
46594659 Say (name, " Named constant '%s' already has a value" _err_en_US);
46604660 }
46614661 if (inOldStyleParameterStmt_) {
46624662 // non-standard extension PARAMETER statement (no parentheses)
46634663 Walk (expr);
46644664 auto folded{EvaluateExpr (expr)};
4665- if (details. type ()) {
4665+ if (details-> type ()) {
46664666 SayWithDecl (name, symbol,
46674667 " Alternative style PARAMETER '%s' must not already have an explicit type" _err_en_US);
46684668 } else if (folded) {
@@ -4674,9 +4674,9 @@ bool DeclarationVisitor::Pre(const parser::NamedConstantDef &x) {
46744674 } else if (auto shape{ToArraySpec (
46754675 GetFoldingContext (), evaluate::GetShape (*folded))}) {
46764676 // The type of the named constant is assumed from the expression.
4677- details. set_type (*type);
4678- details. set_init (std::move (*folded));
4679- details. set_shape (std::move (*shape));
4677+ details-> set_type (*type);
4678+ details-> set_init (std::move (*folded));
4679+ details-> set_shape (std::move (*shape));
46804680 } else {
46814681 Say (at, " The expression must have constant shape" _err_en_US);
46824682 }
@@ -4693,7 +4693,7 @@ bool DeclarationVisitor::Pre(const parser::NamedConstantDef &x) {
46934693 Walk (expr);
46944694 if (auto converted{EvaluateNonPointerInitializer (
46954695 symbol, expr, expr.thing .value ().source )}) {
4696- details. set_init (std::move (*converted));
4696+ details-> set_init (std::move (*converted));
46974697 }
46984698 }
46994699 return false ;
0 commit comments