diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-15 01:02:11 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-15 01:02:11 +0000 |
commit | 6d96d3ad1d95a58d81cc8b573d9bce444bbf8021 (patch) | |
tree | f6c0bd1148e37ce2f907e1d2ef2fb8dd12d0f2bb /lib/Parse/ParseDecl.cpp | |
parent | 9ca33fd56720112bcc4bccb8aa6107abbb68cae3 (diff) |
Small cleanup: move trailing-return-type special-casing into
getDeclSpecContextFromDeclaratorContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152766 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 3ff9da035f..2fac0dca40 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -36,9 +36,7 @@ TypeResult Parser::ParseTypeName(SourceRange *Range, Declarator::TheContext Context, AccessSpecifier AS, Decl **OwnedType) { - DeclSpecContext DSC = DSC_normal; - if (Context == Declarator::TrailingReturnContext) - DSC = DSC_trailing; + DeclSpecContext DSC = getDeclSpecContextFromDeclaratorContext(Context); // Parse the common declaration-specifiers piece. DeclSpec DS(AttrFactory); @@ -1629,6 +1627,8 @@ Parser::getDeclSpecContextFromDeclaratorContext(unsigned Context) { return DSC_class; if (Context == Declarator::FileContext) return DSC_top_level; + if (Context == Declarator::TrailingReturnContext) + return DSC_trailing; return DSC_normal; } |