odr_violation1.cc 466 B

123456789101112131415161718192021222324
  1. #include <algorithm>
  2. #include "odr_header1.h"
  3. class Ordering {
  4. public:
  5. bool operator()(int a, int b) {
  6. return a < b;
  7. }
  8. };
  9. void SortAscending(int array[], int size) {
  10. std::sort(array, array + size, Ordering());
  11. }
  12. extern "C" int OverriddenCFunction(int i) __attribute__ ((weak));
  13. extern "C" int OverriddenCFunction(int i) {
  14. return i;
  15. }
  16. // Instantiate the Derived vtable, without optimization.
  17. OdrBase* CreateOdrDerived1() {
  18. return new OdrDerived;
  19. }