Bug 19309 – [Reg 2.080.0] Unicode char reference in a comment causes warning

Status
RESOLVED
Resolution
INVALID
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-10-17T03:24:45Z
Last change time
2019-12-18T09:49:26Z
Assigned to
No Owner
Creator
Ludovit Lucenic

Comments

Comment #0 by llucenic — 2018-10-17T03:24:45Z
Having a Unicode character reference, e.g. #x000D, in a comment block in D code causes compiler warning > C preprocessor directive `#%s` is not supported secondarily causing compilation failure when using dub to build such a project. Based on the instruction from Walter (https://github.com/dlang/dmd/pull/7820#issuecomment-430420147), I am filling this bug as a regression of DMD 2.080.0 caused by PR #7820. DMD 2.082.1 has still got this regression (as of time of this writting).
Comment #1 by llucenic — 2018-10-17T06:32:17Z
This is the code excerpt (comment): /** * Grammar: * source code characters are defined by the following grammar rules * --- *Character ::= LineCharacter | EndOfLineCharacter * *LineCharacter ::= Space * | [#x0021-#x2027] | [#x202A-#xD7FF] * | [#xE000-#xFFFD] | [#x10000-#x10FFFF] * * *Space ::= #x0020 | #x0009 | #x000B | #x000C * * *EndOfLineCharacter ::= #x000D | #x000A | #x2028 | #x2029 * * *EndOfLine ::= #x000D #x000A | EndOfLineCharacter | EndOfFile * * *EndOfFile ::= #x0000 | #x001A | < physical-end-of-file > * --- * See_also: * $(D isNewline()), $(D isWhitespace()) */ I had to remove all #s from in front of the x0000s in order to compile with 2.080.0.
Comment #2 by bugzilla — 2018-12-13T06:05:58Z
I can't reproduce this problem. The error message comes from the lexer trying to process text into tokens. This does not happen inside regular /* */ comments. I suspect there is something else going on with your code. Please verify: 1. that the code presented here is exactly the entire contents of the file you are trying to compile 2. what command line switches you are using 3. what system you are compiling on 4. the filename extension of the file you're compiling
Comment #3 by bugzilla — 2019-12-18T09:49:26Z
Still cannot reproduce the problem. Reopen if how to repro it is found.