Yet another decltype(auto) template template-parameter question. This time minimal code I was able to create to reproduce the error looks like this:
template <template <decltype(auto)> class TT, decltype(auto) V>
void foo(TT<V>) {
};
template <decltype(auto)>
struct Bar{};
int x;
int main() {
foo(Bar<(x)>{});
}
This in [clang] results in:
prog.cc:11:5: error: no matching function for call to 'foo'
foo(Bar<(x)>{});
^~~
prog.cc:2:6: note: candidate template ignored: substitution failure [with TT = Bar]: non-type template argument is not a constant expression
void foo(TT<V>) {
^
1 error generated.
[gcc] accepts the code.
To my understanding the code is well-formed and clang is buggy in its interpretation, but need the confirmation before submitting a bug to lvvm. Am I right?