mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
31 lines
506 B
D
31 lines
506 B
D
/*
|
|
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);
|
|
}
|