Bug 4865 – Post-position attributes cannot be used with auto return functions
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2010-09-14T07:47:00Z
Last change time
2011-05-06T02:02:17Z
Assigned to
nobody
Creator
samukha
Comments
Comment #0 by samukha — 2010-09-14T07:47:27Z
struct S
{
auto foo() const //line 8
{
return 1; //line 10
}
}
void main()
{
}
test.d(8): no identifier for declarator foo
test.d(8): semicolon expected, not 'pure'
test.d(10): Declaration expected, not 'return'
Applies to any attribute that can be specified after the declaration. The example compiles if the return type is explicitly specified or the attribute is put in front of the declaration.
Comment #1 by kennytm — 2011-05-06T01:59:11Z
*** Issue 5867 has been marked as a duplicate of this issue. ***
Comment #2 by kennytm — 2011-05-06T02:02:17Z
*** This issue has been marked as a duplicate of issue 4040 ***