Skip to content

Syntax highlighting broken after member function with requires clause with less comparison  #185728

Description

(Note: This was originally submitted to the cpp-tools repo as microsoft/vscode-cpptools#11100)
Consider the following snippet:

template <int n>
struct S{        
    int foo() requires(n == 2)
    {
        return 2;
    }

        
    int foo() requires(n < 2)
    {
        return 2;
    }

private:
    int b;
};

The syntax highlighting is completely broken after the second requires clause:

image

Expected behavior:
The syntax highlighting should continue to work as normal, as it does if you replace the < with >:
image

Version: 1.79.2
Commit: 695af09
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.51
Embedder: vscode.dev

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

grammarSyntax highlighting grammarupstream-issue-linkedThis is an upstream issue that has been reported upstream

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions