[cfe-commits] Patch improving parse of tuple in 98-mode

Douglas Gregor dgregor at apple.com
Mon Jan 24 07:46:58 PST 2011


On Jan 23, 2011, at 1:15 AM, Chandler Carruth wrote:

> Hello,
> 
> I was trying to see how Clang in -std=c++98 would handle libc++ and ran into some trouble. GCC enables a substantial amount of C++ functionality when inside of system headers in addition to suppressing warnings. Clang however only suppresses warnings and relies on 0x features to be enabled with ExtWarns in 98 mode in order for them to work in system headers. The end result is that while Clang is fine with the variadic templates, it barfs on several other constructs. One is the use of 'vector<vector<int>>'-style closing angle brackets. I've attached a patch, constructed with our fixit rewriter, that makes all of those contain the mandated space. Chris indicated on IRC that this should likely just be avoided in libc++.

Yes, this should be avoided in libc++. The change that allows >> instead of > > actually does break some obscure code, so we can't just downgrade the error to a warning.

> The other major blocker is that R-value references aren't an extension but are used heavily in libc++. Should these also become an extension, or should we add more robust survival tactics in system headers much as GCC does?

Rvalue references will become an ExtWarn they are implemented well enough to be useful. With luck, that'll happen this week.

> One more small blocker was the use of default template parameter arguments in function templates. Same question as to how best to proceed.

This can be downgraded to an ExtWarn, although we need some better testing to be sure that it actually works, first.

	- Doug





More information about the cfe-commits mailing list