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: unassignedclangb...@nondot.org
          Reporter: mehdi.am...@apple.com
                CC: dgre...@apple.com, llvm-bugs@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-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to