parent
5b9a3d54b6
commit
e0c511688e
|
@ -248,6 +248,12 @@ public:
|
|||
///
|
||||
unsigned getParsedSpecifiers() const;
|
||||
|
||||
/// isEmpty - Return true if this declaration specifier is completely empty:
|
||||
/// no tokens were parsed in the production of it.
|
||||
bool isEmpty() const {
|
||||
return getParsedSpecifiers() == DeclSpec::PQ_None;
|
||||
}
|
||||
|
||||
void SetRangeStart(SourceLocation Loc) { Range.setBegin(Loc); }
|
||||
void SetRangeEnd(SourceLocation Loc) { Range.setEnd(Loc); }
|
||||
|
||||
|
|
|
@ -65,6 +65,7 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, bool isVariadic,
|
|||
}
|
||||
|
||||
/// getParsedSpecifiers - Return a bitmask of which flavors of specifiers this
|
||||
/// declaration specifier includes.
|
||||
///
|
||||
unsigned DeclSpec::getParsedSpecifiers() const {
|
||||
unsigned Res = 0;
|
||||
|
|
|
@ -549,7 +549,7 @@ Parser::DeclTy *Parser::ParseFunctionDefinition(Declarator &D) {
|
|||
// If this is C90 and the declspecs were completely missing, fudge in an
|
||||
// implicit int. We do this here because this is the only place where
|
||||
// declaration-specifiers are completely optional in the grammar.
|
||||
if (getLang().ImplicitInt && D.getDeclSpec().getParsedSpecifiers() == 0) {
|
||||
if (getLang().ImplicitInt && D.getDeclSpec().isEmpty()) {
|
||||
const char *PrevSpec;
|
||||
D.getMutableDeclSpec().SetTypeSpecType(DeclSpec::TST_int,
|
||||
D.getIdentifierLoc(),
|
||||
|
|
Loading…
Reference in New Issue