| Issue |
164179
|
| Summary |
unicode whitespace between `#` and directive name not diagnosed in skipped group
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
zygoloid
|
As noted in discussion of a [recent C++ NB comment](https://github.com/cplusplus/nbballot/issues/595), Clang treats Unicode whitespace as being whitespace as an extension (issuing a warning diagnostic, which becomes an error under `-pedantic-errors`). This is mostly a conforming extension, but we fail to produce a standard-mandated diagnostic if the whitespace occurs before the directive name in a skipped group:
```c++
#if 0
<U+3000>#line 1
#<U+3000>line 1
#endif
```
This is ill-formed; within a skipped group, the directive syntax is [only relaxed after the directive name](https://eel.is/c++draft/cpp.pre#5), so we're still required to issue a diagnostic for the Unicode whitespace (which forms a single-character pp-token, resulting in a token sequence that does not obey the grammar for a directive) if it occurs before the directive name. In order to conform, we should produce the `ExtWarn` diagnostic in this case too.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs