summaryrefslogtreecommitdiffstats
path: root/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p2-cxx0x.cpp
blob: 70c9aeb48819c4a1a1bece28655e00876a69376e (plain)
1
2
3
4
5
6
7
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s 

auto a() -> int; // ok
const auto b() -> int; // expected-error {{function with trailing return type must specify return type 'auto', not 'auto const'}}
auto *c() -> int; // expected-error {{function with trailing return type must specify return type 'auto', not 'auto *'}}
auto (d() -> int); // expected-error {{trailing return type may not be nested within parentheses}}
auto e() -> auto (*)() -> auto (*)() -> void; // ok: same as void (*(*e())())();