[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / ParserSYCL / unique_stable_name.cpp
blobaa50f54ab213715a9832a8ade5210daeda37e12a
1 // RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -verify -Wno-unused %s
3 namespace NS {
4 using good = double;
7 void f(int var) {
8 // expected-error@+1{{expected '(' after '__builtin_sycl_unique_stable_name'}}
9 __builtin_sycl_unique_stable_name int; // Correct usage is __builtin_sycl_unique_stable_name(int);
11 // expected-error@+1{{expected '(' after '__builtin_sycl_unique_stable_name'}}
12 __builtin_sycl_unique_stable_name{int}; // Correct usage is __builtin_sycl_unique_stable_name(int);
14 // expected-error@+2{{expected ')'}}
15 // expected-note@+1{{to match this '('}}
16 __builtin_sycl_unique_stable_name(int; // Missing paren before semicolon
18 // expected-error@+2{{expected ')'}}
19 // expected-note@+1{{to match this '('}}
20 __builtin_sycl_unique_stable_name(int, float); // Missing paren before comma
22 // expected-error@+1{{unknown type name 'var'}}
23 __builtin_sycl_unique_stable_name(var);
24 __builtin_sycl_unique_stable_name(NS::good);
26 // expected-error@+1{{expected a type}}
27 __builtin_sycl_unique_stable_name(for (int i = 0; i < 10; ++i) {})
28 __builtin_sycl_unique_stable_name({
29 (for (int i = 0; i < 10; ++i){})})
32 template <typename T>
33 void f2() {
34 __builtin_sycl_unique_stable_name(typename T::good_type);
37 struct S {
38 class good_type {};
41 void use() {
42 f2<S>();