This is an archive of the discontinued LLVM Phabricator instance.

PR44514: Fix recovery from noexcept with non-convertible expressions
ClosedPublic

Authored by erichkeane on Jan 13 2020, 8:15 AM.

Details

Summary

We currently treat noexcept(not-convertible-to-bool) as 'none', which
results in the typeloc info being a different size, and causing an
assert later on in the process. In order to make recovery less
destructive, replace this with noexcept(false) and a constructed 'false'
expression.

Diff Detail

Event Timeline

erichkeane created this revision.Jan 13 2020, 8:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2020, 8:15 AM
aaron.ballman accepted this revision.Jan 13 2020, 1:35 PM

LGTM aside from a simplification. Can you mention the LLVM bug report in the commit log, as well (and close the bug)?

clang/lib/Sema/SemaExceptionSpec.cpp
90–92

This can be simplified with APSInt::getUnsigned() unless you reallllly need it to be a one-bit integer.

This revision is now accepted and ready to land.Jan 13 2020, 1:35 PM
This revision was automatically updated to reflect the committed changes.
erichkeane marked an inline comment as done.Jan 13 2020, 1:54 PM
erichkeane added inline comments.
clang/lib/Sema/SemaExceptionSpec.cpp
90–92

We normally DO create it as a 1 bit APSInt (the return type of the ConstantExpr), as discussed on IRC we should probably not differ from that.