[cfe-dev] How to control C++0x adoption in a large codebase?
rjmccall at apple.com
Fri Oct 14 03:23:51 PDT 2011
On Oct 14, 2011, at 1:14 AM, Ahmed Charles wrote:
> In any case, the warning won't solve library issues, like using
> next(std::vector) in the clang namespace without qualifying llvm::,
> because it's found using adl. There are likely to be lots of issues
> that the warnings couldn't hope to cover. I'm not against the
> warnings, but ultimately, if you aren't building with C++98, you can't
> be sure that it works there.
Agreed. This seems like a lot of code in Clang to work around
what's obviously a major libstdc++ issue. I do understand their
dilemma, but it's going to be a huge problem for a lot of people,
and "if you care about the old ABI, you can never enable C++11"
is not a reasonable answer.
It is possible to design a library which upgrades gracefully — they
can't reasonably make std::list::size() O(1) while maintaining the
ABI, but they can still implement emplace() if C++11 is enabled.
Alternatively, for clients like Google that don't care about breaking
ABI, they could make the C++11 implementation downgrade
gracefully like libc++ does. But this should be solved by libstdc++
instead of hacking compilers around a situation that wouldn't
happen if libstdc++ had an appropriate solution.
More information about the cfe-dev