[llvm-bugs] [Bug 31863] New: Clang can't read back a PCH just produced: Assertion failed: (D && "Cannot get layout of forward declarations!"), function getASTRecordLayout

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Feb 4 00:43:35 PST 2017


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

            Bug ID: 31863
           Summary: Clang can't read back a PCH just produced: Assertion
                    failed: (D && "Cannot get layout of forward
                    declarations!"), function getASTRecordLayout
           Product: clang
           Version: 4.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Modules
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mehdi.amini at apple.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17936
  --> https://llvm.org/bugs/attachment.cgi?id=17936&action=edit
Repro reduced

Clang-4.0 (and trunk) are crashing when building Unreal Engine, a PCH can't be
read back we hit this assertion. I believe this is a regression from clang-3.9
introduced in r276159:

Author: Richard Smith <richard-llvm at metafoo.co.uk>
Date:   Wed Jul 20 14:10:16 2016

    [modules] Don't emit initializers for VarDecls within a module eagerly
whenever
    we first touch any part of that module. Instead, defer them until the first
    time that module is (transitively) imported. The initializer step for a
module
    then recursively initializes modules that its own headers imported.

    For example, this avoids running the <iostream> global initializer in
programs
    that don't actually use iostreams, but do use other parts of the standard
    library.


Reduced repro attached. Run with:

clang -c -x objective-c++-header pre.h -std=c++14 -o pre.gch
clang -c -x objective-c++ /dev/null    -std=c++14 -include-pch pre.gch

-- 
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/20170204/3c3698ee/attachment.html>


More information about the llvm-bugs mailing list