]> granicus.if.org Git - clang/commitdiff
ParseOptionalTypeSpecifier should consume a token if it returns true.
authorChris Lattner <sabre@nondot.org>
Wed, 21 Jan 2009 19:19:26 +0000 (19:19 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 21 Jan 2009 19:19:26 +0000 (19:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62704 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDecl.cpp

index bf922780c7c292df592887a4bc911c68ee571d82..384bdc19d08bae4652c0522a698c480640ae7a0b 100644 (file)
@@ -511,9 +511,8 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
     case tok::identifier: {
       // In C++, check to see if this is a scope specifier like foo::bar::, if
       // so handle it as such.  This is important for ctor parsing.
-      if (getLang().CPlusPlus &&
-        TryAnnotateCXXScopeToken())
-          continue;
+      if (getLang().CPlusPlus && TryAnnotateCXXScopeToken())
+        continue;
       
       // This identifier can only be a typedef name if we haven't already seen
       // a type-specifier.  Without this check we misparse:
@@ -842,7 +841,9 @@ bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, int& isInvalid,
   case tok::kw___cdecl:
   case tok::kw___stdcall:
   case tok::kw___fastcall:
-    return PP.getLangOptions().Microsoft;
+    if (!PP.getLangOptions().Microsoft) return false;
+    ConsumeToken();
+    return true;
 
   default:
     // Not a type-specifier; do nothing.