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;
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;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits