re: #18662 (review)
Reason is that SettingsValue is a return value of one of the methods of ArgsManager. Not sure why C++ doesn't require the struct layout for return values of methods when no object with such method is initialized. Though it does require the layout when an object with such method is instantiated... I can't change the way C++ works.
Complier error messages here are pretty unhelfpul, but this happens because of the ArgsManager destructor, not the method return value. Following change should fix:
diff --git a/src/util/settings.h b/src/util/settings.h
index bbb6abe2c09..1d03639fa26 100644
--- a/src/util/settings.h
+++ b/src/util/settings.h
@@ -9,7 +9,7 @@
#include <string>
#include <vector>
-#include <univalue.h> // For util::SettingsValue = UniValue
+class UniValue;
namespace util {
diff --git a/src/util/system.cpp b/src/util/system.cpp
index b0a538b5277..49a3ab447b9 100644
--- a/src/util/system.cpp
+++ b/src/util/system.cpp
@@ -231,6 +231,8 @@ ArgsManager::ArgsManager()
// nothing to do
}
+ArgsManager::~ArgsManager() {}
+
const std::set<std::string> ArgsManager::GetUnsuitableSectionOnlyArgs() const
{
std::set<std::string> unsuitables;
diff --git a/src/util/system.h b/src/util/system.h
index 3138522b5c8..96f51e6074a 100644
--- a/src/util/system.h
+++ b/src/util/system.h
@@ -192,6 +192,7 @@ protected:
public:
ArgsManager();
+ ~ArgsManager();
/**
* Select the network in use