Fix handling of implicit int, resolving PR2012 and reverting (and

subsuming) my patch for PR1999.

llvm-svn: 49251
This commit is contained in:
Chris Lattner
2008-04-05 06:32:51 +00:00
parent 94fc8063b4
commit 9d51f2b9d4
10 changed files with 64 additions and 33 deletions

View File

@@ -467,7 +467,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().isC90() && !D.getDeclSpec().getParsedSpecifiers() == 0) {
if (getLang().ImplicitInt && D.getDeclSpec().getParsedSpecifiers() == 0) {
const char *PrevSpec;
D.getDeclSpec().SetTypeSpecType(DeclSpec::TST_int, D.getIdentifierLoc(),
PrevSpec);