Godbolt link: https://godbolt.org/z/qeqqfMKa6
This code:
#include <string>
template <typename Tag>
struct StrongSymbol {
explicit StrongSymbol<Tag>(std::string name) : m_name(std::move(name)) {}
StrongSymbol<Tag>() : StrongSymbol<Tag>("") {}
std::string m_name;
};
Builds cleanly in clang, and in gcc fails with:
error: expected unqualified-id before ')' token
6 | StrongSymbol<Tag>() : StrongSymbol<Tag>("") {}
| ^
but only if compiled with -std=c++20 (in gcc).
Any idea what happens here? Is this a gcc bug?