]> granicus.if.org Git - clang/commit
Drastically simplify the mapping from the declaration corresponding to
authorDouglas Gregor <dgregor@apple.com>
Wed, 2 Nov 2011 17:38:53 +0000 (17:38 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 2 Nov 2011 17:38:53 +0000 (17:38 +0000)
commit0b1beb7a295b20f7e05479d599dde027f9f692fe
treec932abee89ecef5192a7619975fe3004180fd9c0
parent38738fcace68630bbbfe174c6a3698a4c94b3dc9
Drastically simplify the mapping from the declaration corresponding to
the injected-class-name of a class (or class template) to the
declaration that results from substituting the given template
arguments. Previously, we would actually perform a substitution into
the injected-class-name type and then retrieve the resulting
declaration. However, in certain, rare circumstances involving
deeply-nested member templates, we would get the wrong substitution
arguments.

This new approach just matches up the declaration with a declaration
that's part of the current context (or one of its parents), which will
either be an instantiation (during template instantiation) or the
declaration itself (during the definition of the template). This is
both more efficient (we're avoiding a substitution) and more correct
(we can't get the template arguments wrong in the member-template
case).

Fixes <rdar://problem/9676205>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143551 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaTemplateInstantiateDecl.cpp
test/SemaTemplate/class-template-decl.cpp