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

Incorrect "incomplete type "A" is not allowed C/C++(70)" message #13044

Open
schattenmann80 opened this issue Dec 11, 2024 · 2 comments
Open
Labels
bug duplicate fixed Check the Milestone for the release in which the fix is or will be available. Language Service regression A bug that didn't exist in a previous release Verified - Internal Verified issue reproduces world ready An issue relating string character encodings, localization translations, etc.
Milestone

Comments

@schattenmann80
Copy link

Environment

  • OS and Version: win11

  • VS Code Version:
    Version: 1.95.3 (user setup)
    Commit: f1a4fb101478ce6ec82fe9627c43efbf9e98c813
    Date: 2024-11-13T14:50:04.152Z
    Electron: 32.2.1
    ElectronBuildId: 10427718
    Chromium: 128.0.6613.186
    Node.js: 20.18.0
    V8: 12.8.374.38-electron.0
    OS: Windows_NT x64 10.0.22631

  • C/C++ Extension Version: v1.22.11

  • If using SSH remote, specify OS of remote machine: debian 12

Bug Summary and Steps to Reproduce

example.zip
Bug Summary:

Steps to reproduce:

  1. Create header file test.h with a struct A and include a comment with the char: ä or ö
 * test struct with: ä
 */

struct A
{
	int a1;
	long a2;
	char a3;
	bool a4;
};
  1. Save header file in the encoding ISO 8859-15 ( Set vscode setting: "files.encoding": "iso885915" )
  2. Create source file test.cpp, save it in encoding "ISO 8859-15", include test.h and use the struct A
#include <test.h>

int main( int argc, char** argv )
{
	A a;
	a.a1 = 1;

	return a.a1;
}
  1. Close test.h and restart Inteliisense for active file
  2. The following error appears: "incomplete type "A" is not allowedC/C++(70)"

If test.h is open the error does not appear.

I suspect that the error is some encoding releated problem.

if I change the encoding of the files to UTF-8 the error does not appear.

Expected behavior:
No error should appear.

Configuration and Logs

-------- Diagnostics - 11.12.2024, 15:26:31
Version: 1.22.11
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "/home/hmr/test-repo/**"
    ],
    "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/hmr/test-repo/**",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Additional Tracked Settings:
{
    "editorTabSize": 4,
    "editorInsertSpaces": false,
    "editorAutoClosingBrackets": "languageDefined",
    "filesEncoding": "iso885915",
    "filesAssociations": {},
    "filesExclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/Thumbs.db": true
    },
    "filesAutoSaveAfterDelay": false,
    "editorInlayHintsEnabled": true,
    "editorParameterHintsEnabled": true,
    "searchExclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/*.code-search": true
    },
    "workbenchSettingsEditor": "ui"
}
cpptools version (native): 1.22.11.0
Current database path: /home/hmr/.cache/vscode-cpptools/62cdf2c8a68edbe968cb6f56c2ec1fc9/.browse.VC.db
Translation Unit Mappings:
[ /home/hmr/test-repo/abc/src/test.cpp - source TU]:
Translation Unit Configurations:
[ /home/hmr/test-repo/abc/src/test.cpp ]
    Process ID: 25164
    Memory Usage: 16 MB
    Compiler Path: /usr/bin/gcc
    Includes:
        /home/hmr/test-repo/include
    System Includes:
        /usr/include/c++/12
        /usr/include/x86_64-linux-gnu/c++/12
        /usr/include/c++/12/backward
        /usr/lib/gcc/x86_64-linux-gnu/12/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=120200
Total Memory Usage: 16 MB

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

Other Extensions

No response

Additional context

if i downgrade to 1.21.6 the error does not appear.

@fearthecowboy fearthecowboy added bug Verified - Internal Verified issue reproduces labels Dec 11, 2024
@fearthecowboy
Copy link
Member

Confirmed.

I'm assuming that it's loading as a UTF-8 file and byte E4 (which is ä in ISO-8859-15) is an invalid character in UTF-8.

Likely related to the changes in the buffer management.

@fearthecowboy fearthecowboy changed the title Incorret "incomplete type "A" is not allowedC/C++(70)" message Incorrect "incomplete type "A" is not allowed C/C++(70)" message Dec 11, 2024
@sean-mcmanus sean-mcmanus added Language Service regression A bug that didn't exist in a previous release labels Dec 11, 2024
@sean-mcmanus sean-mcmanus added this to the 1.23 milestone Dec 11, 2024
@sean-mcmanus sean-mcmanus moved this to Todo in cpptools Dec 11, 2024
@sean-mcmanus sean-mcmanus added world ready An issue relating string character encodings, localization translations, etc. duplicate fixed Check the Milestone for the release in which the fix is or will be available. labels Dec 11, 2024
@sean-mcmanus sean-mcmanus modified the milestones: 1.23, 1.23.3 Dec 11, 2024
@sean-mcmanus sean-mcmanus moved this from Todo to Done in cpptools Dec 11, 2024
@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Dec 11, 2024

@schattenmann80 This was already fixed for our pending 1.23.3 release as part of #13028 (although the current plan is to not release that till January due to vacations).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug duplicate fixed Check the Milestone for the release in which the fix is or will be available. Language Service regression A bug that didn't exist in a previous release Verified - Internal Verified issue reproduces world ready An issue relating string character encodings, localization translations, etc.
Projects
Status: Done
Development

No branches or pull requests

3 participants