Skip to content

Commit 374adca

Browse files
[NFC][SYCL] Use [[fallthrough]] unconditionally (#7689)
C++17 guarantees its existence.
1 parent e1e6df5 commit 374adca

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

sycl/include/sycl/detail/defines_elementary.hpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,6 @@
6161
#endif
6262
#endif
6363

64-
#ifndef __SYCL_FALLTHROUGH
65-
#if defined(__cplusplus) && __cplusplus >= 201703L && \
66-
__SYCL_HAS_CPP_ATTRIBUTE(fallthrough)
67-
#define __SYCL_FALLTHROUGH [[fallthrough]]
68-
#elif __SYCL_HAS_CPP_ATTRIBUTE(gnu::fallthrough)
69-
#define __SYCL_FALLTHROUGH [[gnu::fallthrough]]
70-
#elif __has_attribute(fallthrough)
71-
#define __SYCL_FALLTHROUGH __attribute__((fallthrough))
72-
#elif __SYCL_HAS_CPP_ATTRIBUTE(clang::fallthrough)
73-
#define __SYCL_FALLTHROUGH [[clang::fallthrough]]
74-
#else
75-
#define __SYCL_FALLTHROUGH
76-
#endif
77-
#endif // __SYCL_FALLTHROUGH
78-
7964
// Stringify an argument to pass it in _Pragma directive below.
8065
#ifndef __SYCL_STRINGIFY
8166
#define __SYCL_STRINGIFY(x) #x

sycl/source/detail/image_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,10 @@ image_impl::image_impl(cl_mem MemObject, const context &SyclContext,
288288
switch (MDimensions) {
289289
case 3:
290290
getImageInfo(Context, PI_IMAGE_INFO_DEPTH, MRange[2], Mem);
291-
__SYCL_FALLTHROUGH;
291+
[[fallthrough]];
292292
case 2:
293293
getImageInfo(Context, PI_IMAGE_INFO_HEIGHT, MRange[1], Mem);
294-
__SYCL_FALLTHROUGH;
294+
[[fallthrough]];
295295
case 1:
296296
getImageInfo(Context, PI_IMAGE_INFO_WIDTH, MRange[0], Mem);
297297
}

0 commit comments

Comments
 (0)