diff --git a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake index 12420db331961..0facb0b9be0c1 100644 --- a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake +++ b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake @@ -179,8 +179,9 @@ function(_get_common_compile_options output_var flags) endif() list(APPEND compile_options "-Wconversion") list(APPEND compile_options "-Wno-sign-conversion") - # Silence this warning because _Complex is a part of C99. + list(APPEND compile_options "-Wdeprecated") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # Silence this warning because _Complex is a part of C99. list(APPEND compile_options "-fext-numeric-literals") else() list(APPEND compile_options "-Wno-c99-extensions") diff --git a/libc/src/__support/CPP/span.h b/libc/src/__support/CPP/span.h index e9e3dbf169ce0..a41c9b744e370 100644 --- a/libc/src/__support/CPP/span.h +++ b/libc/src/__support/CPP/span.h @@ -10,7 +10,7 @@ #include // For size_t -#include "array.h" // For array +#include "array.h" // For array #include "src/__support/macros/config.h" #include "type_traits.h" // For remove_cv_t, enable_if_t, is_same_v, is_const_v @@ -52,6 +52,8 @@ template class span { LIBC_INLINE constexpr span() : span_data(nullptr), span_size(0) {} + LIBC_INLINE constexpr span(const span &) = default; + LIBC_INLINE constexpr span(pointer first, size_type count) : span_data(first), span_size(count) {} diff --git a/libc/test/src/setjmp/CMakeLists.txt b/libc/test/src/setjmp/CMakeLists.txt index 049df89ba39a6..392230784bd99 100644 --- a/libc/test/src/setjmp/CMakeLists.txt +++ b/libc/test/src/setjmp/CMakeLists.txt @@ -11,6 +11,8 @@ add_libc_unittest( libc_setjmp_unittests SRCS setjmp_test.cpp + CXX_STANDARD + 20 DEPENDS libc.src.setjmp.longjmp libc.src.setjmp.setjmp diff --git a/libc/test/src/setjmp/setjmp_test.cpp b/libc/test/src/setjmp/setjmp_test.cpp index 9e5f74a1734b3..27113cd6e0631 100644 --- a/libc/test/src/setjmp/setjmp_test.cpp +++ b/libc/test/src/setjmp/setjmp_test.cpp @@ -27,7 +27,7 @@ TEST(LlvmLibcSetJmpTest, SetAndJumpBack) { // The first time setjmp is called, it should return 0. // Subsequent calls will return the value passed to jump_back below. if (LIBC_NAMESPACE::setjmp(buf) <= MAX_LOOP) { - ++n; + n = n + 1; jump_back(buf, n); } ASSERT_EQ(longjmp_called, n);