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
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())())();
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'}}