Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / dcl.decl / dcl.meaning / dcl.fct.default / p8.cpp
blob4412f332753945241e0008f90d7a093b46e3e773
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 class A {
3 void f(A* p = this) { } // expected-error{{invalid use of 'this'}}
5 void test();
6 };
8 void A::test() {
9 void g(int = this);
10 // expected-error@-1 {{cannot initialize a parameter of type 'int' with an rvalue of type 'A *'}}
11 // expected-note@-2 {{passing argument to parameter here}}
13 void h(int = ((void)this,42));
14 // expected-error@-1 {{default argument references 'this'}}