Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warning for -Wdeprecated-redundant-constexpr-static-def #1285

Conversation

ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Nov 4, 2023

C++17からinline変数が導入されたことによりクラスのconstepxr staticメンバー変数のout-of-line定義が重複になり廃止予定になったとコンパイラーに指摘されたため取り除きます。

clang-17のレポート

src/skeleton/dragtreeview.cpp:35:37: warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Wdeprecated-redundant-constexpr-static-def]
   35 | constexpr const char* DragTreeView::s_css_classname;
      |                                     ^
src/skeleton/editview.cpp:783:33: warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Wdeprecated-redundant-constexpr-static-def]
  783 | constexpr const char* EditView::s_css_classname;
      |                                 ^
src/skeleton/toolbar.cpp:33:32: warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Wdeprecated-redundant-constexpr-static-def]
   33 | constexpr const char* ToolBar::s_css_label;
      |                                ^
src/skeleton/window.cpp:49:33: warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Wdeprecated-redundant-constexpr-static-def]
   49 | constexpr const char* JDWindow::s_css_stat_label;
      |                                 ^

C++17からinline変数が導入されたことによりクラスのconstepxr static
メンバー変数のout-of-line定義が重複になり廃止予定になったと
コンパイラーに指摘されたため取り除きます。

clang-17のレポート
```
src/skeleton/dragtreeview.cpp:35:37: warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Wdeprecated-redundant-constexpr-static-def]
   35 | constexpr const char* DragTreeView::s_css_classname;
      |                                     ^
src/skeleton/editview.cpp:783:33: warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Wdeprecated-redundant-constexpr-static-def]
  783 | constexpr const char* EditView::s_css_classname;
      |                                 ^
src/skeleton/toolbar.cpp:33:32: warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Wdeprecated-redundant-constexpr-static-def]
   33 | constexpr const char* ToolBar::s_css_label;
      |                                ^
src/skeleton/window.cpp:49:33: warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Wdeprecated-redundant-constexpr-static-def]
   49 | constexpr const char* JDWindow::s_css_stat_label;
      |                                 ^
```
@ma8ma ma8ma added the bug バグの追跡 label Nov 4, 2023
@ma8ma ma8ma merged commit ae73bda into master Nov 4, 2023
20 checks passed
@ma8ma ma8ma deleted the fix-compiler-warnings-for-Wdeprecated-redundant-constexpr-static-def branch November 4, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug バグの追跡
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant