2013/12/20 Jan Kundrát <j...@gentoo.org>:
> On Friday, 20 December 2013 12:56:43 CEST, Sven Eden wrote:
>>
>> And no, the languages are _not_ "source-incompatible". That would be a
>> scandal!
>
>
> You might argue about this, but that doesn't change these facts. This is
> absolutely valid C++98 program:
>
> jkt@svist ~ $ cat foo.cpp int main() {
>    auto int foo;
>    return 0;
> }
> jkt@svist ~ $ g++ -std=c++98 -pedantic foo.cpp
> jkt@svist ~ $ echo $?
> 0
>
> ...which will *not* build under the C++11 mode:
>
> jkt@svist ~ $ g++ -std=c++0x foo.cpp
> foo.cpp: In function ‘int main()’:
> foo.cpp:2:14: error: two or more data types in declaration of ‘foo’
>
> Yes, -Wc++0x-compat warns about this, yes, it's included in -Wall, but it
> does not change the fact that there *is* code out there which does conform
> to C++98 standard, does *not* try to "outsmart the compiler", and which will
> not build in the C++11 mode. Do we really have to be having this discussion?

The C++ Committee considered this exact case in relation to the new
meaning of `auto` and decided that such code doesn't really exist in
the wild. You won't hit auto-related issues in almost all packages in
Portage I guess.

There are more obscure cases of incompatibility though, with more
obscure error messages, like with autogenerated move ctors and the
likes. I've hitted it myself a couple of times in more or less complex
template code, but can't think of an example off the top of my head
unfortunately.

-- 
  Georg Rudoy
  LeechCraft — http://leechcraft.org

Reply via email to