Skip to content

Commit cb43fe3

Browse files
authored
[libc++][NFC] Inline _LIBCPP_FALLTHROUGH() (#135001)
We have `[[fallthrough]]` available in all standards modes, so we can just inline it like other stanard attributes we use.
1 parent b656915 commit cb43fe3

File tree

5 files changed

+5
-8
lines changed

5 files changed

+5
-8
lines changed

libcxx/include/__config

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,9 +1124,6 @@ typedef __char32_t char32_t;
11241124
__attribute__((__format__(archetype, format_string_index, first_format_arg_index)))
11251125
# define _LIBCPP_PACKED __attribute__((__packed__))
11261126

1127-
// Use a function like macro to imply that it must be followed by a semicolon
1128-
# define _LIBCPP_FALLTHROUGH() [[fallthrough]]
1129-
11301127
# if __has_attribute(__no_sanitize__) && !defined(_LIBCPP_COMPILER_GCC)
11311128
# define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi")))
11321129
# else

libcxx/include/__functional/hash.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ struct __murmur2_or_cityhash<_Size, 32> {
6464
switch (__len) {
6565
case 3:
6666
__h ^= static_cast<_Size>(__data[2] << 16);
67-
_LIBCPP_FALLTHROUGH();
67+
[[__fallthrough__]];
6868
case 2:
6969
__h ^= static_cast<_Size>(__data[1] << 8);
70-
_LIBCPP_FALLTHROUGH();
70+
[[__fallthrough__]];
7171
case 1:
7272
__h ^= __data[0];
7373
__h *= __m;

libcxx/include/locale

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2419,7 +2419,7 @@ bool money_get<_CharT, _InputIterator>::__do_get(
24192419
return false;
24202420
}
24212421
}
2422-
_LIBCPP_FALLTHROUGH();
2422+
[[__fallthrough__]];
24232423
case money_base::none:
24242424
if (__p != 3) {
24252425
while (__b != __e && __ct.is(ctype_base::space, *__b))

libcxx/include/regex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3929,7 +3929,7 @@ _ForwardIterator basic_regex<_CharT, _Traits>::__parse_character_escape(
39293929
if (__hd == -1)
39303930
std::__throw_regex_error<regex_constants::error_escape>();
39313931
__sum = 16 * __sum + static_cast<unsigned>(__hd);
3932-
_LIBCPP_FALLTHROUGH();
3932+
[[__fallthrough__]];
39333933
case 'x':
39343934
++__first;
39353935
if (__first == __last)

libcxx/src/filesystem/path_parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct PathParser {
9090
if (TkEnd)
9191
return makeState(PS_InRootName, Start, TkEnd);
9292
}
93-
_LIBCPP_FALLTHROUGH();
93+
[[__fallthrough__]];
9494
case PS_InRootName: {
9595
PosPtr TkEnd = consumeAllSeparators(Start, End);
9696
if (TkEnd)

0 commit comments

Comments
 (0)