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:
0diff --git a/src/util/settings.h b/src/util/settings.h
1index bbb6abe2c09..1d03639fa26 100644
2--- a/src/util/settings.h
3+++ b/src/util/settings.h
4@@ -9,7 +9,7 @@
5 #include <string>
6 #include <vector>
7
8-#include <univalue.h> // For util::SettingsValue = UniValue
9+class UniValue;
10
11 namespace util {
12
13diff --git a/src/util/system.cpp b/src/util/system.cpp
14index b0a538b5277..49a3ab447b9 100644
15--- a/src/util/system.cpp
16+++ b/src/util/system.cpp
17@@ -231,6 +231,8 @@ ArgsManager::ArgsManager()
18 // nothing to do
19 }
20
21+ArgsManager::~ArgsManager() {}
22+
23 const std::set<std::string> ArgsManager::GetUnsuitableSectionOnlyArgs() const
24 {
25 std::set<std::string> unsuitables;
26diff --git a/src/util/system.h b/src/util/system.h
27index 3138522b5c8..96f51e6074a 100644
28--- a/src/util/system.h
29+++ b/src/util/system.h
30@@ -192,6 +192,7 @@ protected:
31
32 public:
33 ArgsManager();
34+ ~ArgsManager();
35
36 /**
37 * Select the network in use