Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla
Bug 124 - __traits(parent, X.Y) recurs X for template struct X with repeated applications of __traits(parent, ...)
Summary: __traits(parent, X.Y) recurs X for template struct X with repeated applicatio...
Status: RESOLVED WONTFIX
Alias: None
Product: GDC
Classification: Unclassified
Component: gdc (show other bugs)
Version: development
Hardware: All All
: --- normal
Assignee: Iain Buclaw
URL:
Depends on:
Blocks:
 
Reported: 2014-05-06 04:48 CEST by soltanmm
Modified: 2014-05-06 08:28 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description soltanmm 2014-05-06 04:48:49 CEST
-- BEGIN CODE --

struct A(T)
{
  static struct B {}
}

pragma(msg,__traits(parent,__traits(parent,__traits(parent,A!int.B))));

-- END CODE --

The resulting output is `A!int`.

If this is the intended behavior of the compiler, then it is problematic for the implementation of `std.traits.fullyQualifiedName`, as the code there (line 340 of std/traits.d) ends up forward referencing itself into oblivion (and therefore making fullyQualifiedName broken for instances of the above pattern).

I have a feeling it isn't intended, though.
Comment 1 Johannes Pfau 2014-05-06 08:28:33 CEST
I can reproduce this with DMD 2.065 so it's a frontend bug common to all D compilers.

Please report this bug to https://issues.dlang.org/