D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15329 - __traits(isPOD, S) incorrectly returns true for structs with disabled S.init
Summary: __traits(isPOD, S) incorrectly returns true for structs with disabled S.init
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-13 18:14 UTC by ZombineDev
Modified: 2022-10-13 08:19 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ZombineDev 2015-11-13 18:14:48 UTC
struct S
{   
   @disable
   enum init = 0;
}

static assert (!__traits(compiles, { S7 s = S7.init; }));
static assert (!is(typeof(S.init)));

static assert (__traits(isPOD, S7)); // Compiles - this is wrong
Comment 1 RazvanN 2018-06-13 10:14:35 UTC
I assume that instead of S7 you were referring to S.

Why should it not compile? From the glossary [1] :

"POD (Plain Old Data)
Refers to a struct that contains no hidden members, does not have virtual functions, does not inherit, has no destructor, and can be initialized and copied via simple bit copies."

If I'm not missing anything, S complies with all of the above.

[1] https://dlang.org/glossary.html#pod
Comment 2 RazvanN 2022-10-13 08:19:10 UTC
Closing as per previous comment.