[PATCH] D87815: [clang] Fix a typo-correction crash

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 22 11:21:40 PDT 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG16ca71180330: [clang] Fix a typo-correction crash (authored by hokein).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87815/new/

https://reviews.llvm.org/D87815

Files:
  clang/lib/Sema/SemaExpr.cpp
  clang/test/SemaCXX/typo-correction-crash.cpp


Index: clang/test/SemaCXX/typo-correction-crash.cpp
===================================================================
--- clang/test/SemaCXX/typo-correction-crash.cpp
+++ clang/test/SemaCXX/typo-correction-crash.cpp
@@ -32,3 +32,12 @@
 void cast_expr(int g) { +int(n)(g); } // expected-error {{undeclared identifier 'n'}}
 
 void bind() { for (const auto& [test,_] : _test_) { }; } // expected-error {{undeclared identifier '_test_'}}
+
+namespace NoCrash {
+class S {
+  void Function(int a) {
+    unknown1(unknown2, Function, unknown3); // expected-error 2{{use of undeclared identifier}} \
+                                               expected-error {{reference to non-static member function must be called}}
+  }
+};
+}
Index: clang/lib/Sema/SemaExpr.cpp
===================================================================
--- clang/lib/Sema/SemaExpr.cpp
+++ clang/lib/Sema/SemaExpr.cpp
@@ -6068,8 +6068,6 @@
       ExprResult result = S.CheckPlaceholderExpr(args[i]);
       if (result.isInvalid()) hasInvalid = true;
       else args[i] = result.get();
-    } else if (hasInvalid) {
-      (void)S.CorrectDelayedTyposInExpr(args[i]);
     }
   }
   return hasInvalid;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87815.293533.patch
Type: text/x-patch
Size: 1180 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200922/b5697c27/attachment.bin>


More information about the cfe-commits mailing list