[PATCH] -fdelayed-template-parsing: handle cases where a late-parsed function is not a direct member of a template, but rather nested inside a class that's a member of a template (PR19613)

Richard Smith richard at metafoo.co.uk
Wed Apr 30 10:42:43 PDT 2014


Neither the before code nor the after code looks right...

The outermost lexical level (and possibly others in the future) can have multiple template parameter lists, and you should use `getNumTemplateParameterLists`/`getTemplateParameterList` on each level to add all of them (these exist on `DeclaratorDecl` for `FunctionDecls` and on `TagDecl` for the other cases). For instance:

  template<typename A> struct S {
    template<typename B> struct T;
  };
  template<typename A> template<typename B> struct S<A>::T {
    template<typename C, typename D> struct U;
    template<typename C> struct U<C, C> {
      template<typename E> void f() { /* ... */ }
    };
  };

http://reviews.llvm.org/D3555






More information about the cfe-commits mailing list