]> granicus.if.org Git - clang/commitdiff
enhance tentative parsing to handle ms extensions, patch by Martin Vejnar!
authorChris Lattner <sabre@nondot.org>
Tue, 28 Sep 2010 23:35:09 +0000 (23:35 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 28 Sep 2010 23:35:09 +0000 (23:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115004 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 085edb1281227330aed56d9059d36f213ad539e6..43d856d85f360f6702e668f671d0e760e57e61e4 100644 (file)
@@ -532,7 +532,12 @@ Parser::TPResult Parser::TryParseDeclarator(bool mayBeAbstract,
       // '(' declarator ')'
       // '(' attributes declarator ')'
       // '(' abstract-declarator ')'
-      if (Tok.is(tok::kw___attribute))
+      if (Tok.is(tok::kw___attribute) ||
+          Tok.is(tok::kw___declspec) ||
+          Tok.is(tok::kw___cdecl) ||
+          Tok.is(tok::kw___stdcall) ||
+          Tok.is(tok::kw___fastcall) ||
+          Tok.is(tok::kw___thiscall))
         return TPResult::True(); // attributes indicate declaration
       TPResult TPR = TryParseDeclarator(mayBeAbstract, mayHaveIdentifier);
       if (TPR != TPResult::Ambiguous())
index 105bb7f3a433132658b3daffa2db96d7682366d5..3dfa241fa178e9567d03093915833304de992845 100644 (file)
@@ -30,6 +30,10 @@ void foo() {
 
 typedef bool (__stdcall __stdcall *blarg)(int);
 
+void local_callconv()
+{
+  bool (__stdcall *p)(int);
+}
 
 // Charify extension.
 #define FOO(x) #@x