Browse Source

fix implicit fallthrough in gcc 7

fixes #3700
Tobias Jungel 8 years ago
parent
commit
37e112f456
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/google/protobuf/stubs/port.h

+ 2 - 0
src/google/protobuf/stubs/port.h

@@ -243,6 +243,8 @@ static const uint64 kuint64max = GOOGLE_ULONGLONG(0xFFFFFFFFFFFFFFFF);
      __has_cpp_attribute(clang::fallthrough)
      __has_cpp_attribute(clang::fallthrough)
 #  define GOOGLE_FALLTHROUGH_INTENDED [[clang::fallthrough]]
 #  define GOOGLE_FALLTHROUGH_INTENDED [[clang::fallthrough]]
 # endif
 # endif
+#elif defined(__GNUC__) && __GNUC__ > 6
+# define GOOGLE_FALLTHROUGH_INTENDED [[gnu::fallthrough]]
 #endif
 #endif
 
 
 #ifndef GOOGLE_FALLTHROUGH_INTENDED
 #ifndef GOOGLE_FALLTHROUGH_INTENDED