diff options
| author | John McCall <rjmccall@apple.com> | 2010-10-16 06:59:13 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-10-16 06:59:13 +0000 |
| commit | 2c2eb12d9c895b2174788f5068f106e5e933bbfc (patch) | |
| tree | db885535fc5fa507a44cee8d9783717cf82fa1d3 /clang/lib/Sema/SemaDeclCXX.cpp | |
| parent | 622581b73bf9466eaa79deb336613e42eef7d68d (diff) | |
| download | bcm5719-llvm-2c2eb12d9c895b2174788f5068f106e5e933bbfc.tar.gz bcm5719-llvm-2c2eb12d9c895b2174788f5068f106e5e933bbfc.zip | |
White-listing templated-scope friend decls is a good idea, but doing it
by marking the decl invalid isn't. Make some steps towards supporting these
and then hastily shut them down at the last second by marking them as
unsupported.
llvm-svn: 116661
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index be1ee358e2a..583f7c59b41 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -6532,6 +6532,17 @@ Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, bool IsDefinition, if (ND->isInvalidDecl()) FrD->setInvalidDecl(); + else { + FunctionDecl *FD; + if (FunctionTemplateDecl *FTD = dyn_cast<FunctionTemplateDecl>(ND)) + FD = FTD->getTemplatedDecl(); + else + FD = cast<FunctionDecl>(ND); + + // Mark templated-scope function declarations as unsupported. + if (FD->getNumTemplateParameterLists()) + FrD->setUnsupportedFriend(true); + } return ND; } |

