Skip to content

Commit b88b194

Browse files
committed
Merge branch 'main' into lsp-main
2 parents 405e49f + 44a7255 commit b88b194

File tree

98 files changed

+1524
-1214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+1524
-1214
lines changed

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
13-
- uses: actions/setup-python@v4
13+
- uses: actions/setup-python@v5
1414
with:
1515
python-version: 3.x
16-
- uses: actions/cache@v2
16+
- uses: actions/cache@v4
1717
with:
1818
key: ${{ github.ref }}
1919
path: .cache

build_h2.bat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@echo off
2+
cd source
3+
cppfront reflect.h2 -verb
4+
cd ..\include
5+
cppfront cpp2regex.h2 -verb
6+
cd..

docs/cpp2/functions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,12 @@ In a function body, a **definite last use** of a local name is a single use of t
388388

389389
For each definite last use:
390390

391-
- If the name is a local object or a `copy` or `move` parameter, we know the object will not be used again before being destroyed, and so the object is automatically treated as an rvalue (move candidate). If the expression that contains the last use is able to move from the rvalue, the move will happen automatically.
391+
- If the name is a `copy` or `move` parameter or is a local object whose name does not start with `guard`, we know the object will not be used again before being destroyed, and so the object is automatically treated as an rvalue (move candidate). If the expression that contains the last use is able to move from the rvalue, the move will happen automatically.
392392

393393
- If the name is a `forward` parameter, the object is automatically forwarded to preserve its constness and value category (`std::forward`-ed).
394394

395+
> Note: This gives language meaning to a naming convention of `guard` as a name prefix for "guard" stack objects, such as local `std::scoped_lock` objects, whose destructors are always the object's real last use.
396+
395397
For example:
396398

397399
``` cpp title="Definite last uses" linenums="1" hl_lines="13 16 19 21"

gen_build.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
cppfront -_gen_build > source\build.info
3+
@echo Build stamp updated to:
4+
type source\build.info

include/cpp2regex.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ template<typename CharT, typename Iter, int max_groups> class match_context
149149

150150
private: std::array<match_group<Iter>,max_groups> groups {};
151151

152-
public: explicit match_context(Iter const& begin_, Iter const& end_);
152+
public: match_context(Iter const& begin_, Iter const& end_);
153153

154154
#line 68 "cpp2regex.h2"
155155
public: match_context(match_context const& that);
@@ -212,7 +212,7 @@ template<typename Func> class on_return
212212
{
213213
private: Func func;
214214

215-
public: explicit on_return(Func const& f);
215+
public: on_return(Func const& f);
216216
#line 136 "cpp2regex.h2"
217217
public: auto operator=(Func const& f) -> on_return& ;
218218

@@ -577,7 +577,7 @@ template<typename CharT, typename matcher_wrapper> class regular_expression
577577
public: context<Iter> ctx;
578578
public: int pos;
579579

580-
public: explicit search_return(cpp2::impl::in<bool> matched_, context<Iter> const& ctx_, Iter const& pos_);
580+
public: search_return(cpp2::impl::in<bool> matched_, context<Iter> const& ctx_, Iter const& pos_);
581581

582582
#line 690 "cpp2regex.h2"
583583
public: [[nodiscard]] auto group_number() const& -> decltype(auto);

include/cpp2util.h

Lines changed: 149 additions & 148 deletions
Large diffs are not rendered by default.

regression-tests/mixed-bugfix-for-ufcs-non-local.cpp2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ d: _ == t<o.f()>(); // Fails on Clang 12 (lambda in unevaluated context).
3838

3939
u: @struct type = {
4040
b: bool == o.f();
41-
c: bool == :(forward x: decltype(o.f())) = x;(true); // Fails on Clang 12 (lambda in unevaluated context).
41+
// UFCS used in the decltype in the line below causes all compilers to report error/crash
42+
c: bool == :(forward x: decltype(f(o))) = x;(true); // Fails on Clang 12 (lambda in unevaluated context).
4243
g: (s, sz) pre(s.sz() != 0) = { }
4344
}
4445

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
123
2+
0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hi ho hum
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
12145505332166550543

0 commit comments

Comments
 (0)