diff options
author | Steve Naroff <snaroff@apple.com> | 2009-01-06 17:40:00 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-01-06 17:40:00 +0000 |
commit | 7ec5658f92fd5b65f682b6e942b95210426fc6e2 (patch) | |
tree | ef53ce9642d4312b161f6b5c8c4ebef1703b9962 | |
parent | da76b28553c7a36620256f6a36f763682d988c1a (diff) |
Fix <rdar://problem/5956221> clang ObjC rewriter: Microsoft-specific __fastcall keyword unrecognized.
This fix is C++ specific.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61816 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Parse/ParseTentative.cpp | 6 | ||||
-rw-r--r-- | test/Parser/MicrosoftExtensions.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/Parse/ParseTentative.cpp b/lib/Parse/ParseTentative.cpp index dd75319b28..11df2f45ce 100644 --- a/lib/Parse/ParseTentative.cpp +++ b/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/test/Parser/MicrosoftExtensions.c b/test/Parser/MicrosoftExtensions.c index 0ff59f75aa..6b097ab7a8 100644 --- a/test/Parser/MicrosoftExtensions.c +++ b/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)(); |