Files
Oleksandr Tarasiuk 5ee1495ab6 [Clang] fix parser recovery for invalid static_assert string messages (#187859)
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.
2026-04-27 17:19:27 +03:00

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, ""