xref: /aosp_15_r20/external/clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p2-cxx0x.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2 
3 auto a() -> int; // ok
4 const auto b() -> int; // expected-error {{function with trailing return type must specify return type 'auto', not 'const auto'}}
5 auto *c() -> int; // expected-error {{function with trailing return type must specify return type 'auto', not 'auto *'}}
6 auto (d() -> int); // expected-error {{trailing return type may not be nested within parentheses}}
7 auto e() -> auto (*)() -> auto (*)() -> void; // ok: same as void (*(*e())())();
8