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

             Bug #: 13531
           Summary: Assertion "Cannot get layout of forward declarations"
                    when using -gdwarf-2
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


Created attachment 9003
  --> http://llvm.org/bugs/attachment.cgi?id=9003
Log of clang run

The following program crashes clang r161317 when compiled with option
-gdwarf-2:

template <typename>
struct unique_ptr {
    unique_ptr() {}
};

template <unsigned>
struct Vertex {};

//static void crash() // Compiles
void crash() // Asserts
{
    unique_ptr<Vertex<2>[]> v = unique_ptr<Vertex<2>[]>();
}


This results in (full log attached):

% ~/LLVM/build/Release+Asserts/bin/clang++ -c -gdwarf-2 -v clang.cpp
clang version 3.2 (trunk 161317)
[...]
Assertion failed: (D && "Cannot get layout of forward declarations!"), function
getASTRecordLayout, file
/Users/rynnsauer/LLVM/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp, line
2384.


Without option -gdwarf-2, the code compiles correctly.

The bug already exists in clang r160613.

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