Skip to content

Commit f0d4811

Browse files
authored
[libc++] Add CI job for testing macOS C++03 (llvm#75355)
It's not that I have much love for C++03, but we should ensure that it works. Some recent changes broke this configuration because slightly older Clang versions don't support attribute syntax in C++03 mode.
1 parent 8d300e6 commit f0d4811

File tree

5 files changed

+38
-18
lines changed

5 files changed

+38
-18
lines changed

libcxx/include/deque

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -967,12 +967,18 @@ public:
967967
// For more details, see the "Using libc++" documentation page or
968968
// the documentation for __sanitizer_annotate_contiguous_container.
969969
_LIBCPP_HIDE_FROM_ABI void __annotate_double_ended_contiguous_container(
970-
[[__maybe_unused__]] const void* __beg,
971-
[[__maybe_unused__]] const void* __end,
972-
[[__maybe_unused__]] const void* __old_con_beg,
973-
[[__maybe_unused__]] const void* __old_con_end,
974-
[[__maybe_unused__]] const void* __new_con_beg,
975-
[[__maybe_unused__]] const void* __new_con_end) const {
970+
const void* __beg,
971+
const void* __end,
972+
const void* __old_con_beg,
973+
const void* __old_con_end,
974+
const void* __new_con_beg,
975+
const void* __new_con_end) const {
976+
(void)__beg;
977+
(void)__end;
978+
(void)__old_con_beg;
979+
(void)__old_con_end;
980+
(void)__new_con_beg;
981+
(void)__new_con_end;
976982
#ifndef _LIBCPP_HAS_NO_ASAN
977983
if (__beg != nullptr && __asan_annotate_container_with_allocator<_Allocator>::value)
978984
__sanitizer_annotate_double_ended_contiguous_container(
@@ -982,10 +988,14 @@ public:
982988

983989
_LIBCPP_HIDE_FROM_ABI
984990
void __annotate_from_to(
985-
[[__maybe_unused__]] size_type __beg,
986-
[[__maybe_unused__]] size_type __end,
987-
[[__maybe_unused__]] __asan_annotation_type __annotation_type,
988-
[[__maybe_unused__]] __asan_annotation_place __place) const _NOEXCEPT {
991+
size_type __beg,
992+
size_type __end,
993+
__asan_annotation_type __annotation_type,
994+
__asan_annotation_place __place) const _NOEXCEPT {
995+
(void)__beg;
996+
(void)__end;
997+
(void)__annotation_type;
998+
(void)__place;
989999
#ifndef _LIBCPP_HAS_NO_ASAN
9901000
// __beg - index of the first item to annotate
9911001
// __end - index behind the last item to annotate (so last item + 1)

libcxx/include/string

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,8 +1917,9 @@ private:
19171917
{return __is_long() ? __get_long_pointer() : __get_short_pointer();}
19181918

19191919
// The following functions are no-ops outside of AddressSanitizer mode.
1920-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __annotate_contiguous_container(
1921-
[[__maybe_unused__]] const void* __old_mid, [[__maybe_unused__]] const void* __new_mid) const {
1920+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __annotate_contiguous_container(const void* __old_mid, const void* __new_mid) const {
1921+
(void)__old_mid;
1922+
(void)__new_mid;
19221923
#if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN)
19231924
const void* __begin = data();
19241925
const void* __end = data() + capacity() + 1;

libcxx/include/vector

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -852,11 +852,15 @@ private:
852852
// the documentation for __sanitizer_annotate_contiguous_container.
853853

854854
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
855-
void __annotate_contiguous_container([[__maybe_unused__]] const void *__beg,
856-
[[__maybe_unused__]] const void *__end,
857-
[[__maybe_unused__]] const void *__old_mid,
858-
[[__maybe_unused__]] const void *__new_mid) const
859-
{
855+
void __annotate_contiguous_container(const void *__beg,
856+
const void *__end,
857+
const void *__old_mid,
858+
const void *__new_mid) const
859+
{
860+
(void)__beg;
861+
(void)__end;
862+
(void)__old_mid;
863+
(void)__new_mid;
860864
#ifndef _LIBCPP_HAS_NO_ASAN
861865
if (!__libcpp_is_constant_evaluated() && __beg != nullptr && __asan_annotate_container_with_allocator<_Allocator>::value)
862866
__sanitizer_annotate_contiguous_container(__beg, __end, __old_mid, __new_mid);

libcxx/test/support/assert_macros.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void test_log(const char* condition, const char* file, int line, const F& functo
5050
}
5151

5252
template <class Arg>
53-
[[noreturn]] void test_fail(const char* file, int line, const Arg& arg) {
53+
TEST_NORETURN void test_fail(const char* file, int line, const Arg& arg) {
5454
test_log("", file, line, arg);
5555
std::abort();
5656
}

libcxx/utils/ci/buildkite-pipeline.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ steps:
156156
<<: *mac_agent_any_arch
157157
<<: *common
158158

159+
- label: MacOS with C++03
160+
command: libcxx/utils/ci/run-buildbot generic-cxx03
161+
<<: *mac_agent_any_arch
162+
<<: *common
163+
159164
# Build with the configuration we use to generate libc++.dylib on Apple platforms
160165
- label: Apple system
161166
command: libcxx/utils/ci/run-buildbot apple-system

0 commit comments

Comments
 (0)