diff options
author | Richard Trieu <rtrieu@google.com> | 2013-12-21 02:33:43 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2013-12-21 02:33:43 +0000 |
commit | 2f024f432d62a6a7c3a9dac016f69babd31d6788 (patch) | |
tree | 444c956a089120980d9f2a18c2f8c177b48ce35d /clang/examples/PrintFunctionNames/PrintFunctionNames.cpp | |
parent | 38b8c938e8b75333d1efa47e4128bed3cd569110 (diff) | |
download | llvm-2f024f432d62a6a7c3a9dac016f69babd31d6788.zip llvm-2f024f432d62a6a7c3a9dac016f69babd31d6788.tar.gz llvm-2f024f432d62a6a7c3a9dac016f69babd31d6788.tar.bz2 |
Add -Winfinite-recursion to Clang
This new warning detects when a function will recursively call itself on every
code path though that function. This catches simple recursive cases such as:
void foo() {
foo();
}
As well as more complex functions like:
void bar() {
if (test()) {
bar();
return;
} else {
bar();
}
return;
}
This warning uses the CFG. As with other CFG-based warnings, this is off
by default. Due to false positives, this warning is also disabled for
templated functions.
llvm-svn: 197853
Diffstat (limited to 'clang/examples/PrintFunctionNames/PrintFunctionNames.cpp')
0 files changed, 0 insertions, 0 deletions