reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
//RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -pedantic -verify

struct C {
  auto fGlob() __global -> decltype(this);
  auto fGen() -> decltype(this);
  auto fErr() __global __local -> decltype(this); //expected-error{{multiple address spaces specified for type}}
};

void bar(__local C*);
// expected-note@-1{{candidate function not viable: address space mismatch in 1st argument ('decltype(this)' (aka '__global C *')), parameter type must be '__local C *'}}
// expected-note@-2{{candidate function not viable: address space mismatch in 1st argument ('decltype(this)' (aka 'C *')), parameter type must be '__local C *'}}

__global C Glob;
void foo(){
bar(Glob.fGlob()); // expected-error{{no matching function for call to 'bar'}}
// FIXME: AS of 'this' below should be correctly deduced to generic
bar(Glob.fGen()); // expected-error{{no matching function for call to 'bar'}}
}