Skip to content

Commit 35da899

Browse files
committed
Merge branch 'master' into hive
2 parents 17c7b08 + cbbdbf5 commit 35da899

36 files changed

Lines changed: 86 additions & 40 deletions

.github/workflows/script/link_check.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,34 @@ def add_link(origin_link: str):
156156
for m in re.finditer(r'[\*-] (.*?)\[link (.*?)\]', line):
157157
add_link(m.group(2))
158158

159+
# Markdownの参照スタイルリンク定義 (`[label]: url`) も参照として扱う。
160+
# 例: `[max_size]: ./scoped_allocator_adaptor/max_size.md`
161+
# (脚注 `[^label]:` は除外)
162+
for line in text.split("\n"):
163+
m = re.match(r'\s{0,3}\[([^\^\]][^\]]*)\]:\s+(\S+)', line)
164+
if m:
165+
add_link(m.group(2))
166+
159167
return inner_links, outer_links
160168

169+
# --- 孤立ページ (lonely page) チェック用 ---
170+
# 「孤立ページ」とは、どのページからもリンクされていない .md のこと。
171+
# reference/ 配下の .md は、リンク先パスをtypoすると「ページは存在するのに
172+
# どこからもリンクされない」孤立ページになる。そうしたリンクミスを検出するため、
173+
# 内部リンクチェックの一部として、reference/ 配下の全 .md が最低1箇所から
174+
# 参照されているかを確認する。
175+
176+
# どこからもリンクされていなくてよいページ (意図的に他ページから参照されないもの)。
177+
# ここに載せるのは「意図的にスタンドアロンなページ」だけにすること。
178+
# リンクミスで孤立したページは、ここに登録せず親ページ側のリンクを修正すること。
179+
LONELY_PAGE_ALLOWLIST = {
180+
"reference.md", # リファレンスのトップ索引 (index.md からのリンクはグローバルナビ扱い)
181+
"reference/node_handle.md", # node_handleを説明する説明用カテゴリ概要ページ
182+
# C++26の説明専用ヘルパー。Senderアルゴリズムの仕様定義で用いられるが、
183+
# 現状どのアルゴリズムページの仕様記述からも参照されていない。
184+
"reference/execution/execution/query-with-default.md",
185+
}
186+
161187
def check(check_inner_link: bool, check_outer_link: bool, url: str) -> bool:
162188
if not check_inner_link and not check_outer_link:
163189
print("unchecked", file=sys.stderr)
@@ -166,6 +192,7 @@ def check(check_inner_link: bool, check_outer_link: bool, url: str) -> bool:
166192
found_error = False
167193
current_dir = os.getcwd()
168194
outer_link_dict = dict()
195+
referenced = set() # 内部リンクの参照先 (repo相対パスに正規化)。孤立ページ検出用
169196
if len(url) <= 0:
170197
path_list = [(p, False) for p in glob.glob("**/*.md", recursive=True)]
171198
path_list.append(("GLOBAL_QUALIFY_LIST.txt", True))
@@ -198,6 +225,25 @@ def check(check_inner_link: bool, check_outer_link: bool, url: str) -> bool:
198225
if not os.path.exists(rel_link):
199226
print("{} href {} not found.".format(p, link), file=sys.stderr)
200227
found_error = True
228+
# 孤立ページ検出用に、.md への参照先をrepo相対で記録する
229+
if link.endswith(".md"):
230+
if link.startswith("/"):
231+
referenced.add(os.path.normpath(link.lstrip("/")))
232+
else:
233+
referenced.add(os.path.normpath(os.path.join(dirname, link)))
234+
235+
# 孤立ページ (lonely page) チェック: reference/ 配下に、どのページからも
236+
# リンクされていない .md ファイルが無いか確認する (リンク先パスのtypo等で発生する)。
237+
if check_inner_link:
238+
for p in sorted(glob.glob("reference/**/*.md", recursive=True)):
239+
norm = os.path.normpath(p)
240+
if norm in LONELY_PAGE_ALLOWLIST:
241+
continue
242+
if norm not in referenced:
243+
print("{} is a lonely page (どこからもリンクされていない孤立ページです。"
244+
"リンク先のtypo等が原因の可能性があります)".format(p),
245+
file=sys.stderr)
246+
found_error = True
201247

