1 | //RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -pedantic -verify |
2 | |
3 | struct C { |
4 | auto fGlob() __global -> decltype(this); |
5 | auto fGen() -> decltype(this); |
6 | auto fErr() __global __local -> decltype(this); //expected-error{{multiple address spaces specified for type}} |
7 | }; |
8 | |
9 | void bar(__local C*); |
10 | // expected-note@-1{{candidate function not viable: address space mismatch in 1st argument ('decltype(this)' (aka '__global C *')), parameter type must be '__local C *'}} |
11 | // expected-note@-2{{candidate function not viable: address space mismatch in 1st argument ('decltype(this)' (aka 'C *')), parameter type must be '__local C *'}} |
12 | |
13 | __global C Glob; |
14 | void foo(){ |
15 | bar(Glob.fGlob()); // expected-error{{no matching function for call to 'bar'}} |
16 | // FIXME: AS of 'this' below should be correctly deduced to generic |
17 | bar(Glob.fGen()); // expected-error{{no matching function for call to 'bar'}} |
18 | } |
19 | |