1 // RUN: not %clang_cc1 -triple x86_64-unknown-unknown -Wno-unused-value -fcxx-exceptions -frecovery-ast -std=gnu++17 -ast-dump %s | FileCheck -strict-whitespace %s
3 // CHECK: FunctionDecl {{.*}} s1 'auto ()'
5 // FIXME: why we're finding int as the return type. int is used as a fallback type?
6 // CHECK: FunctionDecl {{.*}} invalid s2 'auto () -> int'
8 // CHECK: FunctionDecl {{.*}} invalid s3 'auto () -> int'
9 auto s3() -> decltype(undef());
10 // CHECK: FunctionDecl {{.*}} invalid s4 'auto ()'
14 // CHECK: FunctionDecl {{.*}} s5 'void ()'
15 auto s5() {} // valid, no return stmt, fallback to void
18 // CHECK: CXXMethodDecl {{.*}} foo1 'auto ()'
20 // CHECK: CXXMethodDecl {{.*}} invalid foo2 'auto () -> int'
21 auto foo2() -> undef();
22 // CHECK: CXXMethodDecl {{.*}} invalid foo3 'auto () -> int'
23 auto foo3() -> decltype(undef());
24 // CHECK: CXXMethodDecl {{.*}} invalid foo4 'auto ()'
25 auto foo4() { return undef(); }
26 // CHECK: CXXMethodDecl {{.*}} foo5 'void ()'
27 auto foo5() {} // valid, no return stmt, fallback to void.