
Doug Gregor <dgregor@cs.indiana.edu> writes:
"Arkadiy Vertleyb" <vertleyb@hotmail.com> writes:
I'm not convinced that this particular ODR violation ends up being a problem in practice, though -- ultimately we end up getting the same type out of any typeof(...), and if we're never generating linker symbols within the computation performed by typeof, we're probably going to get away with it. I think it's worth trying an automatic scheme and stress-testing it to see if we can make it break. Better yet, explicitly construct a pared-down version _designed_ to break and see if we can cause a problem.
The only time I've ever seen a compiler/toolchain diagnose an ODR violation is when it results in two symbols with the same name and different sizes being linked together.
Well, it's the *un-* diagnosed ODR violations that are really dangerous...
As you said, we're not generating anything for the linker so this case won't crop up. Fear, Uncertainty, and Doubt make me wonder if trying to use Arkadiy's typeof in an exported template would trigger an ODR violation diagnostic in an EDG compiler, but I have neither proof nor the compiler around.
I say we try to get away with the ODR violation. We know we're getting typeof/decltype eventually, so the ODR violation will eventually disappear anyway.
...but I agree with you anyway. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com