[flang] Update CommandTest for AIX (NFC) (#118403)
[llvm-project.git] / clang / test / CXX / dcl.decl / dcl.meaning / dcl.fct / p2-cxx0x.cpp
blob881742df7e8b2911195f21f6b8e6a0ae9342ef04
1 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
2 // RUN: not %clang_cc1 -fsyntax-only -std=c++11 -fno-diagnostics-show-line-numbers -fcaret-diagnostics-max-lines=1 %s 2>&1 | FileCheck %s -strict-whitespace
4 auto a() -> int; // ok
5 const auto b() -> int; // expected-error {{function with trailing return type must specify return type 'auto', not 'const auto'}}
6 auto *c() -> int; // expected-error {{function with trailing return type must specify return type 'auto', not 'auto *'}}
7 auto (d() -> int); // expected-error {{trailing return type may not be nested within parentheses}}
8 auto e() -> auto (*)() -> auto (*)() -> void; // ok: same as void (*(*e())())();
10 namespace GH78694 {
12 template <typename T> struct B {
13 // CHECK: error: function with trailing return type must specify return type 'auto', not 'void'
14 // CHECK-NEXT: {{^}} template <class U> B(U) -> B<int>;
15 // CHECK-NEXT: {{^}} ~~~~~~~~^~~~~~{{$}}
16 template <class U> B(U) -> B<int>; // expected-error {{function with trailing return type must specify return type 'auto', not 'void'}}