202248
if check_outer_link:
203249
# GitHub-hosted runnerはIPv6アウトバウンド経路を持たない

GLOBAL_QUALIFY_LIST.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
* <concepts>[link /reference/concepts.md]
113113
* common_reference_with[link /reference/concepts/common_reference_with.md]
114114
* common_with[link /reference/concepts/common_with.md]
115+
* constructible_from[link /reference/concepts/constructible_from.md]
115116
* convertible_to[link /reference/concepts/convertible_to.md]
116117
* copy_constructible[link /reference/concepts/copy_constructible.md]
117118
* default_initializable[link /reference/concepts/default_initializable.md]

implementation-status.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,14 @@
299299
| P2169R4: [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | 14 | 18 | | |
300300
| P1854R4: [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | 14 | 14 | | |
301301
| P2361R6: [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md) | `static_assert``[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | 14 | 18 | | |
302-
| P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | 15 | | | |
302+
| P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | 15 | Yes | | |
303303
| P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) | 型消去のために`void*`からポインタ型へのキャストを許可する | 14 | 17 | | |
304304
| P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr``S.size()``S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | 14 | 17 | | |
305305
| P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | 15 | Yes | | |
306306
| P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | 15 | 19 | | |
307307
| P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | |
308308
| P2748R5: [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md) | 寿命切れの変数によって引き起こされるバグを防止する | 14 | 19 | | |
309-
| P3106R1: [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | yes | 17 | | |
309+
| P3106R1: [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | Yes | 17 | | |
310310
| P0609R3: [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) | `auto [a, b [[maybe_unused]], c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | 15 | 19 | | |
311311
| P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md) | `export module MACRO_NAME;`を禁止 | 15 | | | |
312312
| P2809R3: [空の無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md) | 並行プログラムの進行保証などを考慮して空の無限ループを未定義動作ではないものとする | 14 | 19 | | |
@@ -316,7 +316,7 @@
316316
| P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) | 定数式の文脈での配置`new`を許可 | 15 | 20 | | |
317317
| P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md) | 未定義動作を引き起こす操作をコンパイルエラーとする | 15 | 19 | | |
318318
| P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md) | 畳み込み式を含む制約の包摂関係を認識できるようにし、オーバーロード解決の曖昧さを解消する | | 19 | | |
319-
| P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | |
319+
| P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | 21 | | |
320320
| P2686R5: [`constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) | 定数式に対する構造化束縛を許可し、関連して`constexpr`参照の制限を緩和して自動変数も参照できるようにする | 16 | | | |
321321
| P3068R6: [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | 16 | | | |
322322
| P2865R6: [非推奨だった組み込み配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md) | C++20で非推奨となっていた配列比較を削除 | 15 | 20 | | |
@@ -332,7 +332,7 @@
332332
| P3533R2: [`constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md) | 定数式の文脈での仮想継承を許可 | 16 | | | |
333333
| P2843R3: [プリプロセッサ仕様での「未定義動作」を不適格 (診断不要) に変更](/lang/cpp26/preprocessing_is_never_undefined.md) | プリプロセッサとレキサーの文脈での「未定義動作」用語を不適格 (診断不要) に変更 | 16 | | | |
334334
| P3868R1: [モジュール宣言より前での`#line`ディレクティブの使用を許可する](/lang/cpp26/allow_line_before_module_declarations.md) | モジュール宣言より前での`#line`ディレクティブの使用を禁止していたのは過度な制限だった | | | | |
335-
| P4136R2: [`#line`ディレクティブの制約を現実の実装に合わせて緩和する](/lang/cpp26/line_is_not_in_line_with_existing_implementation.md) | `#line 0``#line 2147483648`のような行番号指定を不適格としていたが、条件付きサポートとして許可する | | yes | | |
335+
| P4136R2: [`#line`ディレクティブの制約を現実の実装に合わせて緩和する](/lang/cpp26/line_is_not_in_line_with_existing_implementation.md) | `#line 0``#line 2147483648`のような行番号指定を不適格としていたが、条件付きサポートとして許可する | | Yes | | |
336336
| P4004R1: [可変引数テンプレートの半順序を再検討する](/lang/cpp26/reconsider_partial_ordering_of_variadic_templates.md) | 可変引数テンプレートの部分特殊化の半順序ルールを再検討して、より一貫したルールにする | | | | |
337337
| P3865R3: [テンプレートテンプレートパラメータに対するクラステンプレートパラメータ引数推論](/lang/cpp26/class_template_argument_deduction_for_type_template_template_parameters.md) | テンプレートテンプレートパラメータからクラステンプレート引数を推論できるようにクラステンプレートのテンプレート引数推論を拡張する | | | | |
338338
| P3726R2: [共用体の生存期間ルールの調整](/lang/cpp26/adjustments_to_union_lifetime_rules.md.nolink) | `union`メンバの活性化や生存期間に関する規則を整理して`constexpr`評価などの一貫性を改善する | | | | |

