Commit Graph

4 Commits

Author SHA1 Message Date
Douglas Gregor 39cacdb04b Tighten up the conversion from a single-level template argument list
to a multi-level template argument list by making it explicit. The
forced auditing of callers found a bug in the instantiation of member
classes inside member templates.

I *love* static type systems.

llvm-svn: 80391
2009-08-28 20:50:45 +00:00
Douglas Gregor 01afeeff1d Implement template instantiation for member class templates.
When performing template instantiation of the definitions of member
templates (or members thereof),  we build a data structure containing
the template arguments from each "level" of template
instantiation. During template instantiation, we substitute all levels
of template arguments simultaneously. 

llvm-svn: 80389
2009-08-28 20:31:08 +00:00
Douglas Gregor a654dd8ae8 Collect multiple levels of template arguments into a new type,
MultiLevelTemplateArgumentList. This is a baby step toward
instantiating member templates; no intended functionality change yet.

llvm-svn: 80380
2009-08-28 17:37:35 +00:00
Douglas Gregor e704c9df31 Implement instantiation of the declarations of member function
templates within class templates, producing a member function template
of a class template specialization. If you can parse that, I'm
sorry. Example:

  template<typename T>
  struct X {
    template<typename U> void f(T, U);
  };

When we instantiate X<int>, we now instantiate the declaration
X<int>::f, which looks like this:

  template<typename U> void X<int>::f(int, U);

The path this takes through
TemplateDeclInstantiator::VisitCXXMethodDecl is convoluted and
ugly, but I don't know how to improve it yet. I'm resting my hopes on
the multi-level substitution required to instantiate definitions of
nested templates, which may simplify this code as well.

More testing to come...

llvm-svn: 80252
2009-08-27 16:57:43 +00:00