This is an archive of the discontinued LLVM Phabricator instance.

[CUDA][HIP] Fix empty ctor/dtor check for union
ClosedPublic

Authored by yaxunl on May 4 2020, 2:34 PM.

Details

Summary

union ctor does not call ctors of its data members. union dtor does not call dtors of its data members.
Also union does not have base class.

https://godbolt.org/z/8RxZeG

Currently when clang checks whether union has an empty ctor/dtor, it checks the ctors/dtors of its
data members. This causes incorrectly diagnose device side global variables and shared variables as
having non-empty ctors/dtors.

This patch fixes that.

Diff Detail

Event Timeline

yaxunl created this revision.May 4 2020, 2:34 PM
tra accepted this revision.May 4 2020, 3:14 PM

Nice! Thank you for the patch.

This revision is now accepted and ready to land.May 4 2020, 3:14 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2020, 6:52 PM