Skip to content

Commit 5cefc73

Browse files
committed
Fixes for regex and non-regex tests.
1 parent 617b042 commit 5cefc73

File tree

8 files changed

+53
-53
lines changed

8 files changed

+53
-53
lines changed

include/cpp2regex.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,9 +1621,9 @@ return cpp2::move(_ret) + ")";
16211621
//
16221622

16231623
#line 121 "regex.h2"
1624-
template <typename CharT, typename Iter, int max_groups> [[nodiscard]] auto match_context<CharT,Iter,max_groups>::fail() const& -> auto { return match_return(false, end); }
1624+
template <typename CharT, typename Iter, int max_groups> [[nodiscard]] auto match_context<CharT,Iter,max_groups>::fail() const& -> auto { return match_return<Iter>(false, end); }
16251625
#line 122 "regex.h2"
1626-
template <typename CharT, typename Iter, int max_groups> [[nodiscard]] auto match_context<CharT,Iter,max_groups>::pass(cpp2::impl::in<Iter> cur) const& -> auto { return match_return(true, cur); }
1626+
template <typename CharT, typename Iter, int max_groups> [[nodiscard]] auto match_context<CharT,Iter,max_groups>::pass(cpp2::impl::in<Iter> cur) const& -> auto { return match_return<Iter>(true, cur); }
16271627

16281628
#line 126 "regex.h2"
16291629
// End function that returns a valid match.

regression-tests/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ while getopts ${optstring} arg; do
9292
;;
9393
t)
9494
# Replace commas with spaces
95-
chosen_tests=${OPTARG/,/ }
95+
chosen_tests=${OPTARG//,/ }
9696
;;
9797
\?)
9898
echo "Invalid option: -${OPTARG}."
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
pure2-bugfix-for-ufcs-noexcept.cpp2:5:26: error: lambda expression in an unevaluated operand
22
static_assert(noexcept(CPP2_UFCS(swap)(t(), t())));// Fails on Clang 12 (lambda in unevaluated context) and GCC 10 (static assertion failed)
33
^
4-
../../../include/cpp2util.h:1167:59: note: expanded from macro 'CPP2_UFCS'
4+
../../../include/cpp2util.h:1168:59: note: expanded from macro 'CPP2_UFCS'
55
#define CPP2_UFCS(...) CPP2_UFCS_(&,CPP2_UFCS_EMPTY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
66
^
7-
../../../include/cpp2util.h:1134:66: note: expanded from macro 'CPP2_UFCS_'
7+
../../../include/cpp2util.h:1135:66: note: expanded from macro 'CPP2_UFCS_'
88
#define CPP2_UFCS_(LAMBDADEFCAPT,SFINAE,MVFWD,QUALID,TEMPKW,...) \
99
^
1010
1 error generated.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
pure2-bugfix-for-ufcs-sfinae.cpp2:1:78: error: lambda expression in an unevaluated operand
22
template<typename T> [[nodiscard]] auto f() -> std::type_identity_t<decltype(CPP2_UFCS_NONLOCAL(a)(T()))>;
33
^
4-
../../../include/cpp2util.h:1172:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
4+
../../../include/cpp2util.h:1173:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
55
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
66
^
7-
../../../include/cpp2util.h:1134:66: note: expanded from macro 'CPP2_UFCS_'
7+
../../../include/cpp2util.h:1135:66: note: expanded from macro 'CPP2_UFCS_'
88
#define CPP2_UFCS_(LAMBDADEFCAPT,SFINAE,MVFWD,QUALID,TEMPKW,...) \
99
^
1010
pure2-bugfix-for-ufcs-sfinae.cpp2:1:78: error: lambda expression in an unevaluated operand
1111
template<typename T> [[nodiscard]] auto f() -> std::type_identity_t<decltype(CPP2_UFCS_NONLOCAL(a)(T()))>{}// Fails on Clang 12 (lambda in unevaluated context).
1212
^
13-
../../../include/cpp2util.h:1172:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
13+
../../../include/cpp2util.h:1173:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
1414
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
1515
^
16-
../../../include/cpp2util.h:1134:66: note: expanded from macro 'CPP2_UFCS_'
16+
../../../include/cpp2util.h:1135:66: note: expanded from macro 'CPP2_UFCS_'
1717
#define CPP2_UFCS_(LAMBDADEFCAPT,SFINAE,MVFWD,QUALID,TEMPKW,...) \
1818
^
1919
2 errors generated.

