llvm-project/clang/test/Parser/macro-expansion-recovery.cpp
Oleksandr T. d7e7f22626
[Clang] fix missing source location for errors in macro-expanded (#143460)
Fixes #143216

--- 

This patch fixes diagnostic locations for tokens from macro expansions.
2025-06-11 14:19:25 -07:00

23 lines
598 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify %s
namespace GH143216 {
#define A x y
enum { A }; // expected-error {{missing ',' between enumerators}}
#define B x y
void f() {
int a[2];
auto [B] = a; // expected-error {{expected ','}}
}
#define C <int!
template <class T> class D;
D C; // expected-error {{expected unqualified-id}} \
// expected-error {{expected '>'}} \
// expected-note {{to match this '<'}}
#define E F::{
class F { E }}; // expected-error {{expected identifier}} \
// expected-error {{expected member name or ';' after declaration specifiers}}
}