Commit Graph

11 Commits

Author SHA1 Message Date
Kenneth Moreland
e3e1a76072 Disable deprecation for MSVC 2017
Although technically supported, this version of the visual studio likes
to put the warnings where templates are defined (rather than
instantiated). That makes it impossible to suppress a warning when, for
example, when a deprecated class is legitmately used in an std template
to implement other deprecated functionality.

To prevent this, disable deprecations on MSVC compilers before 2019. I
doubt any developers are using this compiler anywhere but the dashboard,
and the warnings should legitimately appear elsewhere.
2021-04-26 12:47:44 -06:00
Kenneth Moreland
8922f600e1 Use GNU attributes for deprecated
There appears to be a bug in GCC where if you mixed C++ attributes like
`[[deprecated]]` with GNU attributes like `__attribute__(())`, you will
get a compile error. This can be a problem when using attributes to both
set the export (i.e. visibility) of an item and deprecating the same
item.

This problem has been encountered before. Commit
34b0bba84207a89e8fddfe62e7a1ff30b1b53a18 fixed the problem by using
`[[gnu::visibility()]]` instead of `__attribute__()` in the export
macros. This works fine for export macros defined by VTK-m headers such
as `VTKM_ALWAYS_EXPORT`. Unfortunately, we have little control over the
export macros that CMake automatically creates. Rather than rewrite the
CMake export code, we go the other way and use `__attribute__()` for all
exports _and_ the depreciated attribute.
2021-02-15 12:39:11 -07:00
Vicente Adolfo Bolea Sanchez
bbe36d8c33 cmake: set c++14 as minimum c++ rev
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-02-08 17:13:05 +01:00
Kitware Robot
cf0cdcf7d1 clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
Robert Maynard
53c33e24ad Assume NVCC has zero support for VTK_M_DEPRECATED_ATTRIBUTE_SUPPORTED 2020-05-13 14:52:13 -04:00
Robert Maynard
0ee0bf7cb2 Correct vtkm/Deprecated.h to work with CUDA and VS2019 2020-05-04 12:02:56 -04:00
Robert Maynard
e37eedadb1 CUDA doesn't like [[deprecated]] when applied to typedefs
So we disable deprecation support when building with `nvcc`
2020-03-31 14:56:49 -04:00
Kenneth Moreland
fb01d38a09 Disable deprecated attribute when using nvcc under VS
The nvcc compiler under visual studio seems to give the error `attribute
does not apply to any entity` when you try to use the `[[deprecated]]`
attribute. So disable for this compiler configuration.
2020-01-22 07:52:59 -07:00
Kenneth Moreland
6fc883213c Deprecate ListTag operations
The newer List operations should still work on the old ListTags, so make
those changes first to ensure that everything still works as expected if
given an old ListTag.

Next step is to deprecate ListTagBase itself and move all the lists to
the new types.
2019-12-05 11:27:31 -05:00
Kenneth Moreland
f62b50259e Refactor deprecated macros
Previously we relied on CMake's compiler detection module to build the
macros for using the deprecated attribute. However, CMake created macros
for pre-C++14 versions of the feature, which do not work in all cases.
Also, we have the need to be able to suppress deprecation warnings when
we are implementing a deprecated thing. Since we have to query compilers
ourself, we might as well figure out if the deprecated attribute we want
is supported.

Worst case is that we won't support deprecation warnings everywhere we
could. That will not create incorrect code and we can always add that
later.
2019-11-06 14:47:59 -07:00
Kenneth Moreland
ed4d0d50c3 Add VTKM_DEPRECATED macro
The `VTKM_DEPRECATED` macro allows us to remove (and usually replace)
features from VTK-m in minor releases while still following the conventions
of semantic versioning. The idea is that when we want to remove or replace
a feature, we first mark the old feature as deprecated. The old feature
will continue to work, but compilers that support it will start to issue a
warning that the use is deprecated and should stop being used. The
deprecated features should remain viable until at least the next major
version. At the next major version, deprecated features from the previous
version may be removed.
2019-11-06 09:58:53 -07:00