diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-10-01 18:44:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-10-01 18:44:50 +0000 |
commit | dab60ad68a3a98d687305941a3852e793705f945 (patch) | |
tree | c2274cfc2b12b9a28683b67319dc981e21937402 /lib/Sema/DeclSpec.cpp | |
parent | 393bd8e185692a451b2ba16bdfc9e7d3543b4217 (diff) |
Implement the C++0x "trailing return type" feature, e.g.,
auto f(int) -> int
from Daniel Wallin!
(With a few minor bug fixes from me).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115322 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/DeclSpec.cpp')
-rw-r--r-- | lib/Sema/DeclSpec.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/DeclSpec.cpp b/lib/Sema/DeclSpec.cpp index b46e8af9db..979b76ae98 100644 --- a/lib/Sema/DeclSpec.cpp +++ b/lib/Sema/DeclSpec.cpp @@ -59,7 +59,8 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, bool isVariadic, unsigned NumExceptions, SourceLocation LPLoc, SourceLocation RPLoc, - Declarator &TheDeclarator) { + Declarator &TheDeclarator, + ParsedType TrailingReturnType) { DeclaratorChunk I; I.Kind = Function; I.Loc = LPLoc; @@ -76,6 +77,7 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, bool isVariadic, I.Fun.hasAnyExceptionSpec = hasAnyExceptionSpec; I.Fun.NumExceptions = NumExceptions; I.Fun.Exceptions = 0; + I.Fun.TrailingReturnType = TrailingReturnType.getAsOpaquePtr(); // new[] an argument array if needed. if (NumArgs) { |