blob: 73ed39dd4b954f0604e2b7adad203095f9e272e0 [file] [log] [blame]
/*
TEST_OUTPUT:
---
fail_compilation/ice12350.d(15): Error: type `MyUDC` has no value
fail_compilation/ice12350.d(30): Error: template instance `ice12350.testAttrs!(MyStruct)` error instantiating
---
*/
enum MyUDC;
struct MyStruct
{
int a;
@MyUDC int b;
}
void testAttrs(T)(const ref T t)
if (is(T == struct))
{
foreach (name; __traits(allMembers, T))
{
auto tr = __traits(getAttributes, __traits(getMember, t, name));
}
}
void main()
{
MyStruct s;
testAttrs(s);
}