Skip to content

Commit

Permalink
Casey's accumulated nitpicks (microsoft#4945)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaseyCarter authored Sep 12, 2024
1 parent 6cb175d commit 73b5791
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 48 deletions.
2 changes: 0 additions & 2 deletions stl/inc/__msvc_formatter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ class basic_format_parse_context;
template <class _CharT>
concept _Format_supported_charT = _Is_any_of_v<_CharT, char, wchar_t>;

// Generic formatter definition, the deleted default constructor
// makes it "disabled" as per N4950 [format.formatter.spec]/5
_EXPORT_STD template <class _Ty, class _CharT = char>
struct formatter {
formatter() = delete;
Expand Down
32 changes: 14 additions & 18 deletions tests/libcxx/expected_results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ std/language.support/support.limits/support.limits.general/mdspan.version.compil
std/language.support/support.limits/support.limits.general/cstring.version.compile.pass.cpp FAIL

# Various bogosity (LLVM-D141004), warning C6011: Dereferencing NULL pointer
# Note: The :1 (ASAN) configuration doesn't run static analysis.
# Note: The :1 (ASan) configuration doesn't run static analysis.
std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp:0 FAIL
std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_values.pass.cpp:0 FAIL

Expand Down Expand Up @@ -224,7 +224,7 @@ std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_strong.pa
std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_weak.pass.cpp:1 SKIPPED
std/input.output/syncstream/osyncstream/thread/several_threads.pass.cpp:1 SKIPPED

# VSO-2164191 "[ASAN][STL] Interception breaks strtoll"
# VSO-2164191 "[ASan][STL] Interception breaks strtoll"
std/strings/string.conversions/stoll.pass.cpp:1 FAIL


Expand Down Expand Up @@ -285,7 +285,7 @@ std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp:0 FAIL
std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp:1 FAIL

# VSO-1271673 "static analyzer doesn't know about short-circuiting"
# Note: The :1 (ASAN) configuration doesn't run static analysis.
# Note: The :1 (ASan) configuration doesn't run static analysis.
std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort.pass.cpp:0 FAIL
std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp:0 FAIL

Expand Down Expand Up @@ -315,7 +315,7 @@ std/algorithms/robust_re_difference_type.compile.pass.cpp:1 FAIL

# DevCom-1638563 VSO-1457836: icky static analysis false positive
# Resolved wontfix, need to report again.
# Note: The :1 (ASAN) configuration doesn't run static analysis.
# Note: The :1 (ASan) configuration doesn't run static analysis.
std/language.support/support.coroutines/end.to.end/go.pass.cpp:0 FAIL

# DevCom-1638496 VSO-1462745: C1XX doesn't properly reject int <=> unsigned
Expand Down Expand Up @@ -462,7 +462,7 @@ std/input.output/syncstream/syncbuf/syncstream.syncbuf.members/emit.pass.cpp FAI

# *** VCRUNTIME BUGS ***
# DevCom-10373274 VSO-1824997 "vcruntime nothrow array operator new falls back on the wrong function"
# This passes for the :1 (ASAN) configuration, surprisingly.
# This passes for the :1 (ASan) configuration, surprisingly.
std/language.support/support.dynamic/new.delete/new.delete.array/new.size_nothrow.replace.indirect.pass.cpp:0 FAIL
std/language.support/support.dynamic/new.delete/new.delete.array/new.size_nothrow.replace.indirect.pass.cpp:2 FAIL

Expand Down Expand Up @@ -570,15 +570,17 @@ std/input.output/filesystems/class.path/range_concept_conformance.compile.pass.c
# This test is bogus according to the wording that was ultimately accepted for C++23.
std/strings/basic.string/string.capacity/resize_and_overwrite.pass.cpp FAIL

# contiguous_iterator requires to_address() which calls operator->(), but this bogus test uses an iterator that lacks operator->().
# libc++ speculatively implements the proposed resolution for LWG-4058.
std/iterators/iterator.requirements/iterator.concepts/iterator.concept.random.access/contiguous_iterator.compile.pass.cpp FAIL

# Bogus test expects to_address() to SFINAE away for int.
std/utilities/memory/pointer.conversion/to_address_without_pointer_traits.pass.cpp FAIL

# We disagree about whether various chrono types should be optimized, and the test is clearly wrong about vector<bool>::reference.
std/utilities/format/format.formatter/format.formatter.locking/enable_nonlocking_formatter_optimization.compile.pass.cpp FAIL

# `increasing_allocator` calls `std::allocator::deallocate` with the wrong size
std/containers/sequences/vector.bool/shrink_to_fit.pass.cpp FAIL
std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp FAIL


# *** LIKELY STL BUGS ***
# Not analyzed, likely STL bugs. Various assertions.
Expand Down Expand Up @@ -961,7 +963,7 @@ std/utilities/format/format.tuple/format.pass.cpp FAIL

# Not analyzed. Static analysis thinks that array indexing is out of bounds because it can't prove otherwise.
# warning C28020: The expression '_Param_(1)<1' is not true at this call.
# Note: The :1 (ASAN) configuration doesn't run static analysis.
# Note: The :1 (ASan) configuration doesn't run static analysis.
std/containers/views/mdspan/extents/ctor_default.pass.cpp:0 FAIL
std/containers/views/mdspan/extents/ctor_from_array.pass.cpp:0 FAIL
std/containers/views/mdspan/extents/ctor_from_integral.pass.cpp:0 FAIL
Expand All @@ -974,7 +976,7 @@ std/containers/views/mdspan/mdspan/ctor.dh_span.pass.cpp:0 FAIL

# Not analyzed. Apparent false positives from static analysis where it thinks `new (std::nothrow)` could return null, despite an assert().
# warning C28182: Dereferencing NULL pointer.
# Note: The :1 (ASAN) configuration doesn't run static analysis.
# Note: The :1 (ASan) configuration doesn't run static analysis.
std/language.support/support.dynamic/new.delete/new.delete.array/new.size_align_nothrow.pass.cpp:0 FAIL
std/language.support/support.dynamic/new.delete/new.delete.array/new.size_nothrow.pass.cpp:0 FAIL

Expand Down Expand Up @@ -1215,12 +1217,6 @@ std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.nonmembers/ostream.pa
# Not analyzed. static_assert(testComplexity()) is failing.
std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection_complexity.pass.cpp FAIL

# Not analyzed.
# MSVC constexpr error: failure was caused by unexpected deallocation count
# Clang assertion: _CrtIsValidHeapPointer(block)
std/containers/sequences/vector.bool/shrink_to_fit.pass.cpp FAIL
std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp FAIL

# Not analyzed.
# MSVC truncation warnings.
# Clang assertion: std::hermite(n, +inf) == inf
Expand All @@ -1233,7 +1229,7 @@ std/containers/views/views.span/span.cons/copy.pass.cpp FAIL
std/utilities/optional/optional.object/optional.object.ctor/gh_101960_internal_ctor.compile.pass.cpp FAIL


# *** XFAILs WHICH PASS ***
# *** XFAILS WHICH PASS ***
# These tests contain `// XFAIL: msvc` comments, which accurately describe runtime failures for x86 and x64.
# However, for ARM and ARM64, they successfully compile, then we don't run them.
# Our test harness properly handles the ambiguity of whether a FAIL line in this file means "fails to compile"
Expand All @@ -1244,7 +1240,7 @@ std/utilities/optional/optional.object/optional.object.ctor/gh_101960_internal_c
# In the meantime, because this is platform-dependent and we don't have a way to express that in this file,
# we need to mark these tests as SKIPPED.
# Finally, note that only :0 (MSVC) and :2 (Clang) configurations are mentioned here,
# because we don't run :1 (ASAN) for ARM and ARM64.
# because we don't run :1 (ASan) for ARM and ARM64.
std/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/ostream.pass.cpp:0 SKIPPED
std/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/ostream.pass.cpp:2 SKIPPED
std/time/time.clock/time.clock.system/sys_date.ostream.pass.cpp:0 SKIPPED
Expand Down
6 changes: 4 additions & 2 deletions tests/std/tests/GH_000431_lex_compare_memcmp_classify/env.lst
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@

RUNALL_INCLUDE ..\char8_t_matrix.lst
RUNALL_CROSSLIST
* PM_CL="" # Test manual vectorization
* PM_CL="/D_USE_STD_VECTOR_ALGORITHMS=0" # Test memcmp optimization
# Test manual vectorization:
* PM_CL=""
# Test memcmp optimization:
* PM_CL="/D_USE_STD_VECTOR_ALGORITHMS=0"
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ class ContiguousIterator {
public:
using value_type = int;
using difference_type = int;
using element_type = int;
using iterator_category = std::contiguous_iterator_tag;
int* operator->() const;
int& operator*() const;
int& operator[](int) const;

value_type* operator->() const;
value_type& operator*() const;
value_type& operator[](difference_type) const;
ContiguousIterator& operator++();
ContiguousIterator operator++(int);
ContiguousIterator& operator--();
ContiguousIterator operator--(int);
ContiguousIterator& operator+=(int);
ContiguousIterator& operator-=(int);
ContiguousIterator& operator+=(difference_type);
ContiguousIterator& operator-=(difference_type);
friend auto operator<=>(ContiguousIterator, ContiguousIterator) = default;
friend int operator-(ContiguousIterator, ContiguousIterator);
friend ContiguousIterator operator+(ContiguousIterator, int);
friend ContiguousIterator operator-(ContiguousIterator, int);
friend ContiguousIterator operator+(int, ContiguousIterator);
friend difference_type operator-(ContiguousIterator, ContiguousIterator);
friend ContiguousIterator operator+(ContiguousIterator, difference_type);
friend ContiguousIterator operator-(ContiguousIterator, difference_type);
friend ContiguousIterator operator+(difference_type, ContiguousIterator);
};

static_assert(std::contiguous_iterator<ContiguousIterator>);
Expand Down
2 changes: 1 addition & 1 deletion tests/std/tests/P1206R7_ranges_to_mappish/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ struct mappish_instantiator {
assert(c6.get_allocator().state == 13);
assert(ranges::is_permutation(c6, expected, any_pair_eq));
}
#endif
#endif // ^^^ no workaround ^^^
{
std::same_as<T> auto c7 = R{some_pairs} | ranges::to<C>(Alloc{13});
assert(c7.get_allocator().state == 13);
Expand Down
8 changes: 4 additions & 4 deletions tests/std/tests/P1206R7_ranges_to_misc/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ constexpr bool test_reservable() {
assert(r.cap_ == ranges::size(some_ints));
assert(r.reserved_ == ranges::size(some_ints));
}
#endif
#endif // ^^^ no workaround ^^^

return true;
}
Expand Down Expand Up @@ -100,7 +100,7 @@ constexpr bool test_common_constructible() {
assert(c1.last_ == ranges::end(some_ints));
assert(c1.args_ == 3);
}
#endif
#endif // ^^^ no workaround ^^^

// Verify that more than one argument can be passed after the range:
{
Expand All @@ -116,7 +116,7 @@ constexpr bool test_common_constructible() {
assert(c3.last_ == ranges::end(some_ints));
assert(c3.args_ == 4);
}
#endif
#endif // ^^^ no workaround ^^^

return true;
}
Expand Down Expand Up @@ -315,7 +315,7 @@ constexpr void test_lwg4016_per_kind() {
std::same_as<V> auto vec = std::views::empty<int> | ranges::to<V>(std::size_t{42}, std::allocator<int>{});
assert(ranges::equal(vec, std::views::repeat(0, 42)));
}
#endif
#endif // ^^^ no workaround ^^^
{
std::same_as<V> auto vec = ranges::to<V>(std::views::iota(0, 42), std::initializer_list<int>{-3, -2, -1});
assert(ranges::equal(vec, std::views::iota(-3, 42)));
Expand Down
2 changes: 1 addition & 1 deletion tests/std/tests/P1206R7_ranges_to_sequence/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ struct sequence_instantiator {
assert(c6.get_allocator().state == 13);
assert(ranges::equal(c6, meow));
}
#endif
#endif // ^^^ no workaround ^^^
{
std::same_as<T> auto c7 = R{meow} | ranges::to<C>(Alloc{13});
assert(c7.get_allocator().state == 13);
Expand Down
2 changes: 1 addition & 1 deletion tests/std/tests/P1206R7_ranges_to_settish/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ struct settish_instantiator {
assert(c6.get_allocator().state == 13);
assert(ranges::is_permutation(c6, expected));
}
#endif
#endif // ^^^ no workaround ^^^
{
std::same_as<T> auto c7 = R{some_ints} | ranges::to<C>(Alloc{13});
assert(c7.get_allocator().state == 13);
Expand Down
2 changes: 0 additions & 2 deletions tests/std/tests/P2136R3_invoke_r/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include <string>
#include <type_traits>

#include <is_permissive.hpp>

using namespace std;

constexpr int square(int n) {
Expand Down
4 changes: 2 additions & 2 deletions tests/std/tests/VSO_0000000_vector_algorithms/env.lst
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

RUNALL_INCLUDE ..\usual_matrix.lst
RUNALL_CROSSLIST
* PM_CL="" # Test default setting
* PM_CL="/D_USE_STD_VECTOR_ALGORITHMS=0" # Test escape hatch, see GH-1751
* PM_CL=""
* PM_CL="/D_USE_STD_VECTOR_ALGORITHMS=0"
4 changes: 2 additions & 2 deletions tests/std/tests/VSO_0000000_vector_algorithms_floats/env.lst
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ RUNALL_CROSSLIST
* PM_CL="/fp:precise"
* PM_CL="/fp:fast"
RUNALL_CROSSLIST
* PM_CL="" # Test default setting
* PM_CL="/D_USE_STD_VECTOR_ALGORITHMS=0" # Test escape hatch, see GH-1751
* PM_CL=""
* PM_CL="/D_USE_STD_VECTOR_ALGORITHMS=0"
6 changes: 3 additions & 3 deletions tools/format/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ execute_process(
if(clang_format_version MATCHES "clang-format version ([0-9]+\.[0-9]+\.[0-9]+)")
set(expected_version "18.1.8")
if(CMAKE_MATCH_1 VERSION_LESS expected_version)
message(FATAL_ERROR "Found clang-format ${CMAKE_MATCH_1}, older than expected ${expected_version}.")
message(FATAL_ERROR "Found clang-format: ${CLANG_FORMAT} (\"${CMAKE_MATCH_1}\", older than expected version \"${expected_version}\")")
elseif(CMAKE_MATCH_1 VERSION_EQUAL expected_version)
message(STATUS "Found clang-format ${CMAKE_MATCH_1}.")
message(STATUS "Found clang-format: ${CLANG_FORMAT} (found expected version \"${CMAKE_MATCH_1}\")")
elseif(CMAKE_MATCH_1 VERSION_GREATER expected_version)
message(WARNING "Found clang-format ${CMAKE_MATCH_1}, newer than expected ${expected_version}.")
message(WARNING "Found clang-format: ${CLANG_FORMAT} (\"${CMAKE_MATCH_1}\", newer than expected version \"${expected_version}\")")
endif()
else()
message(FATAL_ERROR "Unexpected `clang-format --version` output: '${clang_format_version}'")
Expand Down

0 comments on commit 73b5791

Please sign in to comment.