[llvm-bugs] [Bug 30566] New: clang asserts when compiling lambda with a initialized capture

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 29 12:38:13 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30566

            Bug ID: 30566
           Summary: clang asserts when compiling lambda with a initialized
                    capture
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ahatanak at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

$ cat t2.cpp
int name1;

int foo1(int *a) {
  auto s1= [name=name](int *a) -> int {
    return *a;
  };
  return sizeof(s1);
}

$ clang++ -std=c++14 t2.cpp -c -o /dev/null 
t2.cpp:4:18: error: use of undeclared identifier 'name'; did you mean 'name1'?
  auto s1= [name=name](int *a) -> int {
                 ^~~~
                 name1
t2.cpp:1:5: note: 'name1' declared here
int name1;
    ^
Assertion failed: (!A->getDeducedType().isNull() && "cannot request the size of
an undeduced or dependent auto type"), function getTypeInfoImpl, file
/Users/ahatanaka/projects/llvm/git/llvm/tools/clang/lib/AST/ASTContext.cpp,
line 1856.
Stack dump:

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160929/409880a4/attachment.html>


More information about the llvm-bugs mailing list