Skip to content

Conversation

@Naghasan
Copy link

Remove unneeded default label which triggers a warning with -Wcovered-switch-default

Remove unneeded default label which triggers a warning with -Wcovered-switch-default
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" backend:SPIR-V labels May 29, 2025
@llvmbot
Copy link
Member

llvmbot commented May 29, 2025

@llvm/pr-subscribers-backend-spir-v

@llvm/pr-subscribers-clang

Author: Victor Lomuller (Naghasan)

Changes

Remove unneeded default label which triggers a warning with -Wcovered-switch-default


Full diff: https://github.com/llvm/llvm-project/pull/141954.diff

1 Files Affected:

  • (modified) clang/lib/Sema/SemaSPIRV.cpp (-2)
diff --git a/clang/lib/Sema/SemaSPIRV.cpp b/clang/lib/Sema/SemaSPIRV.cpp
index bd72194b905f5..c27d3fed2b990 100644
--- a/clang/lib/Sema/SemaSPIRV.cpp
+++ b/clang/lib/Sema/SemaSPIRV.cpp
@@ -129,8 +129,6 @@ static bool checkGenericCastToPtr(Sema &SemaRef, CallExpr *Call) {
     AddrSpace = SemaRef.LangOpts.isSYCL() ? LangAS::sycl_private
                                           : LangAS::opencl_private;
     break;
-  default:
-    llvm_unreachable("Invalid builtin function");
   }
   Qual.setAddressSpace(AddrSpace);
   Call->setType(SemaRef.getASTContext().getPointerType(

@Naghasan Naghasan changed the title Fix build issue after c474f8f [clang] Fix build issue after c474f8f May 29, 2025
@Naghasan Naghasan changed the title [clang] Fix build issue after c474f8f [clang][SPIRV] Fix build issue after c474f8f May 29, 2025
@Naghasan
Copy link
Author

Naghasan commented May 29, 2025

@farzonl @VyacheslavLevytskyy if you could approve / merge, that fix the issue reported by the bots

@Keenuts Keenuts merged commit c6893dc into llvm:main May 30, 2025
15 checks passed
@Keenuts
Copy link
Contributor

Keenuts commented May 30, 2025

thanks!

steven-studio pushed a commit to steven-studio/llvm-project that referenced this pull request Sep 11, 2025
Remove unneeded default label which triggers a warning with
-Wcovered-switch-default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend:SPIR-V clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants