From f22bd9dc4cc974b548a9c9f67abe03cb05cf54bf Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 13 Jun 2017 17:24:35 +0200 Subject: [PATCH] Clang: Fix warning in HighlightingMark::punctuationKind Actually mixing returns and not is not that well readable workflow. A other option would be to use if. Change-Id: I36f07adb77d50ddc6890b6292c7883a1b5f80f58 Reviewed-by: Thiago Macieira Reviewed-by: Ivan Donchevskii Reviewed-by: Nikolai Kosjar --- src/tools/clangbackend/ipcsource/highlightingmark.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/tools/clangbackend/ipcsource/highlightingmark.cpp b/src/tools/clangbackend/ipcsource/highlightingmark.cpp index 6dcf82c6623..2a648153aae 100644 --- a/src/tools/clangbackend/ipcsource/highlightingmark.cpp +++ b/src/tools/clangbackend/ipcsource/highlightingmark.cpp @@ -374,12 +374,16 @@ HighlightingType operatorKind(const Cursor &cursor) HighlightingType HighlightingMark::punctuationKind(const Cursor &cursor) { + HighlightingType highlightingType = HighlightingType::Invalid; + switch (cursor.kind()) { - case CXCursor_DeclRefExpr: return operatorKind(cursor); + case CXCursor_DeclRefExpr: highlightingType = operatorKind(cursor); break; case CXCursor_Constructor: - case CXCursor_CallExpr: collectOutputArguments(cursor); - default: return HighlightingType::Invalid; + case CXCursor_CallExpr: collectOutputArguments(cursor); break; + default: break; } + + return highlightingType; } static HighlightingType highlightingTypeForKeyword(CXTranslationUnit cxTranslationUnit,