When compiling C++ code with clang++ on Windows, the tellg() function returns -1 when attempting to get the size of a large file (around 6GB). However, when compiling the same code with MSVC or g++, the file size is retrieved correctly.
#include <fstream>
#include <iostream>
int main() {
std::ifstream inFIle("test.file", std::ios::binary|std::ios::in);
if(!inFIle.is_open() || !inFIle.good()) {
std::cout << "fail" << std::endl;
return 0;
}
inFIle.seekg(0, std::ios::end);
auto size = inFIle.tellg();
inFIle.seekg(0, std::ios::beg);
std::cout << size << std::endl;
return 0;
}