This fixes a crash when declaring a destructor with a wrong name, then
writing result to pch file and loading it again. The PCH storage uses
DeclarationNameKey as key and it is the same key for both the invalid
destructor and the implicit one that was created because the other one
was invalid. When querying for the Foo::~Foo we end up getting
Foo::~Bar, which is then rejected and we end up with nullptr in
CXXRecordDecl::GetDestructor().
Details
Details
- Reviewers
sammccall - Commits
- rGeed0af6179ca: [clang] Exclude invalid destructors from lookups.
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Unit Tests
Time | Test | |
---|---|---|
8,039 ms | windows > Clang.Driver::cl-options.c |
Event Timeline
Comment Actions
addressed review comments
clang/test/PCH/cxx-invalid-destructor.cpp | ||
---|---|---|
2 | We need this, otherwise the PCH file is rejected for containing errors. |
split into separate block, add a comment why