std::exception::what() ほか、C++98時点の throw() 例外仕様の記載漏れを修正 - #1761
Merged
Merged
Conversation
`std::exception::what()` の C++98 版の宣言に、例外仕様 `throw()` が抜けていたため追加しました。
## 変更内容
```diff
- virtual const char* what() const; // (1) C++98
+ virtual const char* what() const throw(); // (1) C++98
```
## 根拠
C++98/03 の規格 18.6.1 [lib.exception] では、`what()` は次のように宣言されています。
virtual const char* what() const throw();
C++11 で `throw()` が `noexcept` に置き換えられたため、C++11 版の宣言(`noexcept`)とも対応がとれます。
Member
|
プレビュー生成のコメント投稿に失敗しているようなので、 botのフリして代わりに投稿します。 ⚡ プレビュー (HTML) (更新時刻: 2026-10-03 18:57:41 JST) 変更記事一覧4件の記事が変更されました。
※ソース (.md) に直接変更のあった記事を列挙しています。グローバル修飾や変換規則の変更による変化は考慮していません。 |
Member
|
ありがとうございます。マージしました。 |
faithandbrave
added a commit
that referenced
this pull request
Oct 3, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
std::exceptionのメンバ関数のうち、C++98 版の宣言に例外仕様throw()が抜けていたため追加しました。変更内容
以下のページの C++98 の宣言に
throw()を追加しています。what()根拠
C++98/03 の規格 18.6.1 [lib.exception] では、
exceptionクラスは次のように宣言されています。C++11 でこれらの
throw()はnoexceptに置き換えられたため、既存の C++11 版の宣言とも対応がとれます。