我要控诉clang!!!
  • 板块灌水区
  • 楼主YCSluogu
  • 当前回复12
  • 已保存回复12
  • 发布时间2022/6/27 11:21
  • 上次更新2023/10/27 22:29:00
查看原帖
我要控诉clang!!!
311721
YCSluogu楼主2022/6/27 11:21

RT

有如下代码:

#include <iostream>

using namespace std;

int main() {
  int a[5] = {5, 4, 3, 2, 1};
  sort(a, a + 5);
  for (int i = 0; i < 5; i++) {
    cout << a[i] << " ";
  }
  do {
    cout << endl;
    for (int i = 0; i < 5; i++) {
      cout << a[i] << " ";
    }
  } while (next_permutation(a, a + 5));
  cout << endl;
  return 0;
}

用g++编译:

test.cpp: In function 'int main()':
test.cpp:7:3: error: 'sort' was not declared in this scope
   sort(a, a + 5);
   ^~~~
test.cpp:7:3: note: suggested alternative: 'qsort'
   sort(a, a + 5);
   ^~~~
   qsort
test.cpp:16:12: error: 'next_permutation' was not declared in this scope
   } while (next_permutation(a, a + 5));

但是在clang里面,压!根!不!报!错!

于是我在机房开心的考试成绩,100->0

QAQAQAQAQAQAQAQAQAQAQAQ

(或者说我用msys2下的是个假clang?)

可是我舍不得我亲爱的clangd和vim

2022/6/27 11:21
加载中...