summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-01-02 23:52:42 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-01-02 23:52:42 +0000
commit50e291eaf28383e8b9c061dedc3aa0acb9d0c9e6 (patch)
tree227ed404063ea5ef3ba4a45a8610ebdf8053c03e /clang/lib/Sema/SemaOverload.cpp
parent96625fdc6bff9f9bbf96239860a501778623b680 (diff)
downloadbcm5719-llvm-50e291eaf28383e8b9c061dedc3aa0acb9d0c9e6.tar.gz
bcm5719-llvm-50e291eaf28383e8b9c061dedc3aa0acb9d0c9e6.zip
Fix and simplify handling of return type for (generic) lambda conversion function to function pointer.
Previously, we would: * compute the type of the conversion function and static invoker as a side-effect of template argument deduction for a conversion * re-compute the type as part of deduced return type deduction when building the conversion function itself Neither of these turns out to be quite correct. There are other ways to reach a declaration of the conversion function than in a conversion (such as an explicit call or friend declaration), and performing auto deduction causes the function type to be rebuilt in the context of the lambda closure type (which is different from the context in which it originally appeared, resulting in spurious substitution failures for constructs that are valid in one context but not the other, such as the use of an enclosing class's "this" pointer). This patch switches us to use a different strategy: as before, we use the declared type of the operator() to form the type of the conversion function and invoker, but we now populate that type as part of return type deduction for the conversion function. And the invoker is now treated as simply being an implementation detail of building the conversion function, and isn't given special treatment by template argument deduction for the conversion function any more. llvm-svn: 321683
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r--clang/lib/Sema/SemaOverload.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 07d931552f3..f2b1963df1e 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -11328,9 +11328,6 @@ Sema::ResolveSingleFunctionTemplateSpecialization(OverloadExpr *ovl,
return Matched;
}
-
-
-
// Resolve and fix an overloaded expression that can be resolved
// because it identifies a single function template specialization.
//
OpenPOWER on IntegriCloud