This is an archive of the discontinued LLVM Phabricator instance.

[clang] Fix constrained decltype(auto) deduction
ClosedPublic

Authored by mizvekov on Mar 5 2021, 3:51 PM.

Details

Summary

Prior to this fix, constrained decltype(auto) behaves exactly the same
as constrained regular auto.
This fixes it so it deduces like decltype(auto).

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Diff Detail

Event Timeline

mizvekov requested review of this revision.Mar 5 2021, 3:51 PM
mizvekov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMar 5 2021, 3:51 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
rsmith accepted this revision.Mar 5 2021, 3:57 PM

Looks good, thanks!

clang/test/CXX/dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp
59–63

For completeness, it'd be nice to test the decltype((...)) case too.

This revision is now accepted and ready to land.Mar 5 2021, 3:57 PM
mizvekov updated this revision to Diff 328689.Mar 5 2021, 4:31 PM

Added new tests as suggested by rsmith.

By the way, I still need help commiting this.

mizvekov updated this revision to Diff 328711.Mar 5 2021, 6:03 PM

Turns out someone had already reported this bug.

This change puts "PR48384" in the new tests.

This revision was landed with ongoing or failed builds.Mar 5 2021, 6:20 PM
This revision was automatically updated to reflect the committed changes.