Page MenuHomePhabricator

[Sema] Add implicit cast for conversion of function references
Changes PlannedPublic

Authored by aaronpuchert on Sep 3 2019, 10:30 AM.

Details

Reviewers
rsmith
riccibruno
Summary

When initializing a reference to a non-noexcept function from a noexcept
function we didn't add an implicit cast node, which confused a type-
checking assertion in CodeGen. The same conversion is used for function
pointer conversion already.

Fixes PR43154.

Event Timeline

aaronpuchert created this revision.Sep 3 2019, 10:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 3 2019, 10:30 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aaronpuchert marked 2 inline comments as done.Sep 3 2019, 10:33 AM

If anyone shares my feeling that the boolean output parameters of CompareReferenceRelationship should rather move to the return value, I would be happy to do that.

clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p4-ast.cpp
5

This is new.

15

This is also new.

Perhaps I should mention that this fixes an assertion failure.

aaronpuchert planned changes to this revision.Tue, Oct 8, 12:53 PM

If anyone shares my feeling that the boolean output parameters of CompareReferenceRelationship should rather move to the return value, I would be happy to do that.

I'll do that in a separate change and then rebase this on top.