- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The following code works fine
[cpp]#includeunion empty_union { }; int main() { assert(__is_empty(empty_union)); return 0; }[/cpp]
However, according to the latest ISO C++ 0x draft, std::is_empty should not recognize empty unions. GCC's __is_empty does not recognize empty unions as well.
Is this intentional or a bug?
Thanks
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I hope you compiled with g++ 4.3.x and later, as probably __is_empty does not work (and is not recognized and gives error) with 4.2.x or lower, could be due to c++0x features and functions.
I reproduced your problem, the icc & gcc give different result with __is_empty .
I would escalate it as a bug.
regards
I reproduced your problem, the icc & gcc give different result with __is_empty .
I would escalate it as a bug.
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting Milind Kulkarni (Intel)
I hope you compiled with g++ 4.3.x and later, as probably __is_empty does not work (and is not recognized and gives error) with 4.2.x or lower, could be due to c++0x features and functions.
I reproduced your problem, the icc & gcc give different result with __is_empty .
I would escalate it as a bug.
regards
I reproduced your problem, the icc & gcc give different result with __is_empty .
I would escalate it as a bug.
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes, i meant g++ 4.3.x or later, and that includes g++ 4.4.4, so It should be escalated and fixed.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page