Skip to content

Commit abf9c1a

Browse files
authored
[libc++] Switch a few attribute to use the C++11 syntax (#133293)
Using the C++11 attribute syntax makes it more strict where attributes can be applied, reducing the number of possible positions an attribute can appear in.
1 parent d66af9c commit abf9c1a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libcxx/include/__config

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,8 +1157,8 @@ typedef __char32_t char32_t;
11571157
# define _LIBCPP_USING_IF_EXISTS
11581158
# endif
11591159

1160-
# if __has_attribute(__no_destroy__)
1161-
# define _LIBCPP_NO_DESTROY __attribute__((__no_destroy__))
1160+
# if __has_cpp_attribute(_Clang::__no_destroy__)
1161+
# define _LIBCPP_NO_DESTROY [[_Clang::__no_destroy__]]
11621162
# else
11631163
# define _LIBCPP_NO_DESTROY
11641164
# endif
@@ -1188,14 +1188,14 @@ typedef __char32_t char32_t;
11881188
# define _LIBCPP_NO_SPECIALIZATIONS
11891189
# endif
11901190

1191-
# if __has_attribute(__standalone_debug__)
1192-
# define _LIBCPP_STANDALONE_DEBUG __attribute__((__standalone_debug__))
1191+
# if __has_cpp_attribute(_Clang::__standalone_debug__)
1192+
# define _LIBCPP_STANDALONE_DEBUG [[_Clang::__standalone_debug__]]
11931193
# else
11941194
# define _LIBCPP_STANDALONE_DEBUG
11951195
# endif
11961196

1197-
# if __has_attribute(__preferred_name__)
1198-
# define _LIBCPP_PREFERRED_NAME(x) __attribute__((__preferred_name__(x)))
1197+
# if __has_cpp_attribute(_Clang::__preferred_name__)
1198+
# define _LIBCPP_PREFERRED_NAME(x) [[_Clang::__preferred_name__(x)]]
11991199
# else
12001200
# define _LIBCPP_PREFERRED_NAME(x)
12011201
# endif

0 commit comments

Comments
 (0)