Skip to content

Commit 0f1361b

Browse files
[Driver] Fix a warning
This patch fixes: clang/lib/Driver/ToolChains/Darwin.cpp:2937:3: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]
1 parent 2c74237 commit 0f1361b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

clang/lib/Driver/ToolChains/Darwin.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2927,14 +2927,12 @@ static bool sdkSupportsBuiltinModules(
29272927
const Darwin::DarwinPlatformKind &TargetPlatform,
29282928
const Darwin::DarwinEnvironmentKind &TargetEnvironment,
29292929
const std::optional<DarwinSDKInfo> &SDKInfo) {
2930-
switch (TargetEnvironment) {
2931-
case Darwin::NativeEnvironment:
2932-
case Darwin::Simulator:
2933-
case Darwin::MacCatalyst:
2930+
if (TargetEnvironment == Darwin::NativeEnvironment ||
2931+
TargetEnvironment == Darwin::Simulator ||
2932+
TargetEnvironment == Darwin::MacCatalyst) {
29342933
// Standard xnu/Mach/Darwin based environments
29352934
// depend on the SDK version.
2936-
break;
2937-
default:
2935+
} else {
29382936
// All other environments support builtin modules from the start.
29392937
return true;
29402938
}

0 commit comments

Comments
 (0)