<div dir="ltr">Hi Everyone,<div><br>We're trying to integrate the CERN ROOT framework with Julia, both<br>of which use LLVM/Clang for C++ interoperability. As such, we're hoping<br>to harmonize the versions of clang used in both projects. One major<br>obstacle to this currently is a patch that the ROOT folks are carrying<br>to support their I/O system which uses the structure of C++ classes to<br>determine the on-disk format. The patch as is isn't really in a form<br>that could be submitted upstream, but we're hoping to solicit some advice<br>to come up with a solution that would be acceptable to clang, and not<br>require any local code patches.</div><div><br>With that in mind, let us describe the problem:</div><div><br>As mentioned, ROOT uses the structure of C++ classes to determine it's<br>IO format. The one wrinkle to that is that sometimes the I/O storage<br>format and the in-memory format are not exactly the same. In particular,<br>ROOT has a</div><div><br>typedef double Double32_t;<br><br></div><div>where if this typedef appears in a struct that is serialized to disk,<br>it indicates that it should be stored with 32bit precision on disk, but<br>with 64bit precision in memory.</div><div><br>That's *only* for I/O information; for anything regarding symbols we<br>need these two to share their instantiation data.</div><div><br>I.e. we want to distinguish the types of D<double>::m and<br>D<Double32_t>::m (and also D<vector<Double32_t>>::m and D<vector<double>>::m) in</div><div><br>template <class T><br>struct D {<br>using type = std::remove_reference<D>;<br>T m;<br>static int s;<br>};<br><br></div><div>But &D<double>::s must the the same as D<Double32_t>::s; more importantly:</div><div><br>void f(D<double>);<br><br></div><div>must be called by f(D<Double32_t>{}). That is (IIRC) in contrast of what<br>the C++ committee discussed for strong typedefs. </div></div>