規格案N4842を読んでいて分からないことがあったので質問させてください.
9.2.7 The inline specifier の第5パラグラフにて,
If the inline specifier is used in a friend function declaration, that declaration shall be a definition or the function shall have previously been declared inline.
とあり,
「classの内側でinlineなfriend関数を宣言した後,classの外側で定義とかできないのか?」
と考え試しに以下のエラーコードを書いてみましたが何もエラーがでませんでした.
エラーが出力されないのは,
第6パラグラフの後半に記載されているNDR(no diagnostic is required)と関係があるのでしょうか?
パラグラフが異なるので関係ないと思いますが...
C++
1struct X{ 2 friend inline void f(); 3}; 4 5void f(){} // エラー出ず
実行環境
GCC 9.2.0
Clang 6.0.0

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/01/24 15:14 編集
2020/01/28 05:10