Corentin Jabot 55f1b91d50
[Clang] Fix a crash when parsing an invalid decltype (#148798)
We would try to exact an annotated token before checking if it was
valid, leading to a crash when `decltype` was the only token that was
parsed (which can happen in the absense of opening paren)

Fixes #114815
2025-07-15 18:09:51 +02:00

7 lines
203 B
C++

// RUN: %clang_cc1 -verify %s -std=c++11 -fsyntax-only
#define ID(X) X
extern int ID(decltype);
// expected-error@-1 {{expected '(' after 'decltype'}} \
// expected-error@-1 {{expected unqualified-id}}