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

            Bug ID: 22109
           Summary: Assertion failure when taking the size of template
                    argument that is an ill-formed lambda type
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

template <class T>
class A;

class B {
  A<int> a;
};

template <class X>
void F(X x) {
  int y = sizeof(x);
}

void Test(B b) {
  F([b]() {});
}

clang -std=c++11 foo.cc

clang-3.5: ../tools/clang/lib/AST/RecordLayoutBuilder.cpp:2807: const
clang::ASTRecordLayout &clang::ASTContext::getASTRecordLayout(const
clang::RecordDecl *) const: Assertion `!D->isInvalidDecl() && "Cannot get
layout of invalid decl!"' failed

It looks like the lambda is not marked as invalid, but should be.  Since Clang
thinks the lambda is valid, it assumes that all parts of the lambda are valid
as well, then asserting when it finds that the captured variable b has invalid
type.

-- 
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