summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2022-01-25 22:23:53 +0100
committerSven Gothel <[email protected]>2022-01-25 22:23:53 +0100
commitb5b7716036ef67d5fb539623d09e349b38b19718 (patch)
treeff442103cc168e20e54d7e1d489423353037060e
parentc1a2184d180f874f548e4d42ac3e2cec1ac09ada (diff)
Fixes for clang++ 11.0.1-2
-rw-r--r--include/jau/ringbuffer.hpp6
-rw-r--r--test/test_lfringbuffer_a.hpp4
2 files changed, 7 insertions, 3 deletions
diff --git a/include/jau/ringbuffer.hpp b/include/jau/ringbuffer.hpp
index 590637b..47397eb 100644
--- a/include/jau/ringbuffer.hpp
+++ b/include/jau/ringbuffer.hpp
@@ -1026,7 +1026,11 @@ class ringbuffer {
* @see getMultiPCEnabled()
* @see setMultiPCEnabled()
*/
- constexpr void setMultiPCEnabled(const bool v) {
+ constexpr_non_literal_var void setMultiPCEnabled(const bool v) {
+ /**
+ * Using just 'constexpr_non_literal_var' because
+ * clang: 'unique_lock<std::mutex>' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors
+ */
if( multi_pc_enabled ) {
std::unique_lock<std::mutex> lockMultiRead(syncMultiRead, std::defer_lock); // same for *this instance!
std::unique_lock<std::mutex> lockMultiWrite(syncMultiWrite, std::defer_lock);
diff --git a/test/test_lfringbuffer_a.hpp b/test/test_lfringbuffer_a.hpp
index 2815ad7..4c88e8c 100644
--- a/test/test_lfringbuffer_a.hpp
+++ b/test/test_lfringbuffer_a.hpp
@@ -558,7 +558,7 @@ class TestRingbuffer_A {
* Empty [RW][][ ][ ][ ][ ][ ][ ][ ][ ][ ] ; start
* Empty [ ][ ][ ][RW][ ][ ][ ][ ][ ][ ][ ]
*/
- Value_type dummy;
+ Value_type dummy = getDefault<Value_type>();
rb.put(dummy);
rb.put(dummy);
rb.put(dummy);
@@ -593,7 +593,7 @@ class TestRingbuffer_A {
* Empty [RW][][ ][ ][ ][ ][ ][ ][ ][ ][ ] ; start
* Avail [ ][ ][R][.][W][ ][ ][ ][ ][ ][ ] ; W > R
*/
- Value_type dummy;
+ Value_type dummy = getDefault<Value_type>();
rb.put(dummy); // r idx 0 -> 1
rb.put(dummy);
rb.put(dummy);