site
site copied to clipboard
定義された用語の意図しない使用方法を検出するスクリプトを追加
- #1347
「未定義」の意図しない使用方法を検出してみました。
許可された使用法として以下を設定して見ましたが、「挙動は未定義」と「振る舞いは未定義」は「動作は未定義」に統合してしまっていいかもしれません。
- 未定義動作
- 未定義の動作
- 動作は未定義
- 挙動は未定義
- 振る舞いは未定義
仕様を調べながら、個別の問題をどう直すか相談していく必要がありそうです。 このスクリプトでの意図しない「未定義」の使用が0になったらマージします。
site % python3 .github/workflows/script/defined_word_check.py
implementation-status.md: the file includes unintended word use "未定義". Around the word:"| P0137R1: [参照メンバをもつクラスの置き換え](/lang/cpp17/replacement_of_class_objects_containing_reference_members.md) | 参照型メンバや`const`メンバ変数を含むクラスについてこれまで結果は未定義とされていた配置`new`によるオブジェクトの置き換えを条件付きで可能とする | 7 | 6.0 | No | 2017 Update 7 |"
lang/cpp11/lambda_expressions.md: the file includes unintended word use "未定義". Around the word:" foo()(2); // 未定義の振る舞い"
lang/cpp17.md: the file includes unintended word use "未定義". Around the word:"| [参照メンバをもつクラスの置き換え](cpp17/replacement_of_class_objects_containing_reference_members.md) | 参照型メンバや`const`メンバ変数を含むクラスについてこれまで結果は未定義とされていた配置`new`によるオブジェクトの置き換えを条件付きで可能とする |"
reference/array/array/back.md: the file includes unintended word use "未定義". Around the word:"要素数が0の場合(`N == 0`の場合)、この関数呼び出しの効果は未定義である。"
reference/array/array/front.md: the file includes unintended word use "未定義". Around the word:"要素数が0の場合(`N == 0`の場合)、この関数呼び出しの効果は未定義である。"
reference/atomic/atomic/fetch_add.md: the file includes unintended word use "未定義". Around the word:" - 結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない"
reference/atomic/atomic/fetch_sub.md: the file includes unintended word use "未定義". Around the word:" - 結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない"
reference/atomic/atomic/op_minus_assign.md: the file includes unintended word use "未定義". Around the word:" - 結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない"
reference/atomic/atomic/op_plus_assign.md: the file includes unintended word use "未定義". Around the word:" - 結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない"
reference/atomic/atomic_fetch_add.md: the file includes unintended word use "未定義". Around the word:"符号付き整数型に対しては、2の補数表現による演算が行われ、未定義動作はない。アドレス型に関しては結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない。"
reference/atomic/atomic_fetch_add_explicit.md: the file includes unintended word use "未定義". Around the word:"符号付き整数型に対しては、2の補数表現による演算が行われ、未定義動作はない。アドレス型に関しては結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない。"
reference/atomic/atomic_fetch_and.md: the file includes unintended word use "未定義". Around the word:"符号付き整数型に対しては、2の補数表現による演算が行われ、未定義動作はない。アドレス型に関しては結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない。"
reference/atomic/atomic_fetch_and_explicit.md: the file includes unintended word use "未定義". Around the word:"符号付き整数型に対しては、2の補数表現による演算が行われ、未定義動作はない。アドレス型に関しては結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない。"
reference/atomic/atomic_fetch_or.md: the file includes unintended word use "未定義". Around the word:"符号付き整数型に対しては、2の補数表現による演算が行われ、未定義動作はない。アドレス型に関しては結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない。"
reference/atomic/atomic_fetch_or_explicit.md: the file includes unintended word use "未定義". Around the word:"符号付き整数型に対しては、2の補数表現による演算が行われ、未定義動作はない。アドレス型に関しては結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない。"
reference/atomic/atomic_fetch_sub.md: the file includes unintended word use "未定義". Around the word:"符号付き整数型に対しては、2の補数表現による演算が行われ、未定義動作はない。アドレス型に関しては結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない。"
reference/atomic/atomic_fetch_sub_explicit.md: the file includes unintended word use "未定義". Around the word:"符号付き整数型に対しては、2の補数表現による演算が行われ、未定義動作はない。アドレス型に関しては結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない。"
reference/atomic/atomic_fetch_xor.md: the file includes unintended word use "未定義". Around the word:"符号付き整数型に対しては、2の補数表現による演算が行われ、未定義動作はない。アドレス型に関しては結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない。"
reference/atomic/atomic_fetch_xor_explicit.md: the file includes unintended word use "未定義". Around the word:"符号付き整数型に対しては、2の補数表現による演算が行われ、未定義動作はない。アドレス型に関しては結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない。"
reference/atomic/atomic_ref/fetch_add.md: the file includes unintended word use "未定義". Around the word:" - 結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない"
reference/atomic/atomic_ref/fetch_sub.md: the file includes unintended word use "未定義". Around the word:" - 結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない"
reference/atomic/atomic_ref/op_minus_assign.md: the file includes unintended word use "未定義". Around the word:" - 結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない"
reference/atomic/atomic_ref/op_plus_assign.md: the file includes unintended word use "未定義". Around the word:" - 結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない"
reference/cstddef/offsetof.md: the file includes unintended word use "未定義". Around the word:"スタンダードレイアウトではないクラス型においての`offsetof`の利用は条件付きのサポートとなる(C++17より以前は未定義)。"
reference/future/shared_future/get.md: the file includes unintended word use "未定義". Around the word:"- `future::get()` : 共有状態に格納されている値への`const`左辺値参照を返す。<br/>備考:共有状態が破壊された後、その参照を介してのアクセスは未定義の振る舞いをする。`shared_future`オブジェクトの寿命よりも長いオブジェクトに参照を保持しないこと。"
reference/ios/basic_ios/op_assign.md: the file includes unintended word use "未定義". Around the word:"- コピー代入演算子は `private` で未定義(C++03 まで)、あるいは、`public` で `delete`(C++11 から)である。 "
reference/ios/basic_ios/op_constructor.md: the file includes unintended word use "未定義". Around the word:"- コピーコンストラクタは `private` で未定義(C++03 まで)、あるいは、`public` で `delete`(C++11 から)である。 "
reference/ios/ios_base/op_assign.md: the file includes unintended word use "未定義". Around the word:"- コピー代入演算子は `private` で未定義(C++03 まで)、あるいは、`public` で `delete`(C++11 から)である。 "
reference/ios/ios_base/op_constructor.md: the file includes unintended word use "未定義". Around the word:"- コピーコンストラクタは `private` で未定義(C++03 まで)、あるいは、`public` で `delete`(C++11 から)である。 "
reference/list/list/merge.md: the file includes unintended word use "未定義". Around the word:"- 移動先と移動元のアロケータが等値でない場合(`get_allocator() != x.get_allocator()`の場合)、この関数呼び出しの効果は未定義である。"
reference/list/list/splice.md: the file includes unintended word use "未定義". Around the word:"- 移動先と移動元のアロケータが等値でない場合(`get_allocator() != x.get_allocator()`の場合)、この関数呼び出しの効果は未定義である。"
reference/new/op_new.md: the file includes unintended word use "未定義". Around the word:" ただし、記憶域の確保に失敗する可能性もあり、また、成功しても当該ポインタを間接参照した場合の結果は未定義である。"
reference/new/op_new[].md: the file includes unintended word use "未定義". Around the word:" ただし、記憶域の確保に失敗する可能性もあり、また、成功しても当該ポインタを間接参照した場合の結果は未定義である。"
reference/node_handle/node_handle.md: the file includes unintended word use "未定義". Around the word:"`key_type` を `K`、 `mapped_type` を `T` としたとき、`std::pair<K, T>`または`std::pair<const K, T>`に対するユーザー定義の特殊化が存在する場合、ノードハンドルを用いる操作は未定義である。"
reference/ranges/range_adaptor_closure.md: the file includes unintended word use "未定義". Around the word:"CV修飾を含む`D`を引数とする `|` 演算子を含む式の動作は、プログラム定義の`operator|`関数が選択された場合は未定義である。"
reference/regex/regex_iterator.md: the file includes unintended word use "未定義". Around the word:"シーケンス終端のイテレータに対する [`operator*`](regex_iterator/op_deref.md) 演算子適用は未定義である。その他のイテレータに対する [`operator*`](regex_iterator/op_deref.md) 演算子適用の結果は `const` [`match_results`](match_results.md)`<BidirectionalIterator>&` である。 "
reference/regex/regex_iterator.md: the file includes unintended word use "未定義". Around the word:"同様に、シーケンス終端のイテレータに対する [`operator->`](regex_iterator/op_arrow.md) 演算子適用は未定義である。その他のイテレータに対する [`operator->`](regex_iterator/op_arrow.md) 演算子適用の結果は `const` [`match_results`](match_results.md)`<BidirectionalIterator>*` である。"
reference/regex/regex_token_iterator.md: the file includes unintended word use "未定義". Around the word:"シーケンス終端のイテレータに対する [`operator*`](regex_token_iterator/op_deref.md) 演算子適用は未定義である。その他のイテレータに対する [`operator*`](regex_token_iterator/op_deref.md) 演算子適用の結果は `const` [`sub_match`](sub_match.md)`<BidirectionalIterator>&` である。 "
reference/regex/regex_token_iterator.md: the file includes unintended word use "未定義". Around the word:"同様に、シーケンス終端のイテレータに対する [`operator->`](regex_token_iterator/op_arrow.md) 演算子適用は未定義である。その他のイテレータに対する [`operator->`](regex_token_iterator/op_arrow.md) 演算子適用の結果は `const` [`sub_match`](sub_match.md)`<BidirectionalIterator>*` である。"