aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-10-13 14:39:41 +0000
committerDouglas Gregor <dgregor@apple.com>2009-10-13 14:39:41 +0000
commita735b206fdb5c15767a45289e1ffb3b568f70f2b (patch)
tree242dc0820c5aa63c2f75a80e15b81b0f3970ca12 /lib/Sema/SemaDeclCXX.cpp
parentd9878a181f09ffc76b61d430aa3a001102fda5af (diff)
Improve the internal representation and semantic analysis of friend
function templates. This commit ensures that friend function templates are constructed as FunctionTemplateDecls rather than partial FunctionDecls (as they previously were). It then implements template instantiation for friend function templates, injecting the friend function template only when no previous declaration exists at the time of instantiation. Oh, and make sure that explicit specialization declarations are not friends. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83970 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index eb1abafb7d..519694aea8 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -4347,8 +4347,6 @@ Sema::ActOnFriendFunctionDecl(Scope *S,
Declarator &D,
bool IsDefinition,
MultiTemplateParamsArg TemplateParams) {
- // FIXME: do something with template parameters
-
const DeclSpec &DS = D.getDeclSpec();
assert(DS.isFriendSpecified());
@@ -4404,6 +4402,7 @@ Sema::ActOnFriendFunctionDecl(Scope *S,
// Recover from invalid scope qualifiers as if they just weren't there.
NamedDecl *PrevDecl = 0;
if (!ScopeQual.isInvalid() && ScopeQual.isSet()) {
+ // FIXME: RequireCompleteDeclContext
DC = computeDeclContext(ScopeQual);
// FIXME: handle dependent contexts
@@ -4479,7 +4478,7 @@ Sema::ActOnFriendFunctionDecl(Scope *S,
bool Redeclaration = false;
NamedDecl *ND = ActOnFunctionDeclarator(S, D, DC, T, DInfo, PrevDecl,
- MultiTemplateParamsArg(*this),
+ move(TemplateParams),
IsDefinition,
Redeclaration);
if (!ND) return DeclPtrTy();