================
@@ -3647,15 +3647,28 @@ class IsTypeDeclaredInsideVisitor
 };
 } // namespace
 
-/// This function checks if the function has 'auto' return type that contains
+/// This function checks if the given function has a return type that contains
 /// a reference (in any way) to a declaration inside the same function.
-bool ASTNodeImporter::hasAutoReturnTypeDeclaredInside(FunctionDecl *D) {
+bool ASTNodeImporter::hasReturnTypeDeclaredInside(FunctionDecl *D) {
   QualType FromTy = D->getType();
   const auto *FromFPT = FromTy->getAs<FunctionProtoType>();
   assert(FromFPT && "Must be called on FunctionProtoType");
 
+  auto IsCXX11LambdaWithouTrailingReturn = [&]() {
+    if (!Importer.FromContext.getLangOpts().CPlusPlus11)
----------------
mizvekov wrote:

I think CPlusPlus11 is set for C++11 *and later*, but we want to return early 
here for C++14 onwards, as in that case lambda with deduced return type will 
have AutoType.
```suggestion
    if (Importer.FromContext.getLangOpts().CPlusPlus14)
```

https://github.com/llvm/llvm-project/pull/89096
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to