Skip to content

Commit a65350b

Browse files
committed
Remove UFCS from regex and more non-regex test fixes.
1 parent 5cefc73 commit a65350b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

include/cpp2regex.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,7 @@ template<typename Func> [[nodiscard]] auto make_on_return(Func const& func) -> a
18931893
#line 413 "regex.h2"
18941894
auto parse_context_group_state::post_process_list(token_vec& list) -> void{
18951895
// Merge all characters
1896-
auto merge_pos {CPP2_UFCS(begin)(list)};
1896+
auto merge_pos {list.begin()};
18971897
for( ; merge_pos != list.end(); (++merge_pos) ) {
18981898
if (cpp2::impl::is<char_token>(*cpp2::impl::assert_not_null(*cpp2::impl::assert_not_null(merge_pos)))) {
18991899
auto combine_pos {merge_pos + 1};
@@ -3835,7 +3835,7 @@ template<typename CharT, bool negate> [[nodiscard]] auto word_boundary_token_mat
38353835
#line 2474 "regex.h2"
38363836
template <typename CharT, typename matcher_wrapper> template<typename Iter> [[nodiscard]] auto regular_expression<CharT,matcher_wrapper>::search(Iter const& start, Iter const& end) const& -> search_return<Iter>{
38373837
context<Iter> ctx {start, end};
3838-
auto r {CPP2_UFCS(fail)(ctx)};
3838+
auto r {ctx.fail()};
38393839

38403840
auto cur {start};
38413841
for( ; true; (++cur) ) {

regression-tests/test-results/gcc-10-c++20/pure2-bugfix-for-requires-clause-in-forward-declaration.cpp.output

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:46: error: expect
66
In file included from pure2-bugfix-for-requires-clause-in-forward-declaration.cpp:7:
77
../../../include/cpp2util.h:10005:47: error: static assertion failed: GCC 11 or higher is required to support variables and type-scope functions that have a 'requires' clause. This includes a type-scope 'forward' parameter of non-wildcard type, such as 'func: (this, forward s: std::string)', which relies on being able to add a 'requires' clause - in that case, use 'forward s: _' instead if you need the result to compile with GCC 10.
88
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:4:1: note: in expansion of macro ‘CPP2_REQUIRES_’
9-
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:3: error: no declaration matches ‘element::element(auto:93&&) requires is_same_v<std::__cxx11::string, typename std::remove_cv<typename std::remove_reference<decltype(element::__ct ::n)>::type>::type>’
9+
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:3: error: no declaration matches ‘element::element(auto:231&&) requires is_same_v<std::__cxx11::string, typename std::remove_cv<typename std::remove_reference<decltype(element::__ct ::n)>::type>::type>’
1010
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:5:11: note: candidates are: ‘element::element(const element&)’
11-
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:20: note: ‘template<class auto:91> element::element(auto:91&&)’
11+
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:20: note: ‘template<class auto:229> element::element(auto:229&&)’
1212
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:1:7: note: ‘class element’ defined here
1313
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:5:78: error: expected unqualified-id before ‘{’ token
14-
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:8: error: no declaration matches ‘element& element::operator=(auto:94&&) requires is_same_v<std::__cxx11::string, typename std::remove_cv<typename std::remove_reference<decltype(element::operator=::n)>::type>::type>’
14+
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:8: error: no declaration matches ‘element& element::operator=(auto:232&&) requires is_same_v<std::__cxx11::string, typename std::remove_cv<typename std::remove_reference<decltype(element::operator=::n)>::type>::type>’
1515
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:6:16: note: candidates are: ‘void element::operator=(const element&)’
16-
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:16: note: ‘template<class auto:92> element& element::operator=(auto:92&&)’
16+
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:16: note: ‘template<class auto:230> element& element::operator=(auto:230&&)’
1717
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:1:7: note: ‘class element’ defined here

source/regex.h2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ parse_context_group_state: @struct type = {
412412
// Apply optimizations to the matcher list.
413413
post_process_list: (inout list: token_vec) = {
414414
// Merge all characters
415-
merge_pos := list.begin();
415+
merge_pos := list..begin();
416416
while merge_pos != list..end() next (merge_pos++) {
417417
if merge_pos** is char_token {
418418
combine_pos := merge_pos + 1;
@@ -2473,7 +2473,7 @@ regular_expression: <CharT, matcher_wrapper> type = {
24732473
search: (in this, str: bview<CharT>, start, length) search(get_iter(str, start), get_iter(str, start + length));
24742474
search: <Iter> (in this, start: Iter, end: Iter) -> search_return<Iter> = {
24752475
ctx: context<Iter> = (start, end);
2476-
r := ctx.fail();
2476+
r := ctx..fail();
24772477

24782478
cur:= start;
24792479
while true next (cur++) {

0 commit comments

Comments
 (0)