Move the initialization of VAListTagName after InitializeSema()
This innocuous statement to get the identifier info for __va_list_tag was causing an assertion failure: NextIsPrevious() && "decl became non-canonical unexpectedly" if the __va_list_tag identifier was found in a PCH in some circumstances, because it was looked up before the ASTReader had a Sema object to use to find existing decls to merge with. We could possibly move getting the identifier info even later, or make it lazy if we wanted to, but this seemed like the minimal change. Now why a PCH would have this identifier in the first place is a bit mysterious. This seems to be related to the global module index in some way, because when the test case is built without the global module index it will not emit an identifier for __va_list_tag into the PCH, but with the global module index it does. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217275 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- lib/Sema/Sema.cpp 4 additions, 2 deletionslib/Sema/Sema.cpp
- test/Modules/Inputs/va_list/module.modulemap 5 additions, 0 deletionstest/Modules/Inputs/va_list/module.modulemap
- test/Modules/Inputs/va_list/va_list_a.h 2 additions, 0 deletionstest/Modules/Inputs/va_list/va_list_a.h
- test/Modules/Inputs/va_list/va_list_b.h 2 additions, 0 deletionstest/Modules/Inputs/va_list/va_list_b.h
- test/Modules/va_list.m 27 additions, 0 deletionstest/Modules/va_list.m
Loading
Please register or sign in to comment