build: Add missing include headers (#5915)

diff --git a/source/enum_set.h b/source/enum_set.h
index a375138..340f5b9 100644
--- a/source/enum_set.h
+++ b/source/enum_set.h
@@ -12,11 +12,14 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include <stddef.h>
+
 #include <algorithm>
 #include <cassert>
 #include <cstdint>
 #include <functional>
 #include <initializer_list>
+#include <iterator>
 #include <limits>
 #include <type_traits>
 #include <vector>
diff --git a/source/opt/optimizer.cpp b/source/opt/optimizer.cpp
index 94b15c6..a41885c 100644
--- a/source/opt/optimizer.cpp
+++ b/source/opt/optimizer.cpp
@@ -18,6 +18,7 @@
 #include <charconv>
 #include <memory>
 #include <string>
+#include <system_error>
 #include <unordered_map>
 #include <utility>
 #include <vector>
diff --git a/source/val/function.h b/source/val/function.h
index c4cd5a4..d3dd639 100644
--- a/source/val/function.h
+++ b/source/val/function.h
@@ -20,6 +20,7 @@
 #include <map>
 #include <set>
 #include <string>
+#include <type_traits>
 #include <unordered_map>
 #include <unordered_set>
 #include <utility>