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

IntelliSense fails to handle aliased struct #12724

Open
mehlian opened this issue Sep 17, 2024 · 1 comment
Open

IntelliSense fails to handle aliased struct #12724

mehlian opened this issue Sep 17, 2024 · 1 comment
Labels
bug Language Service Visual Studio Inherited from Visual Studio
Milestone

Comments

@mehlian
Copy link

mehlian commented Sep 17, 2024

Environment

  • OS and Version: Windows 10
  • VS Code Version: 1.84.2
  • C/C++ Extension Version: 1.21.6
  • If using SSH remote, specify OS of remote machine:

Bug Summary and Steps to Reproduce

Bug Summary:
When aliasing is used for struct that uses same name as namespace then IntelliSense shows error.

Steps to reproduce:

  1. Paste in code:
namespace AAA
{
    struct AAA
    {
        int integer;
    };

    int AAAtest(int a)
    {
        return a + 10;
    }
}

namespace BBB
{
using AAA = AAA::AAA; // shows error

void test(AAA *aa)
{
    aa->integer++;
    int result = ::AAA::AAAtest(10);
}
}
  1. Error overloaded function "AAA::AAA::AAA" is not a type nameC/C++(757) will be shown on mouse hover over using AAA = AAA::AAA; line.

Expected behavior:
No error should be shown here.
Code compiles using clang version 14.0.6 Android (8490178, based on r450784d) (other compilers not tested).

Configuration and Logs

{
    "configurations": [
        {
            "name": "android",
            "includePath": [
                "${workspaceFolder}/src/**"
            ],
            "defines": [
                "_DEBUG",
                "DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "${workspaceFolder}/../android_sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe",
            "cStandard": "c11",
            "cppStandard": "c++11",
            "intelliSenseMode": "linux-clang-arm64",
            "browse": {
                "limitSymbolsToIncludedHeaders": true
            },
            "compilerArgs": [
                "--target=aarch64-unknown-linux-android26",
                "-Werror",
                "-pedantic-errors",
                "--std=c++11",
                "-fPIC",
                "-ferror-limit=0",
                "-fstack-protector-strong",
                "-Wno-writable-strings",
                "-Wno-gnu-anonymous-struct",
                "-Wno-nested-anon-types",
                "-Wl,--no-undefined-version",
                "-Wl,-undefined,error",
                "-Wl,--error-unresolved-symbols",
                "-Wl,--no-undefined",
                "-Wl,-error-limit=0",
                "-Wl,--build-id=sha1",
                "-mno-relax"
            ]
        }
    ],
    "version": 4
}

Other Extensions

No response

Additional context

No response

@Colengms
Copy link
Collaborator

Hi @mehlian . Thanks for reporting this. Since this also repro's in VS (which shares the same IntelliSense implementation), I opened an issue against VS internally. (ID 2255630)

@Colengms Colengms added bug Language Service Visual Studio Inherited from Visual Studio labels Sep 19, 2024
@Colengms Colengms added this to the Tracking milestone Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Language Service Visual Studio Inherited from Visual Studio
Projects
Status: No status
Development

No branches or pull requests

2 participants