Calling method of template base class

Viewed 2574

The following code compiles in visual studio 2015 (even with /Za option). It doesn't compile on gcc and clang.

struct A
{
};

template<typename T>
struct B
{
  void f()
  {
  }
};

template<typename T>
struct C : B<T>
{
  void f()
  {
  }

  void g()
  {
    B::f();
  }
};

int main()
{
  C<A> c;
  c.g();

  return 0;
}

Demo

gcc - error: 'template struct B' used without template parameters
clang - error: 'B' is not a class, namespace, or enumeration

Which compiler is compliant to standard specifications? Any ambiguity in the specs?

Edit
I've added f() in C to have a more pertinent example.

3 Answers
Related