Fix handling of implicit int, resolving PR2012 and reverting (and
subsuming) my patch for PR1999.
llvm-svn: 49251
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index 7609124..cd99fc0 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -467,7 +467,7 @@
// 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);