| 1 |
// RUN: %clang_cc1 -verify=c11,both -std=c11 %s |
| 2 |
// RUN: %clang_cc1 -verify=c23,both -std=c23 %s |
| 3 |
|
| 4 |
/* WG14 N1518: Clang 15 |
| 5 |
* Recommendations for extended identifier characters for C and C++ |
| 6 |
* |
| 7 |
* This paper effectively adopts UAX #31, which was later officially adopted |
| 8 |
* for C23 via WG14 N2836 and supersedes N1518. |
| 9 |
*/ |
| 10 |
|
| 11 |
// This file takes test cases from clang/test/C/C23/n2836_n2939.c. |
| 12 |
// This file contains Unicode characters; please do not "fix" them! |
| 13 |
|
| 14 |
// This was fine in C11, is now an error in C23. |
| 15 |
extern int ٢; // c23-error {{character <U+0662> not allowed at the start of an identifier}} \ |
| 16 |
c23-warning {{declaration does not declare anything}} |
| 17 |
|
| 18 |
// This was an error in C11 but is an extension in C23. |
| 19 |
extern int ∞; // c11-error {{unexpected character <U+221E>}} \ |
| 20 |
c11-warning {{declaration does not declare anything}} \ |
| 21 |
c23-warning {{mathematical notation character <U+221E> in an identifier is a Clang extension}} |
| 22 |
|
| 23 |
int \u1DC0; // both-error {{expected identifier or '('}} |
| 24 |
int e\u1DC0; // Ok |