brintos

brintos / llvm-project-archived public Read only

0
0
Text · 977 B · 09a274a Raw
38 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++2b -ast-dump %s | FileCheck -strict-whitespace %s2 3namespace GH116928 {4struct S {5  int f(this S&);6};7 8void main() {9  S s;10  int x = s.f();11  // CHECK: CallExpr 0x{{[^ ]*}} <col:11, col:15> 'int12  // CHECK-NEXT: |-ImplicitCastExpr 0x{{[^ ]*}} <col:13> 'int (*)(S &)' <FunctionToPointerDecay>13  // CHECK-NEXT: | `-DeclRefExpr 0x{{[^ ]*}} <col:13> 'int (S &)' lvalue CXXMethod 0x{{[^ ]*}} 'f' 'int (S &)'14}15}16 17namespace GH1269720 {18template <typename T>19struct S {20  void f(this S&);21  void g(S s) {22    s.f();23  }24  // CHECK: CallExpr 0x{{[^ ]*}} <line:22:5, col:9> '<dependent type>'25  // CHECK-NEXT: `-MemberExpr 0x{{[^ ]*}} <col:5, col:7> '<bound member function type>' .f26  // CHECK-NEXT:   `-DeclRefExpr 0x{{[^ ]*}} <col:5> 'S<T>' lvalue ParmVar 0x{{[^ ]*}} 's' 'S<T>'27};28}29 30namespace GH130272 {31struct A {};32struct B {33  operator A(this B);34};35A a = A(B{});36// CHECK: CallExpr 0x{{[^ ]*}} <col:9, col:11> 'A'37}38