forked from hsutter/cppfront
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
is()/as(): refactor of is() and as() for std::any and std::optional t…
…o new design (part 3 of n) (hsutter#1251) * is()/as(): Refactor is() and as() for std::any * is()/as(): refactor is() and as() for std::optional * Fix tests
- Loading branch information
1 parent
a18d22e
commit 2949161
Showing
4 changed files
with
72 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 16 additions & 16 deletions
32
regression-tests/test-results/gcc-10-c++20/pure2-default-arguments.cpp.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,66 @@ | ||
In file included from pure2-default-arguments.cpp:7: | ||
../../../include/cpp2util.h:2086:28: error: local variable ‘obj’ may not appear in this context | ||
2086 | template<typename T, typename X> | ||
2086 | template<typename T, std::same_as<std::any> X> | ||
| ^~~ | ||
../../../include/cpp2util.h:2047:34: note: in definition of macro ‘CPP2_UFCS_IDENTITY’ | ||
2047 | return false; | ||
| ^ | ||
../../../include/cpp2util.h:2086:15: note: in expansion of macro ‘CPP2_FORWARD’ | ||
2086 | template<typename T, typename X> | ||
2086 | template<typename T, std::same_as<std::any> X> | ||
| ^~~~~~~~~~~~ | ||
../../../include/cpp2util.h:2107:22: note: in expansion of macro ‘CPP2_UFCS_CONSTRAINT_ARG’ | ||
2107 | } | ||
| ^ | ||
../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ | ||
2137 | | ||
2137 | return false; | ||
| ^ | ||
pure2-default-arguments.cpp2:6:22: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ | ||
../../../include/cpp2util.h:2086:92: error: local variable ‘params’ may not appear in this context | ||
2086 | template<typename T, typename X> | ||
2086 | template<typename T, std::same_as<std::any> X> | ||
| ^ | ||
../../../include/cpp2util.h:2047:34: note: in definition of macro ‘CPP2_UFCS_IDENTITY’ | ||
2047 | return false; | ||
| ^ | ||
../../../include/cpp2util.h:2086:79: note: in expansion of macro ‘CPP2_FORWARD’ | ||
2086 | template<typename T, typename X> | ||
2086 | template<typename T, std::same_as<std::any> X> | ||
| ^ | ||
../../../include/cpp2util.h:2107:22: note: in expansion of macro ‘CPP2_UFCS_CONSTRAINT_ARG’ | ||
2107 | } | ||
| ^ | ||
../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ | ||
2137 | | ||
2137 | return false; | ||
| ^ | ||
pure2-default-arguments.cpp2:6:22: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ | ||
../../../include/cpp2util.h:2087:74: error: local variable ‘obj’ may not appear in this context | ||
2087 | requires (std::is_same_v<X,std::any> && !std::is_same_v<T,std::any> && !std::is_same_v<T,empty>) | ||
| ^~~ | ||
2087 | constexpr auto is( X const& x ) -> bool{ | ||
| ^ | ||
../../../include/cpp2util.h:2047:34: note: in definition of macro ‘CPP2_UFCS_IDENTITY’ | ||
2047 | return false; | ||
| ^ | ||
../../../include/cpp2util.h:2087:61: note: in expansion of macro ‘CPP2_FORWARD’ | ||
2087 | requires (std::is_same_v<X,std::any> && !std::is_same_v<T,std::any> && !std::is_same_v<T,empty>) | ||
| ^~~~~~~~~~~~ | ||
2087 | constexpr auto is( X const& x ) -> bool{ | ||
| ^ | ||
../../../include/cpp2util.h:2107:22: note: in expansion of macro ‘CPP2_UFCS_CONSTRAINT_ARG’ | ||
2107 | } | ||
| ^ | ||
../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ | ||
2137 | | ||
2137 | return false; | ||
| ^ | ||
pure2-default-arguments.cpp2:6:22: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ | ||
../../../include/cpp2util.h:2087:93: error: local variable ‘params’ may not appear in this context | ||
2087 | requires (std::is_same_v<X,std::any> && !std::is_same_v<T,std::any> && !std::is_same_v<T,empty>) | ||
| ^~~~~~ | ||
2087 | constexpr auto is( X const& x ) -> bool{ | ||
| ^ | ||
../../../include/cpp2util.h:2047:34: note: in definition of macro ‘CPP2_UFCS_IDENTITY’ | ||
2047 | return false; | ||
| ^ | ||
../../../include/cpp2util.h:2087:80: note: in expansion of macro ‘CPP2_FORWARD’ | ||
2087 | requires (std::is_same_v<X,std::any> && !std::is_same_v<T,std::any> && !std::is_same_v<T,empty>) | ||
| ^~~~~~~~~~~~ | ||
2087 | constexpr auto is( X const& x ) -> bool{ | ||
| ^ | ||
../../../include/cpp2util.h:2107:22: note: in expansion of macro ‘CPP2_UFCS_CONSTRAINT_ARG’ | ||
2107 | } | ||
| ^ | ||
../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ | ||
2137 | | ||
2137 | return false; | ||
| ^ | ||
pure2-default-arguments.cpp2:6:22: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ | ||
pure2-default-arguments.cpp2:6:61: error: ‘std::source_location’ has not been declared |
20 changes: 10 additions & 10 deletions
20
regression-tests/test-results/gcc-13-c++2b/mixed-bugfix-for-ufcs-non-local.cpp.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
In file included from mixed-bugfix-for-ufcs-non-local.cpp:6: | ||
../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type | ||
2100 | { | ||
2100 | return value(x); | ||
| ^ | ||
../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ | ||
2137 | | ||
2137 | return false; | ||
| ^ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:13:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:13:36: error: template argument 1 is invalid | ||
../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type | ||
2100 | { | ||
2100 | return value(x); | ||
| ^ | ||
../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ | ||
2137 | | ||
2137 | return false; | ||
| ^ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:21:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:21:36: error: template argument 1 is invalid | ||
../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type | ||
2100 | { | ||
2100 | return value(x); | ||
| ^ | ||
../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ | ||
2137 | | ||
2137 | return false; | ||
| ^ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:31:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:31:36: error: template argument 1 is invalid | ||
../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type | ||
2100 | { | ||
2100 | return value(x); | ||
| ^ | ||
../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ | ||
2137 | | ||
2137 | return false; | ||
| ^ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:33:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:33:36: error: template argument 1 is invalid | ||
../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type | ||
2100 | { | ||
2100 | return value(x); | ||
| ^ | ||
../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ | ||
2137 | | ||
2137 | return false; | ||
| ^ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:21:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:21:36: error: template argument 1 is invalid |
20 changes: 10 additions & 10 deletions
20
regression-tests/test-results/gcc-14-c++2b/mixed-bugfix-for-ufcs-non-local.cpp.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
In file included from mixed-bugfix-for-ufcs-non-local.cpp:6: | ||
../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type | ||
2100 | { | ||
2100 | return value(x); | ||
| ^ | ||
../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ | ||
2137 | | ||
2137 | return false; | ||
| ^ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:13:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:13:36: error: template argument 1 is invalid | ||
../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type | ||
2100 | { | ||
2100 | return value(x); | ||
| ^ | ||
../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ | ||
2137 | | ||
2137 | return false; | ||
| ^ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:21:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:21:36: error: template argument 1 is invalid | ||
../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type | ||
2100 | { | ||
2100 | return value(x); | ||
| ^ | ||
../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ | ||
2137 | | ||
2137 | return false; | ||
| ^ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:31:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:31:36: error: template argument 1 is invalid | ||
../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type | ||
2100 | { | ||
2100 | return value(x); | ||
| ^ | ||
../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ | ||
2137 | | ||
2137 | return false; | ||
| ^ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:33:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:33:36: error: template argument 1 is invalid | ||
../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type | ||
2100 | { | ||
2100 | return value(x); | ||
| ^ | ||
../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ | ||
2137 | | ||
2137 | return false; | ||
| ^ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:21:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ | ||
mixed-bugfix-for-ufcs-non-local.cpp2:21:36: error: template argument 1 is invalid |