Bug 14874 – __traits(getFunctionAttributes) does not support the new `return` attribute

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-08-06T01:36:00Z
Last change time
2017-07-22T12:36:27Z
Assigned to
monkeyworks12
Creator
monkeyworks12

Comments

Comment #0 by monkeyworks12 — 2015-08-06T01:36:38Z
import std.traits; struct Test { int n; ref int getN() return { return n; } } void main() { //fails assert(functionAttributes!(Test.getN) & FunctionAttribute.return_); }
Comment #1 by monkeyworks12 — 2015-08-06T20:41:33Z
After some investigating, it seems that the fault lies with __traits(getFunctionAttributes). import std.traits; struct Test { int n; ref int getN() return { return n; } } void main() { //Prints `tuple("ref", "@system")` pragma(msg, __traits(getFunctionAttributes, Test.getN)); }
Comment #2 by github-bugzilla — 2015-08-12T05:42:03Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/0c1fd7108015d06e120178b7d8de6cd7caad6283 Merge pull request #4868 from MetaLang/master Fix Issue 14874 - __traits(getFunctionAttributes) does not support the new `return` attribute
Comment #3 by github-bugzilla — 2017-07-22T12:36:27Z
Commit pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/0c1fd7108015d06e120178b7d8de6cd7caad6283 Merge pull request #4868 from MetaLang/master