diff options
author | Alp Toker <alp@nuanti.com> | 2013-10-18 05:54:24 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2013-10-18 05:54:24 +0000 |
commit | 530fa4fc800f2788cfe6d4113677ca631d1e801f (patch) | |
tree | 2c02a59121a3e8c226379f726d57f920d3b74ee6 /lib/Parse/ParseCXXInlineMethods.cpp | |
parent | 08235661cf457978ba4645ec8e22697aebabe4fa (diff) |
Check "late parsed" friend functions for redefinition
r177003 applied the late parsed template technique to friend functions
but omitted the corresponding check for redefinitions.
This patch adds the same check already in use for templates to the
new code path in order to diagnose and reject invalid redefinitions
that were being silently accepted.
Fixes PR17324.
Reviewed by Richard Smith.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192948 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseCXXInlineMethods.cpp')
-rw-r--r-- | lib/Parse/ParseCXXInlineMethods.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Parse/ParseCXXInlineMethods.cpp b/lib/Parse/ParseCXXInlineMethods.cpp index 8d82d03d83..6bab7988cf 100644 --- a/lib/Parse/ParseCXXInlineMethods.cpp +++ b/lib/Parse/ParseCXXInlineMethods.cpp @@ -176,7 +176,9 @@ NamedDecl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS, // If you remove this, you can remove the code that clears the flag // after parsing the member. if (D.getDeclSpec().isFriendSpecified()) { - getFunctionDecl(FnD)->setLateTemplateParsed(true); + FunctionDecl *FD = getFunctionDecl(FnD); + Actions.CheckForFunctionRedefinition(FD); + FD->setLateTemplateParsed(true); } } else { // If semantic analysis could not build a function declaration, |