]> granicus.if.org Git - clang/commitdiff
Fix Parser::ParseDeclaratorInternal(): add langopts test when recognizing blocks.
authorSteve Naroff <snaroff@apple.com>
Thu, 28 Aug 2008 10:07:06 +0000 (10:07 +0000)
committerSteve Naroff <snaroff@apple.com>
Thu, 28 Aug 2008 10:07:06 +0000 (10:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55468 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDecl.cpp

index 76fca9e885f2f2bd9ce83092bc29cadcb5da6248..cd2dda2941e99bf9d6ff15ba4f43a0e9363c10cc 100644 (file)
@@ -1116,10 +1116,10 @@ void Parser::ParseDeclaratorInternal(Declarator &D) {
       (Kind != tok::caret || !getLang().Blocks))
     return ParseDirectDeclarator(D);
   
-  // Otherwise, '*' -> pointer or '&' -> reference.
+  // Otherwise, '*' -> pointer, '^' -> block, '&' -> reference.
   SourceLocation Loc = ConsumeToken();  // Eat the * or &.
 
-  if (Kind == tok::star || Kind == tok::caret) {
+  if (Kind == tok::star || (Kind == tok::caret && getLang().Blocks)) {
     // Is a pointer.
     DeclSpec DS;