зеркало из https://github.com/microsoft/clang-1.git
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
This commit is contained in:
Родитель
5baba9d983
Коммит
58b5259e95
|
@ -7683,7 +7683,10 @@ void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: keep track of references to static functions
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,3 +44,6 @@ static void f11(void) { } // expected-warning{{unused}}
|
||||||
|
|
||||||
static void f12(void) { } // expected-warning{{unused}}
|
static void f12(void) { } // expected-warning{{unused}}
|
||||||
static void f12(void);
|
static void f12(void);
|
||||||
|
|
||||||
|
// PR7923
|
||||||
|
static void unused(void) { unused(); } // expected-warning{{unused}}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче