[all-commits] [llvm/llvm-project] ecae67: [ASTImporter] Fix AST import crash for a friend decl

vabridgers via All-commits all-commits at lists.llvm.org
Tue Jun 30 13:57:36 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ecae672ac2ac42bc15bdc794cc56ddccadec9e4f
      https://github.com/llvm/llvm-project/commit/ecae672ac2ac42bc15bdc794cc56ddccadec9e4f
  Author: Vince Bridgers <vince.a.bridgers at gmail.com>
  Date:   2020-06-30 (Tue, 30 Jun 2020)

  Changed paths:
    M clang/lib/AST/ASTImporterLookupTable.cpp

  Log Message:
  -----------
  [ASTImporter] Fix AST import crash for a friend decl

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'

Reviewers: martong, a.sidorin

Reviewed By: martong

Subscribers: kristof.beyls, rnkovacs, teemperor, cfe-commits, dkrupp

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82882




More information about the All-commits mailing list