Skip to content

Commit f79b04d

Browse files
authored
Fix unknown '-Wsuggest-override' warning if it is not supported in clang (#29392)
### Details: Some older clang versions (e.g. clang-10) do not have `-Wsuggest-override` warning and compilation process displays tons of warnings ### Tickets: - N/A
1 parent 1984108 commit f79b04d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/core/include/openvino/core/rtti.hpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,16 @@
118118
#endif
119119

120120
#if defined(__clang__)
121-
# define OPENVINO_SUPPRESS_SUGGEST_OVERRIDE_START \
122-
OPENVINO_DO_PRAGMA(clang diagnostic push) \
123-
OPENVINO_DO_PRAGMA(clang diagnostic ignored "-Wsuggest-override") \
124-
OPENVINO_DO_PRAGMA(clang diagnostic ignored "-Winconsistent-missing-override")
121+
# if defined(__has_warning) && __has_warning("-Wsuggest-override")
122+
# define OPENVINO_SUPPRESS_SUGGEST_OVERRIDE_START \
123+
OPENVINO_DO_PRAGMA(clang diagnostic push) \
124+
OPENVINO_DO_PRAGMA(clang diagnostic ignored "-Wsuggest-override") \
125+
OPENVINO_DO_PRAGMA(clang diagnostic ignored "-Winconsistent-missing-override")
126+
# else
127+
# define OPENVINO_SUPPRESS_SUGGEST_OVERRIDE_START \
128+
OPENVINO_DO_PRAGMA(clang diagnostic push) \
129+
OPENVINO_DO_PRAGMA(clang diagnostic ignored "-Winconsistent-missing-override")
130+
# endif // defined(__has_warning) && __has_warning("-Wsuggest-override")
125131
# define OPENVINO_SUPPRESS_SUGGEST_OVERRIDE_END OPENVINO_DO_PRAGMA(clang diagnostic pop)
126132
#elif (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ > 405))
127133
# define OPENVINO_SUPPRESS_SUGGEST_OVERRIDE_START \

0 commit comments

Comments
 (0)