Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ranges library mingw 13.1.0 error squiggles bug #11050

Closed
MFattakhov opened this issue Jun 6, 2023 · 4 comments
Closed

Ranges library mingw 13.1.0 error squiggles bug #11050

MFattakhov opened this issue Jun 6, 2023 · 4 comments

Comments

@MFattakhov
Copy link

MFattakhov commented Jun 6, 2023

Environment

  • OS and Version: Windows 11 22H2
  • VS Code Version: 1.78.2
  • C/C++ Extension Version: 1.16.0 pre-release

Bug Summary and Steps to Reproduce

Bug Summary:
Error squiggles when using mingw 13.1.0 g++ compiler and ranges' library features. For example, using std::views::iota gives you no instance of overloaded function "std::ranges::views::_Iota::operator()" matches the argument listC/C++(304) tmp.cpp(5, 17): argument types are: (int, int) tmp.cpp(5, 17): object type is: const std::ranges::views::_Iota

Steps to reproduce:

  1. Write
#include <ranges>
#include <iostream>

int main() {
  for (auto i : std::views::iota(1, 10)) {
    std::cout << i << " ";
  }
  return 0;
}

in some tmp.cpp
2. Ensure IntelliSense configuration is set up with mingw's g++ 13.1.0 compiler (can be installed via scoop)
3. Observe error squiggles
4. Ensure there is no compilation errors via `g++ -g -std=c++20 ".\tmp.cpp"

Expected behavior:
Obviously there shouldn't be any error. Works fine with mingw's g++ 12.2.0 compiler

Configuration and Logs

c_cpp_properties.json
{
    "configurations": [
        {
            "name": "gcc 12.2.0",
            "includePath": [
                "${default}",
                "C:\\Users\\Marat\\scoop\\apps\\mingw\\12.2.0-rt_v10-rev2\\lib\\gcc\\x86_64-w64-mingw32\\12.2.0\\include\\c++\\x86_64-w64-mingw32",
                "C:\\Users\\Marat\\scoop\\apps\\mingw\\12.2.0-rt_v10-rev2\\lib\\gcc\\x86_64-w64-mingw32\\12.2.0\\include\\c++",
                "C:\\Users\\Marat\\scoop\\apps\\mingw\\12.2.0-rt_v10-rev2\\lib\\gcc\\x86_64-w64-mingw32\\12.2.0\\include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.22000.0",
            "compilerPath": "C:/Users/Marat/scoop/apps/mingw/12.2.0-rt_v10-rev2/bin/g++.exe",
            "cStandard": "c17",
            "cppStandard": "c++20",
            "compilerArgs": [],
            "intelliSenseMode": "gcc-x64",
            "compilerPathInCppPropertiesJson": "C:/Users/Marat/scoop/apps/mingw/12.2.0-rt_v10-rev2/bin/g++.exe",
            "mergeConfigurations": false,
            "browse": {
                "path": [
                    "#C_Cpp.default.compilerPath#",
                    "C:\\Users\\Marat\\scoop\\apps\\mingw\\12.2.0-rt_v10-rev2\\lib\\gcc\\x86_64-w64-mingw32\\12.2.0\\include\\c++\\x86_64-w64-mingw32",
                    "C:\\Users\\Marat\\scoop\\apps\\mingw\\12.2.0-rt_v10-rev2\\lib\\gcc\\x86_64-w64-mingw32\\12.2.0\\include\\c++",
                    "C:\\Users\\Marat\\scoop\\apps\\mingw\\12.2.0-rt_v10-rev2\\lib\\gcc\\x86_64-w64-mingw32\\12.2.0\\include",
                    "${workspaceFolder}"
                ],
                "limitSymbolsToIncludedHeaders": true
            }
        },
        {
            "name": "gcc 13.1.0",
            "includePath": [
                "${default}",
                "C:\\Users\\Marat\\scoop\\apps\\mingw\\current\\lib\\gcc\\x86_64-w64-mingw32\\13.1.0\\include\\c++\\x86_64-w64-mingw32",
                "C:\\Users\\Marat\\scoop\\apps\\mingw\\current\\lib\\gcc\\x86_64-w64-mingw32\\13.1.0\\include\\c++",
                "C:\\Users\\Marat\\scoop\\apps\\mingw\\current\\lib\\gcc\\x86_64-w64-mingw32\\13.1.0\\include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.22000.0",
            "cStandard": "c17",
            "compilerPath": "C:/Users/Marat/scoop/apps/mingw/current/bin/g++.exe",
            "compilerPathInCppPropertiesJson": "C:/Users/Marat/scoop/apps/mingw/current/bin/g++.exe",
            "cppStandard": "c++20",
            "intelliSenseMode": "gcc-x64",
            "mergeConfigurations": false,
            "browse": {
                "path": [
                    "${workspaceFolder}"
                ],
                "limitSymbolsToIncludedHeaders": true
            }
        }
    ],
    "version": 4
}
--------------------------------------------------------------------------
Log diagnostics:
-------- Diagnostics - 6/6/2023, 12:39:40 PM
Version: 1.16.0
Current Configuration:
{
    "name": "gcc 13.1.0",
    "includePath": [
        "c:\\Users\\Marat\\Desktop\\competitive code\\yandex\\#C_Cpp.default.compilerPath#",
        "C:\\Users\\Marat\\scoop\\apps\\mingw\\current\\lib\\gcc\\x86_64-w64-mingw32\\13.1.0\\include\\c++\\x86_64-w64-mingw32",
        "C:\\Users\\Marat\\scoop\\apps\\mingw\\current\\lib\\gcc\\x86_64-w64-mingw32\\13.1.0\\include\\c++",
        "C:\\Users\\Marat\\scoop\\apps\\mingw\\current\\lib\\gcc\\x86_64-w64-mingw32\\13.1.0\\include"
    ],
    "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
    ],
    "windowsSdkVersion": "10.0.22000.0",
    "cStandard": "c17",
    "compilerPath": "C:/Users/Marat/scoop/apps/mingw/current/bin/g++.exe",
    "compilerPathInCppPropertiesJson": "C:/Users/Marat/scoop/apps/mingw/current/bin/g++.exe",
    "cppStandard": "c++20",
    "intelliSenseMode": "gcc-x64",
    "mergeConfigurations": false,
    "browse": {
        "path": [
            "#C_Cpp.default.compilerPath#",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    },
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "intelliSenseModeIsExplicit": true
}
Translation Unit Mappings:
[ C:\Users\Marat\Desktop\competitive code\yandex\tmp.cpp ]:
    C:\Users\Marat\Desktop\competitive code\yandex\tmp.cpp
Translation Unit Configurations:
[ C:\Users\Marat\Desktop\competitive code\yandex\tmp.cpp ]:
    Process ID: 19724
    Memory Usage: 157 MB
    Compiler Path: C:\Users\Marat\scoop\apps\mingw\current\bin\g++.exe
    Includes:
        C:\Users\Marat\scoop\apps\mingw\current\lib\gcc\x86_64-w64-mingw32\13.1.0\include\c++\x86_64-w64-mingw32
        C:\Users\Marat\scoop\apps\mingw\current\lib\gcc\x86_64-w64-mingw32\13.1.0\include\c++
        C:\Users\Marat\scoop\apps\mingw\current\lib\gcc\x86_64-w64-mingw32\13.1.0\include
        C:\Users\Marat\scoop\apps\mingw\13.1.0-rt_v11-rev1\lib\gcc\x86_64-w64-mingw32\13.1.0\include\c++
        C:\Users\Marat\scoop\apps\mingw\13.1.0-rt_v11-rev1\lib\gcc\x86_64-w64-mingw32\13.1.0\include\c++\x86_64-w64-mingw32
        C:\Users\Marat\scoop\apps\mingw\13.1.0-rt_v11-rev1\lib\gcc\x86_64-w64-mingw32\13.1.0\include\c++\backward
        C:\Users\Marat\scoop\apps\mingw\13.1.0-rt_v11-rev1\lib\gcc\x86_64-w64-mingw32\13.1.0\include
        C:\Users\Marat\scoop\apps\mingw\13.1.0-rt_v11-rev1\lib\gcc\x86_64-w64-mingw32\13.1.0\include-fixed
        C:\Users\Marat\scoop\apps\mingw\13.1.0-rt_v11-rev1\x86_64-w64-mingw32\include
    Defines:
        _DEBUG
        UNICODE
        _UNICODE
    Standard Version: c++20
    IntelliSense Mode: windows-gcc-x64
    Other Flags:
        --g++
        --gnu_version=130100
Total Memory Usage: 157 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 2673

Other Extensions

No response

Additional context

No response

@michelleangela michelleangela added bug Language Service investigate: repro This issue's repro steps needs to be investigated/confirmed labels Jun 6, 2023
@michelleangela
Copy link
Contributor

@MFattakhov
Thank you for reporting this issue. We have other related GCC 13 issues in the IntelliSense engine that is shared with Visual Studio. Sometimes, when a new compiler version is released, the IntelliSense engine will need to be updated to support compiler changes. We'll investigate and get internal logs.

@michelleangela michelleangela self-assigned this Jun 6, 2023
@Colengms
Copy link
Contributor

Given the dependency on convertible_to in the ranges header, I suspect this is the same issue as #11038

@Colengms Colengms removed the investigate: repro This issue's repro steps needs to be investigated/confirmed label Jun 12, 2023
@Colengms
Copy link
Contributor

Using #11038 to track this. Closing this one as a duplicate.

@Colengms Colengms closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2023
@michelleangela michelleangela removed their assignment Jun 29, 2023
@michelleangela
Copy link
Contributor

Fix available in pre-release https://github.com/microsoft/vscode-cpptools/releases/tag/v1.17.0.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants