Skip to content

Commit 280c96a

Browse files
committed
test: add case for UFCS noexcept
1 parent 1a3fc51 commit 280c96a

5 files changed

+40
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
t: type = {
2+
swap: (inout this, that) = { }
3+
}
4+
main: () = { static_assert(noexcept(t().swap(t()))); }

regression-tests/test-results/gcc-13/pure2-bugfix-for-ufcs-noexcept.cpp.execution

Whitespace-only changes.

regression-tests/test-results/gcc-13/pure2-bugfix-for-ufcs-noexcept.cpp.output

Whitespace-only changes.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
#define CPP2_USE_MODULES Yes
3+
4+
//=== Cpp2 type declarations ====================================================
5+
6+
7+
#include "cpp2util.h"
8+
9+
#line 1 "pure2-bugfix-for-ufcs-noexcept.cpp2"
10+
class t;
11+
12+
13+
//=== Cpp2 type definitions and function declarations ===========================
14+
15+
#line 1 "pure2-bugfix-for-ufcs-noexcept.cpp2"
16+
class t {
17+
public: auto swap(t const& that) noexcept -> void;
18+
19+
public: t() = default;
20+
public: t(t const&) = delete; /* No 'that' constructor, suppress copy */
21+
public: auto operator=(t const&) -> void = delete;
22+
#line 3 "pure2-bugfix-for-ufcs-noexcept.cpp2"
23+
};
24+
auto main() -> int;
25+
26+
27+
//=== Cpp2 function definitions =================================================
28+
29+
30+
#line 2 "pure2-bugfix-for-ufcs-noexcept.cpp2"
31+
auto t::swap(t const& that) noexcept -> void{}
32+
33+
auto main() -> int{static_assert(noexcept(CPP2_UFCS(&,,(swap),(t()),(,), t()))); }
34+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pure2-bugfix-for-ufcs-noexcept.cpp2... ok (all Cpp2, passes safety checks)
2+

0 commit comments

Comments
 (0)