Skip to content

fix for ISO warning #2818

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

Closed
heshpdx opened this issue Nov 20, 2024 · 1 comment · Fixed by #2824
Closed

fix for ISO warning #2818

heshpdx opened this issue Nov 20, 2024 · 1 comment · Fixed by #2824
Assignees

Comments

@heshpdx
Copy link
Contributor

heshpdx commented Nov 20, 2024

Fixing up some esoteric messages from the compiler and I came across this one.

vtr-vpr/libs/libvtrutil/src/vtr_ndmatrix.h:79:24: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
   79 |     NdMatrixProxy<T, 1>(const size_t* dim_sizes, const size_t* dim_stride, T* start)
      |                        ^

Here is the simple fix from my tree:

diff --git a/src/vtr-vpr/libs/libvtrutil/src/vtr_ndmatrix.h b/src/vtr-vpr/libs/libvtrutil/src/vtr_ndmatrix.h
index c3a4692..b34a9c8 100644
--- a/src/vtr-vpr/libs/libvtrutil/src/vtr_ndmatrix.h
+++ b/src/vtr-vpr/libs/libvtrutil/src/vtr_ndmatrix.h
@@ -34,7 +34,7 @@ class NdMatrixProxy {
      *    @param dim_stride: The stride of this dimension (i.e. how many element in memory between indicies of this dimension)
      *    @param  start: Pointer to the start of the sub-matrix this proxy represents
      */
-    NdMatrixProxy<T, N>(const size_t* dim_sizes, const size_t* dim_strides, T* start)
+    NdMatrixProxy(const size_t* dim_sizes, const size_t* dim_strides, T* start)
         : dim_sizes_(dim_sizes)
         , dim_strides_(dim_strides)
         , start_(start) {}
@@ -76,7 +76,7 @@ class NdMatrixProxy<T, 1> {
      *    @param dim_stride: The stride of this dimension (i.e. how many element in memory between indicies of this dimension)
      *    @param  start: Pointer to the start of the sub-matrix this proxy represents
      */
-    NdMatrixProxy<T, 1>(const size_t* dim_sizes, const size_t* dim_stride, T* start)
+    NdMatrixProxy(const size_t* dim_sizes, const size_t* dim_stride, T* start)
         : dim_sizes_(dim_sizes)
         , dim_strides_(dim_stride)
         , start_(start) {}

Sorry that this is an issue and not a PR; I'm juggling a lot of things and wanted to just communicate this small thing.

@AlexandreSinger
Copy link
Contributor

@heshpdx Thank you for this issue! I have resolved it in a PR. It is strange to put the template IDs in the constructor of any templated class. This must have been done by mistake. I have also found that the copy constructor of this class also does this, so I have resolved that as well.

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