We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The test.c below fails in clang-8, but works with gcc-8.
It is natural that a slice array of equal size is initialized using the initializer list.
It probably shouldn't fail, and implicitly use this operator: void std::slice_array::operator=(const std::valarray& val_arr).
FreeBSD 11.2
Yuri
---test.cpp--- #include
void f() { typedef std::valarray matrix; matrix m; m[std::slice(2, 3, 3)] = {0.,0.,0.}; }
---message.txt--- valarray-ilist.cpp:6:26: error: no viable overloaded '=' m[std::slice(2, 3, 3)] = {0.,0.,0.};
/usr/include/c++/v1/valarray:1258:24: note: candidate function not viable: cannot convert initializer list argument to 'const std::__1::slice_array<double>' const slice_array& operator=(const slice_array& __sa) const; ^ /usr/include/c++/v1/valarray:1261:10: note: candidate function not viable: cannot convert initializer list argument to 'const std::__1::slice_array<double>::value_type' (aka 'const double') void operator=(const value_type& __x) const; ^ /usr/include/c++/v1/valarray:1165:5: note: candidate template ignored: couldn't infer template argument '_Expr' operator=(const _Expr& __v) const; ^
The text was updated successfully, but these errors were encountered:
This isn't a clang bug per se, it's a libc++ issue.
Sorry, something went wrong.
This has been fixed in LLVM 12: https://godbolt.org/z/ezqrY4dnq.
No branches or pull requests
Extended Description
The test.c below fails in clang-8, but works with gcc-8.
It is natural that a slice array of equal size is initialized using the initializer list.
It probably shouldn't fail, and implicitly use this operator: void std::slice_array::operator=(const std::valarray& val_arr).
FreeBSD 11.2
Yuri
---test.cpp---
#include
void f() {
typedef std::valarray matrix;
matrix m;
m[std::slice(2, 3, 3)] = {0.,0.,0.};
}
---message.txt---
valarray-ilist.cpp:6:26: error: no viable overloaded '='
m[std::slice(2, 3, 3)] = {0.,0.,0.};
The text was updated successfully, but these errors were encountered: