Make sure special struct TypeInfo members are semantically analyzed before emitting the TypeInfo (#3783)

As there are apparently cases where the struct hasn't had semantic3
yet, at least with -linkonce-templates. This prevents erroneous xopCmp
etc. (failing to compile) from being referenced in the TypeInfo (=>
linker errors) / being analyzed for -linkonce-templates codegen.
`semanticTypeInfoMembers()` replaces them by `object._xopCmp()` etc.
if compilation fails.
This commit is contained in:
Martin Kinkelin 2021-07-14 15:41:06 +02:00 committed by GitHub
parent 2578795801
commit 6e15e1ab04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View file

@ -602,7 +602,6 @@ void DtoDeclareFunction(FuncDeclaration *fdecl, const bool willDefine) {
Logger::println("Function is inside a linkonce_odr template, will be "
"defined after declaration.");
if (fdecl->semanticRun < PASSsemantic3done) {
// this can e.g. happen for special __xtoHash member functions
Logger::println("Function hasn't had sema3 run yet, running it now.");
const bool semaSuccess = fdecl->functionSemantic3();
(void)semaSuccess;