[cfe-dev] Bug? Implicit instantiation of undefined template error in seemingly valid code

Andy Gibbs via cfe-dev cfe-dev at lists.llvm.org
Fri Oct 21 06:29:23 PDT 2016


Hi,


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


template <int> struct Wrapper;

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

template <int I> template <int J>
struct Lookup<I>::Helper<Wrapper<J>> {
  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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20161021/6f006a9e/attachment.html>


More information about the cfe-dev mailing list