Блог пользователя JoeyWheeler

Автор JoeyWheeler, история, 8 лет назад, По-английски
#include <algorithm>

struct RT {
    std::pair<int,int> v[100000]; // runtime linked with size of this array, 6s at 10000, 20s at 20000, who knows at 200000 (quadratic time? who knows)
} z;

int main() {
}

The above code seems to be stuck in compiling on g++ with c++11 under linux. (compiled as g++ -o prog prog.cpp -std=c++11) It's been tested and has failed under

  • Linux 4.0.6-1-ARCH x86_64 GNU/Linux — g++ (GCC) 5.1.0

  • Linux 4.3.3-1-ARCH x86_64 GNU/Linux — g++ (GCC) 5.3.0

  • Linux 3.19.0-21-generic x86_64 GNU/Linux — g++ (GCC) 5.3.0

  • It also fails when submitted to ideone.com, codeforces.com (eg), dmoj.ca

It appears to compile successfully using clang++ and when using cygwin

Could other people try compile this and see what results they get?

  • Проголосовать: нравится
  • +72
  • Проголосовать: не нравится

»
8 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by JoeyWheeler (previous revision, new revision, compare).

»
8 лет назад, # |
Rev. 2   Проголосовать: нравится +10 Проголосовать: не нравится

For me compiling it works with both g++ prog.cpp and g++ prog.cpp -std=c++11.

Linux 3.19.0-42-generic x86_64, gcc version 4.8.4

»
8 лет назад, # |
Rev. 3   Проголосовать: нравится +15 Проголосовать: не нравится

For me it compiles without -std=c++11 on g++ 5.2.1 (doesn't with the option on), and both works on g++ 4.9.3

Linux 4.2.0-22-generic x86_64 (Ubuntu Gnome 15.10), g++ version 5.2.1 / 4.9.3

»
8 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

You should report this bug here: https://gcc.gnu.org/bugs/

»
8 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Compiles just fine for me both with and without std=c++11 on Windows (MinGW-w64, GCC 4.9.2) and Linux (g++ (Debian 4.7.2-5) 4.7.2)

»
8 лет назад, # |
  Проголосовать: нравится +69 Проголосовать: не нравится

I've submitted it as bug on gcc issue tracker two months ago https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68203