The following code compiles fine both with clang++ 8.0.0 and g++ 9.1.0 (compilation flags are -Wall -Wextra -Werror -pedantic-errors):
template <typename>
struct Base
{
};
struct Derived : Base<int>
{
Base base()
{
return Base();
}
};
int main()
{
}
Is it a bug in these compilers or a feature of the C++ standard?