1 // The first run checks that the correct errors are generated,
2 // implicitly checking the order of default argument parsing:
3 // RUN: %clang_cc1 -fsyntax-only -verify %s
4 // The second run checks the order of inline method definitions:
5 // RUN: not %clang_cc1 -fsyntax-only %s 2> %t
6 // RUN: FileCheck %s < %t
15 void a2(B b
= B()); // expected-error{{use of default argument to function 'B' that is declared later in class 'B'}}
19 // CHECK: error: use of undeclared identifier 'first'
20 void a4(int a
= first
); // expected-error{{use of undeclared identifier 'first'}}
24 B(int b
= 42) { // expected-note{{default argument declared here}}
30 void b1(A a
= A()); // expected-error{{use of default argument to function 'A' that is declared later in class 'A'}}
32 // CHECK: error: use of undeclared identifier 'second'
33 void b2(int a
= second
); // expected-error{{use of undeclared identifier 'second'}}
42 A(int a
= 42); // expected-note{{default argument declared here}}
44 // CHECK: error: use of undeclared identifier 'third'
45 void a7(int a
= third
); // expected-error{{use of undeclared identifier 'third'}}