ioi-2023 / contestant-vm

Contestant virtual machine for online IOI (since 2020)
1 stars 2 forks source link

C++17 features are not recognized by Visual Studio Code C++ extension #96

Closed boasbakker closed 1 year ago

boasbakker commented 1 year ago

Describe the bug When using C++ 17 features the C++ extension gives an error because it doesn't recognize them. Since C++17 is allowed at the IOI, I think the C++ language standard of the C++ extension should be set to C++17 by default.

To Reproduce Steps to reproduce the behavior:

  1. Open Visual Studio Code
  2. Create a new C++ file
  3. Write this code, or other code that uses C++17 features:
    #include <numeric>
    int main()
    {
    int a = std::gcd(1,1);
    }
  4. See error

Expected behavior There would be no error because the setting Cpp standard of the C++ extension would be set to C++17.

Screenshots

image

Please complete the following information:

radl97 commented 1 year ago

Hi! Thank you for your report! I do not think we will be able to release a new VM release this late in the process, but if I have the time, I will try to fix this, as this seems generally. But note that this will be low priority, as we have closed down contestant requests, with most of the non-critical UI issues.

One thing that bothers me is that I think this was in fact tested. @horcsinbalint Did you experience similar issue?

As a workaround contestants could try the other C++ extension (clangd) There is a section about how to install and enable it in the VM manual provided within the VM. If you can test it (whether C++17 works), please share it here @baosbakker .


Also: can you try opening a folder (a workspace) and have the C++ file in there within a project? This is the most widely used (and thus, tested) setup for VSCode. I have experienced C++ related weird issues or annoyances when a C++ file was not opened as part of a project (even if it is a single-file project).

horcsinbalint commented 1 year ago

Hi! Yes, I have tested whether the C/C++ extension works and I have not found any issues. For me setting C++ manually to gnu++17 resolved this question. It would certainly be more elegant to have it set by default, but I think this is not an issue that would break the competition (like #73 or #52).

radl97 commented 1 year ago

Ah, I see, that's probably why the bug with the sertings were bumped 😅

radl97 commented 1 year ago

We have fixed this issue on the laptops \o/