This revision was automatically updated to reflect the committed changes. Closed by commit rL345870: Use C++11 fallthrough attribute syntax when available and add a break (authored by rnk, committed by ). Herald added a subscriber: llvm-commits.
Changed prior to commit: https://reviews.llvm.org/D53985?vs=172175&id=172189#toc Repository: rL LLVM https://reviews.llvm.org/D53985 Files: libcxx/trunk/include/__config libcxxabi/trunk/src/demangle/ItaniumDemangle.h Index: libcxx/trunk/include/__config =================================================================== --- libcxx/trunk/include/__config +++ libcxx/trunk/include/__config @@ -1248,8 +1248,12 @@ # define _LIBCPP_DIAGNOSE_ERROR(...) #endif -#if __has_attribute(fallthough) || _GNUC_VER >= 700 // Use a function like macro to imply that it must be followed by a semicolon +#if __cplusplus > 201402L && __has_cpp_attribute(fallthrough) +# define _LIBCPP_FALLTHROUGH() [[fallthrough]] +#elif __has_cpp_attribute(clang::fallthrough) +# define _LIBCPP_FALLTHROUGH() [[clang::fallthrough]] +#elif __has_attribute(fallthough) || _GNUC_VER >= 700 # define _LIBCPP_FALLTHROUGH() __attribute__((__fallthrough__)) #else # define _LIBCPP_FALLTHROUGH() ((void)0) Index: libcxxabi/trunk/src/demangle/ItaniumDemangle.h =================================================================== --- libcxxabi/trunk/src/demangle/ItaniumDemangle.h +++ libcxxabi/trunk/src/demangle/ItaniumDemangle.h @@ -2812,6 +2812,7 @@ SoFar = make<ExpandedSpecialSubstitution>(SSK); if (!SoFar) return nullptr; + break; default: break; }
Index: libcxx/trunk/include/__config =================================================================== --- libcxx/trunk/include/__config +++ libcxx/trunk/include/__config @@ -1248,8 +1248,12 @@ # define _LIBCPP_DIAGNOSE_ERROR(...) #endif -#if __has_attribute(fallthough) || _GNUC_VER >= 700 // Use a function like macro to imply that it must be followed by a semicolon +#if __cplusplus > 201402L && __has_cpp_attribute(fallthrough) +# define _LIBCPP_FALLTHROUGH() [[fallthrough]] +#elif __has_cpp_attribute(clang::fallthrough) +# define _LIBCPP_FALLTHROUGH() [[clang::fallthrough]] +#elif __has_attribute(fallthough) || _GNUC_VER >= 700 # define _LIBCPP_FALLTHROUGH() __attribute__((__fallthrough__)) #else # define _LIBCPP_FALLTHROUGH() ((void)0) Index: libcxxabi/trunk/src/demangle/ItaniumDemangle.h =================================================================== --- libcxxabi/trunk/src/demangle/ItaniumDemangle.h +++ libcxxabi/trunk/src/demangle/ItaniumDemangle.h @@ -2812,6 +2812,7 @@ SoFar = make<ExpandedSpecialSubstitution>(SSK); if (!SoFar) return nullptr; + break; default: break; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits