| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 82cecba commit 7fd706d
87 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,6 +15,27 @@ | |||
| 15 | 15 | // Cpp2 utilities: | |
| 16 | 16 | // Language support implementations | |
| 17 | 17 | // #include'd by generated Cpp1 code | |
| 18 | + | ||
| 19 | + // There are two kinds of entities in this file. | ||
| 20 | + // | ||
| 21 | + // 1) Entities in namespace cpp2:: itself, and documented at /cppfront/docs | ||
| 22 | + // | ||
| 23 | + // These are intended for programs to use directly, to the extent | ||
| 24 | + // described in the documentation. Using any parts not described in the | ||
| 25 | + // documentation is not supported. | ||
| 26 | + // | ||
| 27 | + // 2) Entities in namespace cpp2::impl::, and macros | ||
| 28 | + // | ||
| 29 | + // These should not be used by the program. They form the language | ||
| 30 | + // support library intended to be called only from generated Cpp2 code. | ||
| 31 | + // | ||
| 32 | + // For example, if a Cpp2 function leaves a local variable | ||
| 33 | + // uninitialized, cppfront will generate uses of impl::deferred_init<> | ||
| 34 | + // under the covers and guarantee it is constructed exactly once, so | ||
| 35 | + // the implementation here doesn't need to check for double construction | ||
| 36 | + // because it can't happen; using the name impl::deferred_init directly | ||
| 37 | + // from program code is not supported. | ||
| 38 | + // | ||
| 18 | 39 | //=========================================================================== | |
| 19 | 40 | ||
| 20 | 41 | #ifndef CPP2_UTIL_H | |
@@ -267,6 +288,12 @@ | |||
| 267 | 288 | #endif | |
| 268 | 289 | ||
| 269 | 290 | ||
| 291 | + //----------------------------------------------------------------------- | ||
| 292 | + // | ||
| 293 | + // Macros | ||
| 294 | + // | ||
| 295 | + //----------------------------------------------------------------------- | ||
| 296 | + // | ||
| 270 | 297 | #define CPP2_TYPEOF(x) std::remove_cvref_t<decltype(x)> | |
| 271 | 298 | #if __cplusplus >= 202302L && \ | |
| 272 | 299 | ( \ | |
@@ -354,27 +381,6 @@ template <typename T> | |||
| 354 | 381 | using deref_t = decltype(*std::declval<T&>()); | |
| 355 | 382 | ||
| 356 | 383 | ||
| 357 | - //----------------------------------------------------------------------- | ||
| 358 | - // | ||
| 359 | - // String: A helper workaround for passing a string literal as a | ||
| 360 | - // template argument | ||
| 361 | - // | ||
| 362 | - //----------------------------------------------------------------------- | ||
| 363 | - // | ||
| 364 | - template<std::size_t N> | ||
| 365 | - struct String | ||
| 366 | - { | ||
| 367 | - constexpr String(const char (&str)[N]) | ||
| 368 | - { | ||
| 369 | - std::copy_n(str, N, value); | ||
| 370 | - } | ||
| 371 | - | ||
| 372 | - auto operator<=>(String const&) const = default; | ||
| 373 | - | ||
| 374 | - char value[N] = {}; | ||
| 375 | - }; | ||
| 376 | - | ||
| 377 | - | ||
| 378 | 384 | //----------------------------------------------------------------------- | |
| 379 | 385 | // | |
| 380 | 386 | // contract_group | |
@@ -461,6 +467,10 @@ auto inline testing = contract_group( | |||
| 461 | 467 | ); | |
| 462 | 468 | ||
| 463 | 469 | ||
| 470 | + namespace impl { | ||
| 471 | + | ||
| 472 | + //----------------------------------------------------------------------- | ||
| 473 | + // | ||
| 464 | 474 | // Check for invalid dereference or indirection which would result in undefined behavior. | |
| 465 | 475 | // | |
| 466 | 476 | // - Null pointer | |
@@ -565,8 +575,8 @@ auto assert_in_bounds(auto&& x, auto&& arg CPP2_SOURCE_LOCATION_PARAM_WITH_DEFAU | |||
| 565 | 575 | return CPP2_FORWARD(x) [ CPP2_FORWARD(arg) ]; | |
| 566 | 576 | } | |
| 567 | 577 | ||
| 568 | - #define CPP2_ASSERT_IN_BOUNDS(x,arg) (cpp2::assert_in_bounds((x),(arg))) | ||
| 569 | - #define CPP2_ASSERT_IN_BOUNDS_LITERAL(x,arg) (cpp2::assert_in_bounds<(arg)>(x)) | ||
| 578 | + #define CPP2_ASSERT_IN_BOUNDS(x,arg) (cpp2::impl::assert_in_bounds((x),(arg))) | ||
| 579 | + #define CPP2_ASSERT_IN_BOUNDS_LITERAL(x,arg) (cpp2::impl::assert_in_bounds<(arg)>(x)) | ||
| 570 | 580 | ||
| 571 | 581 | ||
| 572 | 582 | //----------------------------------------------------------------------- | |
@@ -632,6 +642,8 @@ auto Typeid( [[maybe_unused]] auto&& x ) -> decltype(auto) { | |||
| 632 | 642 | #endif | |
| 633 | 643 | } | |
| 634 | 644 | ||
| 645 | + } // impl | ||
| 646 | + | ||
| 635 | 647 | ||
| 636 | 648 | //----------------------------------------------------------------------- | |
| 637 | 649 | // | |
@@ -692,6 +704,9 @@ template<typename T> | |||
| 692 | 704 | } | |
| 693 | 705 | ||
| 694 | 706 | ||
| 707 | + | ||
| 708 | + namespace impl { | ||
| 709 | + | ||
| 695 | 710 | //----------------------------------------------------------------------- | |
| 696 | 711 | // | |
| 697 | 712 | // in<T> For "in" parameter | |
@@ -947,6 +962,9 @@ class out { | |||
| 947 | 962 | #define CPP2_UFCS_TEMPLATE_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,(),template,__VA_ARGS__) | |
| 948 | 963 | #define CPP2_UFCS_QUALIFIED_TEMPLATE_NONLOCAL(QUALID,...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,QUALID,template,__VA_ARGS__) | |
| 949 | 964 | ||
| 965 | + } // impl | ||
| 966 | + | ||
| 967 | + | ||
| 950 | 968 | ||
| 951 | 969 | //----------------------------------------------------------------------- | |
| 952 | 970 | // | |
@@ -1079,6 +1097,8 @@ inline auto to_string(auto&& value, std::string_view) -> std::string | |||
| 1079 | 1097 | #endif | |
| 1080 | 1098 | ||
| 1081 | 1099 | ||
| 1100 | + namespace impl { | ||
| 1101 | + | ||
| 1082 | 1102 | //----------------------------------------------------------------------- | |
| 1083 | 1103 | // | |
| 1084 | 1104 | // is and as | |
@@ -1624,6 +1644,9 @@ constexpr auto as( X const& x ) -> decltype(auto) | |||
| 1624 | 1644 | { return x.value(); } | |
| 1625 | 1645 | ||
| 1626 | 1646 | ||
| 1647 | + } // impl | ||
| 1648 | + | ||
| 1649 | + | ||
| 1627 | 1650 | //----------------------------------------------------------------------- | |
| 1628 | 1651 | // | |
| 1629 | 1652 | // A variation of GSL's final_action_success / finally | |
@@ -1739,6 +1762,8 @@ constexpr auto unsafe_narrow( X&& x ) noexcept -> decltype(auto) | |||
| 1739 | 1762 | } | |
| 1740 | 1763 | ||
| 1741 | 1764 | ||
| 1765 | + namespace impl { | ||
| 1766 | + | ||
| 1742 | 1767 | //----------------------------------------------------------------------- | |
| 1743 | 1768 | // | |
| 1744 | 1769 | // args: see main() arguments as a container of string_views | |
@@ -1800,6 +1825,8 @@ inline auto make_args(int argc, char** argv) -> args_t | |||
| 1800 | 1825 | return args_t{argc, argv}; | |
| 1801 | 1826 | } | |
| 1802 | 1827 | ||
| 1828 | + } // impl | ||
| 1829 | + | ||
| 1803 | 1830 | ||
| 1804 | 1831 | //----------------------------------------------------------------------- | |
| 1805 | 1832 | // | |
@@ -1877,7 +1904,7 @@ inline auto fopen( const char* filename, const char* mode ) { | |||
| 1877 | 1904 | #endif | |
| 1878 | 1905 | ||
| 1879 | 1906 | if (!x) { | |
| 1880 | - Throw( std::make_error_condition(std::errc::no_such_file_or_directory), "'fopen' attempt failed"); | ||
| 1907 | + impl::Throw(std::make_error_condition(std::errc::no_such_file_or_directory), "'fopen' attempt failed"); | ||
| 1881 | 1908 | } | |
| 1882 | 1909 | return c_raii( x, &std::fclose ); | |
| 1883 | 1910 | } | |
@@ -1893,6 +1920,9 @@ inline auto fopen( const char* filename, const char* mode ) { | |||
| 1893 | 1920 | // with cpp2::fopen as a starting example. | |
| 1894 | 1921 | ||
| 1895 | 1922 | ||
| 1923 | + | ||
| 1924 | + namespace impl { | ||
| 1925 | + | ||
| 1896 | 1926 | //----------------------------------------------------------------------- | |
| 1897 | 1927 | // | |
| 1898 | 1928 | // Signed/unsigned comparison checks | |
@@ -2056,6 +2086,8 @@ inline constexpr auto as_() -> decltype(auto) | |||
| 2056 | 2086 | return as<C,x>(); | |
| 2057 | 2087 | } | |
| 2058 | 2088 | ||
| 2089 | + } // impl | ||
| 2090 | + | ||
| 2059 | 2091 | ||
| 2060 | 2092 | } | |
| 2061 | 2093 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,118 +1,118 @@ | |||
| 1 | 1 | mixed-bugfix-for-ufcs-non-local.cpp2:13:12: error: a lambda expression cannot appear in this context | |
| 2 | 2 | template<t<CPP2_UFCS_NONLOCAL(f)(o)> UnnamedTypeParam1_1> bool inline constexpr v0 = false;// Fails on GCC ([GCC109781][]) and Clang 12 (a lambda expression cannot appear in this context) | |
| 3 | 3 | ^ | |
| 4 | - ../../../include/cpp2util.h:946:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 4 | + ../../../include/cpp2util.h:961:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 5 | 5 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__) | |
| 6 | 6 | ^ | |
| 7 | - ../../../include/cpp2util.h:925:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 7 | + ../../../include/cpp2util.h:940:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 8 | 8 | #define CPP2_UFCS_(LAMBDADEFCAPT,MVFWD,QUALID,TEMPKW,...) \ | |
| 9 | 9 | ^ | |
| 10 | 10 | mixed-bugfix-for-ufcs-non-local.cpp2:15:3: error: a lambda expression cannot appear in this context | |
| 11 | 11 | t<CPP2_UFCS_NONLOCAL(f)(o)> inline constexpr v1 = t<true>();// Fails on Clang 12 (lambda in unevaluated context). | |
| 12 | 12 | ^ | |
| 13 | - ../../../include/cpp2util.h:946:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 13 | + ../../../include/cpp2util.h:961:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 14 | 14 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__) | |
| 15 | 15 | ^ | |
| 16 | - ../../../include/cpp2util.h:925:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 16 | + ../../../include/cpp2util.h:940:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 17 | 17 | #define CPP2_UFCS_(LAMBDADEFCAPT,MVFWD,QUALID,TEMPKW,...) \ | |
| 18 | 18 | ^ | |
| 19 | 19 | mixed-bugfix-for-ufcs-non-local.cpp2:21:12: error: a lambda expression cannot appear in this context | |
| 20 | 20 | template<t<CPP2_UFCS_NONLOCAL(f)(o)> UnnamedTypeParam1_2> auto g() -> void; | |
| 21 | 21 | ^ | |
| 22 | - ../../../include/cpp2util.h:946:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 22 | + ../../../include/cpp2util.h:961:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 23 | 23 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__) | |
| 24 | 24 | ^ | |
| 25 | - ../../../include/cpp2util.h:925:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 25 | + ../../../include/cpp2util.h:940:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 26 | 26 | #define CPP2_UFCS_(LAMBDADEFCAPT,MVFWD,QUALID,TEMPKW,...) \ | |
| 27 | 27 | ^ | |
| 28 | - mixed-bugfix-for-ufcs-non-local.cpp2:23:36: error: a lambda expression cannot appear in this context | ||
| 29 | - auto g([[maybe_unused]] cpp2::in<t<CPP2_UFCS_NONLOCAL(f)(o)>> unnamed_param_1) -> void; | ||
| 30 | - ^ | ||
| 31 | - ../../../include/cpp2util.h:946:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 28 | + mixed-bugfix-for-ufcs-non-local.cpp2:23:42: error: a lambda expression cannot appear in this context | ||
| 29 | + auto g([[maybe_unused]] cpp2::impl::in<t<CPP2_UFCS_NONLOCAL(f)(o)>> unnamed_param_1) -> void; | ||
| 30 | + ^ | ||
| 31 | + ../../../include/cpp2util.h:961:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 32 | 32 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__) | |
| 33 | 33 | ^ | |
| 34 | - ../../../include/cpp2util.h:925:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 34 | + ../../../include/cpp2util.h:940:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 35 | 35 | #define CPP2_UFCS_(LAMBDADEFCAPT,MVFWD,QUALID,TEMPKW,...) \ | |
| 36 | 36 | ^ | |
| 37 | 37 | mixed-bugfix-for-ufcs-non-local.cpp2:27:29: error: a lambda expression cannot appear in this context | |
| 38 | 38 | [[nodiscard]] auto h() -> t<CPP2_UFCS_NONLOCAL(f)(o)>; | |
| 39 | 39 | ^ | |
| 40 | - ../../../include/cpp2util.h:946:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 40 | + ../../../include/cpp2util.h:961:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 41 | 41 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__) | |
| 42 | 42 | ^ | |
| 43 | - ../../../include/cpp2util.h:925:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 43 | + ../../../include/cpp2util.h:940:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 44 | 44 | #define CPP2_UFCS_(LAMBDADEFCAPT,MVFWD,QUALID,TEMPKW,...) \ | |
| 45 | 45 | ^ | |
| 46 | 46 | mixed-bugfix-for-ufcs-non-local.cpp2:31:12: error: a lambda expression cannot appear in this context | |
| 47 | 47 | template<t<CPP2_UFCS_NONLOCAL(f)(o)> UnnamedTypeParam1_3> using a = bool;// Fails on GCC ([GCC109781][]) and Clang 12 (a lambda expression cannot appear in this context) | |
| 48 | 48 | ^ | |
| 49 | - ../../../include/cpp2util.h:946:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 49 | + ../../../include/cpp2util.h:961:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 50 | 50 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__) | |
| 51 | 51 | ^ | |
| 52 | - ../../../include/cpp2util.h:925:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 52 | + ../../../include/cpp2util.h:940:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 53 | 53 | #define CPP2_UFCS_(LAMBDADEFCAPT,MVFWD,QUALID,TEMPKW,...) \ | |
| 54 | 54 | ^ | |
| 55 | 55 | mixed-bugfix-for-ufcs-non-local.cpp2:33:12: error: a lambda expression cannot appear in this context | |
| 56 | 56 | template<t<CPP2_UFCS_NONLOCAL(f)(o)> UnnamedTypeParam1_4> auto inline constexpr b = false;// Fails on GCC ([GCC109781][]). | |
| 57 | 57 | ^ | |
| 58 | - ../../../include/cpp2util.h:946:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 58 | + ../../../include/cpp2util.h:961:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 59 | 59 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__) | |
| 60 | 60 | ^ | |
| 61 | - ../../../include/cpp2util.h:925:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 61 | + ../../../include/cpp2util.h:940:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 62 | 62 | #define CPP2_UFCS_(LAMBDADEFCAPT,MVFWD,QUALID,TEMPKW,...) \ | |
| 63 | 63 | ^ | |
| 64 | 64 | mixed-bugfix-for-ufcs-non-local.cpp2:35:13: error: a lambda expression cannot appear in this context | |
| 65 | 65 | using c = t<CPP2_UFCS_NONLOCAL(f)(o)>;// Fails on Clang 12 (lambda in unevaluated context) and Clang 12 (a lambda expression cannot appear in this context) | |
| 66 | 66 | ^ | |
| 67 | - ../../../include/cpp2util.h:946:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 67 | + ../../../include/cpp2util.h:961:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 68 | 68 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__) | |
| 69 | 69 | ^ | |
| 70 | - ../../../include/cpp2util.h:925:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 70 | + ../../../include/cpp2util.h:940:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 71 | 71 | #define CPP2_UFCS_(LAMBDADEFCAPT,MVFWD,QUALID,TEMPKW,...) \ | |
| 72 | 72 | ^ | |
| 73 | 73 | mixed-bugfix-for-ufcs-non-local.cpp2:37:29: error: a lambda expression cannot appear in this context | |
| 74 | 74 | auto inline constexpr d = t<CPP2_UFCS_NONLOCAL(f)(o)>();// Fails on Clang 12 (lambda in unevaluated context). | |
| 75 | 75 | ^ | |
| 76 | - ../../../include/cpp2util.h:946:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 76 | + ../../../include/cpp2util.h:961:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 77 | 77 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__) | |
| 78 | 78 | ^ | |
| 79 | - ../../../include/cpp2util.h:925:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 79 | + ../../../include/cpp2util.h:940:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 80 | 80 | #define CPP2_UFCS_(LAMBDADEFCAPT,MVFWD,QUALID,TEMPKW,...) \ | |
| 81 | 81 | ^ | |
| 82 | 82 | mixed-bugfix-for-ufcs-non-local.cpp2:21:12: error: a lambda expression cannot appear in this context | |
| 83 | 83 | template<t<CPP2_UFCS_NONLOCAL(f)(o)> UnnamedTypeParam1_2> auto g() -> void{}// Fails on GCC ([GCC109781][]) and Clang 12 (a lambda expression cannot appear in this context) | |
| 84 | 84 | ^ | |
| 85 | - ../../../include/cpp2util.h:946:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 85 | + ../../../include/cpp2util.h:961:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 86 | 86 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__) | |
| 87 | 87 | ^ | |
| 88 | - ../../../include/cpp2util.h:925:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 88 | + ../../../include/cpp2util.h:940:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 89 | 89 | #define CPP2_UFCS_(LAMBDADEFCAPT,MVFWD,QUALID,TEMPKW,...) \ | |
| 90 | 90 | ^ | |
| 91 | - mixed-bugfix-for-ufcs-non-local.cpp2:23:36: error: a lambda expression cannot appear in this context | ||
| 92 | - auto g([[maybe_unused]] cpp2::in<t<CPP2_UFCS_NONLOCAL(f)(o)>> unnamed_param_1) -> void{}// Fails on Clang 12 (lambda in unevaluated context). | ||
| 93 | - ^ | ||
| 94 | - ../../../include/cpp2util.h:946:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 91 | + mixed-bugfix-for-ufcs-non-local.cpp2:23:42: error: a lambda expression cannot appear in this context | ||
| 92 | + auto g([[maybe_unused]] cpp2::impl::in<t<CPP2_UFCS_NONLOCAL(f)(o)>> unnamed_param_1) -> void{}// Fails on Clang 12 (lambda in unevaluated context). | ||
| 93 | + ^ | ||
| 94 | + ../../../include/cpp2util.h:961:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 95 | 95 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__) | |
| 96 | 96 | ^ | |
| 97 | - ../../../include/cpp2util.h:925:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 97 | + ../../../include/cpp2util.h:940:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 98 | 98 | #define CPP2_UFCS_(LAMBDADEFCAPT,MVFWD,QUALID,TEMPKW,...) \ | |
| 99 | 99 | ^ | |
| 100 | 100 | mixed-bugfix-for-ufcs-non-local.cpp2:27:29: error: a lambda expression cannot appear in this context | |
| 101 | 101 | [[nodiscard]] auto h() -> t<CPP2_UFCS_NONLOCAL(f)(o)> { return o; }// Fails on Clang 12 (lambda in unevaluated context). | |
| 102 | 102 | ^ | |
| 103 | - ../../../include/cpp2util.h:946:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 103 | + ../../../include/cpp2util.h:961:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 104 | 104 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__) | |
| 105 | 105 | ^ | |
| 106 | - ../../../include/cpp2util.h:925:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 106 | + ../../../include/cpp2util.h:940:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 107 | 107 | #define CPP2_UFCS_(LAMBDADEFCAPT,MVFWD,QUALID,TEMPKW,...) \ | |
| 108 | 108 | ^ | |
| 109 | - mixed-bugfix-for-ufcs-non-local.cpp2:41:79: error: lambda expression in an unevaluated operand | ||
| 110 | - inline CPP2_CONSTEXPR bool u::c = [](cpp2::in<std::type_identity_t<decltype(CPP2_UFCS_NONLOCAL(f)(o))>> x) mutable -> auto { return x; }(true);// Fails on Clang 12 (lambda in unevaluated context). | ||
| 111 | - ^ | ||
| 112 | - ../../../include/cpp2util.h:946:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 109 | + mixed-bugfix-for-ufcs-non-local.cpp2:41:85: error: lambda expression in an unevaluated operand | ||
| 110 | + inline CPP2_CONSTEXPR bool u::c = [](cpp2::impl::in<std::type_identity_t<decltype(CPP2_UFCS_NONLOCAL(f)(o))>> x) mutable -> auto { return x; }(true);// Fails on Clang 12 (lambda in unevaluated context). | ||
| 111 | + ^ | ||
| 112 | + ../../../include/cpp2util.h:961:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL' | ||
| 113 | 113 | #define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__) | |
| 114 | 114 | ^ | |
| 115 | - ../../../include/cpp2util.h:925:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 115 | + ../../../include/cpp2util.h:940:59: note: expanded from macro 'CPP2_UFCS_' | ||
| 116 | 116 | #define CPP2_UFCS_(LAMBDADEFCAPT,MVFWD,QUALID,TEMPKW,...) \ | |
| 117 | 117 | ^ | |
| 118 | 118 | 13 errors generated. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,9 +8,9 @@ pure2-assert-expected-not-null.cpp2:7:10: error: no member named 'expected' in n | |||
| 8 | 8 | /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/exception:92:8: note: 'unexpected' declared here | |
| 9 | 9 | void unexpected() __attribute__ ((__noreturn__)); | |
| 10 | 10 | ^ | |
| 11 | - pure2-assert-expected-not-null.cpp2:9:165: error: use of undeclared identifier 'ex' | ||
| 12 | - return *cpp2::assert_not_null(std::move(up)) + *cpp2::assert_not_null(std::move(sp)) + *cpp2::assert_not_null(std::move(op)) + *cpp2::assert_not_null(std::move(ex)); | ||
| 13 | - ^ | ||
| 11 | + pure2-assert-expected-not-null.cpp2:9:189: error: use of undeclared identifier 'ex' | ||
| 12 | + return *cpp2::impl::assert_not_null(std::move(up)) + *cpp2::impl::assert_not_null(std::move(sp)) + *cpp2::impl::assert_not_null(std::move(op)) + *cpp2::impl::assert_not_null(std::move(ex)); | ||
| 13 | + ^ | ||
| 14 | 14 | pure2-assert-expected-not-null.cpp2:14:22: error: expected '(' for function-style cast or type construction | |
| 15 | 15 | std::expected<int,bool> ex {std::unexpected(false)}; | |
| 16 | 16 | ~~~^ | |
@@ -21,7 +21,7 @@ pure2-assert-expected-not-null.cpp2:14:10: error: no member named 'expected' in | |||
| 21 | 21 | /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/exception:92:8: note: 'unexpected' declared here | |
| 22 | 22 | void unexpected() __attribute__ ((__noreturn__)); | |
| 23 | 23 | ^ | |
| 24 | - pure2-assert-expected-not-null.cpp2:15:45: error: use of undeclared identifier 'ex' | ||
| 25 | - return *cpp2::assert_not_null(std::move(ex)); | ||
| 26 | - ^ | ||
| 24 | + pure2-assert-expected-not-null.cpp2:15:51: error: use of undeclared identifier 'ex' | ||
| 25 | + return *cpp2::impl::assert_not_null(std::move(ex)); | ||
| 26 | + ^ | ||
| 27 | 27 | 6 errors generated. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments