Breaking backwards compatiblity

bearophile bearophileHUGS at lycos.com
Sat Mar 10 04:31:54 PST 2012


Walter:

> What breaking changes are there in C++11, other than dumping export?

The end of the talk (just before the questions) about Clang of GoingNative2012 has shown one breaking change of C++:

#include <iostream>
struct S { int n; };
struct X { X(int) {} };
void f(void*) {
  std::cerr << "Pointer!\n";
}
void f(X) {
  std::cerr << "X!\n";
}
int main() {
  f(S().n);
}



% clang++ -std=c++11 -g -o cxx11-4 cxx11-4.cpp
% ./cxx11-4
Pointer!
% clang++ -std=c++98 -g -o cxx11-4 cxx11-4.cpp
% ./cxx11-4
X!


But in the end I don't care for C++11 here, my post here was about D and several bug reports that are able to break user code once fixed or improved. If you raise the bar too much for breaking changes now, most of those things will never be fixed or done. And this is _not_ acceptable for me.

Bye,
bearophile


More information about the Digitalmars-d mailing list