Bug 6589 – is(int*==int*); and template X(T : int*=int*) should compile

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-09-01T10:04:51Z
Last change time
2024-12-13T17:56:17Z
Keywords
bootcamp
Assigned to
No Owner
Creator
timon.gehr
Moved to GitHub: dmd#18366 →

Comments

Comment #0 by timon.gehr — 2011-09-01T10:04:51Z
is(int*==int*) / template X(T : int*=int*) do not compile because they are tokenized as is ( int *= = int *) template X ( T : int *= int * ) The parser could explicitly check for the *= = token combination / the *= token. What this would add is that the compiler can actually parse all programs generated from the D grammar. It would solve a similar language problem C++98 had with the X<Y<int>>. I think this should not add more than 10 LOC to the parser in total.
Comment #1 by nick — 2023-11-21T20:11:21Z
It could parse `*==` as `*` and `==`. How can it tell that `*=` should be `*` and `=`?
Comment #2 by nick — 2023-11-21T20:13:55Z
> It could parse `*==` as `*` and `==`. Here I meant the tokenizer. > How can it tell that `*=` should be `*` and `=`? You mean a workaround in the parser to deconstruct the `*=` token?
Comment #3 by robert.schadek — 2024-12-13T17:56:17Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18366 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB