enhance tentative parsing to handle ms extensions, patch by Martin Vejnar!

llvm-svn: 115004
This commit is contained in:
Chris Lattner 2010-09-28 23:35:09 +00:00
parent cc91601211
commit d7821e4ec4
2 changed files with 10 additions and 1 deletions

View File

@ -532,7 +532,12 @@ Parser::TPResult Parser::TryParseDeclarator(bool mayBeAbstract,
// '(' declarator ')' // '(' declarator ')'
// '(' attributes declarator ')' // '(' attributes declarator ')'
// '(' abstract-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 return TPResult::True(); // attributes indicate declaration
TPResult TPR = TryParseDeclarator(mayBeAbstract, mayHaveIdentifier); TPResult TPR = TryParseDeclarator(mayBeAbstract, mayHaveIdentifier);
if (TPR != TPResult::Ambiguous()) if (TPR != TPResult::Ambiguous())

View File

@ -30,6 +30,10 @@ void foo() {
typedef bool (__stdcall __stdcall *blarg)(int); typedef bool (__stdcall __stdcall *blarg)(int);
void local_callconv()
{
bool (__stdcall *p)(int);
}
// Charify extension. // Charify extension.
#define FOO(x) #@x #define FOO(x) #@x