Skip to content

Commit 3da2814

Browse files
authored
[SYCL] Remove superfluous C++ linkage spec from assert headers (#15614)
This [PR](#15570) added C++ linkage specifications for the SYCL wrappers around the STL assert headers `assert.h` and `cassert`. For `cassert`, this is actually superfluous since it is purely a C++ header. This PR removes it.
1 parent 1e1757b commit 3da2814

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

sycl/include/sycl/stl_wrappers/cassert

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <../include/cassert>
1717
#endif
1818

19-
extern "C++" {
2019
#ifdef __SYCL_DEVICE_ONLY__
2120
#include <CL/__spirv/spirv_vars.hpp>
2221

@@ -43,4 +42,3 @@ __devicelib_assert_fail(const char *, const char *, int32_t, const char *,
4342
#endif
4443
#endif
4544
#endif
46-
}

sycl/test/basic_tests/assert_header_with_c_linkage.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
// RUN: %clangxx -fsycl -DASSERT -fsyntax-only %s
2-
// RUN: %clangxx -fsycl -DCASSERT -fsyntax-only %s
1+
// RUN: %clangxx -fsycl -fsyntax-only %s
32

4-
// Verify that compilation works when assert.h/cassert is wrapped by a C linkage
3+
// Verify that compilation works when assert.h is wrapped by a C linkage
54
// specification.
65

76
#ifdef __cplusplus
87
extern "C" {
98
#endif
109

11-
#if defined(ASSERT)
1210
#include <assert.h>
13-
#elif defined(CASSERT)
14-
#include <cassert>
15-
#endif
1611

1712
#ifdef __cplusplus
1813
}

0 commit comments

Comments
 (0)