-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separation of metafunction and runtime regex code. (#1219)
* Separation of metafunction and runtime regex code. * Move metafunction work into reflect.h2 Instead of a separate file in ./source * Update of regression tests. * Merge regex metafunction into cpp2::meta namespace The run-time support library stays in `cpp2util.h` and can use the `cpp2::regex::` subnamespace there The compile-time parts stay in `reflect.h2` and use the `cpp2::meta::` namespace there Eventually this can be generalized for user-written metafunctions when those are supported, but for right now this keeps things consistent for the metafunctions supplied in-the-box with cppfront * Add `add_runtime_support_include` to meta For metafunctions that require runtime support via #includes to be injected into lowered Cpp1 programs Also cleanup while I'm at it: - remove headers from `common.h` that are now already included via `cpp2util.h` - line up some thing that got un-lined-up (OCD) --------- Co-authored-by: Herb Sutter <herb.sutter@gmail.com>
- Loading branch information
1 parent
df73616
commit d70601e
Showing
42 changed files
with
7,266 additions
and
7,156 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2824,8 +2824,6 @@ inline constexpr auto as_() -> decltype(auto) | |
|
||
} | ||
|
||
#include "cpp2regex.h" | ||
|
||
using cpp2::cpp2_new; | ||
|
||
|
||
|
4 changes: 4 additions & 0 deletions
4
regression-tests/test-results/apple-clang-14-c++2b/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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pure2-default-arguments.cpp2:6:61: error: no member named 'source_location' in namespace 'std' | ||
char const* fn = CPP2_UFCS_NONLOCAL(function_name)(std::source_location::current()) | ||
~~~~~^ | ||
1 error generated. |
2 changes: 2 additions & 0 deletions
2
regression-tests/test-results/apple-clang-15-c++2b/pure2-default-arguments.cpp.execution
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
calling: | ||
012 |
4 changes: 4 additions & 0 deletions
4
regression-tests/test-results/clang-15-c++20-libcpp/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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pure2-default-arguments.cpp2:6:61: error: no member named 'source_location' in namespace 'std' | ||
char const* fn = CPP2_UFCS_NONLOCAL(function_name)(std::source_location::current()) | ||
~~~~~^ | ||
1 error generated. |
2 changes: 2 additions & 0 deletions
2
regression-tests/test-results/clang-15-c++20/pure2-default-arguments.cpp.execution
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
calling: | ||
012 |
7 changes: 7 additions & 0 deletions
7
regression-tests/test-results/clang-18-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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pure2-default-arguments.cpp2:6:56: error: cannot take address of consteval function 'current' outside of an immediate invocation | ||
6 | char const* fn = CPP2_UFCS_NONLOCAL(function_name)(std::source_location::current()) | ||
| ^ | ||
/usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/source_location:60:5: note: declared here | ||
60 | current(__builtin_ret_type __p = __builtin_source_location()) noexcept | ||
| ^ | ||
1 error generated. |
7 changes: 7 additions & 0 deletions
7
regression-tests/test-results/clang-18-c++23-libcpp/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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pure2-default-arguments.cpp2:6:56: error: cannot take address of consteval function 'current' outside of an immediate invocation | ||
6 | char const* fn = CPP2_UFCS_NONLOCAL(function_name)(std::source_location::current()) | ||
| ^ | ||
/usr/lib/llvm-18/bin/../include/c++/v1/source_location:60:36: note: declared here | ||
60 | static consteval source_location current(__bsl_ty __ptr = __builtin_source_location()) noexcept { | ||
| ^ | ||
1 error generated. |
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
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
2 changes: 1 addition & 1 deletion
2
regression-tests/test-results/gcc-13-c++2b/mixed-bounds-safety-with-assert.cpp.execution
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 +1 @@ | ||
mixed-bounds-safety-with-assert.cpp2(11) void print_subrange(const auto:263&, cpp2::impl::in<int>, cpp2::impl::in<int>) [with auto:263 = std::vector<int>; cpp2::impl::in<int> = const int]: Bounds safety violation | ||
mixed-bounds-safety-with-assert.cpp2(11) void print_subrange(const auto:243&, cpp2::impl::in<int>, cpp2::impl::in<int>) [with auto:243 = std::vector<int>; cpp2::impl::in<int> = const int]: Bounds safety violation |
2 changes: 2 additions & 0 deletions
2
regression-tests/test-results/gcc-13-c++2b/pure2-default-arguments.cpp.execution
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
calling: int main(int, char**) | ||
012 |
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
2 changes: 1 addition & 1 deletion
2
regression-tests/test-results/gcc-14-c++2b/mixed-bounds-safety-with-assert.cpp.execution
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 +1 @@ | ||
mixed-bounds-safety-with-assert.cpp2(11) void print_subrange(const auto:257&, cpp2::impl::in<int>, cpp2::impl::in<int>) [with auto:257 = std::vector<int>; cpp2::impl::in<int> = const int]: Bounds safety violation | ||
mixed-bounds-safety-with-assert.cpp2(11) void print_subrange(const auto:91&, cpp2::impl::in<int>, cpp2::impl::in<int>) [with auto:91 = std::vector<int>; cpp2::impl::in<int> = const int]: Bounds safety violation |
2 changes: 2 additions & 0 deletions
2
regression-tests/test-results/msvc-2022-c++20/pure2-default-arguments.cpp.execution
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
calling: int __cdecl main(const int,char **) | ||
012 |
1 change: 1 addition & 0 deletions
1
regression-tests/test-results/msvc-2022-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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pure2-default-arguments.cpp |
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
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
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
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
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
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
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
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
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
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
1 change: 1 addition & 0 deletions
1
regression-tests/test-results/pure2-regex_11_group_references.cpp
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
1 change: 1 addition & 0 deletions
1
regression-tests/test-results/pure2-regex_12_case_insensitive.cpp
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
1 change: 1 addition & 0 deletions
1
regression-tests/test-results/pure2-regex_13_possessive_modifier.cpp
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
1 change: 1 addition & 0 deletions
1
regression-tests/test-results/pure2-regex_14_multiline_modifier.cpp
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
1 change: 1 addition & 0 deletions
1
regression-tests/test-results/pure2-regex_15_group_modifiers.cpp
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
1 change: 1 addition & 0 deletions
1
regression-tests/test-results/pure2-regex_16_perl_syntax_modifier.cpp
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
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
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
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
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
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
Oops, something went wrong.