Skip to content

Commit 8c11487

Browse files
authored
Merge pull request swiftlang#15516 from tkremenek/version-4_2-importname
Translate effective version name of '4.x' to '4.2' for ImportNameVersion.
2 parents 37406e8 + a2951aa commit 8c11487

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ClangImporter/ImportName.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ class ImportNameVersion : public RelationalOperationsBase<ImportNameVersion> {
6161
// importing of names. We treat that with a rawValue of 5, and treat
6262
// all major values of 5 or higher as being rawValue = majorversion + 1.
6363
const auto &version = langOpts.EffectiveLanguageVersion;
64-
if (version.size() > 1 && version[0] == 4 && version[1] == 2) {
64+
// If the effective version is 4.x, where x >= 2, the import version
65+
// is 4.2.
66+
if (version.size() > 1 && version[0] == 4 && version[1] >= 2) {
6567
return ImportNameVersion::swift4_2();
6668
}
6769
unsigned major = version[0];

0 commit comments

Comments
 (0)