Fixes #187690 --- This PR fixes parser recovery for invalid `static_assert` declarations with string literal messages. The parser now stops the message lookahead on `;` and `eof`, so invalid inputs are diagnosed as parse errors.
13 lines
354 B
C++
13 lines
354 B
C++
// RUN: %clang_cc1 -fsyntax-only -triple=x86_64-linux -verify %s
|
|
|
|
// expected-error@+2 {{expected ')'}}
|
|
// expected-note@+1 {{to match this '('}}
|
|
static_assert(true, ""1);
|
|
|
|
// expected-error@+1 {{unexpected ';' before ')'}}
|
|
static_assert(true, "";);
|
|
|
|
// expected-error@+2 {{expected ')'}}
|
|
// expected-note@+1 {{to match this '('}}
|
|
static_assert(true, ""
|