Skip to content

IntelliSense fails to convert long double to int #12431

Open
@GoodCoder666

Description

@GoodCoder666

Environment

  • OS and Version: Windows 11 23H2
  • VS Code Version: 1.90.2
  • C/C++ Extension Version: v1.20.5
  • If using SSH remote, specify OS of remote machine: WSL ubuntu

Bug Summary and Steps to Reproduce

Bug Summary:

image

Steps to reproduce:

  1. Create arbitrary cpp file
  2. Type const int var = 1.0l;
  3. Put the cursor on var
  4. Shows const int var = 0

Expected behavior:
Show const int var = 1

This is fine when using a double, e.g. const int var = 1.0;

Configuration and Logs

-------- Diagnostics - 7/3/2024, 11:17:59 AM
Version: 1.20.5
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "/home/stanley/Code/**"
    ],
    "defines": [],
    "compilerPath": "/usr/bin/gcc",
    "cStandard": "c17",
    "cppStandard": "gnu++17",
    "intelliSenseMode": "linux-gcc-x64",
    "compilerPathInCppPropertiesJson": "/usr/bin/gcc",
    "intelliSenseModeIsExplicit": false,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "mergeConfigurations": false,
    "compilerPathIsExplicit": false,
    "browse": {
        "path": [
            "/home/stanley/Code/**",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
cpptools version (native): 1.20.5.0
Translation Unit Mappings:
[ /home/stanley/Code/test.cpp - source TU]:
[ /tmp/temp.cpp - source TU]:
Translation Unit Configurations:
[ /home/stanley/Code/test.cpp ]:
    Process ID: 4915
    Memory Usage: 17 MB
    Compiler Path: /usr/bin/gcc
    Includes:
        /usr/include/c++/11
        /usr/include/x86_64-linux-gnu/c++/11
        /usr/include/c++/11/backward
        /usr/lib/gcc/x86_64-linux-gnu/11/include
        /usr/local/include
        /usr/include/x86_64-linux-gnu
        /usr/include
    Standard Version: c++17
    IntelliSense Mode: linux-gcc-x64
    Other Flags:
        --g++
        --gnu_version=110400
[ /tmp/temp.cpp ]:
    Process ID: 4976
    Memory Usage: 15 MB
    Compiler Path: /usr/bin/gcc
    Includes:
        /usr/include/c++/11
        /usr/include/x86_64-linux-gnu/c++/11
        /usr/include/c++/11/backward
        /usr/lib/gcc/x86_64-linux-gnu/11/include
        /usr/local/include
        /usr/include/x86_64-linux-gnu
        /usr/include
    Standard Version: c++17
    IntelliSense Mode: linux-gcc-x64
    Other Flags:
        --g++
        --gnu_version=110400
Total Memory Usage: 32 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 5620
Number of files parsed: 1

Other Extensions

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.verifiedBug has been reproduced

    Type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions