Skip to content

Commit 614ac76

Browse files
committed
test: add cases for known limitations
1 parent 2f84e6a commit 614ac76

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

regression-tests/pure2-type-and-namespace-aliases.cpp2

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,19 @@ main: () = {
3131
myfunc2();
3232
}
3333

34+
myclass5: type == myclass4;
35+
3436
myclass3: @struct type = {
3537
v0 :== :std::array = (0);;
3638
v1: std::array == v0;
3739
v2: myclass3 == :myclass3 = ();;
3840
v3: _ == v0;
41+
// v4 :== v2; // Not (yet) supported.
42+
// v5: myclass4 == :myclass4 = ();; // Not yet supported.
43+
// v6: myclass5 == :myclass5 = ();; // Not yet supported.
44+
45+
// There's also a false positive:
46+
// <https://github.com/hsutter/cppfront/issues/666#issuecomment-1722329609>.
3947
}
48+
49+
myclass4: @struct type = { }

regression-tests/test-results/pure2-type-and-namespace-aliases.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ namespace N {
1616
class myclass;
1717

1818

19-
#line 34 "pure2-type-and-namespace-aliases.cpp2"
19+
#line 36 "pure2-type-and-namespace-aliases.cpp2"
2020
class myclass3;
2121

2222

23+
#line 49 "pure2-type-and-namespace-aliases.cpp2"
24+
class myclass4;
25+
26+
2327
//=== Cpp2 type definitions and function declarations ===========================
2428

2529

@@ -52,13 +56,23 @@ auto main() -> int;
5256

5357

5458
#line 34 "pure2-type-and-namespace-aliases.cpp2"
59+
using myclass5 = myclass4;
60+
5561
class myclass3 {
5662
public: static constexpr auto v0 = std::array{0};
5763
public: static constexpr std::array v1 = v0;
5864
public: static const myclass3 v2;
5965
public: static constexpr auto v3 = v0;
66+
// v4 :== v2; // Not (yet) supported.
67+
// v5: myclass4 == :myclass4 = ();; // Not yet supported.
68+
// v6: myclass5 == :myclass5 = ();; // Not yet supported.
69+
70+
// There's also a false positive:
71+
// <https://github.com/hsutter/cppfront/issues/666#issuecomment-1722329609>.
6072
};
6173

74+
class myclass4 {};
75+
6276

6377
//=== Cpp2 function definitions =================================================
6478

@@ -86,7 +100,7 @@ auto main() -> int{
86100
myfunc2();
87101
}
88102

89-
#line 37 "pure2-type-and-namespace-aliases.cpp2"
103+
#line 39 "pure2-type-and-namespace-aliases.cpp2"
90104
inline constexpr myclass3 myclass3::v2 = myclass3{};
91105

92106

0 commit comments

Comments
 (0)