Bug? Implicit instantiation of undefined template error in seemingly valid code

Hi,

I have a small code fragment that clang doesn’t like, but seems valid to me and gcc is fine with it.

template struct Wrapper;

template struct Lookup {
template struct Helper;
using Type = typename Helper<Wrapper>::Type;
};

template template
struct Lookup::Helper<Wrapper> {
using Type = void;
};

using A = typename Lookup<12>::Type; // should be void

So, is the code wrong, or is clang wrong?! I have tested with clang 3.8 and 3.9 and gcc 6.1.

Thanks for your thoughts.

Andy