Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / FixIt / fixit-deducing-this.cpp
blobc073fd38ffc2c522ddbe8d4019ef6a7eccc3c895
1 // RUN: %clang_cc1 -verify -std=c++2c %s
2 // RUN: cp %s %t
3 // RUN: not %clang_cc1 -x c++ -std=c++2c -fixit %t
4 // RUN: %clang_cc1 -x c++ -std=c++2c %t
5 // RUN: not %clang_cc1 -std=c++2c -x c++ -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
6 struct S {
7 void f(this S);
8 void g() {
9 (void)&f; // expected-error {{must explicitly qualify name of member function when taking its address}}
10 // CHECK: fix-it:{{.*}}:{9:16-9:16}:"S::"
14 struct S2 {
15 void f(this S2 foo) {
16 g(); // expected-error {{call to non-static member function without an object argument}}
17 // CHECK: fix-it:{{.*}}:{16:9-16:9}:"foo."
19 h(); // expected-error {{call to explicit member function without an object argument}}
20 // CHECK: fix-it:{{.*}}:{19:9-19:9}:"foo."
22 i();
24 var; // expected-error {{invalid use of member 'var' in explicit object member function}}
25 // CHECK: fix-it:{{.*}}:{24:9-24:9}:"foo."
28 void g();
29 void h(this S2 s);
30 static void i();
31 int var;