]> granicus.if.org Git - clang/commitdiff
Fix <rdar://problem/5956221> clang ObjC rewriter: Microsoft-specific __fastcall keywo...
authorSteve Naroff <snaroff@apple.com>
Tue, 6 Jan 2009 17:40:00 +0000 (17:40 +0000)
committerSteve Naroff <snaroff@apple.com>
Tue, 6 Jan 2009 17:40:00 +0000 (17:40 +0000)
This fix is C++ specific.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61816 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseTentative.cpp
test/Parser/MicrosoftExtensions.c

index dd75319b28d8e43ab4e660d89afd99da51eb03a9..11df2f45cea3b8feabe3133a43ee9a6d0f21aeb4 100644 (file)
@@ -624,6 +624,12 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() {
   case tok::kw__Complex:
   case tok::kw___attribute:
     return TPResult::True();
+    
+    // Microsoft
+  case tok::kw___cdecl:
+  case tok::kw___stdcall:
+  case tok::kw___fastcall:
+    return PP.getLangOptions().Microsoft ? TPResult::True() : TPResult::False();
 
     // The ambiguity resides in a simple-type-specifier/typename-specifier
     // followed by a '('. The '(' could either be the start of:
index 0ff59f75aa4604029216774ddc7da809163c1767..6b097ab7a8de075d13f264d611e4b8a928e31d32 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: clang -fsyntax-only -verify -fms-extensions %s
+// RUN: clang -fsyntax-only -verify -fms-extensions -x=objective-c++ %s
 __stdcall int func0();
 int __stdcall func();
 typedef int (__cdecl *tptr)();