/// VFSs that use external names. In that case, the \c FileEntryRef
/// returned by the \c FileManager will have the external name, and not the
/// name that was used to lookup the file.
- llvm::PointerUnion<FileEntry *, const MapEntry *> V;
+ // The second type is really a `const MapEntry *`, but that confuses gcc5.3.
+ // Once that's no longer supported, change this back.
+ llvm::PointerUnion<FileEntry *, const void *> V;
MapValue() = delete;
MapValue(FileEntry &FE) : V(&FE) {}
FileEntryRef::MapValue Value = *SeenFileInsertResult.first->second;
if (LLVM_LIKELY(Value.V.is<FileEntry *>()))
return FileEntryRef(*SeenFileInsertResult.first);
- return FileEntryRef(*Value.V.get<const FileEntryRef::MapEntry *>());
+ return FileEntryRef(*reinterpret_cast<const FileEntryRef::MapEntry *>(
+ Value.V.get<const void *>()));
}
// We've not seen this before. Fill it in.
FileEntry *FE;
if (LLVM_LIKELY(FE = Value.V.dyn_cast<FileEntry *>()))
return FE;
- return &FileEntryRef(*Value.V.get<const FileEntryRef::MapEntry *>())
+ return &FileEntryRef(*reinterpret_cast<const FileEntryRef::MapEntry *>(
+ Value.V.get<const void *>()))
.getFileEntry();
}