diff --git a/flang/lib/evaluate/characteristics.cc b/flang/lib/evaluate/characteristics.cc index 284012affbae..c518da4b6f34 100644 --- a/flang/lib/evaluate/characteristics.cc +++ b/flang/lib/evaluate/characteristics.cc @@ -61,8 +61,8 @@ bool DummyProcedure::operator==(const DummyProcedure &that) const { std::ostream &DummyProcedure::Dump(std::ostream &o) const { attrs.Dump(o, EnumToString); - if (explicitProcedure.has_value()) { - explicitProcedure.value().Dump(o); + if (explicitProcedure) { + explicitProcedure->Dump(o); } return o; } @@ -98,5 +98,6 @@ std::ostream &Procedure::Dump(std::ostream &o) const { } return o << (sep == '(' ? "()" : ")"); } +DEFINE_DEFAULT_CONSTRUCTORS_AND_ASSIGNMENTS(DummyProcedure) } DEFINE_DELETER(Fortran::evaluate::characteristics::Procedure) diff --git a/flang/lib/evaluate/characteristics.h b/flang/lib/evaluate/characteristics.h index 14188a56f951..f4c7cc3c3591 100644 --- a/flang/lib/evaluate/characteristics.h +++ b/flang/lib/evaluate/characteristics.h @@ -53,7 +53,7 @@ struct DummyDataObject { // 15.3.2.3 struct DummyProcedure { ENUM_CLASS(Attr, Pointer, Optional) - DEFAULT_CONSTRUCTORS_AND_ASSIGNMENTS(DummyProcedure) + DECLARE_CONSTRUCTORS_AND_ASSIGNMENTS(DummyProcedure) std::unique_ptr> explicitProcedure; common::EnumSet attrs; bool operator==(const DummyProcedure &) const;