lang/cpp20/concepts.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ int main() {
217217
assert(b.size() == 3);
218218
}
219219
```
220-
* std::constructible_from[link /reference/concepts/constructible_from.md]
221220
* b.size()[link /reference/vector/vector/size.md]
222221
223222
@@ -248,7 +247,6 @@ int main() {
248247
assert(b.size() == 3);
249248
}
250249
```
251-
* std::constructible_from[link /reference/concepts/constructible_from.md]
252250
* std::move_constructible[link /reference/concepts/move_constructible.md]
253251
* b.size()[link /reference/vector/vector/size.md]
254252

@@ -943,7 +941,6 @@ int main() {
943941
void g(std::constructible_from<int> auto x);
944942
```
945943
* std::copy_constructible[link /reference/concepts/copy_constructible.md]
946-
* std::constructible_from[link /reference/concepts/constructible_from.md]
947944

948945
## 備考
949946
- GCC 9.1では、コンセプトが正式サポートされていないため、コンパイルオプションとして`-fconcepts`を付ける必要がある

reference/algorithm/ranges_fold_left_first.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ namespace std::ranges {
1717
constexpr auto fold_left_first(R&& r, F f); // (2)
1818
}
1919
```
20-
* constructible_from[link /reference/concepts/constructible_from.md]
2120
* iter_reference_t[link /reference/iterator/iter_reference_t.md]
2221
* indirectly-binary-left-foldable[link ./ranges_fold_left.md]
2322

reference/algorithm/ranges_fold_left_first_with_iter.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ namespace std::ranges {
1818
}
1919
```
2020
* indirectly-binary-left-foldable[link ./ranges_fold_left.md]
21-
* constructible_from[link /reference/concepts/constructible_from.md]
2221
* iter_reference_t[link /reference/iterator/iter_reference_t.md]
2322
2423
## 概要

reference/algorithm/ranges_fold_right_last.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ namespace std::ranges {
1717
constexpr auto fold_right_last(R&& r, F f); // (2)
1818
}
1919
```
20-
* constructible_from[link /reference/concepts/constructible_from.md]
2120
* iter_reference_t[link /reference/iterator/iter_reference_t.md]
2221
* indirectly-binary-right-foldable[link ./ranges_fold_right.md]
2322

reference/chrono/year_month.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ namespace std::chrono {
5757
5858
| 名前 | 説明 | 対応バージョン |
5959
|------|------|----------------|
60-
| [`operator/`](month_day/op_append.md) | カレンダー要素同士をつなぎ合わせる | C++20 |
60+
| [`operator/`](year_month/op_append.md) | カレンダー要素同士をつなぎ合わせる | C++20 |
6161
6262
6363
### 算術演算

reference/concepts/copy_constructible.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ namespace std {
1414
constructible_from<T, const T> && convertible_to<const T, T>;
1515
}
1616
```
17-
* constructible_from[link /reference/concepts/constructible_from.md]
1817
1918
## 概要
2019

reference/concepts/default_initializable.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ concept default_initializable = constructible_from<T> &&
3333
requires { T{}; } &&
3434
is-default-initializable<T>;
3535
```
36-
* constructible_from[link /reference/concepts/constructible_from.md]
3736
3837
3938
## 例

0 commit comments

Comments
 (0)