We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b642f5 commit a10194cCopy full SHA for a10194c
lib/Sema/TypeCheckDeclPrimary.cpp
@@ -2589,6 +2589,10 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
2589
if (!var->hasStorage())
2590
return;
2591
2592
+ // If the variable is @_extern, it never needs an initializer.
2593
+ if (var->getAttrs().hasAttribute<ExternAttr>())
2594
+ return;
2595
+
2596
if (var->getAttrs().hasAttribute<SILGenNameAttr>()
2597
|| !ABIRoleInfo(var).providesAPI())
2598
test/attr/attr_extern.swift
@@ -73,6 +73,9 @@ struct StructScopeC {
73
74
@_extern(c, "static_member_decl")
75
static func staticMemberDecl()
76
77
+ @_extern(c, "global_static_variable")
78
+ static var globalVariable: Int
79
}
80
81
struct GenericStruct<T> {
0 commit comments