Skip to content

Commit 73b5791

Browse files
authored
Casey's accumulated nitpicks (#4945)
1 parent 6cb175d commit 73b5791

File tree

12 files changed

+42
-48
lines changed

12 files changed

+42
-48
lines changed

stl/inc/__msvc_formatter.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ class basic_format_parse_context;
129129
template <class _CharT>
130130
concept _Format_supported_charT = _Is_any_of_v<_CharT, char, wchar_t>;
131131

132-
// Generic formatter definition, the deleted default constructor
133-
// makes it "disabled" as per N4950 [format.formatter.spec]/5
134132
_EXPORT_STD template <class _Ty, class _CharT = char>
135133
struct formatter {
136134
formatter() = delete;

tests/libcxx/expected_results.txt

+14-18
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ std/language.support/support.limits/support.limits.general/mdspan.version.compil
130130
std/language.support/support.limits/support.limits.general/cstring.version.compile.pass.cpp FAIL
131131

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

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

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

230230

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

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

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

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

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

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

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

573-
# contiguous_iterator requires to_address() which calls operator->(), but this bogus test uses an iterator that lacks operator->().
573+
# libc++ speculatively implements the proposed resolution for LWG-4058.
574574
std/iterators/iterator.requirements/iterator.concepts/iterator.concept.random.access/contiguous_iterator.compile.pass.cpp FAIL
575-
576-
# Bogus test expects to_address() to SFINAE away for int.
577575
std/utilities/memory/pointer.conversion/to_address_without_pointer_traits.pass.cpp FAIL
578576

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

580+
# `increasing_allocator` calls `std::allocator::deallocate` with the wrong size
581+
std/containers/sequences/vector.bool/shrink_to_fit.pass.cpp FAIL
582+
std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp FAIL
583+
582584

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

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

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

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

1218-
# Not analyzed.
1219-
# MSVC constexpr error: failure was caused by unexpected deallocation count
1220-
# Clang assertion: _CrtIsValidHeapPointer(block)
1221-
std/containers/sequences/vector.bool/shrink_to_fit.pass.cpp FAIL
1222-
std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp FAIL
1223-
12241220
# Not analyzed.
12251221
# MSVC truncation warnings.
12261222
# Clang assertion: std::hermite(n, +inf) == inf
@@ -1233,7 +1229,7 @@ std/containers/views/views.span/span.cons/copy.pass.cpp FAIL
12331229
std/utilities/optional/optional.object/optional.object.ctor/gh_101960_internal_ctor.compile.pass.cpp FAIL
12341230

12351231

1236-
# *** XFAILs WHICH PASS ***
1232+
# *** XFAILS WHICH PASS ***
12371233
# These tests contain `// XFAIL: msvc` comments, which accurately describe runtime failures for x86 and x64.
12381234
# However, for ARM and ARM64, they successfully compile, then we don't run them.
12391235
# Our test harness properly handles the ambiguity of whether a FAIL line in this file means "fails to compile"
@@ -1244,7 +1240,7 @@ std/utilities/optional/optional.object/optional.object.ctor/gh_101960_internal_c
12441240
# In the meantime, because this is platform-dependent and we don't have a way to express that in this file,
12451241
# we need to mark these tests as SKIPPED.
12461242
# Finally, note that only :0 (MSVC) and :2 (Clang) configurations are mentioned here,
1247-
# because we don't run :1 (ASAN) for ARM and ARM64.
1243+
# because we don't run :1 (ASan) for ARM and ARM64.
12481244
std/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/ostream.pass.cpp:0 SKIPPED
12491245
std/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/ostream.pass.cpp:2 SKIPPED
12501246
std/time/time.clock/time.clock.system/sys_date.ostream.pass.cpp:0 SKIPPED

tests/std/tests/GH_000431_lex_compare_memcmp_classify/env.lst

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33

44
RUNALL_INCLUDE ..\char8_t_matrix.lst
55
RUNALL_CROSSLIST
6-
* PM_CL="" # Test manual vectorization
7-
* PM_CL="/D_USE_STD_VECTOR_ALGORITHMS=0" # Test memcmp optimization
6+
# Test manual vectorization:
7+
* PM_CL=""
8+
# Test memcmp optimization:
9+
* PM_CL="/D_USE_STD_VECTOR_ALGORITHMS=0"

tests/std/tests/GH_003663_cast_contiguous_iterator_difference_type/test.compile.pass.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ class ContiguousIterator {
88
public:
99
using value_type = int;
1010
using difference_type = int;
11-
using element_type = int;
1211
using iterator_category = std::contiguous_iterator_tag;
13-
int* operator->() const;
14-
int& operator*() const;
15-
int& operator[](int) const;
12+
13+
value_type* operator->() const;
14+
value_type& operator*() const;
15+
value_type& operator[](difference_type) const;
1616
ContiguousIterator& operator++();
1717
ContiguousIterator operator++(int);
1818
ContiguousIterator& operator--();
1919
ContiguousIterator operator--(int);
20-
ContiguousIterator& operator+=(int);
21-
ContiguousIterator& operator-=(int);
20+
ContiguousIterator& operator+=(difference_type);
21+
ContiguousIterator& operator-=(difference_type);
2222
friend auto operator<=>(ContiguousIterator, ContiguousIterator) = default;
23-
friend int operator-(ContiguousIterator, ContiguousIterator);
24-
friend ContiguousIterator operator+(ContiguousIterator, int);
25-
friend ContiguousIterator operator-(ContiguousIterator, int);
26-
friend ContiguousIterator operator+(int, ContiguousIterator);
23+
friend difference_type operator-(ContiguousIterator, ContiguousIterator);
24+
friend ContiguousIterator operator+(ContiguousIterator, difference_type);
25+
friend ContiguousIterator operator-(ContiguousIterator, difference_type);
26+
friend ContiguousIterator operator+(difference_type, ContiguousIterator);
2727
};
2828

2929
static_assert(std::contiguous_iterator<ContiguousIterator>);

tests/std/tests/P1206R7_ranges_to_mappish/test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ struct mappish_instantiator {
162162
assert(c6.get_allocator().state == 13);
163163
assert(ranges::is_permutation(c6, expected, any_pair_eq));
164164
}
165-
#endif
165+
#endif // ^^^ no workaround ^^^
166166
{
167167
std::same_as<T> auto c7 = R{some_pairs} | ranges::to<C>(Alloc{13});
168168
assert(c7.get_allocator().state == 13);

tests/std/tests/P1206R7_ranges_to_misc/test.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ constexpr bool test_reservable() {
6262
assert(r.cap_ == ranges::size(some_ints));
6363
assert(r.reserved_ == ranges::size(some_ints));
6464
}
65-
#endif
65+
#endif // ^^^ no workaround ^^^
6666

6767
return true;
6868
}
@@ -100,7 +100,7 @@ constexpr bool test_common_constructible() {
100100
assert(c1.last_ == ranges::end(some_ints));
101101
assert(c1.args_ == 3);
102102
}
103-
#endif
103+
#endif // ^^^ no workaround ^^^
104104

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

121121
return true;
122122
}
@@ -315,7 +315,7 @@ constexpr void test_lwg4016_per_kind() {
315315
std::same_as<V> auto vec = std::views::empty<int> | ranges::to<V>(std::size_t{42}, std::allocator<int>{});
316316
assert(ranges::equal(vec, std::views::repeat(0, 42)));
317317
}
318-
#endif
318+
#endif // ^^^ no workaround ^^^
319319
{
320320
std::same_as<V> auto vec = ranges::to<V>(std::views::iota(0, 42), std::initializer_list<int>{-3, -2, -1});
321321
assert(ranges::equal(vec, std::views::iota(-3, 42)));

tests/std/tests/P1206R7_ranges_to_sequence/test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ struct sequence_instantiator {
151151
assert(c6.get_allocator().state == 13);
152152
assert(ranges::equal(c6, meow));
153153
}
154-
#endif
154+
#endif // ^^^ no workaround ^^^
155155
{
156156
std::same_as<T> auto c7 = R{meow} | ranges::to<C>(Alloc{13});
157157
assert(c7.get_allocator().state == 13);

tests/std/tests/P1206R7_ranges_to_settish/test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ struct settish_instantiator {
156156
assert(c6.get_allocator().state == 13);
157157
assert(ranges::is_permutation(c6, expected));
158158
}
159-
#endif
159+
#endif // ^^^ no workaround ^^^
160160
{
161161
std::same_as<T> auto c7 = R{some_ints} | ranges::to<C>(Alloc{13});
162162
assert(c7.get_allocator().state == 13);

tests/std/tests/P2136R3_invoke_r/test.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#include <string>
77
#include <type_traits>
88

9-
#include <is_permissive.hpp>
10-
119
using namespace std;
1210

1311
constexpr int square(int n) {

tests/std/tests/VSO_0000000_vector_algorithms/env.lst

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
RUNALL_INCLUDE ..\usual_matrix.lst
55
RUNALL_CROSSLIST
6-
* PM_CL="" # Test default setting
7-
* PM_CL="/D_USE_STD_VECTOR_ALGORITHMS=0" # Test escape hatch, see GH-1751
6+
* PM_CL=""
7+
* PM_CL="/D_USE_STD_VECTOR_ALGORITHMS=0"

tests/std/tests/VSO_0000000_vector_algorithms_floats/env.lst

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ RUNALL_CROSSLIST
5353
* PM_CL="/fp:precise"
5454
* PM_CL="/fp:fast"
5555
RUNALL_CROSSLIST
56-
* PM_CL="" # Test default setting
57-
* PM_CL="/D_USE_STD_VECTOR_ALGORITHMS=0" # Test escape hatch, see GH-1751
56+
* PM_CL=""
57+
* PM_CL="/D_USE_STD_VECTOR_ALGORITHMS=0"

tools/format/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ execute_process(
2020
if(clang_format_version MATCHES "clang-format version ([0-9]+\.[0-9]+\.[0-9]+)")
2121
set(expected_version "18.1.8")
2222
if(CMAKE_MATCH_1 VERSION_LESS expected_version)
23-
message(FATAL_ERROR "Found clang-format ${CMAKE_MATCH_1}, older than expected ${expected_version}.")
23+
message(FATAL_ERROR "Found clang-format: ${CLANG_FORMAT} (\"${CMAKE_MATCH_1}\", older than expected version \"${expected_version}\")")
2424
elseif(CMAKE_MATCH_1 VERSION_EQUAL expected_version)
25-
message(STATUS "Found clang-format ${CMAKE_MATCH_1}.")
25+
message(STATUS "Found clang-format: ${CLANG_FORMAT} (found expected version \"${CMAKE_MATCH_1}\")")
2626
elseif(CMAKE_MATCH_1 VERSION_GREATER expected_version)
27-
message(WARNING "Found clang-format ${CMAKE_MATCH_1}, newer than expected ${expected_version}.")
27+
message(WARNING "Found clang-format: ${CLANG_FORMAT} (\"${CMAKE_MATCH_1}\", newer than expected version \"${expected_version}\")")
2828
endif()
2929
else()
3030
message(FATAL_ERROR "Unexpected `clang-format --version` output: '${clang_format_version}'")

0 commit comments

Comments
 (0)