This is an archive of the discontinued LLVM Phabricator instance.

[ASTImporter] Set the described template if not set
Needs ReviewPublic

Authored by martong on Jan 11 2019, 12:02 AM.

Details

Summary

During the addition of an injected class type to a record it may happen
that a CXXRecordDecl in the redecl chain does not have a described
template set and this caused an assert in LLDB.

Diff Detail

Event Timeline

martong created this revision.Jan 11 2019, 12:02 AM

Can you add a test?

Hello Gabor,

This looks good, but as Shafik mentioned, adding a test would be nice.

@martong Unfortunately this causes a regression on one of the lldb tests TestDataFormatterLibcxxVector.py e.g.

lldb-dotest -p TestDataFormatterLibcxxVector.py -t -G gmodules --no-multiprocess

So this is specific to modules. If you can't reproduce this I can provide a back-trace.

@shafik Ok, I'll take a look into the regression soon. What are exactly gmodules? Is it macOS only? Do you have a description or some docs about it?

shafik added a subscriber: aprantl.Jan 25 2019, 9:41 AM

I don't believe it is directly related to modules but that it just triggers the issue because it may be bringing in more. You can find a description here https://clang.llvm.org/docs/CommandGuide/clang.html#cmdoption-g and @aprantl pointed me to this talk if you want to even more http://llvm.org/devmtg/2015-10/#talk19

@martong have you had a chance to look at this some more? We ran into another problem that this fixes partially. Can I help in any way?

@martong have you had a chance to look at this some more? We ran into another problem that this fixes partially.

I didn't have time to deal with this yet (these days we are preparing an internal release and that took away my time).

Can I help in any way?

I think the only thing missing is to have a test. You mentioned previously that you could help with that and I would appreciate all your help. I think a test with clang-import-test would be just great.