Use C++14-style return type deduction in LLVM.
authorJustin Lebar <jlebar@google.com>
Mon, 10 Feb 2020 23:49:14 +0000 (15:49 -0800)
committerJustin Lebar <jlebar@google.com>
Tue, 11 Feb 2020 15:38:42 +0000 (07:38 -0800)
commitfb45968e6285127a18d4d046613b62f125339576
tree3b5ac39a436743430d90e55d4440e2eaf3af94f2
parentdd11c8fb0d07b346b8eaba5a023d58203c367041
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
llvm/include/llvm/ADT/STLExtras.h
llvm/include/llvm/ADT/fallible_iterator.h
llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h
llvm/include/llvm/ExecutionEngine/Orc/Core.h
llvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h
llvm/include/llvm/Support/Casting.h
llvm/include/llvm/Support/Errno.h
llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp
llvm/unittests/ADT/STLExtrasTest.cpp
llvm/unittests/Support/FormatVariadicTest.cpp
llvm/utils/unittest/googletest/include/gtest/internal/custom/raw-ostream.h