This is an archive of the discontinued LLVM Phabricator instance.

[ASTImporter] Fix AST import crash for a friend decl
ClosedPublic

Authored by vabridgers on Jun 30 2020, 8:24 AM.

Details

Summary

Running CTU testing, we found that VisitFriendDecl in
ASTImporterLookup.cpp was not handling a particular non-dependent case,
so we reached the llvm_unreachable case.

The FriendDecl and QualType not handled were:

(gdb) p D->dump()
FriendDecl 0x7ffff5cf1958
< <<srcfile>>, 'nlohmann::basic_json<std::map, std::vector,

std::basic_string<char>, bool, long long, unsigned long long, double,
std::allocator, adl_serializer, std::vector<unsigned char,
std::allocator<unsigned char>>>':'nlohmann::basic_json<std::map,
std::vector, std::basic_string<char>, bool, long long, unsigned long
long, double, std::allocator, adl_serializer, std::vector<unsigned char,
std::allocator<unsigned char>>>'

(gdb) p Ty->dump()
SubstTemplateTypeParmType 0x7ffff5cf0df0 'class
nlohmann::basic_json<std::map, std::vector, class

std::basic_string<char>, _Bool, long long, unsigned long long, double,
std::allocator, adl_serializer, class std::vector<unsigned char, class
std::allocator<unsigned char> > >' sugar
-TemplateTypeParmType 0x7ffff643ea40 'BasicJsonType' dependent depth 0

index 0

`-TemplateTypeParm 0x7ffff643e9e8 'BasicJsonType'

`-RecordType 0x1012ad20 'class nlohmann::basic_json<std::map,
std::vector, class std::basic_string<char>, _Bool, long long, unsigned
long long, double, std::allocator, adl_serializer, class
std::vector<unsigned char, class std::allocator<unsigned char> > >'

`-ClassTemplateSpecialization 0x1012ab68 'basic_json'

Diff Detail

Event Timeline

vabridgers created this revision.Jun 30 2020, 8:24 AM

fix pre-merge checks

martong accepted this revision.Jun 30 2020, 11:52 AM

Thanks Vince, looks good to me!

This revision is now accepted and ready to land.Jun 30 2020, 11:52 AM
This revision was automatically updated to reflect the committed changes.