37 lines · cpp
1// RUN: %clang_cc1 -fsycl-is-host -fsyntax-only -std=c++17 -verify %s2// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -std=c++17 -verify %s3// RUN: %clang_cc1 -fsycl-is-host -fsyntax-only -std=c++20 -verify %s4// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -std=c++20 -verify %s5// RUN: %clang_cc1 -fsycl-is-host -fsyntax-only -std=c++23 -verify %s6// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -std=c++23 -verify %s7 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}}13struct s {14[[clang::sycl_external]] int bad2;15};16 17// expected-error@+1{{'clang::sycl_external' attribute only applies to functions}}18namespace [[clang::sycl_external]] bad3 {}19 20// expected-error@+1{{'clang::sycl_external' attribute only applies to functions}}21struct [[clang::sycl_external]] bad4;22 23// expected-error@+1{{'clang::sycl_external' attribute only applies to functions}}24enum [[clang::sycl_external]] bad5 {};25 26// expected-error@+1{{'clang::sycl_external' attribute only applies to functions}}27int 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 >= 202002L33// expected-error@+2{{'clang::sycl_external' attribute only applies to functions}}34template<typename>35concept bad8 [[clang::sycl_external]] = true;36#endif37