[cfe-commits] r106099 - in /cfe/trunk: include/clang/AST/ASTContext.h include/clang/AST/CanonicalType.h include/clang/AST/DeclTemplate.h include/clang/AST/Type.h lib/AST/ASTContext.cpp lib/AST/DeclPrinter.cpp lib/AST/DeclTemplate.cpp lib/AST/TypePrinter.cpp lib/Sema/SemaTemplate.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp

Abramo Bagnara abramo.bagnara at gmail.com
Thu Jun 17 03:43:28 PDT 2010


Il 16/06/2010 17:23, Douglas Gregor ha scritto:
> It looks like this broke self-host with an assertion, so I've reverted it in r106100.

This is a reduced testcase:

template <typename C>
struct v {
  template <typename T, typename U = T>
  struct s { };
  s<C> v;
};

The failing assertion happens when default template argument is
substituted due to call of Sema::SubstDefaultTemplateArgument from
Sema::CheckTemplateArgumentList.

Sema::LocalInstantiationScope::getInstantiationOf is called on a null
LocalInstantiationScope.

We've tried to add a Sema::LocalInstantiationScope just before the
related Sema::InstantiatingTemplate to have a valid
LocalInstantiationScope but this is has no effects (apart the obvious
one to reach getInstantiationOf with a non null LocalInstantiationScope).

I guess that the problem is that Sema::CheckTemplateArgumentList is not
called in an appropriately prepared framework, but I'm rather confused
now about why and what is needed to make it work properly.

Can you shed some light on this failure?

BTW I've also noted that (unexpectedly, at least for me) the declaration
context of T is the translation unit.



More information about the cfe-commits mailing list