I have the following snippet (I'm compiling for C++20):
struct Z {
template <typename... Args>
Z(std::vector<std::tuple<Args...>>) {}
};
Z z(std::vector{std::tuple{}});
g++-10
refuses to compile this with the error:
main.cpp:16:9: error: ‘auto’ parameter not permitted in this context
16 | Z z(std::vector{std::tuple{}});
| ^~~
However, clang++
version 10 successfully compiles it (and does the right thing if I create non-empty tuples and try printing their contents).
Is this a case of the most vexing parse? If so, how does clang++
manage to compile this? Otherwise, is this a bug with g++
?