Skip to content

Commit 7f49d99

Browse files
hsutterJohelEGP
authored andcommitted
Results of testing the PR incl. with MSVC 2022
And minor code tweaks
1 parent f7517ef commit 7f49d99

File tree

39 files changed

+243
-32
lines changed

39 files changed

+243
-32
lines changed

regression-tests/mixed-bugfix-for-ufcs-non-local.cpp2

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ ns: namespace = {
1010

1111
// Variables.
1212

13-
v0: <_: t<o.f()>> bool == false; // Fails on GCC ([GCC109781][]).
13+
v0: <_: t<o.f()>> bool == false; // Fails on GCC ([GCC109781][]) and Clang 12 (a lambda expression cannot appear in this context)
1414

1515
v1: t<o.f()> == t<true>(); // Fails on Clang 12 (lambda in unevaluated context).
1616

1717
v2: bool == o.f();
1818

1919
// Functions.
2020

21-
g: <_: t<o.f()>> () = { } // Fails on GCC ([GCC109781][]).
21+
g: <_: t<o.f()>> () = { } // Fails on GCC ([GCC109781][]) and Clang 12 (a lambda expression cannot appear in this context)
2222

2323
g: (_: t<o.f()>) = { } // Fails on Clang 12 (lambda in unevaluated context).
2424

@@ -28,17 +28,17 @@ h: () -> t<o.f()> = o; // Fails on Clang 12 (lambda in unevaluated context).
2828

2929
// Aliases.
3030

31-
a: <_: t<o.f()>> type == bool; // Fails on GCC ([GCC109781][]).
31+
a: <_: t<o.f()>> type == bool; // Fails on GCC ([GCC109781][]) and Clang 12 (a lambda expression cannot appear in this context)
3232

3333
b: <_: t<o.f()>> _ == false; // Fails on GCC ([GCC109781][]).
3434

35-
c: type == t<o.f()>; // Fails on Clang 12 (lambda in unevaluated context).
35+
c: type == t<o.f()>; // Fails on Clang 12 (lambda in unevaluated context) and Clang 12 (a lambda expression cannot appear in this context)
3636

3737
d: _ == t<o.f()>(); // Fails on Clang 12 (lambda in unevaluated context).
3838

3939
u: @struct type = {
4040
b: bool == o.f();
41-
c: bool == :(x: std::type_identity_t<decltype(o.f())>) x;(true);
41+
c: bool == :(x: std::type_identity_t<decltype(o.f())>) x;(true); // Fails on Clang 12 (lambda in unevaluated context).
4242
g: (s, sz) pre(s.sz() != 0) = { }
4343
}
4444

regression-tests/pure2-bugfix-for-ufcs-noexcept.cpp2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ t: type = {
22
swap: (virtual inout this, that) = { } // Non-`virtual` blocked on #508, idiomatic form on #507.
33
}
44
main: () = {
5-
static_assert(noexcept(t().swap(t()))); // Fails on Clang 12 (lambda in unevaluated context).
5+
static_assert(noexcept(t().swap(t()))); // Fails on Clang 12 (lambda in unevaluated context) and GCC 10 (static assertion failed)
66
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
mixed-bugfix-for-ufcs-non-local.cpp2:13:12: error: a lambda expression cannot appear in this context
2+
template<t<CPP2_UFCS_NONLOCAL(f)(o)> _> bool inline constexpr v0 = false;// Fails on GCC ([GCC109781][]).
3+
^
4+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
5+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
6+
^
7+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
8+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
9+
^
10+
mixed-bugfix-for-ufcs-non-local.cpp2:15:3: error: a lambda expression cannot appear in this context
11+
t<CPP2_UFCS_NONLOCAL(f)(o)> inline constexpr v1 = t<true>();// Fails on Clang 12 (lambda in unevaluated context).
12+
^
13+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
14+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
15+
^
16+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
17+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
18+
^
19+
mixed-bugfix-for-ufcs-non-local.cpp2:21:12: error: a lambda expression cannot appear in this context
20+
template<t<CPP2_UFCS_NONLOCAL(f)(o)> _> auto g() -> void;
21+
^
22+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
23+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
24+
^
25+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
26+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
27+
^
28+
mixed-bugfix-for-ufcs-non-local.cpp2:23:36: error: a lambda expression cannot appear in this context
29+
auto g([[maybe_unused]] cpp2::in<t<CPP2_UFCS_NONLOCAL(f)(o)>> unnamed_param_1) -> void;
30+
^
31+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
32+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
33+
^
34+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
35+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
36+
^
37+
mixed-bugfix-for-ufcs-non-local.cpp2:27:29: error: a lambda expression cannot appear in this context
38+
[[nodiscard]] auto h() -> t<CPP2_UFCS_NONLOCAL(f)(o)>;
39+
^
40+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
41+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
42+
^
43+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
44+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
45+
^
46+
mixed-bugfix-for-ufcs-non-local.cpp2:31:12: error: a lambda expression cannot appear in this context
47+
template<t<CPP2_UFCS_NONLOCAL(f)(o)> _> using a = bool;// Fails on GCC ([GCC109781][]).
48+
^
49+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
50+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
51+
^
52+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
53+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
54+
^
55+
mixed-bugfix-for-ufcs-non-local.cpp2:33:12: error: a lambda expression cannot appear in this context
56+
template<t<CPP2_UFCS_NONLOCAL(f)(o)> _> auto inline constexpr b = false;// Fails on GCC ([GCC109781][]).
57+
^
58+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
59+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
60+
^
61+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
62+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
63+
^
64+
mixed-bugfix-for-ufcs-non-local.cpp2:35:13: error: a lambda expression cannot appear in this context
65+
using c = t<CPP2_UFCS_NONLOCAL(f)(o)>;// Fails on Clang 12 (lambda in unevaluated context).
66+
^
67+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
68+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
69+
^
70+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
71+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
72+
^
73+
mixed-bugfix-for-ufcs-non-local.cpp2:37:29: error: a lambda expression cannot appear in this context
74+
auto inline constexpr d = t<CPP2_UFCS_NONLOCAL(f)(o)>();// Fails on Clang 12 (lambda in unevaluated context).
75+
^
76+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
77+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
78+
^
79+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
80+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
81+
^
82+
mixed-bugfix-for-ufcs-non-local.cpp2:21:12: error: a lambda expression cannot appear in this context
83+
template<t<CPP2_UFCS_NONLOCAL(f)(o)> _> auto g() -> void{}// Fails on GCC ([GCC109781][]).
84+
^
85+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
86+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
87+
^
88+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
89+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
90+
^
91+
mixed-bugfix-for-ufcs-non-local.cpp2:23:36: error: a lambda expression cannot appear in this context
92+
auto g([[maybe_unused]] cpp2::in<t<CPP2_UFCS_NONLOCAL(f)(o)>> unnamed_param_1) -> void{}// Fails on Clang 12 (lambda in unevaluated context).
93+
^
94+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
95+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
96+
^
97+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
98+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
99+
^
100+
mixed-bugfix-for-ufcs-non-local.cpp2:27:29: error: a lambda expression cannot appear in this context
101+
[[nodiscard]] auto h() -> t<CPP2_UFCS_NONLOCAL(f)(o)> { return o; }// Fails on Clang 12 (lambda in unevaluated context).
102+
^
103+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
104+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
105+
^
106+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
107+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
108+
^
109+
mixed-bugfix-for-ufcs-non-local.cpp2:41:79: error: lambda expression in an unevaluated operand
110+
inline CPP2_CONSTEXPR bool u::c = [](cpp2::in<std::type_identity_t<decltype(CPP2_UFCS_NONLOCAL(f)(o))>> x) -> auto { return x; }(true);
111+
^
112+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
113+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
114+
^
115+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
116+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
117+
^
118+
13 errors generated.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
0123456789
2+
9
3+
0123456789
4+
9

regression-tests/test-results/clang-12/pure2-bugfix-for-ufcs-arguments.cpp.output

Whitespace-only changes.

regression-tests/test-results/clang-12/pure2-bugfix-for-ufcs-name-lookup.cpp.execution

Whitespace-only changes.

regression-tests/test-results/clang-12/pure2-bugfix-for-ufcs-name-lookup.cpp.output

Whitespace-only changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pure2-bugfix-for-ufcs-noexcept.cpp2:5:26: error: lambda expression in an unevaluated operand
2+
static_assert(noexcept(CPP2_UFCS(swap)(t(), t())));// Fails on Clang 12 (lambda in unevaluated context).
3+
^
4+
../../../include/cpp2util.h:853:59: note: expanded from macro 'CPP2_UFCS'
5+
#define CPP2_UFCS(...) CPP2_UFCS_(&,(),,__VA_ARGS__)
6+
^
7+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
8+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
9+
^
10+
1 error generated.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
pure2-bugfix-for-ufcs-sfinae.cpp2:1:78: error: lambda expression in an unevaluated operand
2+
template<typename T> [[nodiscard]] auto f() -> std::type_identity_t<decltype(CPP2_UFCS_NONLOCAL(a)(T()))>;
3+
^
4+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
5+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
6+
^
7+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
8+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
9+
^
10+
pure2-bugfix-for-ufcs-sfinae.cpp2:1:78: error: lambda expression in an unevaluated operand
11+
template<typename T> [[nodiscard]] auto f() -> std::type_identity_t<decltype(CPP2_UFCS_NONLOCAL(a)(T()))>{}// Fails on Clang 12 (lambda in unevaluated context).
12+
^
13+
../../../include/cpp2util.h:856:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
14+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,(),,__VA_ARGS__)
15+
^
16+
../../../include/cpp2util.h:837:53: note: expanded from macro 'CPP2_UFCS_'
17+
#define CPP2_UFCS_(LAMBDADEFCAPT,QUALID,TEMPKW,...) \
18+
^
19+
2 errors generated.

regression-tests/test-results/gcc-10/mixed-bugfix-for-ufcs-non-local.cpp.execution

Whitespace-only changes.

0 commit comments

Comments
 (0)