Skip to content

Commit

Permalink
Update on "Make C10_NODISCARD macro more portable for nvcc+clang."
Browse files Browse the repository at this point in the history
Make C10_NODISCARD macro more portable for nvcc+clang.

Fixes #13118.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

gh-metadata: pytorch pytorch 20324 gh/ezyang/125/head
  • Loading branch information
ezyang committed May 9, 2019
1 parent fd7c4e6 commit b7a435e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions c10/macros/Macros.h
Expand Up @@ -57,10 +57,8 @@
// error when __has_cpp_attribute is given a scoped attribute in C mode.
#elif __cplusplus && defined(__has_cpp_attribute)
# if __has_cpp_attribute(clang::warn_unused_result)
# ifndef __CUDACC__
# undef C10_NODISCARD
# define C10_NODISCARD [[clang::warn_unused_result]]
# endif
# undef C10_NODISCARD
# define C10_NODISCARD [[clang::warn_unused_result]]
# endif
#endif

Expand Down

0 comments on commit b7a435e

Please sign in to comment.