Skip to content

C++ parsing error (not)? #2608

@python152

Description

@python152
  • VSCode Version: 1.27
  • OS Version: Mac OS 10.13.6

Steps to Reproduce:

The following code seems giving vscode a hard time to parse -

    // hist_bins is vector container
    auto idx = std::lower_bound(hist_bins.begin(), hist_bins.end(), val) - hist_bins.begin();

I think this is valid code, isn't it?

{
	"resource": "/Users/xyz/test.cc",
	"owner": "_generated_diagnostic_collection_name_#0",
	"code": "undefined",
	"severity": 8,
	"message": "more than one operator \"-\" matches these operands: -- function template \"auto std::__1::operator-(const std::__1::__wrap_iter<_Iter1> &__x, const std::__1::__wrap_iter<_Iter2> &__y)-><error-type>\" -- function template \"auto std::__1::operator-(const std::__1::__wrap_iter<_Iter1> &__x, const std::__1::__wrap_iter<_Iter2> &__y)->decltype(((__x.std::__1::__wrap_iter<_Iter>::base()) - (__y.std::__1::__wrap_iter<_Iter>::base())))\" -- operand types are: std::__1::__wrap_iter<uint64_t *> - std::__1::__wrap_iter<uint64_t *>",
	"startLineNumber": 125,
	"startColumn": 78,
	"endLineNumber": 125,
	"endColumn": 78
}

Does this issue occur when all extensions are disabled?: Yes/No

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.parser

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions