Skip to content

Commit

Permalink
Limit [[nodiscard]] to clang >= 13
Browse files Browse the repository at this point in the history
Like GCC 7.4, old versions of clang don't support combining
[[nodiscard]] with __attribute__((visibility(""))).
  • Loading branch information
oleavr committed Aug 22, 2022
1 parent 698f534 commit 95c460f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/v8config.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@ path. Add it with -I<path> to the command line
# define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \
(__has_attribute(warn_unused_result))

# define V8_HAS_CPP_ATTRIBUTE_NODISCARD (V8_HAS_CPP_ATTRIBUTE(nodiscard))
# define V8_HAS_CPP_ATTRIBUTE_NODISCARD \
(__clang_major__ >= 13 && V8_HAS_CPP_ATTRIBUTE(nodiscard))
# define V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS \
(V8_HAS_CPP_ATTRIBUTE(no_unique_address))

Expand Down

0 comments on commit 95c460f

Please sign in to comment.