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

No matching constructor for initialising Array1D #2

Open
dvalters opened this issue Apr 21, 2018 · 2 comments
Open

No matching constructor for initialising Array1D #2

dvalters opened this issue Apr 21, 2018 · 2 comments
Assignees
Labels
bug Something isn't working c++-coding-standard

Comments

@dvalters
Copy link
Owner

dvalters commented Apr 21, 2018

Managed to reproduce a bug reported by @fclubb using the clang-static analyzer (so I assume they were trying to use clang to compile(?)

Anyway clang (version?) does not like this:

include/TNT/tnt_sparse_matrix_csr.h:97

rowptr_(M, r), colind_(nz, c), dim1_(M), dim2_(N) {}

The full error is this:

1 error generated.
 /home/dav/Downloads/cling_2018-01-27_fedora27/bin/../libexec/c++-analyzer -g -std=c++11 -DOMP_COMPILE_FOR_PARALLEL -fopenmp -D'GIT_REVISION=3d0c1a0' -I include -c -o build/catchmentmodel/LSDGrainMatrix.o src/catchmentmodel/LSDGrainMatrix.cpp
In file included from src/catchmentmodel/LSDGrainMatrix.cpp:39:
In file included from include/catchmentmodel/LSDGrainMatrix.hpp:27:
In file included from include/TNT/tnt.h:55:
include/TNT/tnt_sparse_matrix_csr.h:97:3: error: no matching constructor for initialization of 'Array1D<int>'
                rowptr_(M, r), colind_(nz, c), dim1_(M), dim2_(N) {}
                ^       ~~~~

Then a bunch of notes/suggestions from clang:

include/TNT/tnt_array1d.h:63:11: note: candidate constructor not viable: no known conversion from 'const int *' to 'const int' for 2nd argument; dereference the argument with *
                 Array1D(int n, const T &a);
                 ^
include/TNT/tnt_array1d.h:64:11: note: candidate constructor not viable: 2nd argument ('const int *') would lose const qualifier
                 Array1D(int n,  T *a);
                 ^
include/TNT/tnt_array1d.h:62:11: note: candidate constructor not viable: requires single argument 'n', but 2 arguments were provided
        explicit Array1D(int n);
                 ^
include/TNT/tnt_array1d.h:65:14: note: candidate constructor not viable: requires single argument 'A', but 2 arguments were provided
    inline   Array1D(const Array1D &A);
             ^
include/TNT/tnt_array1d.h:61:11: note: candidate constructor not viable: requires 0 arguments, but 2 were provided
                 Array1D();
                 ^

(Repeats for every include of tnt.h)

@dvalters dvalters added bug Something isn't working c++-coding-standard labels Apr 21, 2018
@dvalters dvalters self-assigned this Apr 21, 2018
@dvalters
Copy link
Owner Author

dvalters commented Apr 21, 2018

@dvalters dvalters changed the title No matching array constructor for initialsing Array1D No matching array constructor for initialising Array1D Apr 21, 2018
@dvalters dvalters changed the title No matching array constructor for initialising Array1D No matching constructor for initialising Array1D Apr 21, 2018
@yijun-li-20
Copy link

I have the same problem but on a different project with tnt. And I found this may be helpful. https://lists.freebsd.org/pipermail/freebsd-ports-bugs/2013-July/258663.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c++-coding-standard
Projects
None yet
Development

No branches or pull requests

2 participants