From 8e329caa944c377c51ef567d5aa67cfac9ffd0fa Mon Sep 17 00:00:00 2001 From: Takuya Shimizu Date: Tue, 15 Aug 2023 17:24:13 +0900 Subject: Reland "[Clang][SemaCXX] Add unused warning for variables declared in condition expressions" This patch marks the declarations with initializations in condition expressions such as if (int var = init) as unreferenced so that -Wunused can warn on them. Fixes https://github.com/llvm/llvm-project/issues/61681 Reviewed By: cor3ntin Differential Revision: https://reviews.llvm.org/D152495 --- llvm/lib/Support/VirtualFileSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Support/VirtualFileSystem.cpp') diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index d381d79fba96..e36151038b2d 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -1337,7 +1337,7 @@ std::error_code RedirectingFileSystem::isLocal(const Twine &Path_, SmallString<256> Path; Path_.toVector(Path); - if (std::error_code EC = makeCanonical(Path)) + if (makeCanonical(Path)) return {}; return ExternalFS->isLocal(Path, Result); -- cgit v1.2.3