forked from hsutter/cppfront
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmixed-bugfix-for-ufcs-non-local.cpp2
50 lines (29 loc) · 1.49 KB
/
mixed-bugfix-for-ufcs-non-local.cpp2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
namespace ns {
template<bool> struct t { };
constexpr bool f(const t<true>&) { return true; }
constexpr t<true> o{};
} // namespace ns
ns: namespace = {
// Variables.
v0: <_: t<o.f()>> bool == false; // Fails on GCC ([GCC109781][]) and Clang 12 (a lambda expression cannot appear in this context)
v1: t<o.f()> == t<true>(); // Fails on Clang 12 (lambda in unevaluated context).
v2: bool == o.f();
// Functions.
g: <_: t<o.f()>> () = { } // Fails on GCC ([GCC109781][]) and Clang 12 (a lambda expression cannot appear in this context)
g: (_: t<o.f()>) = { } // Fails on Clang 12 (lambda in unevaluated context).
g: () pre(o.f()) = { }
h: () -> t<o.f()> = o; // Fails on Clang 12 (lambda in unevaluated context).
// Aliases.
a: <_: t<o.f()>> type == bool; // Fails on GCC ([GCC109781][]) and Clang 12 (a lambda expression cannot appear in this context)
b: <_: t<o.f()>> _ == false; // Fails on GCC ([GCC109781][]).
c: type == t<o.f()>; // Fails on Clang 12 (lambda in unevaluated context) and Clang 12 (a lambda expression cannot appear in this context)
d: _ == t<o.f()>(); // Fails on Clang 12 (lambda in unevaluated context).
u: @struct type = {
b: bool == o.f();
// UFCS used in the decltype in the line below causes all compilers to report error/crash
c: bool == :(forward x: decltype(f(o))) = x;(true); // Fails on Clang 12 (lambda in unevaluated context).
g: (s, sz) pre(s.sz() != 0) = { }
}
} // namespace ns
main: () = { }
// [GCC109781]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109781