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

Error Squiggles inside Template in C++ #12094

Closed
srivishalv18 opened this issue Mar 13, 2024 · 1 comment
Closed

Error Squiggles inside Template in C++ #12094

srivishalv18 opened this issue Mar 13, 2024 · 1 comment

Comments

@srivishalv18
Copy link

Environment

  • OS and Version: macOS Sonoma
  • VS Code Version: 1.78.0
  • C/C++ Extension Version: Latest (1.19.7)
  • If using SSH remote, specify OS of remote machine: -

Bug Summary and Steps to Reproduce

Bug Summary:
The Error Squiggles will not show up inside a template inside a class. I have attached screen shots of what happens when I have the template line, and when its commented out.

Steps to reproduce:

  1. Make a new header file
  2. have a basic header like include iostream
  3. Make a template : template
  4. Make a class
  5. Error Lines will not show up in the class inside template.
  6. See error

Expected behavior:

Error Squiggles inside template.
Without Template:
image

With Template:
image

Configuration and Logs

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${default}"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/g++",
            "cStandard": "c17",
            "cppStandard": "c++20",
            "intelliSenseMode": "${default}"
        },
        {
            "name": "Mac",
            "includePath": [
                "${default}",
                "/opt/homebrew/Cellar/googletest/1.14.0/include"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/g++",
            "cStandard": "c17",
            "cppStandard": "c++20",
            "intelliSenseMode": "${default}"
        }
    ],
    "version": 4
}

-------- Diagnostics - 3/13/2024, 1:36:03 AM
Version: 1.19.7
Current Configuration:
{
    "name": "Mac",
    "includePath": [
        "/opt/homebrew/Cellar/googletest/1.14.0/include"
    ],
    "defines": [],
    "macFrameworkPath": [
        "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
    ],
    "cStandard": "c17",
    "cppStandard": "c++17",
    "intelliSenseMode": "macos-clang-arm64",
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "intelliSenseModeIsExplicit": true,
    "mergeConfigurations": false,
    "compilerPath": "/usr/bin/clang",
    "browse": {
        "path": [
            "/opt/homebrew/Cellar/googletest/1.14.0/include",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
cpptools version (native): 1.19.7.0
Translation Unit Mappings:
[ /Users/srivishal/Documents/Data Structs/Projects/ProjectX/Starter Code/prqueue_main.cpp - source TU]:
    /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__iterator/prev.h
    /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__utility/pair.h
    /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/atomic
    /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/stdio.h
    /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/stdlib.h
    /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/sys/_types/_in_addr_t.h
    /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/sys/wait.h
    /Users/srivishal/Documents/Data Structs/Projects/ProjectX/Starter Code/prqueue.h
[ /Users/srivishal/Documents/Data Structs/Projects/ProjectX/Starter Code/temp.h - source TU]:
Translation Unit Configurations:
[ /Users/srivishal/Documents/Data Structs/Projects/ProjectX/Starter Code/prqueue_main.cpp ]:
    Process ID: 34509
    Memory Usage: 7 MB
    Compiler Path: /usr/bin/clang
    Includes:
        /opt/homebrew/Cellar/googletest/1.14.0/include
        /usr/local/include
        /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/c++/v1
        /Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include
        /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include
        /Library/Developer/CommandLineTools/usr/include
    Frameworks:
        /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/System/Library/Frameworks
    Standard Version: c++17
    IntelliSense Mode: macos-clang-arm64
    Other Flags:
        --clang
        --clang_version=160000
[ /Users/srivishal/Documents/Data Structs/Projects/ProjectX/Starter Code/temp.h ]:
    Process ID: 34553
    Memory Usage: 77 MB
    Compiler Path: /usr/bin/clang
    Includes:
        /opt/homebrew/Cellar/googletest/1.14.0/include
        /usr/local/include
        /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/c++/v1
        /Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include
        /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include
        /Library/Developer/CommandLineTools/usr/include
    Frameworks:
        /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/System/Library/Frameworks
    Standard Version: c++17
    IntelliSense Mode: macos-clang-arm64
    Other Flags:
        --clang
        --clang_version=160000
Total Memory Usage: 84 MB

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

Other Extensions

image
image
image

Additional context

I'm sorry if this is not a bug, I've been trying to start on my project which is due Friday but the error squiggles don't work. The error squiggles help me out a lot and I don't think I can code without them so please let me know if anything is wrong !

Code from my project where I discovered the bug:
Take a look at parent, it should give me an error, but it doesn't.
image

It does when I comment the template out though.

image

@sean-mcmanus
Copy link
Collaborator

We're already tracking this with #1946 and #2973 , so you can upvote those.

@sean-mcmanus sean-mcmanus closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 28, 2024
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

2 participants