From 81375259aac5bfdbc0af463c35f3a6934e8a5270 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 26 Oct 2023 22:29:12 +0100 Subject: [PATCH] [bot][ubuntu] Generate current state of CWhy prompts (#42) Co-authored-by: github-actions --- .../ubuntu/clang++-17/missing-hash.cpp | 231 +++++++++--------- .../clang++-17/missing-ostream-operator.cpp | 128 +++++----- ...ion-failure-transform-missing-argument.cpp | 66 ++--- .../ubuntu/clang++-17/push-back-pointer.cpp | 54 ++-- .../ubuntu/clang++-17/reverse-iterator.cpp | 80 +++--- .../ubuntu/clang++-17/template-recursion.cpp | 42 +++- 6 files changed, 322 insertions(+), 279 deletions(-) diff --git a/tests/.regression/ubuntu/clang++-17/missing-hash.cpp b/tests/.regression/ubuntu/clang++-17/missing-hash.cpp index 3982671..2dd9c90 100644 --- a/tests/.regression/ubuntu/clang++-17/missing-hash.cpp +++ b/tests/.regression/ubuntu/clang++-17/missing-hash.cpp @@ -22,102 +22,102 @@ File `/home/runner/work/cwhy/cwhy/tests/c++/missing-hash.cpp`: 53 for (auto* neighbor : n->neighbors) { ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unordered_set.h`: -``` - 93 template, - 95 typename _Pred = equal_to<_Value>, - 96 typename _Alloc = allocator<_Value>> - 97 class unordered_set - 98 { - 99 typedef __uset_hashtable<_Value, _Hash, _Pred, _Alloc> _Hashtable; -100 _Hashtable _M_h; -101 -102 public: -103 // typedefs: +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unordered_set.h`: +``` +100 template, +102 typename _Pred = equal_to<_Value>, +103 typename _Alloc = allocator<_Value>> +104 class unordered_set +105 { +106 typedef __uset_hashtable<_Value, _Hash, _Pred, _Alloc> _Hashtable; +107 _Hashtable _M_h; +108 +109 public: +110 // typedefs: ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unordered_set.h`: -``` -129 using insert_return_type = typename _Hashtable::insert_return_type; -130 #endif -131 -132 // construct/destroy/copy -133 -134 /// Default constructor. -135 unordered_set() = default; -136 -137 /** -138 * @brief Default constructor creates no elements. +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unordered_set.h`: +``` +136 using insert_return_type = typename _Hashtable::insert_return_type; +137 #endif +138 +139 // construct/destroy/copy +140 +141 /// Default constructor. +142 unordered_set() = default; +143 +144 /** +145 * @brief Default constructor creates no elements. ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unordered_set.h`: -``` -372 * -373 * Insertion requires amortized constant time. -374 */ -375 template -376 std::pair -377 emplace(_Args&&... __args) -378 { return _M_h.emplace(std::forward<_Args>(__args)...); } -379 -380 /** -381 * @brief Attempts to insert an element into the %unordered_set. +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unordered_set.h`: +``` +379 * +380 * Insertion requires amortized constant time. +381 */ +382 template +383 std::pair +384 emplace(_Args&&... __args) +385 { return _M_h.emplace(std::forward<_Args>(__args)...); } +386 +387 /** +388 * @brief Attempts to insert an element into the %unordered_set. ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable.h`: -``` -176 * - __detail::_Equality -177 */ -178 template -182 class _Hashtable -183 : public __detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, -184 _Hash, _RangeHash, _Unused, _Traits>, -185 public __detail::_Map_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, -186 _Hash, _RangeHash, _Unused, +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h`: +``` +175 * - __detail::_Equality +176 */ +177 template +181 class _Hashtable +182 : public __detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, +183 _Hash, _RangeHash, _Unused, _Traits>, +184 public __detail::_Map_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, +185 _Hash, _RangeHash, _Unused, ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable.h`: -``` -525 size_type __bkt_count_hint, -526 const _Hash&, const _Equal&, const allocator_type&, -527 false_type __uks); -528 -529 public: -530 // Constructor, destructor, assignment, swap -531 _Hashtable() = default; -532 -533 _Hashtable(const _Hashtable&); +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h`: +``` +524 size_type __bkt_count_hint, +525 const _Hash&, const _Equal&, const allocator_type&, +526 false_type __uks); +527 +528 public: +529 // Constructor, destructor, assignment, swap +530 _Hashtable() = default; +531 +532 _Hashtable(const _Hashtable&); ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable.h`: -``` -945 public: -946 // Emplace -947 template -948 __ireturn_type -949 emplace(_Args&&... __args) -950 { return _M_emplace(__unique_keys{}, std::forward<_Args>(__args)...); } -951 -952 template -953 iterator +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h`: +``` +956 public: +957 // Emplace +958 template +959 __ireturn_type +960 emplace(_Args&&... __args) +961 { return _M_emplace(__unique_keys{}, std::forward<_Args>(__args)...); } +962 +963 template +964 iterator ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable.h`: -``` -2067 for (auto __it = begin(); __it != end(); ++__it) -2068 if (this->_M_key_equals(__k, *__it._M_cur)) -2069 // There is already an equivalent node, no insertion -2070 return { __it, false }; -2071 } -2072 -2073 __hash_code __code = this->_M_hash_code(__k); -2074 size_type __bkt = _M_bucket_index(__code); -2075 if (size() > __small_size_threshold()) -2076 if (__node_ptr __p = _M_find_node(__bkt, __k, __code)) +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h`: +``` +2076 for (auto __it = begin(); __it != end(); ++__it) +2077 if (this->_M_key_equals(__k, *__it._M_cur)) +2078 // There is already an equivalent node, no insertion +2079 return { __it, false }; +2080 } +2081 +2082 __hash_code __code = this->_M_hash_code(__k); +2083 size_type __bkt = _M_bucket_index(__code); +2084 if (size() > __small_size_threshold()) +2085 if (__node_ptr __p = _M_find_node(__bkt, __k, __code)) ``` @@ -126,56 +126,55 @@ This is my error: /home/runner/work/cwhy/cwhy/tests/c++/missing-hash.cpp:43:45: error: call to implicitly-deleted default constructor of 'std::unordered_set>' 43 | std::unordered_set> visited; | ^ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unordered_set.h:135:7: note: explicitly defaulted function was implicitly deleted here - 135 | unordered_set() = default; +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unordered_set.h:142:7: note: explicitly defaulted function was implicitly deleted here + 142 | unordered_set() = default; | ^ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unordered_set.h:100:18: note: default constructor of 'unordered_set>' is implicitly deleted because field '_M_h' has a deleted default constructor - 100 | _Hashtable _M_h; +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unordered_set.h:107:18: note: default constructor of 'unordered_set>' is implicitly deleted because field '_M_h' has a deleted default constructor + 107 | _Hashtable _M_h; | ^ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable.h:531:7: note: explicitly defaulted function was implicitly deleted here - 531 | _Hashtable() = default; +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h:530:7: note: explicitly defaulted function was implicitly deleted here + 530 | _Hashtable() = default; | ^ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable.h:183:7: note: default constructor of '_Hashtable, std::pair, std::allocator>, std::__detail::_Identity, std::equal_to>, std::hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits>' is implicitly deleted because base class '__detail::_Hashtable_base, pair, _Identity, equal_to>, hash>, _Mod_range_hashing, _Default_ranged_hash, _Hashtable_traits>' has a deleted default constructor - 183 | : public __detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h:182:7: note: default constructor of '_Hashtable, std::pair, std::allocator>, std::__detail::_Identity, std::equal_to>, std::hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits>' is implicitly deleted because base class '__detail::_Hashtable_base, pair, _Identity, equal_to>, hash>, _Mod_range_hashing, _Default_ranged_hash, _Hashtable_traits>' has a deleted default constructor + 182 | : public __detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, | ^ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable_policy.h:1674:7: note: explicitly defaulted function was implicitly deleted here - 1674 | _Hashtable_base() = default; +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:1710:7: note: explicitly defaulted function was implicitly deleted here + 1710 | _Hashtable_base() = default; | ^ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable_policy.h:1632:7: note: default constructor of '_Hashtable_base, std::pair, std::__detail::_Identity, std::equal_to>, std::hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits>' is implicitly deleted because base class '_Hash_code_base, pair, _Identity, hash>, _Mod_range_hashing, _Default_ranged_hash, _Hashtable_traits::__hash_cached::value>' has a deleted default constructor - 1632 | : public _Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:1668:7: note: default constructor of '_Hashtable_base, std::pair, std::__detail::_Identity, std::equal_to>, std::hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits>' is implicitly deleted because base class '_Hash_code_base, pair, _Identity, hash>, _Mod_range_hashing, _Default_ranged_hash, _Hashtable_traits::__hash_cached::value>' has a deleted default constructor + 1668 | : public _Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, | ^ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable_policy.h:1261:7: note: explicitly defaulted function was implicitly deleted here - 1261 | _Hash_code_base() = default; +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:1297:7: note: explicitly defaulted function was implicitly deleted here + 1297 | _Hash_code_base() = default; | ^ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable_policy.h:1240:7: note: default constructor of '_Hash_code_base, std::pair, std::__detail::_Identity, std::hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>' is implicitly deleted because base class '_Hashtable_ebo_helper<1, hash>>' has a deleted destructor - 1240 | : private _Hashtable_ebo_helper<1, _Hash> +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:1276:7: note: default constructor of '_Hash_code_base, std::pair, std::__detail::_Identity, std::hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>' is implicitly deleted because base class '_Hashtable_ebo_helper<1, hash>>' has a deleted destructor + 1276 | : private _Hashtable_ebo_helper<1, _Hash> [...] -In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/functional:61: -In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/unordered_map:46: -In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable.h:35: -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable_policy.h:1268:16: error: static assertion failed due to requirement 'std::__is_invocable> &, const std::pair &>{}': hash function must be invocable with an argument of key type - 1268 | static_assert(__is_invocable{}, +In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h:35: +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:1304:16: error: static assertion failed due to requirement 'std::__is_invocable> &, const std::pair &>{}': hash function must be invocable with an argument of key type + 1304 | static_assert(__is_invocable{}, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable.h:2073:29: note: in instantiation of member function 'std::__detail::_Hash_code_base, std::pair, std::__detail::_Identity, std::hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::_M_hash_code' requested here - 2073 | __hash_code __code = this->_M_hash_code(__k); +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h:2082:29: note: in instantiation of member function 'std::__detail::_Hash_code_base, std::pair, std::__detail::_Identity, std::hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::_M_hash_code' requested here + 2082 | __hash_code __code = this->_M_hash_code(__k); | ^ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable.h:950:11: note: in instantiation of function template specialization 'std::_Hashtable, std::pair, std::allocator>, std::__detail::_Identity, std::equal_to>, std::hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits>::_M_emplace &>' requested here - 950 | { return _M_emplace(__unique_keys{}, std::forward<_Args>(__args)...); } +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h:961:11: note: in instantiation of function template specialization 'std::_Hashtable, std::pair, std::allocator>, std::__detail::_Identity, std::equal_to>, std::hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits>::_M_emplace &>' requested here + 961 | { return _M_emplace(__unique_keys{}, std::forward<_Args>(__args)...); } | ^ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unordered_set.h:378:16: note: in instantiation of function template specialization 'std::_Hashtable, std::pair, std::allocator>, std::__detail::_Identity, std::equal_to>, std::hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits>::emplace &>' requested here - 378 | { return _M_h.emplace(std::forward<_Args>(__args)...); } +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unordered_set.h:385:16: note: in instantiation of function template specialization 'std::_Hashtable, std::pair, std::allocator>, std::__detail::_Identity, std::equal_to>, std::hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits>::emplace &>' requested here + 385 | { return _M_h.emplace(std::forward<_Args>(__args)...); } | ^ /home/runner/work/cwhy/cwhy/tests/c++/missing-hash.cpp:50:44: note: in instantiation of function template specialization 'std::unordered_set>::emplace &>' requested here 50 | const auto [_, inserted] = visited.emplace(n->position); | ^ In file included from /home/runner/work/cwhy/cwhy/tests/c++/missing-hash.cpp:31: -In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/functional:61: -In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/unordered_map:46: -In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable.h:35: -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable_policy.h:1270:9: error: type 'const std::hash>' does not provide a call operator - 1270 | return _M_hash()(__k); +In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/functional:63: +In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/unordered_map:41: +In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unordered_map.h:33: +In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h:35: +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:1306:9: error: type 'const std::hash>' does not provide a call operator + 1306 | return _M_hash()(__k); | ^~~~~~~~~ 3 errors generated. ``` diff --git a/tests/.regression/ubuntu/clang++-17/missing-ostream-operator.cpp b/tests/.regression/ubuntu/clang++-17/missing-ostream-operator.cpp index 89270aa..a6abb7f 100644 --- a/tests/.regression/ubuntu/clang++-17/missing-ostream-operator.cpp +++ b/tests/.regression/ubuntu/clang++-17/missing-ostream-operator.cpp @@ -14,19 +14,33 @@ File `/home/runner/work/cwhy/cwhy/tests/c++/missing-ostream-operator.cpp`: 31 } ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/system_error`: +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/cstddef`: ``` -328 /** Write a std::error_code to an ostream. -329 * -330 * @relates error_code -331 * @since C++11 -332 */ -333 template -334 basic_ostream<_CharT, _Traits>& -335 operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) -336 { return (__os << __e.category().name() << ':' << __e.value()); } -337 -338 /** Class error_condition +118 template +119 using __byte_op_t = typename __byte_operand<_IntegerType>::__type; +120 +121 template +122 [[__gnu__::__always_inline__]] +123 constexpr __byte_op_t<_IntegerType> +124 operator<<(byte __b, _IntegerType __shift) noexcept +125 { return (byte)(unsigned char)((unsigned)__b << __shift); } +126 +127 template +``` + +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/system_error`: +``` +332 /** Write a std::error_code to an ostream. +333 * +334 * @relates error_code +335 * @since C++11 +336 */ +337 template +338 basic_ostream<_CharT, _Traits>& +339 operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) +340 { return (__os << __e.category().name() << ':' << __e.value()); } +341 +342 /** Class error_condition ``` @@ -35,76 +49,76 @@ This is my error: /home/runner/work/cwhy/cwhy/tests/c++/missing-ostream-operator.cpp:30:15: error: invalid operands to binary expression ('ostream' (aka 'basic_ostream') and 'Cat') 30 | std::cout << cat << std::endl; | ~~~~~~~~~ ^ ~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/system_error:335:5: note: candidate function template not viable: no known conversion from 'Cat' to 'const error_code' for 2nd argument - 335 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/cstddef:124:5: note: candidate function template not viable: no known conversion from 'ostream' (aka 'basic_ostream') to 'byte' for 1st argument + 124 | operator<<(byte __b, _IntegerType __shift) noexcept + | ^ ~~~~~~~~ +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/system_error:339:5: note: candidate function template not viable: no known conversion from 'Cat' to 'const error_code' for 2nd argument + 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^ ~~~~~~~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:517:5: note: candidate function template not viable: no known conversion from 'Cat' to 'char' for 2nd argument - 517 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:564:5: note: candidate function template not viable: no known conversion from 'Cat' to 'char' for 2nd argument + 564 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^ ~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:523:5: note: candidate function template not viable: no known conversion from 'Cat' to 'char' for 2nd argument - 523 | operator<<(basic_ostream& __out, char __c) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:570:5: note: candidate function template not viable: no known conversion from 'Cat' to 'char' for 2nd argument + 570 | operator<<(basic_ostream& __out, char __c) | ^ ~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:534:5: note: candidate function template not viable: no known conversion from 'Cat' to 'signed char' for 2nd argument - 534 | operator<<(basic_ostream& __out, signed char __c) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:581:5: note: candidate function template not viable: no known conversion from 'Cat' to 'signed char' for 2nd argument + 581 | operator<<(basic_ostream& __out, signed char __c) | ^ ~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:539:5: note: candidate function template not viable: no known conversion from 'Cat' to 'unsigned char' for 2nd argument - 539 | operator<<(basic_ostream& __out, unsigned char __c) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:586:5: note: candidate function template not viable: no known conversion from 'Cat' to 'unsigned char' for 2nd argument + 586 | operator<<(basic_ostream& __out, unsigned char __c) | ^ ~~~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:615:5: note: candidate function template not viable: no known conversion from 'Cat' to 'const char *' for 2nd argument - 615 | operator<<(basic_ostream& __out, const char* __s) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:662:5: note: candidate function template not viable: no known conversion from 'Cat' to 'const char *' for 2nd argument + 662 | operator<<(basic_ostream& __out, const char* __s) | ^ ~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:628:5: note: candidate function template not viable: no known conversion from 'Cat' to 'const signed char *' for 2nd argument - 628 | operator<<(basic_ostream& __out, const signed char* __s) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:675:5: note: candidate function template not viable: no known conversion from 'Cat' to 'const signed char *' for 2nd argument + 675 | operator<<(basic_ostream& __out, const signed char* __s) | ^ ~~~~~~~~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:633:5: note: candidate function template not viable: no known conversion from 'Cat' to 'const unsigned char *' for 2nd argument - 633 | operator<<(basic_ostream& __out, const unsigned char* __s) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:680:5: note: candidate function template not viable: no known conversion from 'Cat' to 'const unsigned char *' for 2nd argument + 680 | operator<<(basic_ostream& __out, const unsigned char* __s) | ^ ~~~~~~~~~~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/ostream.tcc:307:5: note: candidate function template not viable: no known conversion from 'Cat' to 'const char *' for 2nd argument +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/ostream.tcc:307:5: note: candidate function template not viable: no known conversion from 'Cat' to 'const char *' for 2nd argument 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^ ~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:507:5: note: candidate template ignored: deduced conflicting types for parameter '_CharT' ('char' vs. 'Cat') - 507 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) - | ^ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/string_view:672:5: note: candidate template ignored: could not match 'basic_string_view<_CharT, _Traits>' against 'Cat' - 672 | operator<<(basic_ostream<_CharT, _Traits>& __os, +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:554:5: note: candidate template ignored: deduced conflicting types for parameter '_CharT' ('char' vs. 'Cat') + 554 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^ [...] - 178 | operator<<(short __n); + 180 | operator<<(short __n); | ^ ~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:181:7: note: candidate function not viable: no known conversion from 'Cat' to 'unsigned short' for 1st argument - 181 | operator<<(unsigned short __n) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:183:7: note: candidate function not viable: no known conversion from 'Cat' to 'unsigned short' for 1st argument + 183 | operator<<(unsigned short __n) | ^ ~~~~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:189:7: note: candidate function not viable: no known conversion from 'Cat' to 'int' for 1st argument - 189 | operator<<(int __n); +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:191:7: note: candidate function not viable: no known conversion from 'Cat' to 'int' for 1st argument + 191 | operator<<(int __n); | ^ ~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:192:7: note: candidate function not viable: no known conversion from 'Cat' to 'unsigned int' for 1st argument - 192 | operator<<(unsigned int __n) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:194:7: note: candidate function not viable: no known conversion from 'Cat' to 'unsigned int' for 1st argument + 194 | operator<<(unsigned int __n) | ^ ~~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:201:7: note: candidate function not viable: no known conversion from 'Cat' to 'long long' for 1st argument - 201 | operator<<(long long __n) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:203:7: note: candidate function not viable: no known conversion from 'Cat' to 'long long' for 1st argument + 203 | operator<<(long long __n) | ^ ~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:205:7: note: candidate function not viable: no known conversion from 'Cat' to 'unsigned long long' for 1st argument - 205 | operator<<(unsigned long long __n) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:207:7: note: candidate function not viable: no known conversion from 'Cat' to 'unsigned long long' for 1st argument + 207 | operator<<(unsigned long long __n) | ^ ~~~~~~~~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:220:7: note: candidate function not viable: no known conversion from 'Cat' to 'double' for 1st argument - 220 | operator<<(double __f) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:222:7: note: candidate function not viable: no known conversion from 'Cat' to 'double' for 1st argument + 222 | operator<<(double __f) | ^ ~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:224:7: note: candidate function not viable: no known conversion from 'Cat' to 'float' for 1st argument - 224 | operator<<(float __f) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:226:7: note: candidate function not viable: no known conversion from 'Cat' to 'float' for 1st argument + 226 | operator<<(float __f) | ^ ~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:232:7: note: candidate function not viable: no known conversion from 'Cat' to 'long double' for 1st argument - 232 | operator<<(long double __f) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:234:7: note: candidate function not viable: no known conversion from 'Cat' to 'long double' for 1st argument + 234 | operator<<(long double __f) | ^ ~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:245:7: note: candidate function not viable: no known conversion from 'Cat' to 'const void *' for 1st argument; take the address of the argument with & - 245 | operator<<(const void* __p) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:292:7: note: candidate function not viable: no known conversion from 'Cat' to 'const void *' for 1st argument; take the address of the argument with & + 292 | operator<<(const void* __p) | ^ ~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:250:7: note: candidate function not viable: no known conversion from 'Cat' to 'nullptr_t' (aka 'std::nullptr_t') for 1st argument - 250 | operator<<(nullptr_t) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:297:7: note: candidate function not viable: no known conversion from 'Cat' to 'nullptr_t' (aka 'std::nullptr_t') for 1st argument + 297 | operator<<(nullptr_t) | ^ ~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ostream:283:7: note: candidate function not viable: no known conversion from 'Cat' to '__streambuf_type *' (aka 'basic_streambuf> *') for 1st argument - 283 | operator<<(__streambuf_type* __sb); +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ostream:330:7: note: candidate function not viable: no known conversion from 'Cat' to '__streambuf_type *' (aka 'basic_streambuf> *') for 1st argument + 330 | operator<<(__streambuf_type* __sb); | ^ ~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ``` diff --git a/tests/.regression/ubuntu/clang++-17/overload-resolution-failure-transform-missing-argument.cpp b/tests/.regression/ubuntu/clang++-17/overload-resolution-failure-transform-missing-argument.cpp index df2d826..c87e561 100644 --- a/tests/.regression/ubuntu/clang++-17/overload-resolution-failure-transform-missing-argument.cpp +++ b/tests/.regression/ubuntu/clang++-17/overload-resolution-failure-transform-missing-argument.cpp @@ -14,36 +14,36 @@ File `/home/runner/work/cwhy/cwhy/tests/c++/overload-resolution-failure-transfor 42 } ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algo.h`: +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_algo.h`: ``` -4245 * -4246 * @p unary_op must not alter its argument. -4247 */ -4248 template -4250 _GLIBCXX20_CONSTEXPR -4251 _OutputIterator -4252 transform(_InputIterator __first, _InputIterator __last, -4253 _OutputIterator __result, _UnaryOperation __unary_op) -4254 { -4255 // concept requirements +4291 * +4292 * @p unary_op must not alter its argument. +4293 */ +4294 template +4296 _GLIBCXX20_CONSTEXPR +4297 _OutputIterator +4298 transform(_InputIterator __first, _InputIterator __last, +4299 _OutputIterator __result, _UnaryOperation __unary_op) +4300 { +4301 // concept requirements ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algo.h`: +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_algo.h`: ``` -4284 * @p binary_op must not alter either of its arguments. -4285 */ -4286 template -4288 _GLIBCXX20_CONSTEXPR -4289 _OutputIterator -4290 transform(_InputIterator1 __first1, _InputIterator1 __last1, -4291 _InputIterator2 __first2, _OutputIterator __result, -4292 _BinaryOperation __binary_op) -4293 { +4330 * @p binary_op must not alter either of its arguments. +4331 */ +4332 template +4334 _GLIBCXX20_CONSTEXPR +4335 _OutputIterator +4336 transform(_InputIterator1 __first1, _InputIterator1 __last1, +4337 _InputIterator2 __first2, _OutputIterator __result, +4338 _BinaryOperation __binary_op) +4339 { ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/pstl/glue_algorithm_defs.h`: +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/pstl/glue_algorithm_defs.h`: ``` 149 swap_ranges(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, 150 _ForwardIterator2 __first2); @@ -70,27 +70,27 @@ This is my error: /home/runner/work/cwhy/cwhy/tests/c++/overload-resolution-failure-transform-missing-argument.cpp:41:5: error: no matching function for call to 'transform' 41 | std::transform(v.begin(), v.end(), [](int i) { return i * i; }); | ^~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algo.h:4252:5: note: candidate function template not viable: requires 4 arguments, but 3 were provided - 4252 | transform(_InputIterator __first, _InputIterator __last, +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_algo.h:4298:5: note: candidate function template not viable: requires 4 arguments, but 3 were provided + 4298 | transform(_InputIterator __first, _InputIterator __last, | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 4253 | _OutputIterator __result, _UnaryOperation __unary_op) + 4299 | _OutputIterator __result, _UnaryOperation __unary_op) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algo.h:4290:5: note: candidate function template not viable: requires 5 arguments, but 3 were provided - 4290 | transform(_InputIterator1 __first1, _InputIterator1 __last1, +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_algo.h:4336:5: note: candidate function template not viable: requires 5 arguments, but 3 were provided + 4336 | transform(_InputIterator1 __first1, _InputIterator1 __last1, | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 4291 | _InputIterator2 __first2, _OutputIterator __result, + 4337 | _InputIterator2 __first2, _OutputIterator __result, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [...] - 4292 | _BinaryOperation __binary_op) + 4338 | _BinaryOperation __binary_op) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/pstl/glue_algorithm_defs.h:156:1: note: candidate function template not viable: requires 5 arguments, but 3 were provided +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/pstl/glue_algorithm_defs.h:156:1: note: candidate function template not viable: requires 5 arguments, but 3 were provided 156 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result, | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 157 | _UnaryOperation __op); | ~~~~~~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/pstl/glue_algorithm_defs.h:162:1: note: candidate function template not viable: requires 6 arguments, but 3 were provided +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/pstl/glue_algorithm_defs.h:162:1: note: candidate function template not viable: requires 6 arguments, but 3 were provided 162 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 163 | _ForwardIterator __result, _BinaryOperation __op); diff --git a/tests/.regression/ubuntu/clang++-17/push-back-pointer.cpp b/tests/.regression/ubuntu/clang++-17/push-back-pointer.cpp index b3c1873..9c7787c 100644 --- a/tests/.regression/ubuntu/clang++-17/push-back-pointer.cpp +++ b/tests/.regression/ubuntu/clang++-17/push-back-pointer.cpp @@ -14,33 +14,33 @@ File `/home/runner/work/cwhy/cwhy/tests/c++/push-back-pointer.cpp`: 25 } ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_vector.h`: +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h`: ``` -1269 * element at the end of the %vector and assigns the given data -1270 * to it. Due to the nature of a %vector this operation can be -1271 * done in constant time if the %vector has preallocated space -1272 * available. -1273 */ -1274 _GLIBCXX20_CONSTEXPR -1275 void -1276 push_back(const value_type& __x) -1277 { -1278 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) -1279 { +1271 * element at the end of the %vector and assigns the given data +1272 * to it. Due to the nature of a %vector this operation can be +1273 * done in constant time if the %vector has preallocated space +1274 * available. +1275 */ +1276 _GLIBCXX20_CONSTEXPR +1277 void +1278 push_back(const value_type& __x) +1279 { +1280 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) +1281 { ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_vector.h`: +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h`: ``` -1287 _M_realloc_insert(end(), __x); -1288 } -1289 -1290 #if __cplusplus >= 201103L -1291 _GLIBCXX20_CONSTEXPR -1292 void -1293 push_back(value_type&& __x) -1294 { emplace_back(std::move(__x)); } -1295 -1296 template +1289 _M_realloc_insert(end(), __x); +1290 } +1291 +1292 #if __cplusplus >= 201103L +1293 _GLIBCXX20_CONSTEXPR +1294 void +1295 push_back(value_type&& __x) +1296 { emplace_back(std::move(__x)); } +1297 +1298 template ``` @@ -49,14 +49,14 @@ This is my error: /home/runner/work/cwhy/cwhy/tests/c++/push-back-pointer.cpp:24:7: error: no matching member function for call to 'push_back' 24 | v.push_back(pointer); | ~~^~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_vector.h:1276:7: note: candidate function not viable: no known conversion from 'int *' to 'const value_type' (aka 'const int') for 1st argument; dereference the argument with * - 1276 | push_back(const value_type& __x) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:1278:7: note: candidate function not viable: no known conversion from 'int *' to 'const value_type' (aka 'const int') for 1st argument; dereference the argument with * + 1278 | push_back(const value_type& __x) [...] | ^ ~~~~~~~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_vector.h:1293:7: note: candidate function not viable: no known conversion from 'int *' to 'value_type' (aka 'int') for 1st argument; dereference the argument with * - 1293 | push_back(value_type&& __x) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:1295:7: note: candidate function not viable: no known conversion from 'int *' to 'value_type' (aka 'int') for 1st argument; dereference the argument with * + 1295 | push_back(value_type&& __x) | ^ ~~~~~~~~~~~~~~~~ 1 error generated. ``` diff --git a/tests/.regression/ubuntu/clang++-17/reverse-iterator.cpp b/tests/.regression/ubuntu/clang++-17/reverse-iterator.cpp index 70fb91a..facc640 100644 --- a/tests/.regression/ubuntu/clang++-17/reverse-iterator.cpp +++ b/tests/.regression/ubuntu/clang++-17/reverse-iterator.cpp @@ -15,47 +15,47 @@ File `/home/runner/work/cwhy/cwhy/tests/c++/reverse-iterator.cpp`: 34 } ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/basic_string.h`: +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h`: ``` -2033 * there are < @a __n characters to remove, the remainder of -2034 * the string is truncated. If @a __p is beyond end of string, -2035 * out_of_range is thrown. The value of the string doesn't -2036 * change if an error is thrown. -2037 */ -2038 _GLIBCXX20_CONSTEXPR -2039 basic_string& -2040 erase(size_type __pos = 0, size_type __n = npos) -2041 { -2042 _M_check(__pos, "basic_string::erase"); -2043 if (__n == npos) +2050 * there are < @a __n characters to remove, the remainder of +2051 * the string is truncated. If @a __p is beyond end of string, +2052 * out_of_range is thrown. The value of the string doesn't +2053 * change if an error is thrown. +2054 */ +2055 _GLIBCXX20_CONSTEXPR +2056 basic_string& +2057 erase(size_type __pos = 0, size_type __n = npos) +2058 { +2059 _M_check(__pos, "basic_string::erase"); +2060 if (__n == npos) ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/basic_string.h`: +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h`: ``` -2054 * -2055 * Removes the character at @a __position from this string. The value -2056 * of the string doesn't change if an error is thrown. -2057 */ -2058 _GLIBCXX20_CONSTEXPR -2059 iterator -2060 erase(__const_iterator __position) -2061 { -2062 _GLIBCXX_DEBUG_PEDASSERT(__position >= begin() -2063 && __position < end()); +2071 * +2072 * Removes the character at @a __position from this string. The value +2073 * of the string doesn't change if an error is thrown. +2074 */ +2075 _GLIBCXX20_CONSTEXPR +2076 iterator +2077 erase(__const_iterator __position) +2078 { +2079 _GLIBCXX_DEBUG_PEDASSERT(__position >= begin() +2080 && __position < end()); ``` -File `/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/basic_string.h`: +File `/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h`: ``` -2074 * -2075 * Removes the characters in the range [first,last) from this string. -2076 * The value of the string doesn't change if an error is thrown. -2077 */ -2078 _GLIBCXX20_CONSTEXPR -2079 iterator -2080 erase(__const_iterator __first, __const_iterator __last) -2081 { -2082 _GLIBCXX_DEBUG_PEDASSERT(__first >= begin() && __first <= __last -2083 && __last <= end()); +2091 * +2092 * Removes the characters in the range [first,last) from this string. +2093 * The value of the string doesn't change if an error is thrown. +2094 */ +2095 _GLIBCXX20_CONSTEXPR +2096 iterator +2097 erase(__const_iterator __first, __const_iterator __last) +2098 { +2099 _GLIBCXX_DEBUG_PEDASSERT(__first >= begin() && __first <= __last +2100 && __last <= end()); ``` @@ -64,17 +64,17 @@ This is my error: /home/runner/work/cwhy/cwhy/tests/c++/reverse-iterator.cpp:32:7: error: no matching member function for call to 'erase' 32 | s.erase(std::find_if(s.rbegin(), s.rend(), isNotSpace), s.end()); | ~~^~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/basic_string.h:2080:7: note: candidate function not viable: no known conversion from 'std::reverse_iterator<__gnu_cxx::__normal_iterator>>' to '__const_iterator' (aka '__normal_iterator>') for 1st argument - 2080 | erase(__const_iterator __first, __const_iterator __last) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:2097:7: note: candidate function not viable: no known conversion from 'std::reverse_iterator<__gnu_cxx::__normal_iterator>>' to '__const_iterator' (aka '__normal_iterator>') for 1st argument + 2097 | erase(__const_iterator __first, __const_iterator __last) | ^ ~~~~~~~~~~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/basic_string.h:2040:7: note: candidate function not viable: no known conversion from 'std::reverse_iterator<__gnu_cxx::__normal_iterator>>' to 'size_type' (aka 'unsigned long') for 1st argument +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:2057:7: note: candidate function not viable: no known conversion from 'std::reverse_iterator<__gnu_cxx::__normal_iterator>>' to 'size_type' (aka 'unsigned long') for 1st argument [...] - 2040 | erase(size_type __pos = 0, size_type __n = npos) + 2057 | erase(size_type __pos = 0, size_type __n = npos) | ^ ~~~~~~~~~~~~~~~~~~~ -/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/basic_string.h:2060:7: note: candidate function not viable: requires single argument '__position', but 2 arguments were provided - 2060 | erase(__const_iterator __position) +/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:2077:7: note: candidate function not viable: requires single argument '__position', but 2 arguments were provided + 2077 | erase(__const_iterator __position) | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ``` diff --git a/tests/.regression/ubuntu/clang++-17/template-recursion.cpp b/tests/.regression/ubuntu/clang++-17/template-recursion.cpp index 406c469..135d531 100644 --- a/tests/.regression/ubuntu/clang++-17/template-recursion.cpp +++ b/tests/.regression/ubuntu/clang++-17/template-recursion.cpp @@ -3,6 +3,8 @@ This is my code: File `/home/runner/work/cwhy/cwhy/tests/c++/template-recursion.cpp`: ``` + 2 #include + 3 #include 4 #include 5 #include 6 #include @@ -13,10 +15,10 @@ File `/home/runner/work/cwhy/cwhy/tests/c++/template-recursion.cpp`: 11 Matrix(std::span underlying) : underlying(underlying) { 12 assert(underlying.size() == M * N); 13 } -``` - -File `/home/runner/work/cwhy/cwhy/tests/c++/template-recursion.cpp`: -``` +14 +15 std::uint64_t lowestRowSum() const { +16 const auto firstRowSum +17 = std::accumulate(underlying.begin(), std::next(underlying.begin(), N), std::uint64_t(0)); 18 const auto subMatrix = Matrix(underlying.subspan(N)); 19 return std::min(firstRowSum, subMatrix.lowestRowSum()); 20 } @@ -27,21 +29,49 @@ File `/home/runner/work/cwhy/cwhy/tests/c++/template-recursion.cpp`: 25 }; 26 27 #define M 100 +28 #define N 10 +29 +30 int main() { +31 std::vector v(M * N); +32 for (int i = 0; i < M * N; ++i) { +33 v[i] = i; +34 } ``` This is my error: ``` +/home/runner/work/cwhy/cwhy/tests/c++/template-recursion.cpp:9:16: error: no type named 'uint32_t' in namespace 'std' + 9 | template + | ~~~~~^ +/home/runner/work/cwhy/cwhy/tests/c++/template-recursion.cpp:9:33: error: no type named 'uint32_t' in namespace 'std' + 9 | template + | ~~~~~^ /home/runner/work/cwhy/cwhy/tests/c++/template-recursion.cpp:11:17: error: no template named 'span' in namespace 'std' 11 | Matrix(std::span underlying) : underlying(underlying) { | ~~~~~^ -/home/runner/work/cwhy/cwhy/tests/c++/template-recursion.cpp:24:10: error: no template named 'span' in namespace 'std' +/home/runner/work/cwhy/cwhy/tests/c++/template-recursion.cpp:11:27: error: no member named 'uint64_t' in namespace 'std' + 11 | Matrix(std::span underlying) : underlying(underlying) { + | ~~~~~^ +/home/runner/work/cwhy/cwhy/tests/c++/template-recursion.cpp:15:10: error: no type named 'uint64_t' in namespace 'std' + 15 | std::uint64_t lowestRowSum() const { [...] + | ~~~~~^ +/home/runner/work/cwhy/cwhy/tests/c++/template-recursion.cpp:24:10: error: no template named 'span' in namespace 'std' 24 | std::span underlying; | ~~~~~^ -2 errors generated. +/home/runner/work/cwhy/cwhy/tests/c++/template-recursion.cpp:24:20: error: no member named 'uint64_t' in namespace 'std' + 24 | std::span underlying; + | ~~~~~^ +/home/runner/work/cwhy/cwhy/tests/c++/template-recursion.cpp:17:90: error: no member named 'uint64_t' in namespace 'std' + 17 | = std::accumulate(underlying.begin(), std::next(underlying.begin(), N), std::uint64_t(0)); + | ~~~~~^ +/home/runner/work/cwhy/cwhy/tests/c++/template-recursion.cpp:31:22: error: no member named 'uint64_t' in namespace 'std' + 31 | std::vector v(M * N); + | ~~~~~^ +9 errors generated. ```