This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix bugprone-exception-escape warn on noexcept calls
AbandonedPublic

Authored by PiotrZSL on Sep 24 2022, 8:11 AM.

Details

Summary

If there is a function call that calls a non-throwing function,
this check should not report a warning, even if there is a throw
statement within that function.

The dependent_throw() test case was misleading and suggested that this
warning is not triggered when a throw exception is in unreachable code,
but in reality that warning did not trigger because it could not
determine whether the function should be noexcept without specializing
the T template argument. That test case is fixed to show non-specialized
and specialized cases.

Fixes https://github.com/llvm/llvm-project/issues/54668 and
https://github.com/llvm/llvm-project/issues/54956.

Diff Detail

Event Timeline

ngg created this revision.Sep 24 2022, 8:11 AM
ngg requested review of this revision.Sep 24 2022, 8:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 24 2022, 8:11 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Eugene.Zelenko edited reviewers, added: alexfh, aaron.ballman, LegalizeAdulthood; removed: Restricted Project.Sep 24 2022, 8:14 AM

It'll be good idea to mention change in Release Notes.

Will be good idea to mention changes in Release Notes.

lebedev.ri resigned from this revision.Jan 12 2023, 5:32 PM

This review may be stuck/dead, consider abandoning if no longer relevant.
Removing myself as reviewer in attempt to clean dashboard.

LegalizeAdulthood resigned from this revision.Mar 29 2023, 8:18 AM
PiotrZSL commandeered this revision.Jul 18 2023, 2:16 PM
PiotrZSL abandoned this revision.
PiotrZSL added a reviewer: ngg.

Already fixed.