xref: /llvm-project/clang/test/SemaOpenCLCXX/address-space-cond.clcpp (revision d1c8a151df830c6c727f0bb7d33774bd3eb96824)
1// RUN: %clang_cc1 %s -pedantic -verify
2
3namespace PointerRvalues {
4
5void f(__global int *__constant *a, const __global int *__constant *b) {
6  using T = decltype(true ? +a : +b);
7  using T = const __global int *const __constant *;
8}
9
10void g(const __global int *a, __generic int *b) {
11  using T = decltype(true ? +a : +b);
12  using T = const __generic int *;
13}
14
15void h(const __global int **a, __generic int **b) {
16  using T = decltype(true ? +a : +b); // expected-error {{incompatible operand types}}
17}
18
19void i(__global int **a, __generic int **b) {
20  using T = decltype(true ? +a : +b); // expected-error {{incompatible operand types}}
21}
22
23}
24