Skip to content

Commit

Permalink
Merge pull request #1038 from marxin/fix-wimplicit-fallthrough
Browse files Browse the repository at this point in the history
Add [[gnu::fallthrough]] to cases which fall through.
  • Loading branch information
Andersbakken authored Aug 30, 2017
2 parents 93b0063 + 0c0942e commit 320317d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ClangIndexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ String ClangIndexer::addNamePermutations(const CXCursor &cursor, Location locati
// namespaces can include all namespaces in their symbolname
if (originalKind == CXCursor_Namespace)
break;
[[gnu::fallthrough]];
default:
cutoff = pos;
break;
Expand Down
1 change: 1 addition & 0 deletions src/IncludeFileJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ int IncludeFileJob::execute()
case CXCursor_TypedefDecl:
if (!sym.isDefinition())
break;
[[gnu::fallthrough]];
case CXCursor_FunctionDecl:
case CXCursor_FunctionTemplate: {
List<String> alternatives;
Expand Down
1 change: 1 addition & 0 deletions src/Project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1559,6 +1559,7 @@ Set<Symbol> Project::findTargets(const Symbol &symbol)
case CXCursor_StructDecl:
if (symbol.isDefinition() && !(symbol.flags & Symbol::TemplateSpecialization))
return ret;
[[gnu::fallthrough]];
case CXCursor_FunctionDecl:
case CXCursor_CXXMethod:
case CXCursor_Destructor:
Expand Down

0 comments on commit 320317d

Please sign in to comment.