[all-commits] [llvm/llvm-project] ac66c6: Use C++14-style return type deduction in clang.

Justin Lebar via All-commits all-commits at lists.llvm.org
Tue Feb 11 14:41:37 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ac66c61bf9463bf419102ad8b6565dcbc495b0ab
      https://github.com/llvm/llvm-project/commit/ac66c61bf9463bf419102ad8b6565dcbc495b0ab
  Author: Justin Lebar <jlebar at google.com>
  Date:   2020-02-11 (Tue, 11 Feb 2020)

  Changed paths:
    M clang/lib/AST/ASTImporter.cpp
    M clang/lib/StaticAnalyzer/Checkers/GCDAntipatternChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/OSObjectCStyleCast.cpp
    M clang/lib/StaticAnalyzer/Checkers/ObjCAutoreleaseWriteChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/PointerSortingChecker.cpp

  Log Message:
  -----------
  Use C++14-style return type deduction in clang.

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.

Reviewers: bkramer, MaskRay, martong, shafik

Subscribers: martong, cfe-commits

Tags: #clang

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




More information about the All-commits mailing list