New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clang can't read back a PCH just produced: Assertion failed: (D && "Cannot get layout of forward declarations!"), function getASTRecordLayout #31211
Comments
assigned to @zygoloid |
Note: the same repro works with -x c++-header and -x c++. |
@rsmith, I've attempted a fix, can you take a look? https://reviews.llvm.org/D29753 |
A stopgap fix for PCH was committed in r296656. The problem still happens with modules though. Richard triggered the issue with: $ cat test/PCH/empty-def-fwd-struct.modulemap Leaving this open until we find a more complete solution. |
Thanks! I will merge it to the release branch once it's been in tree for a bit. |
Merged to 4.0 in r296762. If we can fix this properly for 4.0.1 that would be great, so marking it a blocker of that. |
*** Bug llvm/llvm-bugzilla-archive#32186 has been marked as a duplicate of this bug. *** |
llvm/llvm-bugzilla-archive#32186 has a totally unrelated symptom with the same root cause (the call to DeclMustBeEmitted in a context where AST invariants are not met during deserialization). |
*** Bug llvm/llvm-bugzilla-archive#32144 has been marked as a duplicate of this bug. *** |
This was mostly addressed by https://reviews.llvm.org/D30793 / r300110. |
Second part of the fix landed in r303432. |
Richard, now that the fixes have been merged, are https://reviews.llvm.org/rL300110 and https://reviews.llvm.org/rL303432 OK to merge to the release_40 branch? |
r303432 is very new; would you prefer to merge it now and revert it from the branch if people have problems with it on trunk, or wait a few days and merge it if there are no complications? (I'm not anticipating any problems, just cautious about merging a patch that's not really been field-tested.) I'm fine with merging r300110 now. |
*** Bug llvm/llvm-bugzilla-archive#33313 has been marked as a duplicate of this bug. *** |
mentioned in issue #31409 |
mentioned in issue llvm/llvm-bugzilla-archive#32144 |
mentioned in issue llvm/llvm-bugzilla-archive#32186 |
mentioned in issue llvm/llvm-bugzilla-archive#33313 |
Extended Description
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@metafoo.co.uk
Date: Wed Jul 20 14:10:16 2016
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
The text was updated successfully, but these errors were encountered: