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

Newer versions of gcc give warning for "error: template-id not allowed for constructor in C++20" #33493

Closed
tehampson opened this issue May 16, 2024 · 0 comments · Fixed by #33491
Assignees

Comments

@tehampson
Copy link
Contributor

Reported by @agners on slack. Opening issue for @yyzhong-g to look into

gcc version 14.1.1 give warning and fails to compile on tip of tree after with the following error:

In file included from ../src/app/InteractionModelDelegatePointers.h:21,
                 from ../src/app/InteractionModelDelegatePointers.cpp:18:
../src/lib/support/static_support_smart_ptr.h:57:38: error: template-id not allowed for constructor in C++20 [-Werror=template-id-cdtor]
   57 |     CheckedGlobalInstanceReference<T>() = default;
      |                                      ^
../src/lib/support/static_support_smart_ptr.h:57:38: note: remove the '< >'
../src/lib/support/static_support_smart_ptr.h:92:31: error: template-id not allowed for constructor in C++20 [-Werror=template-id-cdtor]
   92 |     SimpleInstanceReference<T>() = default;
      |

Reverting #33426, or adding -Wno-error=template-id-cdtor, makes the issue go away

@tehampson tehampson assigned tehampson and unassigned tehampson May 16, 2024
@mergify mergify bot closed this as completed in #33491 May 21, 2024
scarf005 added a commit to scarf005/Cataclysm-BN that referenced this issue Jul 12, 2024
scarf005 added a commit to cataclysmbnteam/Cataclysm-BN that referenced this issue Jul 21, 2024
* build: fix template-id-cdtor error on gcc 14

related: project-chip/connectedhomeip#33493

* build: use explicit `std::replace` from `<algorithm>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants