Skip to content

[Bug] Wrong handling of "-std=c++26" option #752

@adriankwiat

Description

@adriankwiat

Brief Issue Summary

When I configure gcc options in Makefile to -std=c++26, correct code (that is also correct C++23) is wrongly marked as errors. This is not problem with C/C++ extension, because when I configure manually c_cpp_properties.json it behaves properly.

Example:

  • c_cpp_properties.json with cppStandard set to c++23 - correct behavior: Image
  • c_cpp_properties.json with cppStandard set to c++26 - correct behavior: Image
  • Makefile with -std=c++23 - correct behavior: Image
  • Makefile with -std=c++26 - wrong: Image

Debug Log

No current configuration is defined in the workspace state. Assuming 'Default'.
No target defined in the workspace state. Assuming 'Default'.
Dropping various extension output files at /home/adrian/.config/Code/User/workspaceStorage/5628666ef90b2fdc2d3c4aceef47215d/ms-vscode.makefile-tools
Logging level: Normal
Configurations cached at /home/adrian/.config/Code/User/workspaceStorage/5628666ef90b2fdc2d3c4aceef47215d/ms-vscode.makefile-tools/configurationCache.log
No path to the makefile is defined in the settings file.
No folder path to the makefile is defined in the settings file.
Always pre-configure: false
Always post-configure: false
Dry-run switches: '--always-make', '--keep-going', '--print-directory'
No current launch configuration is set in the workspace state.
Default launch configuration: MIMode = undefined,
                miDebuggerPath = undefined,
                stopAtEntry = undefined,
                symbolSearchPath = undefined
Configure on open: true
Configure on edit: true
Configure after command: true
Only .PHONY targets: false
Save before build or configure: true
Build before launch: true
Clear output before build: true
Ignore directory commands: true
compile_commands.json path: null
Deduced command 'make ' for configuration "Default"
Saving opened files before build.
Configuring from cache: /home/adrian/.config/Code/User/workspaceStorage/5628666ef90b2fdc2d3c4aceef47215d/ms-vscode.makefile-tools/configurationCache.log
Load configuration from cache elapsed time: 0.023
Generating in the background a new configuration cache with command: 'make --dry-run --always-make --keep-going --print-directory'
Writing the dry-run output: /home/adrian/.config/Code/User/workspaceStorage/5628666ef90b2fdc2d3c4aceef47215d/ms-vscode.makefile-tools/dryrun.log
Generating dry-run elapsed time: 0.02
Preprocessing: "/home/adrian/.config/Code/User/workspaceStorage/5628666ef90b2fdc2d3c4aceef47215d/ms-vscode.makefile-tools/dryrun.log"
Preprocess elapsed time: 0
Parsing for IntelliSense.
Updating the CppTools IntelliSense Configuration Provider.
Parsing dry-run output for CppTools Custom Configuration Provider.
Unknown C++ standard control flag: c++26
Sending configuration for file /home/adrian/Code/cpp-test/main.cpp -----------------------------------
Parsing for IntelliSense elapsed time: 0.029
Parsing for launch targets.
Found the following 1 launch targets defined in the makefile: /home/adrian/Code/cpp-test>main()
Complete list of launch targets: /home/adrian/Code/cpp-test>main()
Parsing for launch targets elapsed time: 0.016
Generating parse content for build targets.
Generating targets information with command: 'make all --print-data-base --no-builtin-variables --no-builtin-rules --question'
Writing the dry-run output: /home/adrian/.config/Code/User/workspaceStorage/5628666ef90b2fdc2d3c4aceef47215d/ms-vscode.makefile-tools/targets.log
Generating dry-run elapsed time: 0.019
Parsing for build targets from: "/home/adrian/.config/Code/User/workspaceStorage/5628666ef90b2fdc2d3c4aceef47215d/ms-vscode.makefile-tools/targets.log"
Found the following 1 build targets defined in the makefile: main
Complete list of build targets: main
Parsing build targets elapsed time: 0.003
Configure finished. The status for all the subphases that ran:
loadFromCache: return code = 0, elapsed time = 0.023
generateParseContent: return code = 0, elapsed time = 0.02
preprocessParseContent: return code = 0, elapsed time = 0
parseIntelliSense: return code = 0, elapsed time = 0.029
parseLaunch: return code = 0, elapsed time = 0.016
dryrunTargets: return code = 2, elapsed time = 0.019
parseTargets: return code = 0, elapsed time = 0.003
Configure succeeded.
Configure elapsed time: 0.215

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions