Bug 5300 – What type suffixes apply to with single argument template instances is undefined.
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2010-12-01T05:45:00Z
Last change time
2015-06-09T05:15:07Z
Keywords
spec
Assigned to
nobody
Creator
b.helyer
Comments
Comment #0 by b.helyer — 2010-12-01T05:45:49Z
struct Foo(T)
{
T i;
}
void main()
{
Foo!int* foo; // Is this a Foo!(int*), or a Foo!(int)*?
}
The above behaviour is undefined by the documentation. Testing with DMD reveals that the latter behaviour indicated by the comment is correct.
Comment #1 by bearophile_hugs — 2010-12-01T12:36:32Z
See also bug 5286
Comment #2 by r.sagitario — 2010-12-03T01:32:14Z
This is defined by the grammar here:
http://www.digitalmars.com/d/2.0/template.html#TemplateInstance
TemplateInstance:
TemplateIdentifier !( TemplateArgumentList )
TemplateIdentifier ! TemplateSingleArgument
TemplateSingleArgument:
Identifier
BasicTypeX
CharacterLiteral
StringLiteral
IntegerLiteral
FloatLiteral
true
false
null
__FILE__
__LINE__
Comment #3 by bugzilla — 2010-12-03T12:13:23Z
(In reply to comment #2)
> This is defined by the grammar here:
You are correct. Marked as invalid.