| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent acab5c3 commit 7fff368
11 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -77,6 +77,7 @@ outer: @print type = { | |||
| 77 | 77 | ||
| 78 | 78 | object_alias_1: i8 == 42; | |
| 79 | 79 | object_alias_2: == 42; | |
| 80 | + object_alias_3: std::array == (4,5,6); | ||
| 80 | 81 | ||
| 81 | 82 | ||
| 82 | 83 | var: ::outer::mytype = (); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,4 +12,9 @@ main: (args) = { | |||
| 12 | 12 | i++; | |
| 13 | 13 | } | |
| 14 | 14 | std::cout << local_int << "\n"; // prints 43 | |
| 15 | + | ||
| 16 | + _: std::chrono::duration<i32> = 0; | ||
| 17 | + (copy _: std::chrono::duration<i32> = 0) { } | ||
| 18 | + _: std::in_place_t = (); | ||
| 19 | + (copy _: std::in_place_t = ()) { } | ||
| 15 | 20 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,12 +78,12 @@ auto main() -> int{ | |||
| 78 | 78 | if (cpp2::Default.has_handler() && !(std::move(f) == 0) ) { cpp2::Default.report_violation(""); } | |
| 79 | 79 | } | |
| 80 | 80 | { | |
| 81 | - auto const& f = t().f(); | ||
| 81 | + auto const& f{t().f()}; | ||
| 82 | 82 | #line 33 "pure2-bugfix-for-ufcs-name-lookup.cpp2" | |
| 83 | 83 | if (cpp2::Default.has_handler() && !(f == 0) ) { cpp2::Default.report_violation(""); } | |
| 84 | 84 | } | |
| 85 | 85 | { | |
| 86 | - auto const& f = t().f(); | ||
| 86 | + auto const& f{t().f()}; | ||
| 87 | 87 | #line 34 "pure2-bugfix-for-ufcs-name-lookup.cpp2" | |
| 88 | 88 | if (cpp2::Default.has_handler() && !(f == 0) ) { cpp2::Default.report_violation(""); } | |
| 89 | 89 | } | |
@@ -113,12 +113,12 @@ auto const& f = t().f(); | |||
| 113 | 113 | { | |
| 114 | 114 | auto f {[]() mutable -> void{ | |
| 115 | 115 | { | |
| 116 | - cpp2::in<identity> f = identity(); | ||
| 116 | + cpp2::in<identity> f{identity()}; | ||
| 117 | 117 | #line 59 "pure2-bugfix-for-ufcs-name-lookup.cpp2" | |
| 118 | 118 | if (cpp2::Default.has_handler() && !(CPP2_UFCS(f)(t()) == 0) ) { cpp2::Default.report_violation(""); } | |
| 119 | 119 | } | |
| 120 | 120 | { | |
| 121 | - cpp2::in<identity> f = identity(); | ||
| 121 | + cpp2::in<identity> f{identity()}; | ||
| 122 | 122 | #line 60 "pure2-bugfix-for-ufcs-name-lookup.cpp2" | |
| 123 | 123 | static_cast<void>(CPP2_UFCS(f)(u())); | |
| 124 | 124 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,12 +40,12 @@ extern cpp2::i32 y; | |||
| 40 | 40 | #line 5 "pure2-bugfix-for-unbraced-function-expression.cpp2" | |
| 41 | 41 | [[nodiscard]] auto main() -> int{ | |
| 42 | 42 | { | |
| 43 | - auto const& x = t(); | ||
| 43 | + auto const& x{t()}; | ||
| 44 | 44 | #line 6 "pure2-bugfix-for-unbraced-function-expression.cpp2" | |
| 45 | 45 | {CPP2_ASSERT_IN_BOUNDS(x, []() mutable -> auto { return 0; }); } | |
| 46 | 46 | } | |
| 47 | 47 | { | |
| 48 | - auto const& x = t(); | ||
| 48 | + auto const& x{t()}; | ||
| 49 | 49 | #line 7 "pure2-bugfix-for-unbraced-function-expression.cpp2" | |
| 50 | 50 | {CPP2_ASSERT_IN_BOUNDS(x, []() mutable -> auto { return 0; }); } | |
| 51 | 51 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,7 @@ class item { | |||
| 39 | 39 | #line 9 "pure2-interpolation.cpp2" | |
| 40 | 40 | [[nodiscard]] auto main() -> int{ | |
| 41 | 41 | { | |
| 42 | - auto const& x = 0; | ||
| 42 | + auto const& x{0}; | ||
| 43 | 43 | ||
| 44 | 44 | #line 11 "pure2-interpolation.cpp2" | |
| 45 | 45 | { | |
@@ -57,7 +57,7 @@ auto const& x = 0; | |||
| 57 | 57 | } | |
| 58 | 58 | } | |
| 59 | 59 | { | |
| 60 | - auto const& x = item(); | ||
| 60 | + auto const& x{item()}; | ||
| 61 | 61 | ||
| 62 | 62 | #line 25 "pure2-interpolation.cpp2" | |
| 63 | 63 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,27 +55,27 @@ CPP2_REQUIRES_ ((std::is_convertible_v<CPP2_TYPEOF(x), int> && ...)) ; | |||
| 55 | 55 | ||
| 56 | 56 | public: static auto test() -> void; | |
| 57 | 57 | ||
| 58 | - #line 91 "pure2-print.cpp2" | ||
| 58 | + #line 92 "pure2-print.cpp2" | ||
| 59 | 59 | public: template<typename ...Ts> class x { | |
| 60 | 60 | private: std::tuple<Ts...> tup {}; | |
| 61 | 61 | public: x() = default; | |
| 62 | 62 | public: x(x const&) = delete; /* No 'that' constructor, suppress copy */ | |
| 63 | 63 | public: auto operator=(x const&) -> void = delete; | |
| 64 | 64 | ||
| 65 | - #line 93 "pure2-print.cpp2" | ||
| 65 | + #line 94 "pure2-print.cpp2" | ||
| 66 | 66 | }; | |
| 67 | 67 | ||
| 68 | 68 | public: template<typename ...Args> static auto print(std::ostream& out, Args const& ...args) -> void | |
| 69 | 69 | CPP2_REQUIRES_ (cpp2::cmp_greater_eq(sizeof...(Args),0u)) ; | |
| 70 | 70 | ||
| 71 | - #line 99 "pure2-print.cpp2" | ||
| 71 | + #line 100 "pure2-print.cpp2" | ||
| 72 | 72 | public: template<typename ...Args> [[nodiscard]] static auto all(Args const& ...args) -> bool; | |
| 73 | 73 | public: outer() = default; | |
| 74 | 74 | public: outer(outer const&) = delete; /* No 'that' constructor, suppress copy */ | |
| 75 | 75 | public: auto operator=(outer const&) -> void = delete; | |
| 76 | 76 | ||
| 77 | 77 | ||
| 78 | - #line 102 "pure2-print.cpp2" | ||
| 78 | + #line 103 "pure2-print.cpp2" | ||
| 79 | 79 | }; | |
| 80 | 80 | ||
| 81 | 81 | auto main() -> int; | |
@@ -169,8 +169,9 @@ requires ((std::is_convertible_v<CPP2_TYPEOF(x), int> && ...)) {(std::cout << .. | |||
| 169 | 169 | ||
| 170 | 170 | cpp2::i8 constexpr object_alias_1 = 42; | |
| 171 | 171 | auto constexpr object_alias_2 = 42; | |
| 172 | + std::array constexpr object_alias_3{ 4, 5, 6 }; | ||
| 172 | 173 | ||
| 173 | - #line 82 "pure2-print.cpp2" | ||
| 174 | + #line 83 "pure2-print.cpp2" | ||
| 174 | 175 | ::outer::mytype var {}; | |
| 175 | 176 | cout << CPP2_UFCS(g)(var, 42) << "\n"; | |
| 176 | 177 | ||
@@ -180,17 +181,17 @@ requires ((std::is_convertible_v<CPP2_TYPEOF(x), int> && ...)) {(std::cout << .. | |||
| 180 | 181 | () << "\n"; | |
| 181 | 182 | } | |
| 182 | 183 | ||
| 183 | - #line 95 "pure2-print.cpp2" | ||
| 184 | + #line 96 "pure2-print.cpp2" | ||
| 184 | 185 | template<typename ...Args> auto outer::print(std::ostream& out, Args const& ...args) -> void | |
| 185 | 186 | requires (cpp2::cmp_greater_eq(sizeof...(Args),0u)) { | |
| 186 | - #line 96 "pure2-print.cpp2" | ||
| 187 | + #line 97 "pure2-print.cpp2" | ||
| 187 | 188 | (out << ... << args); | |
| 188 | 189 | } | |
| 189 | 190 | ||
| 190 | 191 | template<typename ...Args> [[nodiscard]] auto outer::all(Args const& ...args) -> bool { | |
| 191 | 192 | return (... && args); } | |
| 192 | 193 | ||
| 193 | - #line 104 "pure2-print.cpp2" | ||
| 194 | + #line 105 "pure2-print.cpp2" | ||
| 194 | 195 | auto main() -> int{ | |
| 195 | 196 | outer::test(); | |
| 196 | 197 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -124,6 +124,7 @@ outer:/* @print */ type = | |||
| 124 | 124 | type_alias: type == array<int, 10>; | |
| 125 | 125 | object_alias_1: i8 == 42; | |
| 126 | 126 | object_alias_2: == 42; | |
| 127 | + object_alias_3: std::array == (4, 5, 6); | ||
| 127 | 128 | var: ::outer::mytype = (); | |
| 128 | 129 | cout << var.g(42) << "\n"; | |
| 129 | 130 | cout << inspect var.g(42) -> namespace_alias::string { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ auto main(int const argc_, char** argv_) -> int{ | |||
| 26 | 26 | #line 3 "pure2-statement-scope-parameters.cpp2" | |
| 27 | 27 | auto local_int {42}; | |
| 28 | 28 | { | |
| 29 | - auto const& i = local_int; | ||
| 29 | + auto const& i{local_int}; | ||
| 30 | 30 | ||
| 31 | 31 | // 'in' (read-only) statement scope variable | |
| 32 | 32 | #line 6 "pure2-statement-scope-parameters.cpp2" | |
@@ -35,7 +35,7 @@ auto const& i = local_int; | |||
| 35 | 35 | } | |
| 36 | 36 | } | |
| 37 | 37 | { | |
| 38 | - auto& i = local_int; | ||
| 38 | + auto& i{local_int}; | ||
| 39 | 39 | ||
| 40 | 40 | // 'inout' (read-write) statement scope variable | |
| 41 | 41 | #line 11 "pure2-statement-scope-parameters.cpp2" | |
@@ -45,5 +45,20 @@ auto& i = local_int; | |||
| 45 | 45 | } | |
| 46 | 46 | #line 14 "pure2-statement-scope-parameters.cpp2" | |
| 47 | 47 | std::cout << std::move(local_int) << "\n";// prints 43 | |
| 48 | + | ||
| 49 | + std::chrono::duration<cpp2::i32> auto_16_5 {0}; | ||
| 50 | + { | ||
| 51 | + [[maybe_unused]] std::chrono::duration<cpp2::i32> unnamed_param_1{0}; | ||
| 52 | + #line 17 "pure2-statement-scope-parameters.cpp2" | ||
| 53 | + {} | ||
| 54 | + } | ||
| 55 | + #line 18 "pure2-statement-scope-parameters.cpp2" | ||
| 56 | + std::in_place_t auto_18_5 {}; | ||
| 57 | + { | ||
| 58 | + [[maybe_unused]] std::in_place_t unnamed_param_1{}; | ||
| 59 | + #line 19 "pure2-statement-scope-parameters.cpp2" | ||
| 60 | + {} | ||
| 61 | + } | ||
| 62 | + #line 20 "pure2-statement-scope-parameters.cpp2" | ||
| 48 | 63 | } | |
| 49 | 64 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -73,7 +73,7 @@ namespace N { | |||
| 73 | 73 | auto myfunc() -> void{ | |
| 74 | 74 | N1::pmr_vec<myclass::str> v {"xyzzy", "plugh"}; | |
| 75 | 75 | { | |
| 76 | - auto const& v2 = std::move(v); | ||
| 76 | + auto const& v2{std::move(v)}; | ||
| 77 | 77 | ||
| 78 | 78 | #line 21 "pure2-type-and-namespace-aliases.cpp2" | |
| 79 | 79 | for ( auto const& s : v2 ) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -818,7 +818,7 @@ namespace meta { | |||
| 818 | 818 | static_cast<void>(CPP2_UFCS(emplace_back)((*cpp2::assert_not_null(_1)), s, source_line::category::cpp2)); | |
| 819 | 819 | }}; | |
| 820 | 820 | { | |
| 821 | - auto newline_pos = CPP2_UFCS(find)(source, '\n'); | ||
| 821 | + auto newline_pos{CPP2_UFCS(find)(source, '\n')}; | ||
| 822 | 822 | ||
| 823 | 823 | // First split this string into source_lines | |
| 824 | 824 | // | |
@@ -1483,7 +1483,7 @@ auto basic_enum( | |||
| 1483 | 1483 | ||
| 1484 | 1484 | auto found_non_numeric {false}; | |
| 1485 | 1485 | { | |
| 1486 | - std::string value = "-1"; | ||
| 1486 | + std::string value{"-1"}; | ||
| 1487 | 1487 | ||
| 1488 | 1488 | #line 957 "reflect.h2" | |
| 1489 | 1489 | for ( | |
@@ -1613,7 +1613,7 @@ std::string value = "-1"; | |||
| 1613 | 1613 | CPP2_UFCS(add_member)(t, " operator= : (out this, that) == { }"); | |
| 1614 | 1614 | CPP2_UFCS(add_member)(t, " operator<=> : (this, that) -> std::strong_ordering;"); | |
| 1615 | 1615 | { | |
| 1616 | - std::string to_string = " to_string: (this) -> std::string = { \n"; | ||
| 1616 | + std::string to_string{" to_string: (this) -> std::string = { \n"}; | ||
| 1617 | 1617 | ||
| 1618 | 1618 | // Provide a 'to_string' function to print enumerator name(s) | |
| 1619 | 1619 | ||
@@ -1696,7 +1696,7 @@ auto cpp2_union(meta::type_declaration& t) -> void | |||
| 1696 | 1696 | { | |
| 1697 | 1697 | std::vector<value_member_info> alternatives {}; | |
| 1698 | 1698 | { | |
| 1699 | - auto value = 0; | ||
| 1699 | + auto value{0}; | ||
| 1700 | 1700 | ||
| 1701 | 1701 | // 1. Gather: All the user-written members, and find/compute the max size | |
| 1702 | 1702 | ||
@@ -1745,14 +1745,14 @@ auto value = 0; | |||
| 1745 | 1745 | ||
| 1746 | 1746 | CPP2_UFCS(remove_marked_members)(t); | |
| 1747 | 1747 | { | |
| 1748 | - std::string storage = " _storage: cpp2::aligned_storage<cpp2::max( "; | ||
| 1748 | + std::string storage{" _storage: cpp2::aligned_storage<cpp2::max( "}; | ||
| 1749 | 1749 | ||
| 1750 | 1750 | // Provide storage | |
| 1751 | 1751 | ||
| 1752 | 1752 | #line 1250 "reflect.h2" | |
| 1753 | 1753 | { | |
| 1754 | 1754 | { | |
| 1755 | - std::string comma = ""; | ||
| 1755 | + std::string comma{""}; | ||
| 1756 | 1756 | ||
| 1757 | 1757 | #line 1252 "reflect.h2" | |
| 1758 | 1758 | for ( | |
@@ -1765,7 +1765,7 @@ std::string comma = ""; | |||
| 1765 | 1765 | #line 1258 "reflect.h2" | |
| 1766 | 1766 | storage += "), cpp2::max( "; | |
| 1767 | 1767 | { | |
| 1768 | - std::string comma = ""; | ||
| 1768 | + std::string comma{""}; | ||
| 1769 | 1769 | ||
| 1770 | 1770 | #line 1261 "reflect.h2" | |
| 1771 | 1771 | for ( | |
@@ -1800,7 +1800,7 @@ std::string comma = ""; | |||
| 1800 | 1800 | CPP2_UFCS(add_member)(t, (" set_" + cpp2::to_string(a.name) + ": (inout this, forward _args...: _) = { if !is_" + cpp2::to_string(a.name) + "() { _destroy(); std::construct_at( reinterpret_cast<*" + cpp2::to_string(a.type) + ">(_storage&), _args...); } else { reinterpret_cast<*" + cpp2::to_string(a.type) + ">(_storage&)* = :" + cpp2::to_string(a.type) + " = (_args...); } _discriminator = " + cpp2::to_string(a.value) + "; }\n")); | |
| 1801 | 1801 | } | |
| 1802 | 1802 | { | |
| 1803 | - std::string destroy = " private _destroy: (inout this) = {\n"; | ||
| 1803 | + std::string destroy{" private _destroy: (inout this) = {\n"}; | ||
| 1804 | 1804 | ||
| 1805 | 1805 | // Add destroy | |
| 1806 | 1806 | ||
@@ -1824,7 +1824,7 @@ std::string destroy = " private _destroy: (inout this) = {\n"; | |||
| 1824 | 1824 | // Add default constructor | |
| 1825 | 1825 | CPP2_UFCS(add_member)(t, " operator=: (out this) = { }"); | |
| 1826 | 1826 | { | |
| 1827 | - std::string value_set = ""; | ||
| 1827 | + std::string value_set{""}; | ||
| 1828 | 1828 | ||
| 1829 | 1829 | // Add copy/move construction and assignment | |
| 1830 | 1830 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments