balazske created this revision.
Herald added subscribers: martong, gamesh411, Szelethus, dkrupp.
balazske requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Type of `Callee` can be overloaded function type that was not handled.
This causes a crash if the function is called in such case.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95244

Files:
  clang/lib/AST/Expr.cpp


Index: clang/lib/AST/Expr.cpp
===================================================================
--- clang/lib/AST/Expr.cpp
+++ clang/lib/AST/Expr.cpp
@@ -1392,6 +1392,11 @@
 
     // This should never be overloaded and so should never return null.
     CalleeType = Expr::findBoundMemberType(Callee);
+  } else if (CalleeType->isSpecificPlaceholderType(BuiltinType::Overload)) {
+    ASTContext::GetBuiltinTypeError Error;
+    QualType RetTy = Ctx.GetBuiltinType(BuiltinType::Dependent, Error);
+    assert(Error == ASTContext::GE_None);
+    return RetTy;
   }
 
   const FunctionType *FnType = CalleeType->castAs<FunctionType>();


Index: clang/lib/AST/Expr.cpp
===================================================================
--- clang/lib/AST/Expr.cpp
+++ clang/lib/AST/Expr.cpp
@@ -1392,6 +1392,11 @@
 
     // This should never be overloaded and so should never return null.
     CalleeType = Expr::findBoundMemberType(Callee);
+  } else if (CalleeType->isSpecificPlaceholderType(BuiltinType::Overload)) {
+    ASTContext::GetBuiltinTypeError Error;
+    QualType RetTy = Ctx.GetBuiltinType(BuiltinType::Dependent, Error);
+    assert(Error == ASTContext::GE_None);
+    return RetTy;
   }
 
   const FunctionType *FnType = CalleeType->castAs<FunctionType>();
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to