1 |
On Friday, 20 December 2013 12:56:43 CEST, Sven Eden wrote: |
2 |
> And no, the languages are _not_ "source-incompatible". That would be a |
3 |
> scandal! |
4 |
|
5 |
You might argue about this, but that doesn't change these facts. This is |
6 |
absolutely valid C++98 program: |
7 |
|
8 |
jkt@svist ~ $ cat foo.cpp |
9 |
int main() { |
10 |
auto int foo; |
11 |
return 0; |
12 |
} |
13 |
jkt@svist ~ $ g++ -std=c++98 -pedantic foo.cpp |
14 |
jkt@svist ~ $ echo $? |
15 |
0 |
16 |
|
17 |
...which will *not* build under the C++11 mode: |
18 |
|
19 |
jkt@svist ~ $ g++ -std=c++0x foo.cpp |
20 |
foo.cpp: In function ‘int main()’: |
21 |
foo.cpp:2:14: error: two or more data types in declaration of ‘foo’ |
22 |
|
23 |
Yes, -Wc++0x-compat warns about this, yes, it's included in -Wall, but it |
24 |
does not change the fact that there *is* code out there which does conform |
25 |
to C++98 standard, does *not* try to "outsmart the compiler", and which |
26 |
will not build in the C++11 mode. Do we really have to be having this |
27 |
discussion? |
28 |
|
29 |
Cheers, |
30 |
Jan |