microsoft / microsoft/vscode-cpptools

On text operator, reported unexpected error

Open
#13,036 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Language Service parser Visual Studio
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and Version: archlinux
  • VS Code Version: 1.95.3
  • C/C++ Extension Version: 1.22.11
Bug Summary and Steps to Reproduce

Bug Summary:

inline constexpr unsigned long long operator"" u64(unsigned long long n){return n;}

auto x = 0xfffu64 + 1u64;

reported "Extra text after expected end of number" on 0xfffu64 and 1u64 and consider them as int.

But it can be compiled by g++ and clang++. And there is no limit about number character on the text operator in C++ standard.

Configuration and Logs
none
Other Extensions

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduced C++ snippet using the VS Code C/C++ extension and compare its diagnostics with g++ and clang++. Trace the extension's handling of numeric user-defined literal suffixes. Done means 0xfffu64 and 1u64 are accepted as valid literals without the reported error and are not treated as int.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.