Skip to content

Bump the compiler version to 4.2 (and 3.4) #13767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ set_property(CACHE SWIFT_ANALYZE_CODE_COVERAGE PROPERTY
# SWIFT_VERSION is deliberately /not/ cached so that an existing build directory
# can be reused when a new version of Swift comes out (assuming the user hasn't
# manually set it as part of their own CMake configuration).
set(SWIFT_VERSION "4.1")
set(SWIFT_VERSION "4.2")

set(SWIFT_VENDOR "" CACHE STRING
"The vendor name of the Swift compiler")
Expand Down
4 changes: 2 additions & 2 deletions lib/Basic/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ Optional<Version> Version::getEffectiveLanguageVersion() const {
switch (Components[0]) {
case 3:
#ifdef SWIFT_VERSION_PATCHLEVEL
return Version{3, 3, SWIFT_VERSION_PATCHLEVEL};
return Version{3, 4, SWIFT_VERSION_PATCHLEVEL};
#else
return Version{3, 3};
return Version{3, 4};
#endif
case 4:
static_assert(SWIFT_VERSION_MAJOR == 4,
Expand Down
13 changes: 11 additions & 2 deletions test/Parse/ConditionalCompilation/language_version_explicit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,19 @@
asdf asdf asdf asdf
#endif

#if swift(>=4.0.1)
let z = 1
// NOTE: Please modify this condition...
#if swift(>=4.2)
let b = 1
#else
// This shouldn't emit any diagnostics.
asdf asdf asdf asdf
#endif

// NOTE: ...and modify this condition...
#if swift(>=4.2.1)
// This shouldn't emit any diagnostics.
asdf asdf asdf asdf
#else
let c = 1
#endif
// NOTE: ...the next time the version goes up.
2 changes: 1 addition & 1 deletion test/Serialization/Recovery/crash-recovery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Sub: Base {

// CHECK-CRASH: error: fatal error encountered while reading from module 'Lib'; please file a bug report with your project and the crash log
// CHECK-CRASH-3-NOT: note
// CHECK-CRASH-4: note: compiling as Swift 4.1, with 'Lib' built as Swift 3.3
// CHECK-CRASH-4: note: compiling as Swift 4.2, with 'Lib' built as Swift 3.4
// CHECK-CRASH-LABEL: *** DESERIALIZATION FAILURE (please include this section in any bug report) ***
// CHECK-CRASH: could not find 'disappearingMethod()' in parent class
// CHECK-CRASH: While loading members for 'Sub' in module 'Lib'
4 changes: 2 additions & 2 deletions test/Serialization/Recovery/types-4-to-3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import Lib
func requiresConformance(_: B_RequiresConformance<B_ConformsToProto>) {}
func requiresConformance(_: B_RequiresConformance<C_RelyOnConformanceImpl.Assoc>) {}

class Sub: Base {} // expected-error {{cannot inherit from class 'Base' (compiled with Swift 4.1) because it has overridable members that could not be loaded in Swift 3.3}}
class Impl: Proto {} // expected-error {{type 'Impl' cannot conform to protocol 'Proto' (compiled with Swift 4.1) because it has requirements that could not be loaded in Swift 3.3}}
class Sub: Base {} // expected-error {{cannot inherit from class 'Base' (compiled with Swift 4.2) because it has overridable members that could not be loaded in Swift 3.4}}
class Impl: Proto {} // expected-error {{type 'Impl' cannot conform to protocol 'Proto' (compiled with Swift 4.2) because it has requirements that could not be loaded in Swift 3.4}}

#else // TEST

Expand Down
2 changes: 1 addition & 1 deletion utils/build_swift/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
CMAKE_GENERATOR = 'Ninja'

COMPILER_VENDOR = 'none'
SWIFT_USER_VISIBLE_VERSION = CompilerVersion('4.1')
SWIFT_USER_VISIBLE_VERSION = CompilerVersion('4.2')
CLANG_USER_VISIBLE_VERSION = CompilerVersion('5.0.0')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This default is very suspicious. Shouldn't we be getting it from the Clang repository somehow? cc @Rostepher

SWIFT_ANALYZE_CODE_COVERAGE = 'false'

Expand Down