[cfe-commits] r152766 - /cfe/trunk/lib/Parse/ParseDecl.cpp

Richard Smith richard-llvm at metafoo.co.uk
Wed Mar 14 18:02:11 PDT 2012


Author: rsmith
Date: Wed Mar 14 20:02:11 2012
New Revision: 152766

URL: http://llvm.org/viewvc/llvm-project?rev=152766&view=rev
Log:
Small cleanup: move trailing-return-type special-casing into
getDeclSpecContextFromDeclaratorContext.

Modified:
    cfe/trunk/lib/Parse/ParseDecl.cpp

Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=152766&r1=152765&r2=152766&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Wed Mar 14 20:02:11 2012
@@ -36,9 +36,7 @@
                                  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 @@
     return DSC_class;
   if (Context == Declarator::FileContext)
     return DSC_top_level;
+  if (Context == Declarator::TrailingReturnContext)
+    return DSC_trailing;
   return DSC_normal;
 }
 





More information about the cfe-commits mailing list