Debian Codegraph @

clang/test/SemaSYCL/sycl-external-attr-appertainment.cpp

raw
1 // RUN: %clang_cc1 -fsycl-is-host -fsyntax-only -std=c++17 -verify %s
2 // RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -std=c++17 -verify %s
3 // RUN: %clang_cc1 -fsycl-is-host -fsyntax-only -std=c++20 -verify %s
4 // RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -std=c++20 -verify %s
5 // RUN: %clang_cc1 -fsycl-is-host -fsyntax-only -std=c++23 -verify %s
6 // RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -std=c++23 -verify %s
7
8 // expected-error@+1{{'clang::sycl_external' attribute only applies to functions}}
9 [[clang::sycl_external]] int bad1;
10
11
12 // expected-error@+2{{'clang::sycl_external' attribute only applies to functions}}
13 struct s {
14 [[clang::sycl_external]] int bad2;
15 };
16
17 // expected-error@+1{{'clang::sycl_external' attribute only applies to functions}}
18 namespace [[clang::sycl_external]] bad3 {}
19
20 // expected-error@+1{{'clang::sycl_external' attribute only applies to functions}}
21 struct [[clang::sycl_external]] bad4;
22
23 // expected-error@+1{{'clang::sycl_external' attribute only applies to functions}}
24 enum [[clang::sycl_external]] bad5 {};
25
26 // expected-error@+1{{'clang::sycl_external' attribute only applies to functions}}
27 int bad6(void (fp [[clang::sycl_external]])());
28
29 // expected-error@+1{{'clang::sycl_external' attribute only applies to functions}}
30 [[clang::sycl_external]];
31
32 #if __cplusplus >= 202002L
33 // expected-error@+2{{'clang::sycl_external' attribute only applies to functions}}
34 template<typename>
35 concept bad8 [[clang::sycl_external]] = true;
36 #endif