Skip to content

Where clause on invalid declaration causes the parser running forever #1143

Open
@secure-sw-dev-bot

Description

@secure-sw-dev-bot

This issue was copied from checkedc/checkedc-clang#1144


The test is running on the latest master 373b5dc.

The file content of wrong_where_place1.c is

int *g_arr5  : bounds(g_arr5, g_arr5 + 5) _Where x == 1;

The command is clang -cc1 wrong_where_place1.c

The behavior is the compiler outputs wrong_where_place1.c:1:43: error: where clause on invalid decl forever.
The expected should be one error message and exit.

I did the basic debug. The error message is defined at line 1575 of DiagnosticParserKinds.td and is thrown at line 1937 ParseWhereClauseOnDecl of ParserDecl.cpp.

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