Skip to content

Commit 5b6eda2

Browse files
committed
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)
1 parent 0260d44 commit 5b6eda2

31 files changed

+714
-680
lines changed

include/cpp2util.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2813,8 +2813,6 @@ inline constexpr auto as_() -> decltype(auto)
28132813

28142814
}
28152815

2816-
#include "cpp2regex.h"
2817-
28182816
using cpp2::cpp2_new;
28192817

28202818

regression-tests/test-results/gcc-10-c++20/pure2-bugfix-for-requires-clause-in-forward-declaration.cpp.output

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:46: error: expect
66
In file included from pure2-bugfix-for-requires-clause-in-forward-declaration.cpp:7:
77
../../../include/cpp2util.h:10005:47: error: static assertion failed: GCC 11 or higher is required to support variables and type-scope functions that have a 'requires' clause. This includes a type-scope 'forward' parameter of non-wildcard type, such as 'func: (this, forward s: std::string)', which relies on being able to add a 'requires' clause - in that case, use 'forward s: _' instead if you need the result to compile with GCC 10.
88
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:4:1: note: in expansion of macro ‘CPP2_REQUIRES_’
9-
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:3: error: no declaration matches ‘element::element(auto:241&&) requires is_same_v<std::__cxx11::string, typename std::remove_cv<typename std::remove_reference<decltype(element::__ct ::n)>::type>::type>’
9+
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:3: error: no declaration matches ‘element::element(auto:95&&) requires is_same_v<std::__cxx11::string, typename std::remove_cv<typename std::remove_reference<decltype(element::__ct ::n)>::type>::type>’
1010
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:5:11: note: candidates are: ‘element::element(const element&)’
11-
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:20: note: ‘template<class auto:239> element::element(auto:239&&)’
11+
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:20: note: ‘template<class auto:93> element::element(auto:93&&)’
1212
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:1:7: note: ‘class element’ defined here
1313
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:5:78: error: expected unqualified-id before ‘{’ token
14-
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:8: error: no declaration matches ‘element& element::operator=(auto:242&&) requires is_same_v<std::__cxx11::string, typename std::remove_cv<typename std::remove_reference<decltype(element::operator=::n)>::type>::type>’
14+
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:8: error: no declaration matches ‘element& element::operator=(auto:96&&) requires is_same_v<std::__cxx11::string, typename std::remove_cv<typename std::remove_reference<decltype(element::operator=::n)>::type>::type>’
1515
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:6:16: note: candidates are: ‘void element::operator=(const element&)’
16-
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:16: note: ‘template<class auto:240> element& element::operator=(auto:240&&)’
16+
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:16: note: ‘template<class auto:94> element& element::operator=(auto:94&&)’
1717
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:1:7: note: ‘class element’ defined here

regression-tests/test-results/gcc-10-c++20/pure2-print.cpp.output

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ pure2-print.cpp2:68:1: note: in expansion of macro ‘CPP2_REQUIRES_’
99
pure2-print.cpp2:97:1: note: in expansion of macro ‘CPP2_REQUIRES_’
1010
pure2-print.cpp2:9:41: error: ‘constexpr const T outer::object_alias’ is not a static data member of ‘class outer’
1111
pure2-print.cpp2:9:48: error: template definition of non-template ‘constexpr const T outer::object_alias’
12-
pure2-print.cpp2:67:14: error: no declaration matches ‘void outer::mytype::variadic(const auto:240& ...) requires (is_convertible_v<typename std::remove_cv<typename std::remove_reference<decltype(outer::mytype::variadic::x)>::type>::type, int> && ...)’
13-
pure2-print.cpp2:67:29: note: candidate is: ‘template<class ... auto:239> static void outer::mytype::variadic(const auto:239& ...)’
12+
pure2-print.cpp2:67:14: error: no declaration matches ‘void outer::mytype::variadic(const auto:94& ...) requires (is_convertible_v<typename std::remove_cv<typename std::remove_reference<decltype(outer::mytype::variadic::x)>::type>::type, int> && ...)’
13+
pure2-print.cpp2:67:29: note: candidate is: ‘template<class ... auto:93> static void outer::mytype::variadic(const auto:93& ...)’
1414
pure2-print.cpp2:10:19: note: ‘class outer::mytype’ defined here
1515
pure2-print.cpp2:96:37: error: no declaration matches ‘void outer::print(std::ostream&, const Args& ...) requires cpp2::impl::cmp_greater_eq(sizeof ... (Args ...), 0)’
1616
pure2-print.cpp2:96:37: note: no functions named ‘void outer::print(std::ostream&, const Args& ...) requires cpp2::impl::cmp_greater_eq(sizeof ... (Args ...), 0)’

regression-tests/test-results/gcc-14-c++2b/gcc-version.output

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
g++ (GCC) 14.1.1 20240701 (Red Hat 14.1.1-7)
1+
g++ (GCC) 14.2.1 20240801 (Red Hat 14.2.1-1)
22
Copyright (C) 2024 Free Software Foundation, Inc.
33
This is free software; see the source for copying conditions. There is NO
44
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mixed-bounds-safety-with-assert.cpp2(11) void print_subrange(const auto:237&, cpp2::impl::in<int>, cpp2::impl::in<int>) [with auto:237 = std::vector<int>; cpp2::impl::in<int> = const int]: Bounds safety violation
1+
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

regression-tests/test-results/msvc-2022-c++latest/pure2-regex_10_escapes.cpp.execution

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@ Running tests_10_escapes:
99
08_y: OK regex: foo(\h)bar parsed_regex: foo(\h)bar str: foo bar result_expr: $1 expected_results
1010
09_y: OK regex: (\H)(\h) parsed_regex: (\H)(\h) str: foo bar result_expr: $1-$2 expected_results o-
1111
10_y: OK regex: (\h)(\H) parsed_regex: (\h)(\H) str: foo bar result_expr: $1-$2 expected_results -b
12-
11_y: OK regex: foo(\v+)bar parsed_regex: foo(\v+)bar str: foo
12+
11_y: OK regex: foo(\v+)bar parsed_regex: foo(\v+)bar str: foo
13+
1314

15+
bar result_expr: $1 expected_results
16+
1417

15-
bar result_expr: $1 expected_results
1618

19+
12_y: OK regex: (\V+)(\v) parsed_regex: (\V+)(\v) str: foo
20+
1721

22+
bar result_expr: $1-$2 expected_results foo-
23+
13_y: OK regex: (\v+)(\V) parsed_regex: (\v+)(\V) str: foo
24+
1825

19-
12_y: OK regex: (\V+)(\v) parsed_regex: (\V+)(\v) str: foo
20-
21-
22-
bar result_expr: $1-$2 expected_results foo-
23-
13_y: OK regex: (\v+)(\V) parsed_regex: (\v+)(\V) str: foo
24-
25-
26-
bar result_expr: $1-$2 expected_results
27-
26+
bar result_expr: $1-$2 expected_results
27+
2828

2929
-b
30-
14_y: OK regex: foo(\v)bar parsed_regex: foo(\v)bar str: foobar result_expr: $1 expected_results
31-
15_y: OK regex: (\V)(\v) parsed_regex: (\V)(\v) str: foobar result_expr: $1-$2 expected_results o-
30+
14_y: OK regex: foo(\v)bar parsed_regex: foo(\v)bar str: foobar result_expr: $1 expected_results
31+
15_y: OK regex: (\V)(\v) parsed_regex: (\V)(\v) str: foobar result_expr: $1-$2 expected_results o-
3232
16_y: OK regex: (\v)(\V) parsed_regex: (\v)(\V) str: foobar result_expr: $1-$2 expected_results -b
3333
17_y: OK regex: foo\t\n\r\f\a\ebar parsed_regex: foo\t\n\r\f\a\ebar str: foo
3434
bar result_expr: $& expected_results foo

regression-tests/test-results/pure2-regex_01_char_matcher.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
#define CPP2_IMPORT_STD Yes
3+
#include "cpp2regex.h"
34

45
//=== Cpp2 type declarations ====================================================
56

regression-tests/test-results/pure2-regex_02_ranges.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
#define CPP2_IMPORT_STD Yes
3+
#include "cpp2regex.h"
34

45
//=== Cpp2 type declarations ====================================================
56

regression-tests/test-results/pure2-regex_03_wildcard.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
#define CPP2_IMPORT_STD Yes
3+
#include "cpp2regex.h"
34

45
//=== Cpp2 type declarations ====================================================
56

regression-tests/test-results/pure2-regex_04_start_end.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
#define CPP2_IMPORT_STD Yes
3+
#include "cpp2regex.h"
34

45
//=== Cpp2 type declarations ====================================================
56

0 commit comments

Comments
 (0)