This revision was automatically updated to reflect the committed changes. Closed by commit rG5ade434a7e74: [clang] Fix assertion fail when function has cleanups and fatal errors (authored by Fznamznon).
Changed prior to commit: https://reviews.llvm.org/D158827?vs=553420&id=553872#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158827/new/ https://reviews.llvm.org/D158827 Files: clang/docs/ReleaseNotes.rst clang/lib/Sema/SemaDecl.cpp clang/test/SemaCXX/gh48974.cpp Index: clang/test/SemaCXX/gh48974.cpp =================================================================== --- /dev/null +++ clang/test/SemaCXX/gh48974.cpp @@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -Werror=unused-parameter -Wfatal-errors -verify %s + +void a(int &&s) {} // expected-error{{unused parameter 's'}} + +void b() { + int sum = a(0); +} Index: clang/lib/Sema/SemaDecl.cpp =================================================================== --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -16013,6 +16013,7 @@ // been leftover. This ensures that these temporaries won't be picked up // for deletion in some later function. if (hasUncompilableErrorOccurred() || + hasAnyUnrecoverableErrorsInThisFunction() || getDiagnostics().getSuppressAllDiagnostics()) { DiscardCleanupsInEvaluationContext(); } Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -187,6 +187,8 @@ - Fix crash in __builtin_strncmp and related builtins when the size value exceeded the maximum value representable by int64_t. Fixes (`#64876 <https://github.com/llvm/llvm-project/issues/64876>`_) +- Fixed an assertion if a function has cleanups and fatal erors. + (`#48974 <https://github.com/llvm/llvm-project/issues/48974>`_) Bug Fixes to Compiler Builtins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Index: clang/test/SemaCXX/gh48974.cpp =================================================================== --- /dev/null +++ clang/test/SemaCXX/gh48974.cpp @@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -Werror=unused-parameter -Wfatal-errors -verify %s + +void a(int &&s) {} // expected-error{{unused parameter 's'}} + +void b() { + int sum = a(0); +} Index: clang/lib/Sema/SemaDecl.cpp =================================================================== --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -16013,6 +16013,7 @@ // been leftover. This ensures that these temporaries won't be picked up // for deletion in some later function. if (hasUncompilableErrorOccurred() || + hasAnyUnrecoverableErrorsInThisFunction() || getDiagnostics().getSuppressAllDiagnostics()) { DiscardCleanupsInEvaluationContext(); } Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -187,6 +187,8 @@ - Fix crash in __builtin_strncmp and related builtins when the size value exceeded the maximum value representable by int64_t. Fixes (`#64876 <https://github.com/llvm/llvm-project/issues/64876>`_) +- Fixed an assertion if a function has cleanups and fatal erors. + (`#48974 <https://github.com/llvm/llvm-project/issues/48974>`_) Bug Fixes to Compiler Builtins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits