Skip to content

Commit 3fa1423

Browse files
authored
[libc++] Annotate generic_category/system_category as const (#78052)
This lets the compiler eliminate unused/duplicate calls to it.
1 parent 82afd9b commit 3fa1423

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcxx/include/__system_error/error_category.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ class _LIBCPP_HIDDEN __do_message : public error_category {
6767
string message(int __ev) const override;
6868
};
6969

70-
_LIBCPP_EXPORTED_FROM_ABI const error_category& generic_category() _NOEXCEPT;
71-
_LIBCPP_EXPORTED_FROM_ABI const error_category& system_category() _NOEXCEPT;
70+
__attribute__((__const__)) _LIBCPP_EXPORTED_FROM_ABI const error_category& generic_category() _NOEXCEPT;
71+
__attribute__((__const__)) _LIBCPP_EXPORTED_FROM_ABI const error_category& system_category() _NOEXCEPT;
7272

7373
_LIBCPP_END_NAMESPACE_STD
7474

0 commit comments

Comments
 (0)