According to Cuda Programming guide (v7.5, E2.3.1):
device, constant and shared variables defined in namespace
scope, that are of class type, cannot have a non-empty constructor or a
A destructor for a class is considered empty at a point in the translation unit, if it is either a trivial destructor or it satisfies all of the following conditions:
- The destructor function has been defined.
- The destructor function body is an empty compound statement.
- Its class has no virtual functions and no virtual base classes.
- The destructors of all base classes of its class can be considered empty.
- For all the nonstatic data members of its class that are of class type (or array thereof), the destructor can be considered empty.
Clang already deals with device-side constructors (see D15305).
This patch enforces similar rules for destructors.