[PATCH] D74383: Use C++14-style return type deduction in LLVM.

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 21:48:35 PST 2020


jlebar created this revision.
Herald added subscribers: llvm-commits, dexonsmith.
Herald added a project: LLVM.
jlebar added a reviewer: bkramer.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74383

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74383.243736.patch
Type: text/x-patch
Size: 18733 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200211/023d6c97/attachment-0001.bin>


More information about the llvm-commits mailing list