JDimproved / JDim

2ch browser for linux
https://jdimproved.github.io/JDim/
GNU General Public License v2.0
44 stars 11 forks source link

Root: Move analyze_board_xml() definition to cpp file #1316

Closed ma8ma closed 6 months ago

ma8ma commented 6 months ago

メンバー関数の中で呼び出しているテンプレート関数はインスタンス化が必要だが利用可能な定義がないとclangに警告されたためメンバー関数をclass定義の外に移動します。

clang 17のレポート

../src/dbtree/root.h:186:36: warning: instantiation of function 'DBTREE::Root::slot_analyze_board_xml<DBTREE::Root>' required here, but no definition is available [-Wundefined-func-template]
  186 |         void analyze_board_xml() { slot_analyze_board_xml( *this ); }
      |                                    ^
../src/dbtree/root.h:175:14: note: forward declaration of template entity is here
  175 |         void slot_analyze_board_xml( T& bbsmenu );
      |              ^
../src/dbtree/root.h:186:36: note: add an explicit instantiation declaration to suppress this warning if 'DBTREE::Root::slot_analyze_board_xml<DBTREE::Root>' is explicitly instantiated in another translation unit
  186 |         void analyze_board_xml() { slot_analyze_board_xml( *this ); }
      |                                    ^

関連のpull request: #1307