enhance tentative parsing to handle ms extensions, patch by Martin Vejnar!
llvm-svn: 115004
This commit is contained in:
parent
cc91601211
commit
d7821e4ec4
|
@ -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())
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue