summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-01-06 17:40:00 +0000
committerSteve Naroff <snaroff@apple.com>2009-01-06 17:40:00 +0000
commit1f42c2e94dbec366b0dc8152945d08a0d9f572c8 (patch)
treebd35715441fcde2af4f7d91660d332d5145a39f4
parent9fee535c845ceae80d71e51c47a9baa9745d0bc3 (diff)
downloadbcm5719-llvm-1f42c2e94dbec366b0dc8152945d08a0d9f572c8.tar.gz
bcm5719-llvm-1f42c2e94dbec366b0dc8152945d08a0d9f572c8.zip
Fix <rdar://problem/5956221> clang ObjC rewriter: Microsoft-specific __fastcall keyword unrecognized.
This fix is C++ specific. llvm-svn: 61816
-rw-r--r--clang/lib/Parse/ParseTentative.cpp6
-rw-r--r--clang/test/Parser/MicrosoftExtensions.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp
index dd75319b28d..11df2f45cea 100644
--- a/clang/lib/Parse/ParseTentative.cpp
+++ b/clang/lib/Parse/ParseTentative.cpp
@@ -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:
diff --git a/clang/test/Parser/MicrosoftExtensions.c b/clang/test/Parser/MicrosoftExtensions.c
index 0ff59f75aa4..6b097ab7a8d 100644
--- a/clang/test/Parser/MicrosoftExtensions.c
+++ b/clang/test/Parser/MicrosoftExtensions.c
@@ -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)();
OpenPOWER on IntegriCloud