forked from hsutter/cppfront
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpure2-bugfix-for-ufcs-noexcept.cpp
More file actions
39 lines (25 loc) · 1.22 KB
/
pure2-bugfix-for-ufcs-noexcept.cpp
File metadata and controls
39 lines (25 loc) · 1.22 KB
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
#define CPP2_INCLUDE_STD Yes
//=== Cpp2 type declarations ====================================================
#include "cpp2util.h"
#line 1 "pure2-bugfix-for-ufcs-noexcept.cpp2"
class t;
#line 2 "pure2-bugfix-for-ufcs-noexcept.cpp2"
//=== Cpp2 type definitions and function declarations ===========================
#line 1 "pure2-bugfix-for-ufcs-noexcept.cpp2"
class t {
#line 2 "pure2-bugfix-for-ufcs-noexcept.cpp2"
public: virtual auto swap([[maybe_unused]] t const& that) noexcept -> void;
public: t() = default;
public: t(t const&) = delete; /* No 'that' constructor, suppress copy */
public: auto operator=(t const&) -> void = delete;
#line 3 "pure2-bugfix-for-ufcs-noexcept.cpp2"
};
auto main() -> int;
//=== Cpp2 function definitions =================================================
#line 1 "pure2-bugfix-for-ufcs-noexcept.cpp2"
#line 2 "pure2-bugfix-for-ufcs-noexcept.cpp2"
auto t::swap([[maybe_unused]] t const& that) noexcept -> void{}// Non-`virtual` blocked on #508, idiomatic form on #507.
#line 4 "pure2-bugfix-for-ufcs-noexcept.cpp2"
auto main() -> int{
static_assert(noexcept(CPP2_UFCS(swap)(t(), t())));// Fails on Clang 12 (lambda in unevaluated context) and GCC 10 (static assertion failed)
}