HomePhabricator

Use C++14-style return type deduction in LLVM.

Authored by jlebar on Feb 10 2020, 3:49 PM.

Description

Use C++14-style return type deduction in LLVM.

Summary:
Simplifies the C++11-style "-> decltype(...)" return-type deduction.

Note that you have to be careful about whether the function return type
is auto or decltype(auto). The difference is that bare auto
strips const and reference, just like lambda return type deduction. In
some cases that's what we want (or more likely, we know that the return
type is a value type), but whenever we're wrapping a templated function
which might return a reference, we need to be sure that the return type
is decltype(auto).

No functional change.

Subscribers: dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74383

Details

Committed
jlebarFeb 11 2020, 7:38 AM
Differential Revision
D74383: Use C++14-style return type deduction in LLVM.
Parents
rGdd11c8fb0d07: Fix SFINAE in JSON.h constructor.
Branches
Unknown
Tags
Unknown