From 993a0a8839f39096a997871b8f4ff33a8283e01a Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Tue, 5 Aug 2014 19:01:40 +0200 Subject: [PATCH] Fix error due to two consecutive implicit conversions Credits to Mat for finding the standard defect and explane it. --- src/blackcore/voice_vatlib.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/blackcore/voice_vatlib.cpp b/src/blackcore/voice_vatlib.cpp index 82893ebac..c6126facf 100644 --- a/src/blackcore/voice_vatlib.cpp +++ b/src/blackcore/voice_vatlib.cpp @@ -253,7 +253,12 @@ namespace BlackCore { QString result; - switch (m_micTestResult) + // Due to a standard defect, some compilers do not accept two consecutive implicit conversions. + // Hence calling load() here. + // References: + // http://stackoverflow.com/questions/25143860/implicit-convertion-from-class-to-enumeration-type-in-switch-conditional + // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3323.pdf + switch (m_micTestResult.load()) { case Cvatlib_Voice_Simple::agc_Ok: result = "The test went ok";