[LLVMbugs] [Bug 13531] New: Assertion "Cannot get layout of forward declarations" when using -gdwarf-2

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 6 04:11:16 PDT 2012


             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: unassignedclangbugs at nondot.org
        ReportedBy: jonathan.sauer at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    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

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

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.

More information about the llvm-bugs mailing list