diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
index 0e111ab72bce..2fca975f7512 100644
--- a/include/libcamera/controls.h
+++ b/include/libcamera/controls.h
@@ -170,8 +170,6 @@ private:
 		 std::size_t numElements, std::size_t elementSize);
 };
 
-static_assert(sizeof(ControlValue) == 16, "Invalid size of ControlValue class");
-
 class ControlId
 {
 public:
diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
index 4326174adf86..4615e71d7e3c 100644
--- a/src/libcamera/controls.cpp
+++ b/src/libcamera/controls.cpp
@@ -83,6 +83,8 @@ static constexpr size_t ControlValueSize[] = {
  * \brief Abstract type representing the value of a control
  */
 
+static_assert(sizeof(ControlValue) == 16, "Invalid size of ControlValue class");
+
 /**
  * \brief Construct an empty ControlValue.
  */
