GCC accepts it, while Clang rejects it. It seems evident that GCC considers the two function templates to overload with each other in D, while Clang considers B::f to be hidden in D.
Now the standard
says:
When a using-declarator brings declarations from a base class into
a derived class, member functions and member function templates in
the derived class override and/or hide member functions and member
function templates with the same name,
parameter-type-list, cv-qualification, and ref-qualifier (if any) in a base
class (rather than conflicting). Such hidden or overridden declarations are excluded from the set of
declarations introduced by the
using-declarator.
It doesn't say that the template parameter lists also have to match---so it seems that Clang is correct according to the letter of the law. However, I am wondering whether GCC is following the spirit. I find it hard to imagine that the code above was intended not to compile, since the two function templates are allowed to overload with each other if declared in the same scope. Is there a defect in the wording?