]> granicus.if.org Git - clang/commit
Switch the template specialization kind for a non-defining declaration of a
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 28 Jan 2017 02:56:07 +0000 (02:56 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 28 Jan 2017 02:56:07 +0000 (02:56 +0000)
commita03ab39917580cf79fa52b02cb5eff30a96ea20c
tree02ded9f1b5b00b784d9e1c43faaf9153bf0e3aeb
parent7e8b055800c51f8479b208a64a834ca3e189d127
Switch the template specialization kind for a non-defining declaration of a
non-template function instantiated from a friend declaration in a class
template from TSK_ImplicitInstantiation to TSK_Undeclared.

It doesn't make sense for a non-template function to be flagged as being
instantiated from a template; that property really belongs to the entity
as a whole and not an individual declaration of it. There's some history
here:

 * r137934 started marking these functions as instantiations in order to
   work around an issue where we might instantiate a class template while
   we're still parsing its member definitions, and would otherwise fail
   to instantiate the friend definition

 * r177003 fixed the same issue but for friend templates, but did so by
   making the friends claim to be definitions even before we'd parsed
   their actual bodies; this made the r137934 change redundant

 * r293558 worked around a problem caused by the marking of a non-template
   function as a template instantiation in r137934

This change reverts the code changes from r293358 and r137934 and retains
all the tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293367 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaTemplateInstantiateDecl.cpp