aboutsummaryrefslogtreecommitdiff
path: root/src/zig_clang.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-05-18 12:35:36 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-05-18 12:35:36 -0700
commitab8f8465a301ded54d2a2504ca3394ec1425cacb (patch)
tree60c94fd3f2695db767fc72bdf7e9528d788428cc /src/zig_clang.cpp
parent4187008b5ed3118d9cf58dbdff8bad2974a7910d (diff)
downloadzig-ab8f8465a301ded54d2a2504ca3394ec1425cacb.tar.gz
zig-ab8f8465a301ded54d2a2504ca3394ec1425cacb.zip
stage2: fix deletion of Decls that get re-referenced
When scanDecls happens, we create stub Decl objects that have not been semantically analyzed. When they get referenced, they get semantically analyzed. Before this commit, when they got unreferenced, they were completely deleted, including deleted from the containing Namespace. However, if the update did not cause the containing Namespace to get deleted, for example, if `std.builtin.ExportOptions` is no longer referenced, but `std.builtin` is still referenced, and then `ExportOptions` gets referenced again, the Namespace would be incorrectly missing the Decl, so we get an incorrect "no such member" error. The solution is to, when dealing with a no longer referenced Decl objects during an update, clear them to the state they would be in on a fresh scanDecl, rather than completely deleting them.
Diffstat (limited to 'src/zig_clang.cpp')
0 files changed, 0 insertions, 0 deletions