summaryrefslogtreecommitdiff
path: root/test/SemaCXX/trailing-return-0x.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-02-10 09:58:53 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-02-10 09:58:53 +0000
commiteefb3d5b49c844347f212073a7e975b8118fe8e9 (patch)
treec3493ab063010eff7342253e22bd8245b21c8774 /test/SemaCXX/trailing-return-0x.cpp
parent09aaaa43cd5e24d21c666350476802e7d01d6988 (diff)
downloadclang-eefb3d5b49c844347f212073a7e975b8118fe8e9.tar.gz
Track whether a function type has a trailing return type as type sugar. Use this
to pretty-print such function types better, and to fix a case where we were not instantiating templates in lexical order. In passing, move the Variadic bit from Type's bitfields to FunctionProtoType to get the Type bitfields down to 32 bits. Also ensure that we always substitute the return type of a function when substituting explicitly-specified arguments, since that can cause us to bail out with a SFINAE error before we hit a hard error in parameter substitution. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150241 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/trailing-return-0x.cpp')
-rw-r--r--test/SemaCXX/trailing-return-0x.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaCXX/trailing-return-0x.cpp b/test/SemaCXX/trailing-return-0x.cpp
index e25939fa3e..c219b77d9e 100644
--- a/test/SemaCXX/trailing-return-0x.cpp
+++ b/test/SemaCXX/trailing-return-0x.cpp
@@ -21,6 +21,16 @@ auto g(); // expected-error{{return without trailing return type}}
int h() -> int; // expected-error{{trailing return type must specify return type 'auto', not 'int'}}
+int i();
+auto i() -> int;
+int i() {}
+
+using T = auto (int) -> auto (*)(char) -> void; // expected-note {{previous}}
+using T = void; // expected-error {{type alias redefinition with different types ('void' vs 'auto (int) -> auto (*)(char) -> void')}}
+
+using U = auto (int) -> auto (*)(char) -> void;
+using U = void (*(int))(char); // ok
+
int x;
template <class T>