regression-tests/test-results/gcc-10-c++20/pure2-print.cpp.output

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ pure2-print.cpp2:68:1: note: in expansion of macro ‘CPP2_REQUIRES_’
99
pure2-print.cpp2:97:1: note: in expansion of macro ‘CPP2_REQUIRES_’
1010
pure2-print.cpp2:9:41: error: ‘constexpr const T outer::object_alias’ is not a static data member of ‘class outer’
1111
pure2-print.cpp2:9:48: error: template definition of non-template ‘constexpr const T outer::object_alias’
12-
pure2-print.cpp2:67:14: error: no declaration matches ‘void outer::mytype::variadic(const auto:92& ...) requires (is_convertible_v<typename std::remove_cv<typename std::remove_reference<decltype(outer::mytype::variadic::x)>::type>::type, int> && ...)’
13-
pure2-print.cpp2:67:29: note: candidate is: ‘template<class ... auto:91> static void outer::mytype::variadic(const auto:91& ...)’
12+
pure2-print.cpp2:67:14: error: no declaration matches ‘void outer::mytype::variadic(const auto:230& ...) requires (is_convertible_v<typename std::remove_cv<typename std::remove_reference<decltype(outer::mytype::variadic::x)>::type>::type, int> && ...)’
13+
pure2-print.cpp2:67:29: note: candidate is: ‘template<class ... auto:229> static void outer::mytype::variadic(const auto:229& ...)’
1414
pure2-print.cpp2:10:19: note: ‘class outer::mytype’ defined here
1515
pure2-print.cpp2:96:37: error: no declaration matches ‘void outer::print(std::ostream&, const Args& ...) requires cpp2::impl::cmp_greater_eq(sizeof ... (Args ...), 0)’
1616
pure2-print.cpp2:96:37: note: no functions named ‘void outer::print(std::ostream&, const Args& ...) requires cpp2::impl::cmp_greater_eq(sizeof ... (Args ...), 0)’
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
In file included from mixed-bugfix-for-ufcs-non-local.cpp:6:
2-
../../../include/cpp2util.h:1135:1: error: lambda-expression in template parameter type
3-
1135 | [LAMBDADEFCAPT]< \
2+
../../../include/cpp2util.h:1136:1: error: lambda-expression in template parameter type
3+
1136 | [LAMBDADEFCAPT]< \
44
| ^
5-
../../../include/cpp2util.h:1172:59: note: in expansion of macro ‘CPP2_UFCS_’
6-
1172 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
5+
../../../include/cpp2util.h:1173:59: note: in expansion of macro ‘CPP2_UFCS_’
6+
1173 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
77
| ^~~~~~~~~~
88
mixed-bugfix-for-ufcs-non-local.cpp2:13:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’
99
mixed-bugfix-for-ufcs-non-local.cpp2:13:36: error: template argument 1 is invalid
10-
../../../include/cpp2util.h:1135:1: error: lambda-expression in template parameter type
11-
1135 | [LAMBDADEFCAPT]< \
10+
../../../include/cpp2util.h:1136:1: error: lambda-expression in template parameter type
11+
1136 | [LAMBDADEFCAPT]< \
1212
| ^
13-
../../../include/cpp2util.h:1172:59: note: in expansion of macro ‘CPP2_UFCS_’
14-
1172 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
13+
../../../include/cpp2util.h:1173:59: note: in expansion of macro ‘CPP2_UFCS_’
14+
1173 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
1515
| ^~~~~~~~~~
1616
mixed-bugfix-for-ufcs-non-local.cpp2:21:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’
1717
mixed-bugfix-for-ufcs-non-local.cpp2:21:36: error: template argument 1 is invalid
18-
../../../include/cpp2util.h:1135:1: error: lambda-expression in template parameter type
19-
1135 | [LAMBDADEFCAPT]< \
18+
../../../include/cpp2util.h:1136:1: error: lambda-expression in template parameter type
19+
1136 | [LAMBDADEFCAPT]< \
2020
| ^
21-
../../../include/cpp2util.h:1172:59: note: in expansion of macro ‘CPP2_UFCS_’
22-
1172 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
21+
../../../include/cpp2util.h:1173:59: note: in expansion of macro ‘CPP2_UFCS_’
22+
1173 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
2323
| ^~~~~~~~~~
2424
mixed-bugfix-for-ufcs-non-local.cpp2:31:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’
2525
mixed-bugfix-for-ufcs-non-local.cpp2:31:36: error: template argument 1 is invalid
26-
../../../include/cpp2util.h:1135:1: error: lambda-expression in template parameter type
27-
1135 | [LAMBDADEFCAPT]< \
26+
../../../include/cpp2util.h:1136:1: error: lambda-expression in template parameter type
27+
1136 | [LAMBDADEFCAPT]< \
2828
| ^
29-
../../../include/cpp2util.h:1172:59: note: in expansion of macro ‘CPP2_UFCS_’
30-
1172 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
29+
../../../include/cpp2util.h:1173:59: note: in expansion of macro ‘CPP2_UFCS_’
30+
1173 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
3131
| ^~~~~~~~~~
3232
mixed-bugfix-for-ufcs-non-local.cpp2:33:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’
3333
mixed-bugfix-for-ufcs-non-local.cpp2:33:36: error: template argument 1 is invalid
34-
../../../include/cpp2util.h:1135:1: error: lambda-expression in template parameter type
35-
1135 | [LAMBDADEFCAPT]< \
34+
../../../include/cpp2util.h:1136:1: error: lambda-expression in template parameter type
35+
1136 | [LAMBDADEFCAPT]< \
3636
| ^
37-
../../../include/cpp2util.h:1172:59: note: in expansion of macro ‘CPP2_UFCS_’
38-
1172 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
37+
../../../include/cpp2util.h:1173:59: note: in expansion of macro ‘CPP2_UFCS_’
38+
1173 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
3939
| ^~~~~~~~~~
4040
mixed-bugfix-for-ufcs-non-local.cpp2:21:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’
4141
mixed-bugfix-for-ufcs-non-local.cpp2:21:36: error: template argument 1 is invalid
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
In file included from mixed-bugfix-for-ufcs-non-local.cpp:6:
2-
../../../include/cpp2util.h:1135:1: error: lambda-expression in template parameter type
3-
1135 | [LAMBDADEFCAPT]< \
2+
../../../include/cpp2util.h:1136:1: error: lambda-expression in template parameter type
3+
1136 | [LAMBDADEFCAPT]< \
44
| ^
5-
../../../include/cpp2util.h:1172:59: note: in expansion of macro ‘CPP2_UFCS_’
6-
1172 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
5+
../../../include/cpp2util.h:1173:59: note: in expansion of macro ‘CPP2_UFCS_’
6+
1173 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
77
| ^~~~~~~~~~
88
mixed-bugfix-for-ufcs-non-local.cpp2:13:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’
99
mixed-bugfix-for-ufcs-non-local.cpp2:13:36: error: template argument 1 is invalid
10-
../../../include/cpp2util.h:1135:1: error: lambda-expression in template parameter type
11-
1135 | [LAMBDADEFCAPT]< \
10+
../../../include/cpp2util.h:1136:1: error: lambda-expression in template parameter type
11+
1136 | [LAMBDADEFCAPT]< \
1212
| ^
13-
../../../include/cpp2util.h:1172:59: note: in expansion of macro ‘CPP2_UFCS_’
14-
1172 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
13+
../../../include/cpp2util.h:1173:59: note: in expansion of macro ‘CPP2_UFCS_’
14+
1173 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
1515
| ^~~~~~~~~~
1616
mixed-bugfix-for-ufcs-non-local.cpp2:21:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’
1717
mixed-bugfix-for-ufcs-non-local.cpp2:21:36: error: template argument 1 is invalid
18-
../../../include/cpp2util.h:1135:1: error: lambda-expression in template parameter type
19-
1135 | [LAMBDADEFCAPT]< \
18+
../../../include/cpp2util.h:1136:1: error: lambda-expression in template parameter type
19+
1136 | [LAMBDADEFCAPT]< \
2020
| ^
21-
../../../include/cpp2util.h:1172:59: note: in expansion of macro ‘CPP2_UFCS_’
22-
1172 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
21+
../../../include/cpp2util.h:1173:59: note: in expansion of macro ‘CPP2_UFCS_’
22+
1173 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
2323
| ^~~~~~~~~~
2424
mixed-bugfix-for-ufcs-non-local.cpp2:31:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’
2525
mixed-bugfix-for-ufcs-non-local.cpp2:31:36: error: template argument 1 is invalid
26-
../../../include/cpp2util.h:1135:1: error: lambda-expression in template parameter type
27-
1135 | [LAMBDADEFCAPT]< \
26+
../../../include/cpp2util.h:1136:1: error: lambda-expression in template parameter type
27+
1136 | [LAMBDADEFCAPT]< \
2828
| ^
29-
../../../include/cpp2util.h:1172:59: note: in expansion of macro ‘CPP2_UFCS_’
30-
1172 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
29+
../../../include/cpp2util.h:1173:59: note: in expansion of macro ‘CPP2_UFCS_’
30+
1173 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
3131
| ^~~~~~~~~~
3232
mixed-bugfix-for-ufcs-non-local.cpp2:33:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’
3333
mixed-bugfix-for-ufcs-non-local.cpp2:33:36: error: template argument 1 is invalid
34-
../../../include/cpp2util.h:1135:1: error: lambda-expression in template parameter type
35-
1135 | [LAMBDADEFCAPT]< \
34+
../../../include/cpp2util.h:1136:1: error: lambda-expression in template parameter type
35+
1136 | [LAMBDADEFCAPT]< \
3636
| ^
37-
../../../include/cpp2util.h:1172:59: note: in expansion of macro ‘CPP2_UFCS_’
38-
1172 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
37+
../../../include/cpp2util.h:1173:59: note: in expansion of macro ‘CPP2_UFCS_’
38+
1173 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
3939
| ^~~~~~~~~~
4040
mixed-bugfix-for-ufcs-non-local.cpp2:21:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’
4141
mixed-bugfix-for-ufcs-non-local.cpp2:21:36: error: template argument 1 is invalid

source/regex.h2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ match_context: <CharT, Iter, max_groups: int> type =
118118
// Misc functions
119119
//
120120

121-
fail: (in this) match_return(false, end);
122-
pass: (in this, cur: Iter) match_return(true, cur);
121+
fail: (in this) match_return<Iter>(false, end);
122+
pass: (in this, cur: Iter) match_return<Iter>(true, cur);
123123

124124
}
125125

0 commit comments

Comments
 (0)