From 8f8992e4ee181f1efba3b8ab5eb680e425bf1b12 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Fri, 27 Mar 2020 21:29:01 +0200
Subject: libcamera: pipeline: ipu3: Fix compilation on gcc 5 and 6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Commit 5e7c5d64a67f ("libcamera: ipu3: Do not unconditionally queue
buffers to CIO2") introduced usage of the std::queue default constructor
by using copy-list-initialization from {}. The default constructor was
explicit in C++11, which was fixed retroactively with a defect report
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html).
gcc 5 and 6 are unfortunately affected, requiring explicit usage of the
constructor.

Fixes: 5e7c5d64a67f ("libcamera: ipu3: Do not unconditionally queue buffers to CIO2")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 src/libcamera/pipeline/ipu3/ipu3.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src')

diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index b490a801..1e114ca7 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -1532,7 +1532,8 @@ int CIO2Device::allocateBuffers()
 
 void CIO2Device::freeBuffers()
 {
-	availableBuffers_ = {};
+	/* The default std::queue constructor is explicit with gcc 5 and 6. */
+	availableBuffers_ = std::queue<FrameBuffer *>{};
 
 	buffers_.clear();
 
-- 
cgit v1.2.1