diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-08-25 10:34:54 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-08-25 10:34:54 +0000 |
commit | 58b5259e959f42823cc93f66da1499723eae366c (patch) | |
tree | 7007ee7c58f8475124c85c98c3eb0db61aa2d05f /lib/Sema | |
parent | 5baba9d98364a3525d6afa15a04cdad82fd6dd30 (diff) |
Recursive functions should be marked when used from another function. Fixes http://llvm.org/PR7923.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112045 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index c8e8ecda86..6c25c272f3 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -7683,7 +7683,10 @@ void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) { } // FIXME: keep track of references to static functions - Function->setUsed(true); + + // Recursive functions should be marked when used from another function. + if (CurContext != Function) + Function->setUsed(true); return; } |