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

            Bug ID: 16880
           Summary: Clang crashes when taking sizeof() of undeduced auto
                    variable of ranged for loop
           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

Repro:
void test() {
  for (auto &A : X){
    int x = sizeof(A);
  }
}

Commandline:
clang -std=c++11 testing.cc

Output:
testing.cc:2:18: error: use of undeclared identifier 'X'
  for (auto &A : X){
                 ^
clang-3.3: llvm/tools/clang/lib/AST/ASTContext.cpp:1645: std::pair<long
unsigned int, unsigned int> clang::ASTContext::getTypeInfoImpl(const
clang::Type*) const: Assertion `!A->getDeducedType().isNull() && "cannot
request the size of an undeduced or dependent auto type"' failed.

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