http://llvm.org/bugs/show_bug.cgi?id=12154

             Bug #: 12154
           Summary: Passing a lambda from inside a function template to a
                    method template of a class template does not compile
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


The following program fails to compile with clang r151811:

template <typename T, typename S>
static T bar(S s)
{
  template s.foo<T>([]() -> bool { return true; });
}


This results in:

$ $ ~/LLVM/build/Release+Asserts/bin/clang++ -std=c++0x -v clang.cpp 
clang version 3.1 (trunk 151811)
Target: x86_64-apple-darwin10.8.0
Thread model: posix
[...]
clang.cpp:4:2: error: expected expression
        template s.foo<T>([]() -> bool { return true; });
        ^
1 error generated.


Turning the call to <s.foo> into a non-dependent name like this:

  s.foo([]() -> bool { return true; });

results in a successful compile.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to