-
Notifications
You must be signed in to change notification settings - Fork 169
fix compile error on clang #767
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
Conversation
|
I wonder what is the blast radius of this fix w.r.t. older compilers |
I can test older clang++-17 on MacOS (Sorry but I cannot test compilers older than that only by myself, because MacOS has clang-version fixed and my another computer is ArchLinux with everything including gcc roll-upgrading) But logically, I can tell that all compiler should accept the one without template <class T>
struct A
{
template <int Num> f() { return Num; };
};
template <>
struct A<float>
{
static constexpr float f = 42;
};
A<int> a; a.f<1>()// case 1
A<float> a; a.f<1>()// case 2If we call this function like So that, we use a (You can also find another example in neighbor template <class Executor = boost::asio::any_io_executor>
struct boost::asio::ip::tcp::basic_socket
{
template <class OtherExecutor>
using rebind_executor = basic_socket<OtherExecutor>;
};
using my_socket = basic_socket<system_executor>::template rebind_executor<typename io_context::executor>;Actually, (Just a few days before I reported a GCC internal-compiler-error which happens on grammar-parsing. Finally gcc-contributors found both gcc and clang have the bug. But once I read the gcc-source clang-source of both compiler, I found that gcc has an AST far more complexed, complicated, and hard to maintain than clang. See gcc-bug and clang-bug) Back to // boost/libs/gil/include/boost/gil/algorithm.hpp:1240
init = binary_op1(init, binary_op2(*first1, *first2));
return inner_product_k_t<Size - 1>::template apply(
first1 + 1, first2 + 1, init, binary_op1, binary_op2);You see: this Thank you very much! |
|
Awesome! Thank you very much for the explanation. I'm happy to merge it. |
|
@mloskot Hello, could you please merge branch (I love this library. But for me, who always clones Thank you! :) |
|
@anonymouspc I'd love to get recent changes merged to |
Reopen pull request #766.
Source:
Compilation (clang++ 20.1.7)
File changed:
template.Thank you.