Skip to content

Commit 3f72b03

Browse files
authored
Merge pull request #12987 from slavapestov/zero-init-lazyness
ClangImporter: Don't synthesize zero initializer body if we finished type checking
2 parents ce1ea46 + ca1586d commit 3f72b03

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,9 @@ createDefaultConstructor(ClangImporter::Implementation &Impl,
11331133
// Mark the constructor transparent so that we inline it away completely.
11341134
constructor->getAttrs().add(new (context) TransparentAttr(/*implicit*/ true));
11351135

1136+
if (Impl.hasFinishedTypeChecking())
1137+
return constructor;
1138+
11361139
// Use a builtin to produce a zero initializer, and assign it to self.
11371140

11381141
// Construct the left-hand reference to self.

0 commit comments

Comments
 (0)