From 04bbab586beb522a27d6e10529c7c6f50189570e Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 10 Feb 2012 16:13:20 +0000 Subject: Don't introduce a lambda's operator() into the class until after we have finished parsing the body, so that name lookup will never find anything within the closure type. Then, add this operator() and the conversion function (if available) before completing the class. llvm-svn: 150252 --- clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp') diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp index 21c8e22092b..8fa3837214d 100644 --- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp +++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp @@ -43,3 +43,12 @@ void test_capture_constness(int i, const int ic) { } +struct S1 { + int x, y; + int operator()(int); + void f() { + [&]()->int { + return operator()(this->x + y); + }(); + } +}; -- cgit v1.2.3