From eda8af2a699da594644517f9ff5d5cf38fa039d3 Mon Sep 17 00:00:00 2001
From: hjk <hjk121@nokiamail.com>
Date: Mon, 29 Sep 2014 15:50:30 +0200
Subject: [PATCH] Make QAccessible compile with -Werror

GCC was bailing out when attempting to merge this into the dev
branch due to the use of "potentially uninitialized values".

Change-Id: Id2fc4a123a4b180b9ab439429a0d20245c7ee41b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
---
 src/gui/accessible/qaccessible.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index d3afed604f7..f85b6d1aadb 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -1991,6 +1991,8 @@ QString QAccessibleTextInterface::textBeforeOffset(int offset, QAccessible::Text
     case QAccessible::NoBoundary:
         // return empty, this function currently only supports single lines, so there can be no line before
         return QString();
+    default:
+        Q_UNREACHABLE();
     }
 
     // keep behavior in sync with QTextCursor::movePosition()!
@@ -2063,6 +2065,8 @@ QString QAccessibleTextInterface::textAfterOffset(int offset, QAccessible::TextB
     case QAccessible::NoBoundary:
         // return empty, this function currently only supports single lines, so there can be no line after
         return QString();
+    default:
+        Q_UNREACHABLE();
     }
 
     // keep behavior in sync with QTextCursor::movePosition()!
@@ -2150,6 +2154,8 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
         *startOffset = 0;
         *endOffset = txt.length();
         return txt;
+    default:
+        Q_UNREACHABLE();
     }
 
     // keep behavior in sync with QTextCursor::movePosition()!
-- 
GitLab