summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-25 01:29:56 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-25 01:29:56 +0000
commit4dd412e0228ea17c83b33781e949d16ec101b245 (patch)
treef69cc71d73d731c84da64014a462705de443ac11 /clang
parentecbdf75049f589bace23199f07f23bedcea51b62 (diff)
downloadbcm5719-llvm-4dd412e0228ea17c83b33781e949d16ec101b245.tar.gz
bcm5719-llvm-4dd412e0228ea17c83b33781e949d16ec101b245.zip
Don't emit empty strings for path diagnostics when taking the default branch of a switch statement that has no label.
llvm-svn: 50242
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Analysis/BugReporter.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp
index 5a0e9cb90ab..9c55333e4c6 100644
--- a/clang/lib/Analysis/BugReporter.cpp
+++ b/clang/lib/Analysis/BugReporter.cpp
@@ -322,6 +322,13 @@ void BugReporter::GeneratePathDiagnostic(PathDiagnostic& PD,
}
}
+ else {
+
+ // FIXME: Get line number.
+
+ os << "'Default' branch taken. "
+ "Execution continues after switch statement.";
+ }
PD.push_front(new PathDiagnosticPiece(L, os.str()));
break;
OpenPOWER on IntegriCloud